@abyss-project/banking 1.0.0

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 (204) hide show
  1. package/.eslintrc.js +34 -0
  2. package/README.md +2 -0
  3. package/dist/api/abyss.admin.api.d.ts +2 -0
  4. package/dist/api/abyss.admin.api.js +8 -0
  5. package/dist/api/banking.admin.api.d.ts +13 -0
  6. package/dist/api/banking.admin.api.js +52 -0
  7. package/dist/api/banking.api.d.ts +18 -0
  8. package/dist/api/banking.api.js +76 -0
  9. package/dist/api/categorization-rule.admin.api.d.ts +7 -0
  10. package/dist/api/categorization-rule.admin.api.js +28 -0
  11. package/dist/api/categorization-rule.api.d.ts +7 -0
  12. package/dist/api/categorization-rule.api.js +28 -0
  13. package/dist/api/category.admin.api.d.ts +6 -0
  14. package/dist/api/category.admin.api.js +27 -0
  15. package/dist/api/category.api.d.ts +9 -0
  16. package/dist/api/category.api.js +34 -0
  17. package/dist/api/index.d.ts +12 -0
  18. package/dist/api/index.js +24 -0
  19. package/dist/api/monitor.api.d.ts +2 -0
  20. package/dist/api/monitor.api.js +8 -0
  21. package/dist/api/panel.admin.api.d.ts +6 -0
  22. package/dist/api/panel.admin.api.js +27 -0
  23. package/dist/api/panel.api.d.ts +6 -0
  24. package/dist/api/panel.api.js +28 -0
  25. package/dist/api/user.admin.api.d.ts +5 -0
  26. package/dist/api/user.admin.api.js +23 -0
  27. package/dist/api/user.api.d.ts +4 -0
  28. package/dist/api/user.api.js +17 -0
  29. package/dist/index.d.ts +19 -0
  30. package/dist/index.js +84 -0
  31. package/dist/types/enum/aggregator-type.enum.d.ts +4 -0
  32. package/dist/types/enum/aggregator-type.enum.js +8 -0
  33. package/dist/types/enum/api-error.enum.d.ts +16 -0
  34. package/dist/types/enum/api-error.enum.js +21 -0
  35. package/dist/types/enum/bank-connection-status.enum.d.ts +6 -0
  36. package/dist/types/enum/bank-connection-status.enum.js +10 -0
  37. package/dist/types/enum/cash-account-type.enum.d.ts +26 -0
  38. package/dist/types/enum/cash-account-type.enum.js +30 -0
  39. package/dist/types/enum/index.d.ts +6 -0
  40. package/dist/types/enum/index.js +18 -0
  41. package/dist/types/enum/panel-component-type.enum.d.ts +12 -0
  42. package/dist/types/enum/panel-component-type.enum.js +16 -0
  43. package/dist/types/enum/period-configuration.enum.d.ts +7 -0
  44. package/dist/types/enum/period-configuration.enum.js +11 -0
  45. package/dist/types/index.d.ts +2 -0
  46. package/dist/types/index.js +14 -0
  47. package/dist/types/interface/api/index.d.ts +27 -0
  48. package/dist/types/interface/api/index.js +39 -0
  49. package/dist/types/interface/api/requests/abyss.admin.request.d.ts +3 -0
  50. package/dist/types/interface/api/requests/abyss.admin.request.js +2 -0
  51. package/dist/types/interface/api/requests/banking.admin.request.d.ts +47 -0
  52. package/dist/types/interface/api/requests/banking.admin.request.js +2 -0
  53. package/dist/types/interface/api/requests/banking.request.d.ts +75 -0
  54. package/dist/types/interface/api/requests/banking.request.js +2 -0
  55. package/dist/types/interface/api/requests/categorization-rule.admin.request.d.ts +34 -0
  56. package/dist/types/interface/api/requests/categorization-rule.admin.request.js +2 -0
  57. package/dist/types/interface/api/requests/categorization-rule.request.d.ts +32 -0
  58. package/dist/types/interface/api/requests/categorization-rule.request.js +2 -0
  59. package/dist/types/interface/api/requests/category.admin.request.d.ts +22 -0
  60. package/dist/types/interface/api/requests/category.admin.request.js +2 -0
  61. package/dist/types/interface/api/requests/category.request.d.ts +26 -0
  62. package/dist/types/interface/api/requests/category.request.js +2 -0
  63. package/dist/types/interface/api/requests/panel.admin.request.d.ts +23 -0
  64. package/dist/types/interface/api/requests/panel.admin.request.js +2 -0
  65. package/dist/types/interface/api/requests/panel.request.d.ts +22 -0
  66. package/dist/types/interface/api/requests/panel.request.js +2 -0
  67. package/dist/types/interface/api/requests/user.admin.request.d.ts +15 -0
  68. package/dist/types/interface/api/requests/user.admin.request.js +2 -0
  69. package/dist/types/interface/api/requests/user.request.d.ts +2 -0
  70. package/dist/types/interface/api/requests/user.request.js +2 -0
  71. package/dist/types/interface/api/responses/abyss.admin.response.d.ts +6 -0
  72. package/dist/types/interface/api/responses/abyss.admin.response.js +2 -0
  73. package/dist/types/interface/api/responses/banking.admin.response.d.ts +48 -0
  74. package/dist/types/interface/api/responses/banking.admin.response.js +2 -0
  75. package/dist/types/interface/api/responses/banking.response.d.ts +86 -0
  76. package/dist/types/interface/api/responses/banking.response.js +2 -0
  77. package/dist/types/interface/api/responses/categorization-rule.admin.response.d.ts +22 -0
  78. package/dist/types/interface/api/responses/categorization-rule.admin.response.js +2 -0
  79. package/dist/types/interface/api/responses/categorization-rule.response.d.ts +22 -0
  80. package/dist/types/interface/api/responses/categorization-rule.response.js +2 -0
  81. package/dist/types/interface/api/responses/category.admin.response.d.ts +19 -0
  82. package/dist/types/interface/api/responses/category.admin.response.js +2 -0
  83. package/dist/types/interface/api/responses/category.response.d.ts +32 -0
  84. package/dist/types/interface/api/responses/category.response.js +2 -0
  85. package/dist/types/interface/api/responses/monitor.response.d.ts +7 -0
  86. package/dist/types/interface/api/responses/monitor.response.js +2 -0
  87. package/dist/types/interface/api/responses/panel.admin.response.d.ts +19 -0
  88. package/dist/types/interface/api/responses/panel.admin.response.js +2 -0
  89. package/dist/types/interface/api/responses/panel.response.d.ts +19 -0
  90. package/dist/types/interface/api/responses/panel.response.js +2 -0
  91. package/dist/types/interface/api/responses/storage.admin.response.d.ts +3 -0
  92. package/dist/types/interface/api/responses/storage.admin.response.js +2 -0
  93. package/dist/types/interface/api/responses/user.admin.response.d.ts +14 -0
  94. package/dist/types/interface/api/responses/user.admin.response.js +2 -0
  95. package/dist/types/interface/api/responses/user.response.d.ts +13 -0
  96. package/dist/types/interface/api/responses/user.response.js +2 -0
  97. package/dist/types/interface/api/type-message/api-error.d.ts +8 -0
  98. package/dist/types/interface/api/type-message/api-error.js +2 -0
  99. package/dist/types/interface/api/type-message/base-order.d.ts +4 -0
  100. package/dist/types/interface/api/type-message/base-order.js +2 -0
  101. package/dist/types/interface/api/type-message/base-paginate.d.ts +10 -0
  102. package/dist/types/interface/api/type-message/base-paginate.js +2 -0
  103. package/dist/types/interface/api/type-message/response.d.ts +5 -0
  104. package/dist/types/interface/api/type-message/response.js +2 -0
  105. package/dist/types/interface/index.d.ts +13 -0
  106. package/dist/types/interface/index.js +25 -0
  107. package/dist/types/interface/models/account-transaction.model.d.ts +46 -0
  108. package/dist/types/interface/models/account-transaction.model.js +2 -0
  109. package/dist/types/interface/models/aggregator-bank.model.d.ts +12 -0
  110. package/dist/types/interface/models/aggregator-bank.model.js +2 -0
  111. package/dist/types/interface/models/aggregator-link.model.d.ts +12 -0
  112. package/dist/types/interface/models/aggregator-link.model.js +2 -0
  113. package/dist/types/interface/models/bank-account-history.model.d.ts +11 -0
  114. package/dist/types/interface/models/bank-account-history.model.js +2 -0
  115. package/dist/types/interface/models/bank-account-transaction.model.d.ts +14 -0
  116. package/dist/types/interface/models/bank-account-transaction.model.js +2 -0
  117. package/dist/types/interface/models/bank-account.model.d.ts +26 -0
  118. package/dist/types/interface/models/bank-account.model.js +2 -0
  119. package/dist/types/interface/models/bank-connection.model.d.ts +17 -0
  120. package/dist/types/interface/models/bank-connection.model.js +2 -0
  121. package/dist/types/interface/models/categorization-rule-category.model.d.ts +11 -0
  122. package/dist/types/interface/models/categorization-rule-category.model.js +2 -0
  123. package/dist/types/interface/models/categorization-rule.model.d.ts +44 -0
  124. package/dist/types/interface/models/categorization-rule.model.js +2 -0
  125. package/dist/types/interface/models/category.model.d.ts +14 -0
  126. package/dist/types/interface/models/category.model.js +2 -0
  127. package/dist/types/interface/models/panel.model.d.ts +108 -0
  128. package/dist/types/interface/models/panel.model.js +2 -0
  129. package/dist/types/interface/models/transaction-category.model.d.ts +14 -0
  130. package/dist/types/interface/models/transaction-category.model.js +2 -0
  131. package/dist/types/interface/models/user.model.d.ts +13 -0
  132. package/dist/types/interface/models/user.model.js +2 -0
  133. package/dist/utils/error.utils.d.ts +15 -0
  134. package/dist/utils/error.utils.js +24 -0
  135. package/dist/utils/index.d.ts +1 -0
  136. package/dist/utils/index.js +13 -0
  137. package/package.json +48 -0
  138. package/src/api/abyss.admin.api.ts +16 -0
  139. package/src/api/banking.admin.api.ts +141 -0
  140. package/src/api/banking.api.ts +197 -0
  141. package/src/api/categorization-rule.admin.api.ts +80 -0
  142. package/src/api/categorization-rule.api.ts +80 -0
  143. package/src/api/category.admin.api.ts +63 -0
  144. package/src/api/category.api.ts +74 -0
  145. package/src/api/index.ts +12 -0
  146. package/src/api/monitor.api.ts +6 -0
  147. package/src/api/panel.admin.api.ts +57 -0
  148. package/src/api/panel.api.ts +45 -0
  149. package/src/api/user.admin.api.ts +44 -0
  150. package/src/api/user.api.ts +20 -0
  151. package/src/index.ts +72 -0
  152. package/src/types/enum/aggregator-type.enum.ts +4 -0
  153. package/src/types/enum/api-error.enum.ts +18 -0
  154. package/src/types/enum/bank-connection-status.enum.ts +6 -0
  155. package/src/types/enum/cash-account-type.enum.ts +54 -0
  156. package/src/types/enum/index.ts +7 -0
  157. package/src/types/enum/panel-component-type.enum.ts +12 -0
  158. package/src/types/enum/period-configuration.enum.ts +7 -0
  159. package/src/types/index.ts +2 -0
  160. package/src/types/interface/api/index.ts +29 -0
  161. package/src/types/interface/api/requests/abyss.admin.request.ts +3 -0
  162. package/src/types/interface/api/requests/banking.admin.request.ts +57 -0
  163. package/src/types/interface/api/requests/banking.request.ts +89 -0
  164. package/src/types/interface/api/requests/categorization-rule.admin.request.ts +40 -0
  165. package/src/types/interface/api/requests/categorization-rule.request.ts +38 -0
  166. package/src/types/interface/api/requests/category.admin.request.ts +27 -0
  167. package/src/types/interface/api/requests/category.request.ts +31 -0
  168. package/src/types/interface/api/requests/panel.admin.request.ts +28 -0
  169. package/src/types/interface/api/requests/panel.request.ts +27 -0
  170. package/src/types/interface/api/requests/user.admin.request.ts +20 -0
  171. package/src/types/interface/api/requests/user.request.ts +2 -0
  172. package/src/types/interface/api/responses/abyss.admin.response.ts +7 -0
  173. package/src/types/interface/api/responses/banking.admin.response.ts +73 -0
  174. package/src/types/interface/api/responses/banking.response.ts +119 -0
  175. package/src/types/interface/api/responses/categorization-rule.admin.response.ts +28 -0
  176. package/src/types/interface/api/responses/categorization-rule.response.ts +28 -0
  177. package/src/types/interface/api/responses/category.admin.response.ts +24 -0
  178. package/src/types/interface/api/responses/category.response.ts +39 -0
  179. package/src/types/interface/api/responses/monitor.response.ts +8 -0
  180. package/src/types/interface/api/responses/panel.admin.response.ts +24 -0
  181. package/src/types/interface/api/responses/panel.response.ts +24 -0
  182. package/src/types/interface/api/responses/storage.admin.response.ts +4 -0
  183. package/src/types/interface/api/responses/user.admin.response.ts +18 -0
  184. package/src/types/interface/api/responses/user.response.ts +16 -0
  185. package/src/types/interface/api/type-message/api-error.ts +9 -0
  186. package/src/types/interface/api/type-message/base-order.ts +4 -0
  187. package/src/types/interface/api/type-message/base-paginate.ts +11 -0
  188. package/src/types/interface/api/type-message/response.ts +6 -0
  189. package/src/types/interface/index.ts +15 -0
  190. package/src/types/interface/models/account-transaction.model.ts +53 -0
  191. package/src/types/interface/models/aggregator-bank.model.ts +15 -0
  192. package/src/types/interface/models/aggregator-link.model.ts +15 -0
  193. package/src/types/interface/models/bank-account-history.model.ts +14 -0
  194. package/src/types/interface/models/bank-account.model.ts +29 -0
  195. package/src/types/interface/models/bank-connection.model.ts +20 -0
  196. package/src/types/interface/models/categorization-rule-category.model.ts +14 -0
  197. package/src/types/interface/models/categorization-rule.model.ts +48 -0
  198. package/src/types/interface/models/category.model.ts +17 -0
  199. package/src/types/interface/models/panel.model.ts +135 -0
  200. package/src/types/interface/models/transaction-category.model.ts +17 -0
  201. package/src/types/interface/models/user.model.ts +16 -0
  202. package/src/utils/error.utils.ts +30 -0
  203. package/src/utils/index.ts +1 -0
  204. package/tsconfig.json +105 -0
@@ -0,0 +1,12 @@
1
+ import { AggregatorType } from '../../enum';
2
+ export interface IAggregatorBank {
3
+ id?: string;
4
+ aggregatorType: AggregatorType;
5
+ aggregatorBankId: string;
6
+ logoUrl: string;
7
+ name: string;
8
+ bic: string;
9
+ countries: string[];
10
+ updatedAt?: Date;
11
+ createdAt?: Date;
12
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,12 @@
1
+ import { AggregatorType } from '../../enum';
2
+ import { IBankConnection } from './bank-connection.model';
3
+ import { IUser } from './user.model';
4
+ export interface IAggregatorLink {
5
+ id?: string;
6
+ type: AggregatorType;
7
+ userId: string;
8
+ updatedAt?: Date;
9
+ createdAt?: Date;
10
+ user?: IUser;
11
+ bankConnection?: IBankConnection[];
12
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,11 @@
1
+ import { IBankAccount } from './bank-account.model';
2
+ export interface IBankAccountHistory {
3
+ id?: string;
4
+ expectedBalance: number;
5
+ availableBalance: number;
6
+ date: Date;
7
+ bankAccountId: string;
8
+ updatedAt?: Date;
9
+ createdAt?: Date;
10
+ bankAccount?: IBankAccount;
11
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,14 @@
1
+ import { IBankAccount } from './bank-account.model';
2
+ export interface IBankAccountTransaction {
3
+ id?: string;
4
+ date: Date;
5
+ amount: number;
6
+ currency: string;
7
+ description: string;
8
+ comment: string | null;
9
+ aggregatorTransactionId: string;
10
+ bankAccountId: string;
11
+ updatedAt?: Date;
12
+ createdAt?: Date;
13
+ bankAccount?: IBankAccount;
14
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,26 @@
1
+ import { CashAccountType } from '../../enum';
2
+ import { IAccountTransaction } from './account-transaction.model';
3
+ import { IBankAccountHistory } from './bank-account-history.model';
4
+ import { IBankConnection } from './bank-connection.model';
5
+ export interface IBankAccount {
6
+ id?: string;
7
+ name: string;
8
+ commonName: string | null;
9
+ ownerName: string | null;
10
+ currency: string;
11
+ iban: string;
12
+ color: string;
13
+ cashAccountType: CashAccountType;
14
+ expectedBalance: number;
15
+ availableBalance: number;
16
+ aggregatorAccountId: string;
17
+ aggregatorCreatedAt: Date;
18
+ bankConnectionId: string;
19
+ lastRefresh: Date | null;
20
+ isMasked: boolean;
21
+ updatedAt?: Date;
22
+ createdAt?: Date;
23
+ bankConnection?: IBankConnection;
24
+ accountTransaction?: IAccountTransaction[];
25
+ bankAccountHistory?: IBankAccountHistory[];
26
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,17 @@
1
+ import { BankConnectionStatus } from '../../enum';
2
+ import { IAggregatorLink } from './aggregator-link.model';
3
+ import { IBankAccount } from './bank-account.model';
4
+ export interface IBankConnection {
5
+ id?: string;
6
+ aggregatorConnectionId: string;
7
+ aggregatorAgreementId: string;
8
+ aggregatorBankId: string;
9
+ aggregatorLinkId: string;
10
+ status: BankConnectionStatus;
11
+ lastRefresh: Date | null;
12
+ confirmedAt: Date | null;
13
+ updatedAt?: Date;
14
+ createdAt?: Date;
15
+ aggregatorLink?: IAggregatorLink;
16
+ bankAccount?: IBankAccount[];
17
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,11 @@
1
+ import { ICategorizationRule } from './categorization-rule.model';
2
+ import { ICategory } from './category.model';
3
+ export interface ICategorizationRuleCategory {
4
+ id?: string;
5
+ categoryId: string;
6
+ categorizationRuleId: string;
7
+ updatedAt?: Date;
8
+ createdAt?: Date;
9
+ category?: ICategory;
10
+ categorizationRule?: ICategorizationRule;
11
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,44 @@
1
+ import { ICategorizationRuleCategory } from './categorization-rule-category.model';
2
+ import { ICategory } from './category.model';
3
+ import { ITransactionCategory } from './transaction-category.model';
4
+ import { IUser } from './user.model';
5
+ export interface ICategorizationRule {
6
+ id?: string;
7
+ name: string;
8
+ description: string | null;
9
+ isActive: boolean;
10
+ rules: CategorizationRules[];
11
+ userId: string;
12
+ updatedAt?: Date;
13
+ createdAt?: Date;
14
+ deletedAt?: Date;
15
+ user?: IUser;
16
+ transactionCategory?: ITransactionCategory[];
17
+ category?: ICategory[];
18
+ categorizationRuleCategory?: ICategorizationRuleCategory[];
19
+ }
20
+ export declare type CategorizationRules = {
21
+ label?: {
22
+ shouldEq?: string;
23
+ shouldContains?: string[];
24
+ shouldNotContains?: string[];
25
+ shouldStartsWith?: string[];
26
+ shouldNotStartsWith?: string[];
27
+ shouldEndsWith?: string[];
28
+ shouldNotEndsWith?: string[];
29
+ };
30
+ amount?: {
31
+ min?: number | null;
32
+ minOrEq?: number | null;
33
+ max?: number | null;
34
+ maxOrEq?: number | null;
35
+ };
36
+ date?: {
37
+ before?: Date | null;
38
+ after?: Date | null;
39
+ dayOfMonth?: number[] | null;
40
+ dayOfWeek?: number[] | null;
41
+ month?: number[] | null;
42
+ year?: number[] | null;
43
+ };
44
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,14 @@
1
+ import { ICategorizationRule } from './categorization-rule.model';
2
+ import { ITransactionCategory } from './transaction-category.model';
3
+ import { IUser } from './user.model';
4
+ export interface ICategory {
5
+ id?: string;
6
+ name: string;
7
+ color: string;
8
+ userId: string;
9
+ updatedAt?: Date;
10
+ createdAt?: Date;
11
+ user?: IUser;
12
+ transactionCategory?: ITransactionCategory[];
13
+ categorizationRule?: ICategorizationRule[];
14
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,108 @@
1
+ import { PeriodConfiguration } from '../../enum';
2
+ import { PanelComponentType } from '../../enum/panel-component-type.enum';
3
+ import { IUser } from './user.model';
4
+ export interface IPanel {
5
+ id?: string;
6
+ name: string;
7
+ composition: PanelComposition;
8
+ userId: string;
9
+ updatedAt?: Date;
10
+ createdAt?: Date;
11
+ user?: IUser;
12
+ }
13
+ export declare type PanelComposition = {
14
+ shouldIncludeHeaderCards: boolean;
15
+ config: PanelComponentConfig;
16
+ elements: {
17
+ id: string;
18
+ title?: string;
19
+ config: PanelComponentConfig;
20
+ components: PanelComponent[];
21
+ layout: {
22
+ width: number;
23
+ };
24
+ }[];
25
+ };
26
+ export declare type PanelComponent = {
27
+ id: string;
28
+ config: PanelComponentConfig;
29
+ title?: string;
30
+ layout: {
31
+ width: number;
32
+ };
33
+ } & (AccountBalancePanelComponent | AccountCashPositionPanelComponent | SumPerCategoryPanelComponent | SumPerCategoryPerMonthPanelComponent | TransactionPerAccountPanelComponent | TransactionPerCategoryPanelComponent | TransactionPerDayPanelComponent | TransactionTablePanelComponent | PeriodReportPanelComponent | MonthlyReportPanelComponent);
34
+ export declare type PanelComponentConfig = {
35
+ period: {
36
+ startDate: Date | null;
37
+ endDate: Date | null;
38
+ shouldSyncWithRemote: boolean;
39
+ periodConfiguration: PeriodConfiguration | null;
40
+ };
41
+ bankAccount: {
42
+ selectedIds: string[] | null;
43
+ shouldSyncWithRemote: boolean;
44
+ };
45
+ currency: {
46
+ singleCurrency: string | null;
47
+ multipleCurrency: string[] | null;
48
+ shouldSyncWithRemote: boolean;
49
+ };
50
+ transaction: {
51
+ shouldIncludeUnCategorized: boolean;
52
+ shouldSyncWithRemote: boolean;
53
+ categories: {
54
+ filterCategories: string[] | null;
55
+ shouldSyncWithRemote: boolean;
56
+ };
57
+ };
58
+ menu: {
59
+ enableSelectSingleCurrency: boolean;
60
+ enableSelectMultipleCurrency: boolean;
61
+ enableSelectDate: boolean;
62
+ enableSelectCategories: boolean;
63
+ enableSelectBankAccountIds: boolean;
64
+ enableSelectUnCategorized: boolean;
65
+ };
66
+ };
67
+ export declare type AccountBalancePanelComponent = {
68
+ type: PanelComponentType.ACCOUNT_BALANCE;
69
+ shouldDisplaySelectCurrency?: boolean;
70
+ shouldDisplaySelectBankAccounts?: boolean;
71
+ };
72
+ export declare type AccountCashPositionPanelComponent = {
73
+ type: PanelComponentType.ACCOUNT_CASH_POSITION;
74
+ shouldDisplayTable?: boolean;
75
+ };
76
+ export declare type SumPerCategoryPanelComponent = {
77
+ type: PanelComponentType.SUM_PER_CATEGORY;
78
+ shouldStack?: boolean;
79
+ shouldDisplayCountTransaction?: boolean;
80
+ };
81
+ export declare type SumPerCategoryPerMonthPanelComponent = {
82
+ type: PanelComponentType.SUM_PER_CATEGORY_PER_MONTH;
83
+ shouldStack?: boolean;
84
+ shouldDisplayTable?: boolean;
85
+ shouldDisplayCountTransaction?: boolean;
86
+ shouldGroupByCategoryByDefault?: boolean;
87
+ shouldDisplaySpeedUpByDefault?: boolean;
88
+ };
89
+ export declare type TransactionPerAccountPanelComponent = {
90
+ type: PanelComponentType.TRANSACTION_PER_ACCOUNT;
91
+ };
92
+ export declare type TransactionPerCategoryPanelComponent = {
93
+ type: PanelComponentType.TRANSACTION_PER_CATEGORY;
94
+ shouldDisplaySumTransaction?: boolean;
95
+ };
96
+ export declare type TransactionPerDayPanelComponent = {
97
+ type: PanelComponentType.TRANSACTION_PER_DAY;
98
+ };
99
+ export declare type TransactionTablePanelComponent = {
100
+ type: PanelComponentType.TRANSACTION_TABLE;
101
+ };
102
+ export declare type PeriodReportPanelComponent = {
103
+ type: PanelComponentType.PERIOD_REPORT;
104
+ shouldDisplaySelectBankAccounts?: boolean;
105
+ };
106
+ export declare type MonthlyReportPanelComponent = {
107
+ type: PanelComponentType.MONTHLY_REPORT;
108
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,14 @@
1
+ import { IAccountTransaction } from './account-transaction.model';
2
+ import { ICategorizationRule } from './categorization-rule.model';
3
+ import { ICategory } from './category.model';
4
+ export interface ITransactionCategory {
5
+ id?: string;
6
+ categoryId: string;
7
+ accountTransactionId: string;
8
+ categorizationRuleId: string | null;
9
+ updatedAt?: Date;
10
+ createdAt?: Date;
11
+ accountTransaction?: IAccountTransaction;
12
+ category?: ICategory;
13
+ categorizationRule?: ICategorizationRule | null;
14
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,13 @@
1
+ import { IAggregatorLink } from './aggregator-link.model';
2
+ import { ICategory } from './category.model';
3
+ import { IPanel } from './panel.model';
4
+ export interface IUser {
5
+ id?: string;
6
+ isAdmin: boolean;
7
+ apiKey: string;
8
+ updatedAt?: Date;
9
+ createdAt?: Date;
10
+ aggregatorLink?: IAggregatorLink[];
11
+ panel?: IPanel[];
12
+ category?: ICategory[];
13
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,15 @@
1
+ import { Code, ErrorType } from '../types';
2
+ declare type ErrorParams = {
3
+ code: Code;
4
+ type: ErrorType;
5
+ message?: string;
6
+ };
7
+ export declare class ServiceException extends Error {
8
+ private readonly code;
9
+ private readonly type;
10
+ getCode(): Code;
11
+ getType(): ErrorType;
12
+ constructor(params: ErrorParams);
13
+ }
14
+ export declare const handleError: (error: Error | ErrorParams, _params?: ErrorParams | undefined) => Error;
15
+ export {};
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.handleError = exports.ServiceException = void 0;
4
+ class ServiceException extends Error {
5
+ constructor(params) {
6
+ super(params.message);
7
+ this.code = params.code;
8
+ this.type = params.type;
9
+ }
10
+ getCode() {
11
+ return this.code;
12
+ }
13
+ getType() {
14
+ return this.type;
15
+ }
16
+ }
17
+ exports.ServiceException = ServiceException;
18
+ const handleError = (error, _params) => {
19
+ if (error instanceof Error) {
20
+ return error;
21
+ }
22
+ return new ServiceException(error);
23
+ };
24
+ exports.handleError = handleError;
@@ -0,0 +1 @@
1
+ export * from './error.utils';
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./error.utils"), exports);
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "@abyss-project/banking",
3
+ "version": "1.0.0",
4
+ "description": "Core package to interact with Abyss-Banking",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "keywords": [],
8
+ "author": "scylla",
9
+ "license": "ISC",
10
+ "bugs": {
11
+ "url": "https://gitlab.com/abyss-group/abyss-banking"
12
+ },
13
+ "homepage": "https://gitlab.com/abyss-group/abyss-banking",
14
+ "dependencies": {
15
+ "@googlemaps/google-maps-services-js": "^3.4.0",
16
+ "axios": "^1.2.2",
17
+ "axios-retry": "^3.5.0",
18
+ "core-js": "^3.37.1",
19
+ "dayjs": "^1.10.8",
20
+ "form-data": "^4.0.0",
21
+ "uuid": "^9.0.0"
22
+ },
23
+ "devDependencies": {
24
+ "@types/express-serve-static-core": "^4.17.31",
25
+ "@types/node": "^17.0.4",
26
+ "@types/uuid": "^9.0.0",
27
+ "@typescript-eslint/eslint-plugin": "^4.27.0",
28
+ "@typescript-eslint/parser": "^4.27.0",
29
+ "eslint": "^7.28.0",
30
+ "eslint-config-prettier": "^8.3.0",
31
+ "eslint-config-standard": "^16.0.3",
32
+ "eslint-plugin-filenames-simple": "^0.7.0",
33
+ "eslint-plugin-import": "^2.23.4",
34
+ "eslint-plugin-node": "^11.1.0",
35
+ "eslint-plugin-prettier": "^3.4.0",
36
+ "eslint-plugin-promise": "^5.1.0",
37
+ "prettier": "2.3.1",
38
+ "sequelize-cli": "^6.2.0",
39
+ "typescript": "^4.1.5"
40
+ },
41
+ "scripts": {
42
+ "lint": "eslint \"{src,apps,libs,test,core}/**/*.ts\" --fix",
43
+ "lint:check": "eslint \"{src,apps,libs,test,core}/**/*.ts\" --max-warnings 0",
44
+ "tsc": "tsc",
45
+ "build": "tsc",
46
+ "prepublish": "tsc"
47
+ }
48
+ }
@@ -0,0 +1,16 @@
1
+ import {
2
+ AbyssBankingCore,
3
+ IActivateUserServiceAbyssAdminBody,
4
+ IActivateUserServiceAbyssAdminResponse,
5
+ } from '..';
6
+
7
+ export const activateUserServiceAbyssAdmin = async (
8
+ body: IActivateUserServiceAbyssAdminBody,
9
+ ): Promise<IActivateUserServiceAbyssAdminResponse> => {
10
+ return (
11
+ await AbyssBankingCore.axios.post<IActivateUserServiceAbyssAdminResponse>(
12
+ `abyss/admin/user/activate-service`,
13
+ body,
14
+ )
15
+ ).data;
16
+ };
@@ -0,0 +1,141 @@
1
+ import {
2
+ AbyssBankingCore,
3
+ IConfirmRequisitionBankingAdminParams,
4
+ IConfirmRequisitionBankingAdminResponse,
5
+ IListInstitutionBankingAdminResponse,
6
+ IListInstitutionBankingAdminQuery,
7
+ IListBankConnectionBankingAdminResponse,
8
+ IListBankBankingAdminResponse,
9
+ IGetBankConnectionBankingAdminResponse,
10
+ IGetBankConnectionBankingAdminParams,
11
+ IPaginateAccountTransactionBankingAdminQuery,
12
+ IPaginateAccountTransactionBankingAdminResponse,
13
+ IGetAccountTransactionBankingAdminParams,
14
+ IGetAccountTransactionBankingAdminResponse,
15
+ IUpdateBankAccountBankingAdminParams,
16
+ IUpdateBankAccountBankingAdminBody,
17
+ IUpdateBankAccountBankingAdminResponse,
18
+ ILoadDemoDataBankingAdminResponse,
19
+ IDeleteDemoDataBankingAdminResponse,
20
+ IListBankConnectionBankingAdminParams,
21
+ ILoadDemoDataBankingAdminParams,
22
+ IDeleteDemoDataBankingAdminParams,
23
+ IUpdateAccountTransactionBankingAdminParams,
24
+ IUpdateAccountTransactionBankingAdminBody,
25
+ } from '..';
26
+
27
+ export const listBankConnectionBankingAdmin = async (
28
+ params: IListBankConnectionBankingAdminParams,
29
+ ): Promise<IListBankConnectionBankingAdminResponse> => {
30
+ return (
31
+ await AbyssBankingCore.axios.get<IListBankConnectionBankingAdminResponse>(
32
+ `banking/admin/connection/${params.userId}/list`,
33
+ )
34
+ ).data;
35
+ };
36
+
37
+ export const getBankConnectionBankingAdmin = async (
38
+ params: IGetBankConnectionBankingAdminParams,
39
+ ): Promise<IGetBankConnectionBankingAdminResponse> => {
40
+ return (
41
+ await AbyssBankingCore.axios.get<IGetBankConnectionBankingAdminResponse>(
42
+ `banking/admin/connection/${params.bankConnectionId}`,
43
+ )
44
+ ).data;
45
+ };
46
+
47
+ export const listBankBankingAdmin = async (): Promise<IListBankBankingAdminResponse> => {
48
+ return (
49
+ await AbyssBankingCore.axios.get<IListBankBankingAdminResponse>(`banking/admin/bank/list`)
50
+ ).data;
51
+ };
52
+
53
+ export const listInstitutionBankingAdmin = async (
54
+ query: IListInstitutionBankingAdminQuery,
55
+ ): Promise<IListInstitutionBankingAdminResponse> => {
56
+ return (
57
+ await AbyssBankingCore.axios.get<IListInstitutionBankingAdminResponse>(
58
+ `banking/admin/institution/list`,
59
+ { params: query },
60
+ )
61
+ ).data;
62
+ };
63
+
64
+ export const confirmRequisitionBankingAdmin = async (
65
+ params: IConfirmRequisitionBankingAdminParams,
66
+ ): Promise<IConfirmRequisitionBankingAdminResponse> => {
67
+ return (
68
+ await AbyssBankingCore.axios.post<IConfirmRequisitionBankingAdminResponse>(
69
+ `banking/admin/requisition/confirm/${params.userId}/${params.reference}`,
70
+ )
71
+ ).data;
72
+ };
73
+
74
+ export const paginateAccountTransactionBankingAdmin = async (
75
+ query: IPaginateAccountTransactionBankingAdminQuery,
76
+ ): Promise<IPaginateAccountTransactionBankingAdminResponse> => {
77
+ return (
78
+ await AbyssBankingCore.axios.get<IPaginateAccountTransactionBankingAdminResponse>(
79
+ `banking/admin/transaction/paginate`,
80
+ { params: query },
81
+ )
82
+ ).data;
83
+ };
84
+
85
+ export const getAccountTransactionBankingAdmin = async (
86
+ params: IGetAccountTransactionBankingAdminParams,
87
+ ): Promise<IGetAccountTransactionBankingAdminResponse> => {
88
+ return (
89
+ await AbyssBankingCore.axios.get<IGetAccountTransactionBankingAdminResponse>(
90
+ `banking/admin/transaction/${params.accountTransactionId}`,
91
+ )
92
+ ).data;
93
+ };
94
+
95
+ export const updateAccountTransactionBankingAdmin = async (
96
+ params: IUpdateAccountTransactionBankingAdminParams,
97
+ body: IUpdateAccountTransactionBankingAdminBody,
98
+ ): Promise<IGetAccountTransactionBankingAdminResponse> => {
99
+ return (
100
+ await AbyssBankingCore.axios.put<IGetAccountTransactionBankingAdminResponse>(
101
+ `banking/admin/transaction/${params.accountTransactionId}`,
102
+ body,
103
+ )
104
+ ).data;
105
+ };
106
+
107
+ export const updateBankAccountBankingAdmin = async (
108
+ params: IUpdateBankAccountBankingAdminParams,
109
+ body: IUpdateBankAccountBankingAdminBody,
110
+ ): Promise<IUpdateBankAccountBankingAdminResponse> => {
111
+ return (
112
+ await AbyssBankingCore.axios.put<IUpdateBankAccountBankingAdminResponse>(
113
+ `banking/admin/account/${params.bankAccountId}`,
114
+ body,
115
+ )
116
+ ).data;
117
+ };
118
+
119
+ export const loadDemoDataBankingAdmin = async (
120
+ params: ILoadDemoDataBankingAdminParams,
121
+ ): Promise<ILoadDemoDataBankingAdminResponse> => {
122
+ return (
123
+ await AbyssBankingCore.axios.post<ILoadDemoDataBankingAdminResponse>(
124
+ `banking/admin/demo-data/${params.userId}`,
125
+ )
126
+ ).data;
127
+ };
128
+
129
+ export const deleteDemoDataBankingAdmin = async (
130
+ params: IDeleteDemoDataBankingAdminParams,
131
+ ): Promise<IDeleteDemoDataBankingAdminResponse> => {
132
+ return (
133
+ await AbyssBankingCore.axios.delete<IDeleteDemoDataBankingAdminResponse>(
134
+ `banking/admin/demo-data/${params.userId}`,
135
+ )
136
+ ).data;
137
+ };
138
+
139
+ export const fetchBankingDataBankingAdmin = async (): Promise<string> => {
140
+ return (await AbyssBankingCore.axios.post<string>(`banking/admin/fetch-banking-data`)).data;
141
+ };