@things-factory/accounting 7.0.1-beta.1 → 7.0.1-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/dist-client/activities/activity-book-edit.d.ts +1 -1
  2. package/dist-client/activities/activity-book-edit.js.map +1 -1
  3. package/dist-client/activities/activity-book-view.d.ts +1 -1
  4. package/dist-client/activities/activity-book-view.js.map +1 -1
  5. package/dist-client/activities/activity-expense-edit.d.ts +1 -1
  6. package/dist-client/activities/activity-expense-edit.js.map +1 -1
  7. package/dist-client/activities/activity-expense-view.d.ts +1 -1
  8. package/dist-client/activities/activity-expense-view.js.map +1 -1
  9. package/dist-client/pages/account/account-importer.d.ts +1 -1
  10. package/dist-client/pages/account/account-importer.js.map +1 -1
  11. package/dist-client/pages/account/account-list-page.d.ts +1 -1
  12. package/dist-client/pages/account/account-list-page.js.map +1 -1
  13. package/dist-client/pages/accounting-category/accounting-category-importer.d.ts +1 -1
  14. package/dist-client/pages/accounting-category/accounting-category-importer.js.map +1 -1
  15. package/dist-client/pages/accounting-category/accounting-category-list-page.d.ts +1 -1
  16. package/dist-client/pages/accounting-category/accounting-category-list-page.js.map +1 -1
  17. package/dist-client/pages/financial-statement/financial-statement-importer.d.ts +1 -1
  18. package/dist-client/pages/financial-statement/financial-statement-importer.js.map +1 -1
  19. package/dist-client/pages/financial-statement/financial-statement-list-page.d.ts +1 -1
  20. package/dist-client/pages/financial-statement/financial-statement-list-page.js.map +1 -1
  21. package/dist-client/pages/income-statement/income-statement-importer.d.ts +1 -1
  22. package/dist-client/pages/income-statement/income-statement-importer.js.map +1 -1
  23. package/dist-client/pages/income-statement/income-statement-list-page.d.ts +1 -1
  24. package/dist-client/pages/income-statement/income-statement-list-page.js.map +1 -1
  25. package/dist-client/pages/ledger/ledger-importer.d.ts +1 -1
  26. package/dist-client/pages/ledger/ledger-importer.js.map +1 -1
  27. package/dist-client/pages/ledger/ledger-list-page.d.ts +1 -1
  28. package/dist-client/pages/ledger/ledger-list-page.js.map +1 -1
  29. package/dist-client/pages/main.js.map +1 -1
  30. package/dist-client/pages/transaction/transaction-importer.d.ts +1 -1
  31. package/dist-client/pages/transaction/transaction-importer.js.map +1 -1
  32. package/dist-client/pages/transaction/transaction-list-page.d.ts +1 -1
  33. package/dist-client/pages/transaction/transaction-list-page.js.map +1 -1
  34. package/dist-client/route.js.map +1 -1
  35. package/dist-client/tsconfig.tsbuildinfo +1 -1
  36. package/dist-server/activities/activity-book.d.ts +58 -0
  37. package/dist-server/activities/activity-book.js.map +1 -1
  38. package/dist-server/activities/activity-expense.d.ts +58 -0
  39. package/dist-server/activities/activity-expense.js.map +1 -1
  40. package/dist-server/activities/index.d.ts +1 -0
  41. package/dist-server/activities/index.js +1 -1
  42. package/dist-server/activities/index.js.map +1 -1
  43. package/dist-server/controllers/index.d.ts +0 -0
  44. package/dist-server/index.d.ts +3 -0
  45. package/dist-server/middlewares/index.d.ts +1 -0
  46. package/dist-server/migrations/index.d.ts +1 -0
  47. package/dist-server/routes.d.ts +0 -0
  48. package/dist-server/routes.js +0 -1
  49. package/dist-server/routes.js.map +1 -1
  50. package/dist-server/service/account/account-history.d.ts +23 -0
  51. package/dist-server/service/account/account-history.js +2 -2
  52. package/dist-server/service/account/account-history.js.map +1 -1
  53. package/dist-server/service/account/account-mutation.d.ts +10 -0
  54. package/dist-server/service/account/account-mutation.js +2 -2
  55. package/dist-server/service/account/account-mutation.js.map +1 -1
  56. package/dist-server/service/account/account-query.d.ts +11 -0
  57. package/dist-server/service/account/account-query.js +2 -2
  58. package/dist-server/service/account/account-query.js.map +1 -1
  59. package/dist-server/service/account/account-type.d.ts +17 -0
  60. package/dist-server/service/account/account-type.js +6 -6
  61. package/dist-server/service/account/account-type.js.map +1 -1
  62. package/dist-server/service/account/account.d.ts +22 -0
  63. package/dist-server/service/account/account.js +2 -2
  64. package/dist-server/service/account/account.js.map +1 -1
  65. package/dist-server/service/account/event-subscriber.d.ts +7 -0
  66. package/dist-server/service/account/event-subscriber.js +2 -2
  67. package/dist-server/service/account/event-subscriber.js.map +1 -1
  68. package/dist-server/service/account/index.d.ts +8 -0
  69. package/dist-server/service/accounting-category/accounting-category-mutation.d.ts +10 -0
  70. package/dist-server/service/accounting-category/accounting-category-mutation.js +2 -2
  71. package/dist-server/service/accounting-category/accounting-category-mutation.js.map +1 -1
  72. package/dist-server/service/accounting-category/accounting-category-query.d.ts +11 -0
  73. package/dist-server/service/accounting-category/accounting-category-query.js +2 -2
  74. package/dist-server/service/accounting-category/accounting-category-query.js.map +1 -1
  75. package/dist-server/service/accounting-category/accounting-category-type.d.ts +17 -0
  76. package/dist-server/service/accounting-category/accounting-category-type.js +6 -6
  77. package/dist-server/service/accounting-category/accounting-category-type.js.map +1 -1
  78. package/dist-server/service/accounting-category/accounting-category.d.ts +19 -0
  79. package/dist-server/service/accounting-category/accounting-category.js +6 -7
  80. package/dist-server/service/accounting-category/accounting-category.js.map +1 -1
  81. package/dist-server/service/accounting-category/index.d.ts +6 -0
  82. package/dist-server/service/financial-statement/event-subscriber.d.ts +7 -0
  83. package/dist-server/service/financial-statement/event-subscriber.js +2 -2
  84. package/dist-server/service/financial-statement/event-subscriber.js.map +1 -1
  85. package/dist-server/service/financial-statement/financial-statement-history.d.ts +24 -0
  86. package/dist-server/service/financial-statement/financial-statement-history.js +2 -2
  87. package/dist-server/service/financial-statement/financial-statement-history.js.map +1 -1
  88. package/dist-server/service/financial-statement/financial-statement-mutation.d.ts +10 -0
  89. package/dist-server/service/financial-statement/financial-statement-mutation.js +2 -2
  90. package/dist-server/service/financial-statement/financial-statement-mutation.js.map +1 -1
  91. package/dist-server/service/financial-statement/financial-statement-query.d.ts +11 -0
  92. package/dist-server/service/financial-statement/financial-statement-query.js +2 -2
  93. package/dist-server/service/financial-statement/financial-statement-query.js.map +1 -1
  94. package/dist-server/service/financial-statement/financial-statement-type.d.ts +20 -0
  95. package/dist-server/service/financial-statement/financial-statement-type.js +6 -6
  96. package/dist-server/service/financial-statement/financial-statement-type.js.map +1 -1
  97. package/dist-server/service/financial-statement/financial-statement.d.ts +25 -0
  98. package/dist-server/service/financial-statement/financial-statement.js +3 -3
  99. package/dist-server/service/financial-statement/financial-statement.js.map +1 -1
  100. package/dist-server/service/financial-statement/index.d.ts +8 -0
  101. package/dist-server/service/income-statement/event-subscriber.d.ts +7 -0
  102. package/dist-server/service/income-statement/event-subscriber.js +2 -2
  103. package/dist-server/service/income-statement/event-subscriber.js.map +1 -1
  104. package/dist-server/service/income-statement/income-statement-history.d.ts +24 -0
  105. package/dist-server/service/income-statement/income-statement-history.js +2 -2
  106. package/dist-server/service/income-statement/income-statement-history.js.map +1 -1
  107. package/dist-server/service/income-statement/income-statement-mutation.d.ts +10 -0
  108. package/dist-server/service/income-statement/income-statement-mutation.js +2 -2
  109. package/dist-server/service/income-statement/income-statement-mutation.js.map +1 -1
  110. package/dist-server/service/income-statement/income-statement-query.d.ts +11 -0
  111. package/dist-server/service/income-statement/income-statement-query.js +2 -2
  112. package/dist-server/service/income-statement/income-statement-query.js.map +1 -1
  113. package/dist-server/service/income-statement/income-statement-type.d.ts +20 -0
  114. package/dist-server/service/income-statement/income-statement-type.js +6 -6
  115. package/dist-server/service/income-statement/income-statement-type.js.map +1 -1
  116. package/dist-server/service/income-statement/income-statement.d.ts +26 -0
  117. package/dist-server/service/income-statement/income-statement.js +3 -3
  118. package/dist-server/service/income-statement/income-statement.js.map +1 -1
  119. package/dist-server/service/income-statement/index.d.ts +8 -0
  120. package/dist-server/service/index.d.ts +10 -0
  121. package/dist-server/service/transaction/event-subscriber.d.ts +7 -0
  122. package/dist-server/service/transaction/event-subscriber.js +2 -2
  123. package/dist-server/service/transaction/event-subscriber.js.map +1 -1
  124. package/dist-server/service/transaction/index.d.ts +8 -0
  125. package/dist-server/service/transaction/transaction-history.d.ts +24 -0
  126. package/dist-server/service/transaction/transaction-history.js +2 -2
  127. package/dist-server/service/transaction/transaction-history.js.map +1 -1
  128. package/dist-server/service/transaction/transaction-mutation.d.ts +10 -0
  129. package/dist-server/service/transaction/transaction-mutation.js +2 -2
  130. package/dist-server/service/transaction/transaction-mutation.js.map +1 -1
  131. package/dist-server/service/transaction/transaction-query.d.ts +11 -0
  132. package/dist-server/service/transaction/transaction-query.js +2 -2
  133. package/dist-server/service/transaction/transaction-query.js.map +1 -1
  134. package/dist-server/service/transaction/transaction-type.d.ts +19 -0
  135. package/dist-server/service/transaction/transaction-type.js +6 -6
  136. package/dist-server/service/transaction/transaction-type.js.map +1 -1
  137. package/dist-server/service/transaction/transaction.d.ts +32 -0
  138. package/dist-server/service/transaction/transaction.js +3 -3
  139. package/dist-server/service/transaction/transaction.js.map +1 -1
  140. package/dist-server/tsconfig.tsbuildinfo +1 -1
  141. package/package.json +5 -5
  142. package/server/activities/index.ts +4 -5
  143. package/server/routes.ts +0 -2
@@ -0,0 +1,7 @@
1
+ import { HistoryEntitySubscriber } from '@operato/typeorm-history';
2
+ import { Account } from './account';
3
+ import { AccountHistory } from './account-history';
4
+ export declare class AccountHistoryEntitySubscriber extends HistoryEntitySubscriber<Account, AccountHistory> {
5
+ get entity(): typeof Account;
6
+ get historyEntity(): typeof AccountHistory;
7
+ }
@@ -14,8 +14,8 @@ let AccountHistoryEntitySubscriber = class AccountHistoryEntitySubscriber extend
14
14
  return account_history_1.AccountHistory;
15
15
  }
16
16
  };
17
- AccountHistoryEntitySubscriber = tslib_1.__decorate([
17
+ exports.AccountHistoryEntitySubscriber = AccountHistoryEntitySubscriber;
18
+ exports.AccountHistoryEntitySubscriber = AccountHistoryEntitySubscriber = tslib_1.__decorate([
18
19
  (0, typeorm_1.EventSubscriber)()
19
20
  ], AccountHistoryEntitySubscriber);
20
- exports.AccountHistoryEntitySubscriber = AccountHistoryEntitySubscriber;
21
21
  //# sourceMappingURL=event-subscriber.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"event-subscriber.js","sourceRoot":"","sources":["../../../server/service/account/event-subscriber.ts"],"names":[],"mappings":";;;;AAAA,qCAAyC;AAEzC,8DAAkE;AAElE,uCAAmC;AACnC,uDAAkD;AAG3C,IAAM,8BAA8B,GAApC,MAAM,8BAA+B,SAAQ,yCAAgD;IAClG,IAAW,MAAM;QACf,OAAO,iBAAO,CAAA;IAChB,CAAC;IAED,IAAW,aAAa;QACtB,OAAO,gCAAc,CAAA;IACvB,CAAC;CACF,CAAA;AARY,8BAA8B;IAD1C,IAAA,yBAAe,GAAE;GACL,8BAA8B,CAQ1C;AARY,wEAA8B","sourcesContent":["import { EventSubscriber } from 'typeorm'\n\nimport { HistoryEntitySubscriber } from '@operato/typeorm-history'\n\nimport { Account } from './account'\nimport { AccountHistory } from './account-history'\n\n@EventSubscriber()\nexport class AccountHistoryEntitySubscriber extends HistoryEntitySubscriber<Account, AccountHistory> {\n public get entity() {\n return Account\n }\n\n public get historyEntity() {\n return AccountHistory\n }\n}\n"]}
1
+ {"version":3,"file":"event-subscriber.js","sourceRoot":"","sources":["../../../server/service/account/event-subscriber.ts"],"names":[],"mappings":";;;;AAAA,qCAAyC;AAEzC,8DAAkE;AAElE,uCAAmC;AACnC,uDAAkD;AAG3C,IAAM,8BAA8B,GAApC,MAAM,8BAA+B,SAAQ,yCAAgD;IAClG,IAAW,MAAM;QACf,OAAO,iBAAO,CAAA;IAChB,CAAC;IAED,IAAW,aAAa;QACtB,OAAO,gCAAc,CAAA;IACvB,CAAC;CACF,CAAA;AARY,wEAA8B;yCAA9B,8BAA8B;IAD1C,IAAA,yBAAe,GAAE;GACL,8BAA8B,CAQ1C","sourcesContent":["import { EventSubscriber } from 'typeorm'\n\nimport { HistoryEntitySubscriber } from '@operato/typeorm-history'\n\nimport { Account } from './account'\nimport { AccountHistory } from './account-history'\n\n@EventSubscriber()\nexport class AccountHistoryEntitySubscriber extends HistoryEntitySubscriber<Account, AccountHistory> {\n public get entity() {\n return Account\n }\n\n public get historyEntity() {\n return AccountHistory\n }\n}\n"]}
@@ -0,0 +1,8 @@
1
+ import { Account } from './account';
2
+ import { AccountHistory } from './account-history';
3
+ import { AccountQuery } from './account-query';
4
+ import { AccountMutation } from './account-mutation';
5
+ import { AccountHistoryEntitySubscriber } from './event-subscriber';
6
+ export declare const entities: (typeof Account | typeof AccountHistory)[];
7
+ export declare const resolvers: (typeof AccountQuery | typeof AccountMutation)[];
8
+ export declare const subscribers: (typeof AccountHistoryEntitySubscriber)[];
@@ -0,0 +1,10 @@
1
+ import { AccountingCategory } from './accounting-category';
2
+ import { NewAccountingCategory, AccountingCategoryPatch } from './accounting-category-type';
3
+ export declare class AccountingCategoryMutation {
4
+ createAccountingCategory(accountingCategory: NewAccountingCategory, context: ResolverContext): Promise<AccountingCategory>;
5
+ updateAccountingCategory(id: string, patch: AccountingCategoryPatch, context: ResolverContext): Promise<AccountingCategory>;
6
+ updateMultipleAccountingCategory(patches: AccountingCategoryPatch[], context: ResolverContext): Promise<AccountingCategory[]>;
7
+ deleteAccountingCategory(id: string, context: ResolverContext): Promise<boolean>;
8
+ deleteAccountingCategories(ids: string[], context: ResolverContext): Promise<boolean>;
9
+ importAccountingCategories(accountingCategories: AccountingCategoryPatch[], context: ResolverContext): Promise<boolean>;
10
+ }
@@ -70,6 +70,7 @@ let AccountingCategoryMutation = class AccountingCategoryMutation {
70
70
  return true;
71
71
  }
72
72
  };
73
+ exports.AccountingCategoryMutation = AccountingCategoryMutation;
73
74
  tslib_1.__decorate([
74
75
  (0, type_graphql_1.Directive)('@transaction'),
75
76
  (0, type_graphql_1.Mutation)(returns => accounting_category_1.AccountingCategory, { description: 'To create new AccountingCategory' }),
@@ -125,8 +126,7 @@ tslib_1.__decorate([
125
126
  tslib_1.__metadata("design:paramtypes", [Array, Object]),
126
127
  tslib_1.__metadata("design:returntype", Promise)
127
128
  ], AccountingCategoryMutation.prototype, "importAccountingCategories", null);
128
- AccountingCategoryMutation = tslib_1.__decorate([
129
+ exports.AccountingCategoryMutation = AccountingCategoryMutation = tslib_1.__decorate([
129
130
  (0, type_graphql_1.Resolver)(accounting_category_1.AccountingCategory)
130
131
  ], AccountingCategoryMutation);
131
- exports.AccountingCategoryMutation = AccountingCategoryMutation;
132
132
  //# sourceMappingURL=accounting-category-mutation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"accounting-category-mutation.js","sourceRoot":"","sources":["../../../server/service/accounting-category/accounting-category-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,qEAA0F;AAE1F,+DAA0D;AAC1D,yEAA2F;AAGpF,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IAG/B,AAAN,KAAK,CAAC,wBAAwB,CACD,kBAAyC,EAC7D,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,aAAa,CAAC,wCAAkB,CAAC,CAAC,IAAI,iCACzD,kBAAkB,KACrB,MAAM,EACN,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CAAA;QAEF,OAAO,MAAM,CAAA;IACf,CAAC;IAIK,AAAN,KAAK,CAAC,wBAAwB,CACjB,EAAU,EACP,KAA8B,EACrC,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,MAAM,UAAU,GAAG,EAAE,CAAC,aAAa,CAAC,wCAAkB,CAAC,CAAA;QACvD,MAAM,kBAAkB,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC;YAClD,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;SACzC,CAAC,CAAA;QAEF,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,IAAI,+CAC/B,kBAAkB,GAClB,KAAK,KACR,OAAO,EAAE,IAAI,IACb,CAAA;QAEF,OAAO,MAAM,CAAA;IACf,CAAC;IAIK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AE,CAAA;;;;kFAwCP;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,8BAA8B,EAAE,CAAC;IAC9C,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;0EAO3D;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,yCAAyC,EAAE,CAAC;IAEtF,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAC5B,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;4EAYP;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,yCAAyC,EAAE,CAAC;IAEtF,mBAAA,IAAA,kBAAG,EAAC,sBAAsB,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,kDAAuB,CAAC,CAAC,CAAA;IAC9D,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;4EAaP;AAtIU,0BAA0B;IADtC,IAAA,uBAAQ,EAAC,wCAAkB,CAAC;GAChB,0BAA0B,CAuItC;AAvIY,gEAA0B","sourcesContent":["import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { createAttachment, deleteAttachmentsByRef } from '@things-factory/attachment-base'\n\nimport { AccountingCategory } from './accounting-category'\nimport { NewAccountingCategory, AccountingCategoryPatch } from './accounting-category-type'\n\n@Resolver(AccountingCategory)\nexport class AccountingCategoryMutation {\n @Directive('@transaction')\n @Mutation(returns => AccountingCategory, { description: 'To create new AccountingCategory' })\n async createAccountingCategory(\n @Arg('accountingCategory') accountingCategory: NewAccountingCategory,\n @Ctx() context: ResolverContext\n ): Promise<AccountingCategory> {\n const { domain, user, tx } = context.state\n\n const result = await tx.getRepository(AccountingCategory).save({\n ...accountingCategory,\n domain,\n creator: user,\n updater: user\n })\n\n return result\n }\n\n @Directive('@transaction')\n @Mutation(returns => AccountingCategory, { description: 'To modify AccountingCategory information' })\n async updateAccountingCategory(\n @Arg('id') id: string,\n @Arg('patch') patch: AccountingCategoryPatch,\n @Ctx() context: ResolverContext\n ): Promise<AccountingCategory> {\n const { domain, user, tx } = context.state\n\n const repository = tx.getRepository(AccountingCategory)\n const accountingCategory = await repository.findOne({\n where: { domain: { id: domain.id }, id }\n })\n\n const result = await repository.save({\n ...accountingCategory,\n ...patch,\n updater: user\n })\n\n return result\n }\n\n @Directive('@transaction')\n @Mutation(returns => [AccountingCategory], { description: \"To modify multiple AccountingCategories' information\" })\n async updateMultipleAccountingCategory(\n @Arg('patches', type => [AccountingCategoryPatch]) patches: AccountingCategoryPatch[],\n @Ctx() context: ResolverContext\n ): Promise<AccountingCategory[]> {\n const { domain, user, tx } = context.state\n\n let results = []\n const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')\n const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n const accountingCategoryRepo = tx.getRepository(AccountingCategory)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n const result = await accountingCategoryRepo.save({\n ...newRecord,\n domain,\n creator: user,\n updater: user\n })\n\n results.push({ ...result, cuFlag: '+' })\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const updateRecord = _updateRecords[i]\n const accountingCategory = await accountingCategoryRepo.findOneBy({ id: updateRecord.id })\n\n const result = await accountingCategoryRepo.save({\n ...accountingCategory,\n ...updateRecord,\n updater: user\n })\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete AccountingCategory' })\n async deleteAccountingCategory(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(AccountingCategory).delete({ domain: { id: domain.id }, id })\n await deleteAttachmentsByRef(null, { refBys: [id] }, context)\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple AccountingCategories' })\n async deleteAccountingCategories(\n @Arg('ids', type => [String]) ids: string[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(AccountingCategory).delete({\n domain: { id: domain.id },\n id: In(ids)\n })\n\n await deleteAttachmentsByRef(null, { refBys: ids }, context)\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To import multiple AccountingCategories' })\n async importAccountingCategories(\n @Arg('accountingCategories', type => [AccountingCategoryPatch]) accountingCategories: AccountingCategoryPatch[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await Promise.all(\n accountingCategories.map(async (accountingCategory: AccountingCategoryPatch) => {\n const createdAccountingCategory: AccountingCategory = await tx\n .getRepository(AccountingCategory)\n .save({ domain, ...accountingCategory })\n })\n )\n\n return true\n }\n}\n"]}
1
+ {"version":3,"file":"accounting-category-mutation.js","sourceRoot":"","sources":["../../../server/service/accounting-category/accounting-category-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,qEAA0F;AAE1F,+DAA0D;AAC1D,yEAA2F;AAGpF,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IAG/B,AAAN,KAAK,CAAC,wBAAwB,CACD,kBAAyC,EAC7D,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,MA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IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAC5B,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;4EAYP;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,yCAAyC,EAAE,CAAC;IAEtF,mBAAA,IAAA,kBAAG,EAAC,sBAAsB,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,kDAAuB,CAAC,CAAC,CAAA;IAC9D,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;4EAaP;qCAtIU,0BAA0B;IADtC,IAAA,uBAAQ,EAAC,wCAAkB,CAAC;GAChB,0BAA0B,CAuItC","sourcesContent":["import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { createAttachment, deleteAttachmentsByRef } from '@things-factory/attachment-base'\n\nimport { AccountingCategory } from './accounting-category'\nimport { NewAccountingCategory, AccountingCategoryPatch } from './accounting-category-type'\n\n@Resolver(AccountingCategory)\nexport class AccountingCategoryMutation {\n @Directive('@transaction')\n @Mutation(returns => AccountingCategory, { description: 'To create new AccountingCategory' })\n async createAccountingCategory(\n @Arg('accountingCategory') accountingCategory: NewAccountingCategory,\n @Ctx() context: ResolverContext\n ): Promise<AccountingCategory> {\n const { domain, user, tx } = context.state\n\n const result = await tx.getRepository(AccountingCategory).save({\n ...accountingCategory,\n domain,\n creator: user,\n updater: user\n })\n\n return result\n }\n\n @Directive('@transaction')\n @Mutation(returns => AccountingCategory, { description: 'To modify AccountingCategory information' })\n async updateAccountingCategory(\n @Arg('id') id: string,\n @Arg('patch') patch: AccountingCategoryPatch,\n @Ctx() context: ResolverContext\n ): Promise<AccountingCategory> {\n const { domain, user, tx } = context.state\n\n const repository = tx.getRepository(AccountingCategory)\n const accountingCategory = await repository.findOne({\n where: { domain: { id: domain.id }, id }\n })\n\n const result = await repository.save({\n ...accountingCategory,\n ...patch,\n updater: user\n })\n\n return result\n }\n\n @Directive('@transaction')\n @Mutation(returns => [AccountingCategory], { description: \"To modify multiple AccountingCategories' information\" })\n async updateMultipleAccountingCategory(\n @Arg('patches', type => [AccountingCategoryPatch]) patches: AccountingCategoryPatch[],\n @Ctx() context: ResolverContext\n ): Promise<AccountingCategory[]> {\n const { domain, user, tx } = context.state\n\n let results = []\n const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')\n const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n const accountingCategoryRepo = tx.getRepository(AccountingCategory)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n const result = await accountingCategoryRepo.save({\n ...newRecord,\n domain,\n creator: user,\n updater: user\n })\n\n results.push({ ...result, cuFlag: '+' })\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const updateRecord = _updateRecords[i]\n const accountingCategory = await accountingCategoryRepo.findOneBy({ id: updateRecord.id })\n\n const result = await accountingCategoryRepo.save({\n ...accountingCategory,\n ...updateRecord,\n updater: user\n })\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete AccountingCategory' })\n async deleteAccountingCategory(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(AccountingCategory).delete({ domain: { id: domain.id }, id })\n await deleteAttachmentsByRef(null, { refBys: [id] }, context)\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple AccountingCategories' })\n async deleteAccountingCategories(\n @Arg('ids', type => [String]) ids: string[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(AccountingCategory).delete({\n domain: { id: domain.id },\n id: In(ids)\n })\n\n await deleteAttachmentsByRef(null, { refBys: ids }, context)\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To import multiple AccountingCategories' })\n async importAccountingCategories(\n @Arg('accountingCategories', type => [AccountingCategoryPatch]) accountingCategories: AccountingCategoryPatch[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await Promise.all(\n accountingCategories.map(async (accountingCategory: AccountingCategoryPatch) => {\n const createdAccountingCategory: AccountingCategory = await tx\n .getRepository(AccountingCategory)\n .save({ domain, ...accountingCategory })\n })\n )\n\n return true\n }\n}\n"]}
@@ -0,0 +1,11 @@
1
+ import { Domain, ListParam } from '@things-factory/shell';
2
+ import { User } from '@things-factory/auth-base';
3
+ import { AccountingCategory } from './accounting-category';
4
+ import { AccountingCategoryList } from './accounting-category-type';
5
+ export declare class AccountingCategoryQuery {
6
+ accountingCategory(id: string, context: ResolverContext): Promise<AccountingCategory>;
7
+ accountingCategories(params: ListParam, context: ResolverContext): Promise<AccountingCategoryList>;
8
+ domain(accountingCategory: AccountingCategory): Promise<Domain>;
9
+ updater(accountingCategory: AccountingCategory): Promise<User>;
10
+ creator(accountingCategory: AccountingCategory): Promise<User>;
11
+ }
@@ -35,6 +35,7 @@ let AccountingCategoryQuery = class AccountingCategoryQuery {
35
35
  return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: accountingCategory.creatorId });
36
36
  }
37
37
  };
38
+ exports.AccountingCategoryQuery = AccountingCategoryQuery;
38
39
  tslib_1.__decorate([
39
40
  (0, type_graphql_1.Query)(returns => accounting_category_1.AccountingCategory, { nullable: true, description: 'To fetch a AccountingCategory' }),
40
41
  tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
@@ -72,8 +73,7 @@ tslib_1.__decorate([
72
73
  tslib_1.__metadata("design:paramtypes", [accounting_category_1.AccountingCategory]),
73
74
  tslib_1.__metadata("design:returntype", Promise)
74
75
  ], AccountingCategoryQuery.prototype, "creator", null);
75
- AccountingCategoryQuery = tslib_1.__decorate([
76
+ exports.AccountingCategoryQuery = AccountingCategoryQuery = tslib_1.__decorate([
76
77
  (0, type_graphql_1.Resolver)(accounting_category_1.AccountingCategory)
77
78
  ], AccountingCategoryQuery);
78
- exports.AccountingCategoryQuery = AccountingCategoryQuery;
79
79
  //# sourceMappingURL=accounting-category-query.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"accounting-category-query.js","sourceRoot":"","sources":["../../../server/service/accounting-category/accounting-category-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8F;AAC9F,iDAAuG;AACvG,yDAAgD;AAChD,+DAA0D;AAC1D,yEAAmE;AAG5D,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAE5B,AAAN,KAAK,CAAC,kBAAkB,CAAY,EAAU,EAAS,OAAwB;QAC7E,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,qBAAa,EAAC,wCAAkB,CAAC,CAAC,OAAO,CAAC;YACrD,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;SACzC,CAAC,CAAA;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,oBAAoB,CAChB,MAAiB,EAClB,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,MAAM,YAAY,GAAG,IAAA,qCAA6B,EAAC;YACjD,MAAM;YACN,MAAM;YACN,UAAU,EAAE,MAAM,IAAA,qBAAa,EAAC,wCAAkB,CAAC;YACnD,WAAW,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC;SACrC,CAAC,CAAA;QAEF,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,YAAY,CAAC,eAAe,EAAE,CAAA;QAE3D,OAAO,EAAE,KAAK,EAAE,KAAK,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BAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAqB,wCAAkB;;sDAE3D;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAqB,wCAAkB;;sDAE3D;AA1CU,uBAAuB;IADnC,IAAA,uBAAQ,EAAC,wCAAkB,CAAC;GAChB,uBAAuB,CA2CnC;AA3CY,0DAAuB","sourcesContent":["import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx, Directive } from 'type-graphql'\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { AccountingCategory } from './accounting-category'\nimport { AccountingCategoryList } from './accounting-category-type'\n\n@Resolver(AccountingCategory)\nexport class AccountingCategoryQuery {\n @Query(returns => AccountingCategory!, { nullable: true, description: 'To fetch a AccountingCategory' })\n async accountingCategory(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<AccountingCategory> {\n const { domain } = context.state\n\n return await getRepository(AccountingCategory).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Query(returns => AccountingCategoryList, { description: 'To fetch multiple AccountingCategories' })\n async accountingCategories(\n @Args() params: ListParam,\n @Ctx() context: ResolverContext\n ): Promise<AccountingCategoryList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: await getRepository(AccountingCategory),\n searchables: ['name', 'description']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() accountingCategory: AccountingCategory): Promise<Domain> {\n return await getRepository(Domain).findOneBy({ id: accountingCategory.domainId })\n }\n\n @FieldResolver(type => User)\n async updater(@Root() accountingCategory: AccountingCategory): Promise<User> {\n return await getRepository(User).findOneBy({ id: accountingCategory.updaterId })\n }\n\n @FieldResolver(type => User)\n async creator(@Root() accountingCategory: AccountingCategory): Promise<User> {\n return await getRepository(User).findOneBy({ id: accountingCategory.creatorId })\n }\n}\n"]}
1
+ {"version":3,"file":"accounting-category-query.js","sourceRoot":"","sources":["../../../server/service/accounting-category/accounting-category-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8F;AAC9F,iDAAuG;AACvG,yDAAgD;AAChD,+DAA0D;AAC1D,yEAAmE;AAG5D,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAE5B,AAAN,KAAK,CAAC,kBAAkB,CAAY,EAAU,EAAS,OAAwB;QAC7E,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,qBAAa,EAAC,wCAAkB,CAAC,CAAC,OAAO,CAAC;YACrD,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;SACzC,CAAC,CAAA;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,oBAAoB,CAChB,MAAiB,EAClB,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,MAAM,YAAY,GAAG,IAAA,qCAA6B,EAAC;YACjD,MAAM;YACN,MAAM;YACN,UAAU,EAAE,MAAM,IAAA,qBAAa,EAAC,wCAAkB,CAAC;YACnD,WAAW,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC;SACrC,CAAC,CAAA;QAEF,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,YAAY,CAAC,eAAe,EAAE,CAAA;QAE3D,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACzB,CAAC;IAGK,AAAN,KAAK,CAAC,MAAM,CAAS,kBAAsC;QACzD,OAAO,MAAM,IAAA,qBAAa,EAAC,cAAM,CAAC,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,kBAAkB,CAAC,QAAQ,EAAE,CAAC,CAAA;IACnF,CAAC;IAGK,AA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,uBAAuB;IADnC,IAAA,uBAAQ,EAAC,wCAAkB,CAAC;GAChB,uBAAuB,CA2CnC","sourcesContent":["import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx, Directive } from 'type-graphql'\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { AccountingCategory } from './accounting-category'\nimport { AccountingCategoryList } from './accounting-category-type'\n\n@Resolver(AccountingCategory)\nexport class AccountingCategoryQuery {\n @Query(returns => AccountingCategory!, { nullable: true, description: 'To fetch a AccountingCategory' })\n async accountingCategory(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<AccountingCategory> {\n const { domain } = context.state\n\n return await getRepository(AccountingCategory).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Query(returns => AccountingCategoryList, { description: 'To fetch multiple AccountingCategories' })\n async accountingCategories(\n @Args() params: ListParam,\n @Ctx() context: ResolverContext\n ): Promise<AccountingCategoryList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: await getRepository(AccountingCategory),\n searchables: ['name', 'description']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() accountingCategory: AccountingCategory): Promise<Domain> {\n return await getRepository(Domain).findOneBy({ id: accountingCategory.domainId })\n }\n\n @FieldResolver(type => User)\n async updater(@Root() accountingCategory: AccountingCategory): Promise<User> {\n return await getRepository(User).findOneBy({ id: accountingCategory.updaterId })\n }\n\n @FieldResolver(type => User)\n async creator(@Root() accountingCategory: AccountingCategory): Promise<User> {\n return await getRepository(User).findOneBy({ id: accountingCategory.creatorId })\n }\n}\n"]}
@@ -0,0 +1,17 @@
1
+ import { AccountingCategory } from './accounting-category';
2
+ export declare class NewAccountingCategory {
3
+ name: string;
4
+ description?: string;
5
+ active?: boolean;
6
+ }
7
+ export declare class AccountingCategoryPatch {
8
+ id?: string;
9
+ name?: string;
10
+ description?: string;
11
+ active?: boolean;
12
+ cuFlag?: string;
13
+ }
14
+ export declare class AccountingCategoryList {
15
+ items: AccountingCategory[];
16
+ total: number;
17
+ }
@@ -6,6 +6,7 @@ const type_graphql_1 = require("type-graphql");
6
6
  const accounting_category_1 = require("./accounting-category");
7
7
  let NewAccountingCategory = class NewAccountingCategory {
8
8
  };
9
+ exports.NewAccountingCategory = NewAccountingCategory;
9
10
  tslib_1.__decorate([
10
11
  (0, type_graphql_1.Field)(),
11
12
  tslib_1.__metadata("design:type", String)
@@ -18,12 +19,12 @@ tslib_1.__decorate([
18
19
  (0, type_graphql_1.Field)({ nullable: true }),
19
20
  tslib_1.__metadata("design:type", Boolean)
20
21
  ], NewAccountingCategory.prototype, "active", void 0);
21
- NewAccountingCategory = tslib_1.__decorate([
22
+ exports.NewAccountingCategory = NewAccountingCategory = tslib_1.__decorate([
22
23
  (0, type_graphql_1.InputType)()
23
24
  ], NewAccountingCategory);
24
- exports.NewAccountingCategory = NewAccountingCategory;
25
25
  let AccountingCategoryPatch = class AccountingCategoryPatch {
26
26
  };
27
+ exports.AccountingCategoryPatch = AccountingCategoryPatch;
27
28
  tslib_1.__decorate([
28
29
  (0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
29
30
  tslib_1.__metadata("design:type", String)
@@ -44,12 +45,12 @@ tslib_1.__decorate([
44
45
  (0, type_graphql_1.Field)({ nullable: true }),
45
46
  tslib_1.__metadata("design:type", String)
46
47
  ], AccountingCategoryPatch.prototype, "cuFlag", void 0);
47
- AccountingCategoryPatch = tslib_1.__decorate([
48
+ exports.AccountingCategoryPatch = AccountingCategoryPatch = tslib_1.__decorate([
48
49
  (0, type_graphql_1.InputType)()
49
50
  ], AccountingCategoryPatch);
50
- exports.AccountingCategoryPatch = AccountingCategoryPatch;
51
51
  let AccountingCategoryList = class AccountingCategoryList {
52
52
  };
53
+ exports.AccountingCategoryList = AccountingCategoryList;
53
54
  tslib_1.__decorate([
54
55
  (0, type_graphql_1.Field)(type => [accounting_category_1.AccountingCategory]),
55
56
  tslib_1.__metadata("design:type", Array)
@@ -58,8 +59,7 @@ tslib_1.__decorate([
58
59
  (0, type_graphql_1.Field)(type => type_graphql_1.Int),
59
60
  tslib_1.__metadata("design:type", Number)
60
61
  ], AccountingCategoryList.prototype, "total", void 0);
61
- AccountingCategoryList = tslib_1.__decorate([
62
+ exports.AccountingCategoryList = AccountingCategoryList = tslib_1.__decorate([
62
63
  (0, type_graphql_1.ObjectType)()
63
64
  ], AccountingCategoryList);
64
- exports.AccountingCategoryList = AccountingCategoryList;
65
65
  //# sourceMappingURL=accounting-category-type.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"accounting-category-type.js","sourceRoot":"","sources":["../../../server/service/accounting-category/accounting-category-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAsF;AAEtF,+DAA0D;AAGnD,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;CASjC,CAAA;AARC;IAAC,IAAA,oBAAK,GAAE;;mDACI;AAEZ;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0DACN;AAEpB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qDACV;AARL,qBAAqB;IADjC,IAAA,wBAAS,GAAE;GACC,qBAAqB,CASjC;AATY,sDAAqB;AAY3B,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;CAenC,CAAA;AAdC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDAC3B;AAEX;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qDACb;AAEb;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4DACN;AAEpB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uDACV;AAEhB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uDACX;AAdJ,uBAAuB;IADnC,IAAA,wBAAS,GAAE;GACC,uBAAuB,CAenC;AAfY,0DAAuB;AAkB7B,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;CAMlC,CAAA;AALC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,wCAAkB,CAAC,CAAC;;qDACT;AAE3B;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;qDACN;AALF,sBAAsB;IADlC,IAAA,yBAAU,GAAE;GACA,sBAAsB,CAMlC;AANY,wDAAsB","sourcesContent":["import { ObjectType, Field, InputType, Int, ID, registerEnumType } from 'type-graphql'\n\nimport { AccountingCategory } from './accounting-category'\n\n@InputType()\nexport class NewAccountingCategory {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n active?: boolean\n}\n\n@InputType()\nexport class AccountingCategoryPatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n active?: boolean\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class AccountingCategoryList {\n @Field(type => [AccountingCategory])\n items: AccountingCategory[]\n\n @Field(type => Int)\n total: number\n}\n"]}
1
+ {"version":3,"file":"accounting-category-type.js","sourceRoot":"","sources":["../../../server/service/accounting-category/accounting-category-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAsF;AAEtF,+DAA0D;AAGnD,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;CASjC,CAAA;AATY,sDAAqB;AAEhC;IADC,IAAA,oBAAK,GAAE;;mDACI;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0DACN;AAGpB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qDACV;gCARL,qBAAqB;IADjC,IAAA,wBAAS,GAAE;GACC,qBAAqB,CASjC;AAGM,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;CAenC,CAAA;AAfY,0DAAuB;AAElC;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDAC3B;AAGX;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qDACb;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4DACN;AAGpB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uDACV;AAGhB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uDACX;kCAdJ,uBAAuB;IADnC,IAAA,wBAAS,GAAE;GACC,uBAAuB,CAenC;AAGM,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;CAMlC,CAAA;AANY,wDAAsB;AAEjC;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,wCAAkB,CAAC,CAAC;;qDACT;AAG3B;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;qDACN;iCALF,sBAAsB;IADlC,IAAA,yBAAU,GAAE;GACA,sBAAsB,CAMlC","sourcesContent":["import { ObjectType, Field, InputType, Int, ID, registerEnumType } from 'type-graphql'\n\nimport { AccountingCategory } from './accounting-category'\n\n@InputType()\nexport class NewAccountingCategory {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n active?: boolean\n}\n\n@InputType()\nexport class AccountingCategoryPatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n active?: boolean\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class AccountingCategoryList {\n @Field(type => [AccountingCategory])\n items: AccountingCategory[]\n\n @Field(type => Int)\n total: number\n}\n"]}
@@ -0,0 +1,19 @@
1
+ import { Domain } from '@things-factory/shell';
2
+ import { User } from '@things-factory/auth-base';
3
+ export declare class AccountingCategory {
4
+ readonly id: string;
5
+ domain?: Domain;
6
+ domainId?: string;
7
+ name?: string;
8
+ description?: string;
9
+ active?: boolean;
10
+ parent?: AccountingCategory;
11
+ parentId?: string;
12
+ children?: AccountingCategory[];
13
+ createdAt?: Date;
14
+ updatedAt?: Date;
15
+ creator?: User;
16
+ creatorId?: string;
17
+ updater?: User;
18
+ updaterId?: string;
19
+ }
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
- var AccountingCategory_1;
3
2
  Object.defineProperty(exports, "__esModule", { value: true });
4
3
  exports.AccountingCategory = void 0;
5
4
  const tslib_1 = require("tslib");
@@ -7,8 +6,9 @@ const typeorm_1 = require("typeorm");
7
6
  const type_graphql_1 = require("type-graphql");
8
7
  const shell_1 = require("@things-factory/shell");
9
8
  const auth_base_1 = require("@things-factory/auth-base");
10
- let AccountingCategory = AccountingCategory_1 = class AccountingCategory {
9
+ let AccountingCategory = class AccountingCategory {
11
10
  };
11
+ exports.AccountingCategory = AccountingCategory;
12
12
  tslib_1.__decorate([
13
13
  (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
14
14
  (0, type_graphql_1.Field)(type => type_graphql_1.ID),
@@ -39,7 +39,7 @@ tslib_1.__decorate([
39
39
  tslib_1.__metadata("design:type", Boolean)
40
40
  ], AccountingCategory.prototype, "active", void 0);
41
41
  tslib_1.__decorate([
42
- (0, typeorm_1.ManyToOne)(type => AccountingCategory_1, accountingCategory => accountingCategory.children, { nullable: true }),
42
+ (0, typeorm_1.ManyToOne)(type => AccountingCategory, accountingCategory => accountingCategory.children, { nullable: true }),
43
43
  (0, type_graphql_1.Field)({ nullable: true }),
44
44
  tslib_1.__metadata("design:type", AccountingCategory)
45
45
  ], AccountingCategory.prototype, "parent", void 0);
@@ -48,8 +48,8 @@ tslib_1.__decorate([
48
48
  tslib_1.__metadata("design:type", String)
49
49
  ], AccountingCategory.prototype, "parentId", void 0);
50
50
  tslib_1.__decorate([
51
- (0, typeorm_1.OneToMany)(type => AccountingCategory_1, accountingCategory => accountingCategory.parent),
52
- (0, type_graphql_1.Field)(type => [AccountingCategory_1]),
51
+ (0, typeorm_1.OneToMany)(type => AccountingCategory, accountingCategory => accountingCategory.parent),
52
+ (0, type_graphql_1.Field)(type => [AccountingCategory]),
53
53
  tslib_1.__metadata("design:type", Array)
54
54
  ], AccountingCategory.prototype, "children", void 0);
55
55
  tslib_1.__decorate([
@@ -80,10 +80,9 @@ tslib_1.__decorate([
80
80
  (0, typeorm_1.RelationId)((accountingCategory) => accountingCategory.updater),
81
81
  tslib_1.__metadata("design:type", String)
82
82
  ], AccountingCategory.prototype, "updaterId", void 0);
83
- AccountingCategory = AccountingCategory_1 = tslib_1.__decorate([
83
+ exports.AccountingCategory = AccountingCategory = tslib_1.__decorate([
84
84
  (0, typeorm_1.Entity)(),
85
85
  (0, typeorm_1.Index)('ix_accounting_category_0', (accountingCategory) => [accountingCategory.domain, accountingCategory.name], { unique: true }),
86
86
  (0, type_graphql_1.ObjectType)({ description: 'Entity for AccountingCategory' })
87
87
  ], AccountingCategory);
88
- exports.AccountingCategory = AccountingCategory;
89
88
  //# sourceMappingURL=accounting-category.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"accounting-category.js","sourceRoot":"","sources":["../../../server/service/accounting-category/accounting-category.ts"],"names":[],"mappings":";;;;;AAAA,qCAUgB;AAChB,+CAAyD;AAEzD,iDAA8C;AAC9C,yDAAgD;AASzC,IAAM,kBAAkB,0BAAxB,MAAM,kBAAkB;CAwD9B,CAAA;AAvDC;IAAC,IAAA,gCAAsB,EAA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Y,gDAAkB","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n OneToMany,\n PrimaryGeneratedColumn\n} from 'typeorm'\nimport { ObjectType, Field, Int, ID } from 'type-graphql'\n\nimport { Domain } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\n\n@Entity()\n@Index(\n 'ix_accounting_category_0',\n (accountingCategory: AccountingCategory) => [accountingCategory.domain, accountingCategory.name],\n { unique: true }\n)\n@ObjectType({ description: 'Entity for AccountingCategory' })\nexport class AccountingCategory {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field(type => Domain)\n domain?: Domain\n\n @RelationId((accountingCategory: AccountingCategory) => accountingCategory.domain)\n domainId?: string\n\n @Column()\n @Field({ nullable: true })\n name?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n description?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n active?: boolean\n\n @ManyToOne(type => AccountingCategory, accountingCategory => accountingCategory.children, { nullable: true })\n @Field({ nullable: true })\n parent?: AccountingCategory\n\n @RelationId((accountingCategory: AccountingCategory) => accountingCategory.parent)\n parentId?: string\n\n @OneToMany(type => AccountingCategory, accountingCategory => accountingCategory.parent)\n @Field(type => [AccountingCategory])\n children?: AccountingCategory[]\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n creator?: User\n\n @RelationId((accountingCategory: AccountingCategory) => accountingCategory.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((accountingCategory: AccountingCategory) => accountingCategory.updater)\n updaterId?: string\n}\n"]}
1
+ {"version":3,"file":"accounting-category.js","sourceRoot":"","sources":["../../../server/service/accounting-category/accounting-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BAAkB,CAAC,MAAM,EAAE,kBAAkB,CAAC,IAAI,CAAC,EAChG,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB;IACA,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,+BAA+B,EAAE,CAAC;GAChD,kBAAkB,CAwD9B","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n OneToMany,\n PrimaryGeneratedColumn\n} from 'typeorm'\nimport { ObjectType, Field, Int, ID } from 'type-graphql'\n\nimport { Domain } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\n\n@Entity()\n@Index(\n 'ix_accounting_category_0',\n (accountingCategory: AccountingCategory) => [accountingCategory.domain, accountingCategory.name],\n { unique: true }\n)\n@ObjectType({ description: 'Entity for AccountingCategory' })\nexport class AccountingCategory {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field(type => Domain)\n domain?: Domain\n\n @RelationId((accountingCategory: AccountingCategory) => accountingCategory.domain)\n domainId?: string\n\n @Column()\n @Field({ nullable: true })\n name?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n description?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n active?: boolean\n\n @ManyToOne(type => AccountingCategory, accountingCategory => accountingCategory.children, { nullable: true })\n @Field({ nullable: true })\n parent?: AccountingCategory\n\n @RelationId((accountingCategory: AccountingCategory) => accountingCategory.parent)\n parentId?: string\n\n @OneToMany(type => AccountingCategory, accountingCategory => accountingCategory.parent)\n @Field(type => [AccountingCategory])\n children?: AccountingCategory[]\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n creator?: User\n\n @RelationId((accountingCategory: AccountingCategory) => accountingCategory.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((accountingCategory: AccountingCategory) => accountingCategory.updater)\n updaterId?: string\n}\n"]}
@@ -0,0 +1,6 @@
1
+ import { AccountingCategory } from './accounting-category';
2
+ import { AccountingCategoryQuery } from './accounting-category-query';
3
+ import { AccountingCategoryMutation } from './accounting-category-mutation';
4
+ export declare const entities: (typeof AccountingCategory)[];
5
+ export declare const resolvers: (typeof AccountingCategoryQuery | typeof AccountingCategoryMutation)[];
6
+ export declare const subscribers: any[];
@@ -0,0 +1,7 @@
1
+ import { HistoryEntitySubscriber } from '@operato/typeorm-history';
2
+ import { FinancialStatement } from './financial-statement';
3
+ import { FinancialStatementHistory } from './financial-statement-history';
4
+ export declare class FinancialStatementHistoryEntitySubscriber extends HistoryEntitySubscriber<FinancialStatement, FinancialStatementHistory> {
5
+ get entity(): typeof FinancialStatement;
6
+ get historyEntity(): typeof FinancialStatementHistory;
7
+ }
@@ -14,8 +14,8 @@ let FinancialStatementHistoryEntitySubscriber = class FinancialStatementHistoryE
14
14
  return financial_statement_history_1.FinancialStatementHistory;
15
15
  }
16
16
  };
17
- FinancialStatementHistoryEntitySubscriber = tslib_1.__decorate([
17
+ exports.FinancialStatementHistoryEntitySubscriber = FinancialStatementHistoryEntitySubscriber;
18
+ exports.FinancialStatementHistoryEntitySubscriber = FinancialStatementHistoryEntitySubscriber = tslib_1.__decorate([
18
19
  (0, typeorm_1.EventSubscriber)()
19
20
  ], FinancialStatementHistoryEntitySubscriber);
20
- exports.FinancialStatementHistoryEntitySubscriber = FinancialStatementHistoryEntitySubscriber;
21
21
  //# sourceMappingURL=event-subscriber.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"event-subscriber.js","sourceRoot":"","sources":["../../../server/service/financial-statement/event-subscriber.ts"],"names":[],"mappings":";;;;AAAA,qCAAyC;AAEzC,8DAAkE;AAElE,+DAA0D;AAC1D,+EAAyE;AAGlE,IAAM,yCAAyC,GAA/C,MAAM,yCAA0C,SAAQ,yCAAsE;IACnI,IAAW,MAAM;QACf,OAAO,wCAAkB,CAAA;IAC3B,CAAC;IAED,IAAW,aAAa;QACtB,OAAO,uDAAyB,CAAA;IAClC,CAAC;CACF,CAAA;AARY,yCAAyC;IADrD,IAAA,yBAAe,GAAE;GACL,yCAAyC,CAQrD;AARY,8FAAyC","sourcesContent":["import { EventSubscriber } from 'typeorm'\n\nimport { HistoryEntitySubscriber } from '@operato/typeorm-history'\n\nimport { FinancialStatement } from './financial-statement'\nimport { FinancialStatementHistory } from './financial-statement-history'\n\n@EventSubscriber()\nexport class FinancialStatementHistoryEntitySubscriber extends HistoryEntitySubscriber<FinancialStatement, FinancialStatementHistory> {\n public get entity() {\n return FinancialStatement\n }\n\n public get historyEntity() {\n return FinancialStatementHistory\n }\n}\n"]}
1
+ {"version":3,"file":"event-subscriber.js","sourceRoot":"","sources":["../../../server/service/financial-statement/event-subscriber.ts"],"names":[],"mappings":";;;;AAAA,qCAAyC;AAEzC,8DAAkE;AAElE,+DAA0D;AAC1D,+EAAyE;AAGlE,IAAM,yCAAyC,GAA/C,MAAM,yCAA0C,SAAQ,yCAAsE;IACnI,IAAW,MAAM;QACf,OAAO,wCAAkB,CAAA;IAC3B,CAAC;IAED,IAAW,aAAa;QACtB,OAAO,uDAAyB,CAAA;IAClC,CAAC;CACF,CAAA;AARY,8FAAyC;oDAAzC,yCAAyC;IADrD,IAAA,yBAAe,GAAE;GACL,yCAAyC,CAQrD","sourcesContent":["import { EventSubscriber } from 'typeorm'\n\nimport { HistoryEntitySubscriber } from '@operato/typeorm-history'\n\nimport { FinancialStatement } from './financial-statement'\nimport { FinancialStatementHistory } from './financial-statement-history'\n\n@EventSubscriber()\nexport class FinancialStatementHistoryEntitySubscriber extends HistoryEntitySubscriber<FinancialStatement, FinancialStatementHistory> {\n public get entity() {\n return FinancialStatement\n }\n\n public get historyEntity() {\n return FinancialStatementHistory\n }\n}\n"]}
@@ -0,0 +1,24 @@
1
+ import { HistoryActionType, HistoryEntityInterface } from '@operato/typeorm-history';
2
+ import { User } from '@things-factory/auth-base';
3
+ import { Domain } from '@things-factory/shell';
4
+ import { FinancialStatement, FinancialStatementStatus } from './financial-statement';
5
+ export declare class FinancialStatementHistory implements HistoryEntityInterface<FinancialStatement> {
6
+ readonly id: string;
7
+ version?: number;
8
+ domain?: Domain;
9
+ domainId?: string;
10
+ name: string;
11
+ description?: string;
12
+ active?: boolean;
13
+ state?: FinancialStatementStatus;
14
+ params?: string;
15
+ createdAt?: Date;
16
+ updatedAt?: Date;
17
+ deletedAt?: Date;
18
+ creator?: User;
19
+ creatorId?: string;
20
+ updater?: User;
21
+ updaterId?: string;
22
+ originalId: string;
23
+ action: HistoryActionType;
24
+ }
@@ -16,6 +16,7 @@ let FinancialStatementHistory = class FinancialStatementHistory {
16
16
  this.version = 1;
17
17
  }
18
18
  };
19
+ exports.FinancialStatementHistory = FinancialStatementHistory;
19
20
  tslib_1.__decorate([
20
21
  (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
21
22
  (0, type_graphql_1.Field)(type => type_graphql_1.ID),
@@ -109,7 +110,7 @@ tslib_1.__decorate([
109
110
  }),
110
111
  tslib_1.__metadata("design:type", String)
111
112
  ], FinancialStatementHistory.prototype, "action", void 0);
112
- FinancialStatementHistory = tslib_1.__decorate([
113
+ exports.FinancialStatementHistory = FinancialStatementHistory = tslib_1.__decorate([
113
114
  (0, typeorm_1.Entity)(),
114
115
  (0, typeorm_1.Index)('ix_financial-statement_history_0', (financialStatementHistory) => [
115
116
  financialStatementHistory.originalId,
@@ -122,5 +123,4 @@ FinancialStatementHistory = tslib_1.__decorate([
122
123
  ], { unique: true }),
123
124
  (0, type_graphql_1.ObjectType)({ description: 'History Entity of FinancialStatement' })
124
125
  ], FinancialStatementHistory);
125
- exports.FinancialStatementHistory = FinancialStatementHistory;
126
126
  //# sourceMappingURL=financial-statement-history.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"financial-statement-history.js","sourceRoot":"","sources":["../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ChB,gBAAI;0DAAA;AAEd;IAAC,IAAA,oBAAU,EAAC,CAAC,kBAAsC,EAAE,EAAE,CAAC,kBAAkB,CAAC,OAAO,CAAC;;4DACjE;AAElB;IAAC,IAAA,yCAAuB,GAAE;;6DACA;AAE1B;IAAC,IAAA,qCAAmB,EAAC;QACnB,QAAQ,EAAE,KAAK;QACf,IAAI,EACF,aAAa,IAAI,UAAU,IAAI,aAAa,IAAI,OAAO,IAAI,aAAa,IAAI,SAAS;YACnF,CAAC,CAAC,MAAM;YACR,CAAC,CAAC,aAAa,IAAI,QAAQ;gBACzB,CAAC,CAAC,UAAU;gBACZ,CAAC,CAAC,UAAU;QAClB,IAAI,EAAE,mCAAiB;KACxB,CAAC;;yDAC+B;AA3EtB,yBAAyB;IAnBrC,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EACJ,kCAAkC,EAClC,CAAC,yBAAoD,EAAE,EAAE,CAAC;QACxD,yBAAyB,CAAC,UAAU;QACpC,yBAAyB,CAAC,OAAO;KAClC,EACD,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB;IACA,IAAA,eAAK,EACJ,kCAAkC,EAClC,CAAC,yBAAoD,EAAE,EAAE,CAAC;QACxD,yBAAyB,CAAC,MAAM;QAChC,yBAAyB,CAAC,UAAU;QACpC,yBAAyB,CAAC,OAAO;KAClC,EACD,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB;IACA,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,sCAAsC,EAAE,CAAC;GACvD,yBAAyB,CA4ErC;AA5EY,8DAAyB","sourcesContent":["import { Field, ID, ObjectType } from 'type-graphql'\nimport { Column, Entity, Index, ManyToOne, PrimaryGeneratedColumn, RelationId } from 'typeorm'\n\nimport {\n HistoryActionColumn,\n HistoryActionType,\n HistoryEntityInterface,\n HistoryOriginalIdColumn\n} from '@operato/typeorm-history'\nimport { Role, User } from '@things-factory/auth-base'\nimport { config } from '@things-factory/env'\nimport { Domain } from '@things-factory/shell'\n\nimport { FinancialStatement, FinancialStatementStatus } from './financial-statement'\n\nconst ORMCONFIG = config.get('ormconfig', {})\nconst DATABASE_TYPE = ORMCONFIG.type\n\n@Entity()\n@Index(\n 'ix_financial-statement_history_0',\n (financialStatementHistory: FinancialStatementHistory) => [\n financialStatementHistory.originalId,\n financialStatementHistory.version\n ],\n { unique: true }\n)\n@Index(\n 'ix_financial-statement_history_1',\n (financialStatementHistory: FinancialStatementHistory) => [\n financialStatementHistory.domain,\n financialStatementHistory.originalId,\n financialStatementHistory.version\n ],\n { unique: true }\n)\n@ObjectType({ description: 'History Entity of FinancialStatement' })\nexport class FinancialStatementHistory implements HistoryEntityInterface<FinancialStatement> {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @Column({ nullable: true, default: 1 })\n @Field({ nullable: true })\n version?: number = 1\n\n @ManyToOne(type => Domain)\n @Field(type => Domain)\n domain?: Domain\n\n @RelationId((financialStatement: FinancialStatement) => financialStatement.domain)\n domainId?: string\n\n @Column()\n @Field()\n name: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n description?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n active?: boolean\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n state?: FinancialStatementStatus\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n params?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n createdAt?: Date\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n updatedAt?: Date\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n deletedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field({ nullable: true })\n creator?: User\n\n @RelationId((financialStatement: FinancialStatement) => financialStatement.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field({ nullable: true })\n updater?: User\n\n @RelationId((financialStatement: FinancialStatement) => financialStatement.updater)\n updaterId?: string\n\n @HistoryOriginalIdColumn()\n public originalId!: string\n\n @HistoryActionColumn({\n nullable: false,\n type:\n DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'\n ? 'enum'\n : DATABASE_TYPE == 'oracle'\n ? 'varchar2'\n : 'smallint',\n enum: HistoryActionType\n })\n public action!: HistoryActionType\n}\n"]}
1
+ {"version":3,"file":"financial-statement-history.js","sourceRoot":"","sources":["../../../server/service/financial-statement/financial-statement-history.ts"],"names":[],"mappings":";;;;AAAA,+CAAoD;AACpD,qCAA8F;AAE9F,8DAKiC;AACjC,yDAAsD;AACtD,6CAA4C;AAC5C,iDAA8C;AAE9C,+DAAoF;AAEpF,MAAM,SAAS,GAAG,YAAM,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;AAC7C,MAAM,aAAa,GAAG,SAAS,CAAC,IAAI,CAAA;AAqB7B,IAAM,yBAAyB,GAA/B,MAAM,yBAAyB;IAA/B;QAOL,YAAO,GAAY,CAAC,CAAA;IAqEtB,CAAC;CAAA,CAAA;AA5EY,8DAAyB;AAG3B;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;qDACC;AAInB;IAFC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;IACtC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0DACN;AAIpB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;sCACb,cAAM;yDAAA;AAGf;IADC,IAAA,oBAAU,EAAC,CAAC,kBAAsC,EAAE,EAAE,CAAC,kBAAkB,CAAC,MAAM,CAAC;;2DACjE;AAIjB;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,GAAE;;uDACI;AAIZ;IAFC,IAAA,gBAAM,E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ManyToOne, PrimaryGeneratedColumn, RelationId } from 'typeorm'\n\nimport {\n HistoryActionColumn,\n HistoryActionType,\n HistoryEntityInterface,\n HistoryOriginalIdColumn\n} from '@operato/typeorm-history'\nimport { Role, User } from '@things-factory/auth-base'\nimport { config } from '@things-factory/env'\nimport { Domain } from '@things-factory/shell'\n\nimport { FinancialStatement, FinancialStatementStatus } from './financial-statement'\n\nconst ORMCONFIG = config.get('ormconfig', {})\nconst DATABASE_TYPE = ORMCONFIG.type\n\n@Entity()\n@Index(\n 'ix_financial-statement_history_0',\n (financialStatementHistory: FinancialStatementHistory) => [\n financialStatementHistory.originalId,\n financialStatementHistory.version\n ],\n { unique: true }\n)\n@Index(\n 'ix_financial-statement_history_1',\n (financialStatementHistory: FinancialStatementHistory) => [\n financialStatementHistory.domain,\n financialStatementHistory.originalId,\n financialStatementHistory.version\n ],\n { unique: true }\n)\n@ObjectType({ description: 'History Entity of FinancialStatement' })\nexport class FinancialStatementHistory implements HistoryEntityInterface<FinancialStatement> {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @Column({ nullable: true, default: 1 })\n @Field({ nullable: true })\n version?: number = 1\n\n @ManyToOne(type => Domain)\n @Field(type => Domain)\n domain?: Domain\n\n @RelationId((financialStatement: FinancialStatement) => financialStatement.domain)\n domainId?: string\n\n @Column()\n @Field()\n name: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n description?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n active?: boolean\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n state?: FinancialStatementStatus\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n params?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n createdAt?: Date\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n updatedAt?: Date\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n deletedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field({ nullable: true })\n creator?: User\n\n @RelationId((financialStatement: FinancialStatement) => financialStatement.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field({ nullable: true })\n updater?: User\n\n @RelationId((financialStatement: FinancialStatement) => financialStatement.updater)\n updaterId?: string\n\n @HistoryOriginalIdColumn()\n public originalId!: string\n\n @HistoryActionColumn({\n nullable: false,\n type:\n DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'\n ? 'enum'\n : DATABASE_TYPE == 'oracle'\n ? 'varchar2'\n : 'smallint',\n enum: HistoryActionType\n })\n public action!: HistoryActionType\n}\n"]}
@@ -0,0 +1,10 @@
1
+ import { FinancialStatement } from './financial-statement';
2
+ import { NewFinancialStatement, FinancialStatementPatch } from './financial-statement-type';
3
+ export declare class FinancialStatementMutation {
4
+ createFinancialStatement(financialStatement: NewFinancialStatement, context: ResolverContext): Promise<FinancialStatement>;
5
+ updateFinancialStatement(id: string, patch: FinancialStatementPatch, context: ResolverContext): Promise<FinancialStatement>;
6
+ updateMultipleFinancialStatement(patches: FinancialStatementPatch[], context: ResolverContext): Promise<FinancialStatement[]>;
7
+ deleteFinancialStatement(id: string, context: ResolverContext): Promise<boolean>;
8
+ deleteFinancialStatements(ids: string[], context: ResolverContext): Promise<boolean>;
9
+ importFinancialStatements(financialStatements: FinancialStatementPatch[], context: ResolverContext): Promise<boolean>;
10
+ }
@@ -70,6 +70,7 @@ let FinancialStatementMutation = class FinancialStatementMutation {
70
70
  return true;
71
71
  }
72
72
  };
73
+ exports.FinancialStatementMutation = FinancialStatementMutation;
73
74
  tslib_1.__decorate([
74
75
  (0, type_graphql_1.Directive)('@transaction'),
75
76
  (0, type_graphql_1.Mutation)(returns => financial_statement_1.FinancialStatement, { description: 'To create new FinancialStatement' }),
@@ -125,8 +126,7 @@ tslib_1.__decorate([
125
126
  tslib_1.__metadata("design:paramtypes", [Array, Object]),
126
127
  tslib_1.__metadata("design:returntype", Promise)
127
128
  ], FinancialStatementMutation.prototype, "importFinancialStatements", null);
128
- FinancialStatementMutation = tslib_1.__decorate([
129
+ exports.FinancialStatementMutation = FinancialStatementMutation = tslib_1.__decorate([
129
130
  (0, type_graphql_1.Resolver)(financial_statement_1.FinancialStatement)
130
131
  ], FinancialStatementMutation);
131
- exports.FinancialStatementMutation = FinancialStatementMutation;
132
132
  //# sourceMappingURL=financial-statement-mutation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"financial-statement-mutation.js","sourceRoot":"","sources":["../../../server/service/financial-statement/financial-statement-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,qEAA0F;AAE1F,+DAA0D;AAC1D,yEAA2F;AAGpF,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IAG/B,AAAN,KAAK,CAAC,wBAAwB,CACD,kBAAyC,EAC7D,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,aAAa,CAAC,wCAAkB,CAAC,CAAC,IAAI,iCACzD,kBAAkB,KACrB,MAAM,EACN,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CAAA;QAEF,OAAO,MAAM,CAAA;IACf,CAAC;IAIK,AAAN,KAAK,CAAC,wBAAwB,CACjB,EAAU,EACP,KAA8B,EACrC,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,MAAM,UAAU,GAAG,EAAE,CAAC,aAAa,CAAC,wCAAkB,CAAC,CAAA;QACvD,MAAM,kBAAkB,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC;YAClD,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;SACzC,CAAC,CAAA;QAEF,MAAM,MAAM,GAAG,MAAM,UA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,IAAA,kBAAG,EAAC,SAAS,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,kDAAuB,CAAC,CAAC,CAAA;IACjD,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;kFAwCP;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,8BAA8B,EAAE,CAAC;IAC9C,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;0EAO3D;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,wCAAwC,EAAE,CAAC;IAErF,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAC5B,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;2EAYP;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,wCAAwC,EAAE,CAAC;IAErF,mBAAA,IAAA,kBAAG,EAAC,qBAAqB,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,kDAAuB,CAAC,CAAC,CAAA;IAC7D,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;2EAaP;AAtIU,0BAA0B;IADtC,IAAA,uBAAQ,EAAC,wCAAkB,CAAC;GAChB,0BAA0B,CAuItC;AAvIY,gEAA0B","sourcesContent":["import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { createAttachment, deleteAttachmentsByRef } from '@things-factory/attachment-base'\n\nimport { FinancialStatement } from './financial-statement'\nimport { NewFinancialStatement, FinancialStatementPatch } from './financial-statement-type'\n\n@Resolver(FinancialStatement)\nexport class FinancialStatementMutation {\n @Directive('@transaction')\n @Mutation(returns => FinancialStatement, { description: 'To create new FinancialStatement' })\n async createFinancialStatement(\n @Arg('financialStatement') financialStatement: NewFinancialStatement,\n @Ctx() context: ResolverContext\n ): Promise<FinancialStatement> {\n const { domain, user, tx } = context.state\n\n const result = await tx.getRepository(FinancialStatement).save({\n ...financialStatement,\n domain,\n creator: user,\n updater: user\n })\n\n return result\n }\n\n @Directive('@transaction')\n @Mutation(returns => FinancialStatement, { description: 'To modify FinancialStatement information' })\n async updateFinancialStatement(\n @Arg('id') id: string,\n @Arg('patch') patch: FinancialStatementPatch,\n @Ctx() context: ResolverContext\n ): Promise<FinancialStatement> {\n const { domain, user, tx } = context.state\n\n const repository = tx.getRepository(FinancialStatement)\n const financialStatement = await repository.findOne({\n where: { domain: { id: domain.id }, id }\n })\n\n const result = await repository.save({\n ...financialStatement,\n ...patch,\n updater: user\n })\n\n return result\n }\n\n @Directive('@transaction')\n @Mutation(returns => [FinancialStatement], { description: \"To modify multiple FinancialStatements' information\" })\n async updateMultipleFinancialStatement(\n @Arg('patches', type => [FinancialStatementPatch]) patches: FinancialStatementPatch[],\n @Ctx() context: ResolverContext\n ): Promise<FinancialStatement[]> {\n const { domain, user, tx } = context.state\n\n let results = []\n const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')\n const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n const financialStatementRepo = tx.getRepository(FinancialStatement)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n const result = await financialStatementRepo.save({\n ...newRecord,\n domain,\n creator: user,\n updater: user\n })\n\n results.push({ ...result, cuFlag: '+' })\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const updateRecord = _updateRecords[i]\n const financialStatement = await financialStatementRepo.findOneBy({ id: updateRecord.id })\n\n const result = await financialStatementRepo.save({\n ...financialStatement,\n ...updateRecord,\n updater: user\n })\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete FinancialStatement' })\n async deleteFinancialStatement(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(FinancialStatement).delete({ domain: { id: domain.id }, id })\n await deleteAttachmentsByRef(null, { refBys: [id] }, context)\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple FinancialStatements' })\n async deleteFinancialStatements(\n @Arg('ids', type => [String]) ids: string[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(FinancialStatement).delete({\n domain: { id: domain.id },\n id: In(ids)\n })\n\n await deleteAttachmentsByRef(null, { refBys: ids }, context)\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To import multiple FinancialStatements' })\n async importFinancialStatements(\n @Arg('financialStatements', type => [FinancialStatementPatch]) financialStatements: FinancialStatementPatch[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await Promise.all(\n financialStatements.map(async (financialStatement: FinancialStatementPatch) => {\n const createdFinancialStatement: FinancialStatement = await tx\n .getRepository(FinancialStatement)\n .save({ domain, ...financialStatement })\n })\n )\n\n return true\n }\n}\n"]}
1
+ {"version":3,"file":"financial-statement-mutation.js","sourceRoot":"","sources":["../../../server/service/financial-statement/financial-statement-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,qEAA0F;AAE1F,+DAA0D;AAC1D,yEAA2F;AAGpF,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IAG/B,AAAN,KAAK,CAAC,wBAAwB,CACD,kBAAyC,EAC7D,OAAwB;QAE/B,MAAM,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AAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,wCAAwC,EAAE,CAAC;IAErF,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAC5B,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;2EAYP;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,wCAAwC,EAAE,CAAC;IAErF,mBAAA,IAAA,kBAAG,EAAC,qBAAqB,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,kDAAuB,CAAC,CAAC,CAAA;IAC7D,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;2EAaP;qCAtIU,0BAA0B;IADtC,IAAA,uBAAQ,EAAC,wCAAkB,CAAC;GAChB,0BAA0B,CAuItC","sourcesContent":["import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { createAttachment, deleteAttachmentsByRef } from '@things-factory/attachment-base'\n\nimport { FinancialStatement } from './financial-statement'\nimport { NewFinancialStatement, FinancialStatementPatch } from './financial-statement-type'\n\n@Resolver(FinancialStatement)\nexport class FinancialStatementMutation {\n @Directive('@transaction')\n @Mutation(returns => FinancialStatement, { description: 'To create new FinancialStatement' })\n async createFinancialStatement(\n @Arg('financialStatement') financialStatement: NewFinancialStatement,\n @Ctx() context: ResolverContext\n ): Promise<FinancialStatement> {\n const { domain, user, tx } = context.state\n\n const result = await tx.getRepository(FinancialStatement).save({\n ...financialStatement,\n domain,\n creator: user,\n updater: user\n })\n\n return result\n }\n\n @Directive('@transaction')\n @Mutation(returns => FinancialStatement, { description: 'To modify FinancialStatement information' })\n async updateFinancialStatement(\n @Arg('id') id: string,\n @Arg('patch') patch: FinancialStatementPatch,\n @Ctx() context: ResolverContext\n ): Promise<FinancialStatement> {\n const { domain, user, tx } = context.state\n\n const repository = tx.getRepository(FinancialStatement)\n const financialStatement = await repository.findOne({\n where: { domain: { id: domain.id }, id }\n })\n\n const result = await repository.save({\n ...financialStatement,\n ...patch,\n updater: user\n })\n\n return result\n }\n\n @Directive('@transaction')\n @Mutation(returns => [FinancialStatement], { description: \"To modify multiple FinancialStatements' information\" })\n async updateMultipleFinancialStatement(\n @Arg('patches', type => [FinancialStatementPatch]) patches: FinancialStatementPatch[],\n @Ctx() context: ResolverContext\n ): Promise<FinancialStatement[]> {\n const { domain, user, tx } = context.state\n\n let results = []\n const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')\n const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n const financialStatementRepo = tx.getRepository(FinancialStatement)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n const result = await financialStatementRepo.save({\n ...newRecord,\n domain,\n creator: user,\n updater: user\n })\n\n results.push({ ...result, cuFlag: '+' })\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const updateRecord = _updateRecords[i]\n const financialStatement = await financialStatementRepo.findOneBy({ id: updateRecord.id })\n\n const result = await financialStatementRepo.save({\n ...financialStatement,\n ...updateRecord,\n updater: user\n })\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete FinancialStatement' })\n async deleteFinancialStatement(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(FinancialStatement).delete({ domain: { id: domain.id }, id })\n await deleteAttachmentsByRef(null, { refBys: [id] }, context)\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple FinancialStatements' })\n async deleteFinancialStatements(\n @Arg('ids', type => [String]) ids: string[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(FinancialStatement).delete({\n domain: { id: domain.id },\n id: In(ids)\n })\n\n await deleteAttachmentsByRef(null, { refBys: ids }, context)\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To import multiple FinancialStatements' })\n async importFinancialStatements(\n @Arg('financialStatements', type => [FinancialStatementPatch]) financialStatements: FinancialStatementPatch[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await Promise.all(\n financialStatements.map(async (financialStatement: FinancialStatementPatch) => {\n const createdFinancialStatement: FinancialStatement = await tx\n .getRepository(FinancialStatement)\n .save({ domain, ...financialStatement })\n })\n )\n\n return true\n }\n}\n"]}
@@ -0,0 +1,11 @@
1
+ import { Domain, ListParam } from '@things-factory/shell';
2
+ import { User } from '@things-factory/auth-base';
3
+ import { FinancialStatement } from './financial-statement';
4
+ import { FinancialStatementList } from './financial-statement-type';
5
+ export declare class FinancialStatementQuery {
6
+ financialStatement(id: string, context: ResolverContext): Promise<FinancialStatement>;
7
+ financialStatements(params: ListParam, context: ResolverContext): Promise<FinancialStatementList>;
8
+ domain(financialStatement: FinancialStatement): Promise<Domain>;
9
+ updater(financialStatement: FinancialStatement): Promise<User>;
10
+ creator(financialStatement: FinancialStatement): Promise<User>;
11
+ }
@@ -35,6 +35,7 @@ let FinancialStatementQuery = class FinancialStatementQuery {
35
35
  return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: financialStatement.creatorId });
36
36
  }
37
37
  };
38
+ exports.FinancialStatementQuery = FinancialStatementQuery;
38
39
  tslib_1.__decorate([
39
40
  (0, type_graphql_1.Query)(returns => financial_statement_1.FinancialStatement, { nullable: true, description: 'To fetch a FinancialStatement' }),
40
41
  tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
@@ -72,8 +73,7 @@ tslib_1.__decorate([
72
73
  tslib_1.__metadata("design:paramtypes", [financial_statement_1.FinancialStatement]),
73
74
  tslib_1.__metadata("design:returntype", Promise)
74
75
  ], FinancialStatementQuery.prototype, "creator", null);
75
- FinancialStatementQuery = tslib_1.__decorate([
76
+ exports.FinancialStatementQuery = FinancialStatementQuery = tslib_1.__decorate([
76
77
  (0, type_graphql_1.Resolver)(financial_statement_1.FinancialStatement)
77
78
  ], FinancialStatementQuery);
78
- exports.FinancialStatementQuery = FinancialStatementQuery;
79
79
  //# sourceMappingURL=financial-statement-query.js.map