|
@ -14,6 +14,19 @@ export class ExportService { |
|
|
activityIds?: string[]; |
|
|
activityIds?: string[]; |
|
|
userId: string; |
|
|
userId: string; |
|
|
}): Promise<Export> { |
|
|
}): Promise<Export> { |
|
|
|
|
|
const accounts = await this.prismaService.account.findMany({ |
|
|
|
|
|
select: { |
|
|
|
|
|
accountType: true, |
|
|
|
|
|
balance: true, |
|
|
|
|
|
currency: true, |
|
|
|
|
|
id: true, |
|
|
|
|
|
isDefault: true, |
|
|
|
|
|
isExcluded: true, |
|
|
|
|
|
name: true |
|
|
|
|
|
}, |
|
|
|
|
|
where: { userId } |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
let activities = await this.prismaService.order.findMany({ |
|
|
let activities = await this.prismaService.order.findMany({ |
|
|
orderBy: { date: 'desc' }, |
|
|
orderBy: { date: 'desc' }, |
|
|
select: { |
|
|
select: { |
|
@ -38,6 +51,7 @@ export class ExportService { |
|
|
|
|
|
|
|
|
return { |
|
|
return { |
|
|
meta: { date: new Date().toISOString(), version: environment.version }, |
|
|
meta: { date: new Date().toISOString(), version: environment.version }, |
|
|
|
|
|
accounts, |
|
|
activities: activities.map( |
|
|
activities: activities.map( |
|
|
({ |
|
|
({ |
|
|
accountId, |
|
|
accountId, |
|
|