@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,119 @@
1
+ import {
2
+ BasePaginate,
3
+ IAccountTransaction,
4
+ IAggregatorBank,
5
+ IAggregatorLink,
6
+ IBankAccount,
7
+ IBankAccountHistory,
8
+ IBankConnection,
9
+ IResponse,
10
+ } from '../..';
11
+
12
+ export interface IListConnectionBankingData {
13
+ aggregatorLink: IAggregatorLink[];
14
+ }
15
+ export type IListConnectionBankingResponse = IResponse<IListConnectionBankingData>;
16
+
17
+ export interface IGetBankConnectionBankingData {
18
+ bankConnection: IBankConnection;
19
+ }
20
+ export type IGetBankConnectionBankingResponse = IResponse<IGetBankConnectionBankingData>;
21
+
22
+ export interface IListInstitutionBankingData {
23
+ institution: {
24
+ id: string;
25
+ name: string;
26
+ countries: string[];
27
+ logoUrl: string;
28
+ bic: string;
29
+ transactionTotalDays: string;
30
+ }[];
31
+ }
32
+ export type IListInstitutionBankingResponse = IResponse<IListInstitutionBankingData>;
33
+
34
+ export interface IListBankBankingData {
35
+ aggregatorBank: IAggregatorBank[];
36
+ }
37
+ export type IListBankBankingResponse = IResponse<IListBankBankingData>;
38
+
39
+ export interface ICreateRequisitionBankingData {
40
+ connectionLink: string;
41
+ }
42
+ export type ICreateRequisitionBankingResponse = IResponse<ICreateRequisitionBankingData>;
43
+
44
+ export interface IRenewRequisitionBankingData {
45
+ connectionLink: string;
46
+ }
47
+ export type IRenewRequisitionBankingResponse = IResponse<IRenewRequisitionBankingData>;
48
+
49
+ export interface IConfirmRequisitionBankingData {
50
+ bankConnection: IBankConnection;
51
+ }
52
+ export type IConfirmRequisitionBankingResponse = IResponse<IConfirmRequisitionBankingData>;
53
+
54
+ export type IPaginateAccountTransactionBankingResponse = IResponse<
55
+ BasePaginate<IAccountTransaction>
56
+ >;
57
+
58
+ export interface IGetAccountTransactionBankingData {
59
+ accountTransaction: IAccountTransaction;
60
+ }
61
+ export type IGetAccountTransactionBankingResponse = IResponse<IGetAccountTransactionBankingData>;
62
+
63
+ export interface IUpdateAccountTransactionBankingData {
64
+ accountTransaction: IAccountTransaction;
65
+ }
66
+ export type IUpdateAccountTransactionBankingResponse =
67
+ IResponse<IUpdateAccountTransactionBankingData>;
68
+
69
+ export interface IUpdateBankAccountBankingData {
70
+ bankAccount: IBankAccount;
71
+ }
72
+ export type IUpdateBankAccountBankingResponse = IResponse<IUpdateBankAccountBankingData>;
73
+
74
+ export interface ILoadDemoDataBankingData {
75
+ aggregatorLink: IAggregatorLink;
76
+ }
77
+ export type ILoadDemoDataBankingResponse = IResponse<ILoadDemoDataBankingData>;
78
+
79
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
80
+ export interface IDeleteDemoDataBankingData {}
81
+ export type IDeleteDemoDataBankingResponse = IResponse<IDeleteDemoDataBankingData>;
82
+
83
+ export interface IGetTransactionPerCategoryBankingData {
84
+ analytics: {
85
+ bankAccountId: string;
86
+ transactionCount: number;
87
+ }[];
88
+ }
89
+ export type IGetTransactionPerCategoryBankingResponse =
90
+ IResponse<IGetTransactionPerCategoryBankingData>;
91
+
92
+ export interface IGetSumTransactionPerBankAccountPerCategoryBankingData {
93
+ analytics: {
94
+ bankAccountId: string;
95
+ categories: {
96
+ categoryId: string | null;
97
+ transactionCount: number;
98
+ transactionSum: number;
99
+ transactions: {
100
+ id: string;
101
+ amount: number;
102
+ date: Date;
103
+ description: string;
104
+ comment: string | null;
105
+ }[];
106
+ }[];
107
+ }[];
108
+ }
109
+ export type IGetSumTransactionPerBankAccountPerCategoryBankingResponse =
110
+ IResponse<IGetSumTransactionPerBankAccountPerCategoryBankingData>;
111
+
112
+ export type IPaginateBankAccountHistoryBankingResponse = IResponse<
113
+ BasePaginate<IBankAccountHistory>
114
+ >;
115
+
116
+ export interface IListBankAccountHistoryBankingData {
117
+ bankAccountHistory: IBankAccountHistory[];
118
+ }
119
+ export type IListBankAccountHistoryBankingResponse = IResponse<IListBankAccountHistoryBankingData>;
@@ -0,0 +1,28 @@
1
+ import { ICategorizationRule } from '../../models/categorization-rule.model';
2
+ import { BasePaginate } from '../type-message/base-paginate';
3
+ import { IResponse } from '../type-message/response';
4
+
5
+ export interface IGetCategorizationRuleAdminData {
6
+ categorizationRule: ICategorizationRule;
7
+ }
8
+ export type IGetCategorizationRuleAdminResponse = IResponse<IGetCategorizationRuleAdminData>;
9
+
10
+ export type IPaginateCategorizationRuleAdminResponse = IResponse<BasePaginate<ICategorizationRule>>;
11
+
12
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
13
+ export interface IDeleteCategorizationRuleAdminData {}
14
+ export type IDeleteCategorizationRuleAdminResponse = IResponse<IDeleteCategorizationRuleAdminData>;
15
+
16
+ export interface ICreateCategorizationRuleAdminData {
17
+ categorizationRule: ICategorizationRule;
18
+ }
19
+ export type ICreateCategorizationRuleAdminResponse = IResponse<ICreateCategorizationRuleAdminData>;
20
+
21
+ export interface IUpdateCategorizationRuleAdminData {
22
+ categorizationRule: ICategorizationRule;
23
+ }
24
+ export type IUpdateCategorizationRuleAdminResponse = IResponse<IUpdateCategorizationRuleAdminData>;
25
+
26
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
27
+ export interface IApplyCategorizationRuleAdminData {}
28
+ export type IApplyCategorizationRuleAdminResponse = IResponse<IApplyCategorizationRuleAdminData>;
@@ -0,0 +1,28 @@
1
+ import { ICategorizationRule } from '../../models/categorization-rule.model';
2
+ import { BasePaginate } from '../type-message/base-paginate';
3
+ import { IResponse } from '../type-message/response';
4
+
5
+ export interface IGetCategorizationRuleData {
6
+ categorizationRule: ICategorizationRule;
7
+ }
8
+ export type IGetCategorizationRuleResponse = IResponse<IGetCategorizationRuleData>;
9
+
10
+ export type IPaginateCategorizationRuleResponse = IResponse<BasePaginate<ICategorizationRule>>;
11
+
12
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
13
+ export interface IDeleteCategorizationRuleData {}
14
+ export type IDeleteCategorizationRuleResponse = IResponse<IDeleteCategorizationRuleData>;
15
+
16
+ export interface ICreateCategorizationRuleData {
17
+ categorizationRule: ICategorizationRule;
18
+ }
19
+ export type ICreateCategorizationRuleResponse = IResponse<ICreateCategorizationRuleData>;
20
+
21
+ export interface IUpdateCategorizationRuleData {
22
+ categorizationRule: ICategorizationRule;
23
+ }
24
+ export type IUpdateCategorizationRuleResponse = IResponse<IUpdateCategorizationRuleData>;
25
+
26
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
27
+ export interface IApplyCategorizationRuleData {}
28
+ export type IApplyCategorizationRuleResponse = IResponse<IApplyCategorizationRuleData>;
@@ -0,0 +1,24 @@
1
+ import { ICategory } from '../../models/category.model';
2
+ import { BasePaginate } from '../type-message/base-paginate';
3
+ import { IResponse } from '../type-message/response';
4
+
5
+ export interface IGetCategoryAdminData {
6
+ category: ICategory;
7
+ }
8
+ export type IGetCategoryAdminResponse = IResponse<IGetCategoryAdminData>;
9
+
10
+ export type IPaginateCategoryAdminResponse = IResponse<BasePaginate<ICategory>>;
11
+
12
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
13
+ export interface IDeleteCategoryAdminData {}
14
+ export type IDeleteCategoryAdminResponse = IResponse<IDeleteCategoryAdminData>;
15
+
16
+ export interface ICreateCategoryAdminData {
17
+ category: ICategory;
18
+ }
19
+ export type ICreateCategoryAdminResponse = IResponse<ICreateCategoryAdminData>;
20
+
21
+ export interface IUpdateCategoryAdminData {
22
+ category: ICategory;
23
+ }
24
+ export type IUpdateCategoryAdminResponse = IResponse<IUpdateCategoryAdminData>;
@@ -0,0 +1,39 @@
1
+ import { ICategory } from '../../models/category.model';
2
+ import { ITransactionCategory } from '../../models/transaction-category.model';
3
+ import { IResponse } from '../type-message/response';
4
+
5
+ export interface IListCategoryData {
6
+ category: ICategory[];
7
+ }
8
+ export type IListCategoryResponse = IResponse<IListCategoryData>;
9
+
10
+ export interface IListAnalyticsCategoryData {
11
+ categories: {
12
+ transactionCount: number;
13
+ category: ICategory;
14
+ }[];
15
+ }
16
+ export type IListAnalyticsCategoryResponse = IResponse<IListAnalyticsCategoryData>;
17
+
18
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
19
+ export interface IRemoveCategoryData {}
20
+ export type IRemoveCategoryResponse = IResponse<IRemoveCategoryData>;
21
+
22
+ export interface IAddCategoryData {
23
+ transactionCategory: ITransactionCategory;
24
+ }
25
+ export type IAddCategoryResponse = IResponse<IAddCategoryData>;
26
+
27
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
28
+ export interface IDeleteCategoryData {}
29
+ export type IDeleteCategoryResponse = IResponse<IDeleteCategoryData>;
30
+
31
+ export interface ICreateCategoryData {
32
+ category: ICategory;
33
+ }
34
+ export type ICreateCategoryResponse = IResponse<ICreateCategoryData>;
35
+
36
+ export interface IUpdateCategoryData {
37
+ category: ICategory;
38
+ }
39
+ export type IUpdateCategoryResponse = IResponse<IUpdateCategoryData>;
@@ -0,0 +1,8 @@
1
+ import { IResponse } from '..';
2
+
3
+ export interface IUpMonitorData {
4
+ upTime: number;
5
+ processId: string;
6
+ requestId: string;
7
+ }
8
+ export type IUpMonitorResponse = IResponse<IUpMonitorData>;
@@ -0,0 +1,24 @@
1
+ import { IPanel } from '../../models/panel.model';
2
+ import { BasePaginate } from '../type-message/base-paginate';
3
+ import { IResponse } from '../type-message/response';
4
+
5
+ export interface IGetPanelAdminData {
6
+ panel: IPanel;
7
+ }
8
+ export type IGetPanelAdminResponse = IResponse<IGetPanelAdminData>;
9
+
10
+ export type IPaginatePanelAdminResponse = IResponse<BasePaginate<IPanel>>;
11
+
12
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
13
+ export interface IDeletePanelAdminData {}
14
+ export type IDeletePanelAdminResponse = IResponse<IDeletePanelAdminData>;
15
+
16
+ export interface ICreatePanelAdminData {
17
+ panel: IPanel;
18
+ }
19
+ export type ICreatePanelAdminResponse = IResponse<ICreatePanelAdminData>;
20
+
21
+ export interface IUpdatePanelAdminData {
22
+ panel: IPanel;
23
+ }
24
+ export type IUpdatePanelAdminResponse = IResponse<IUpdatePanelAdminData>;
@@ -0,0 +1,24 @@
1
+ import { IPanel } from '../../models/panel.model';
2
+ import { BasePaginate } from '../type-message/base-paginate';
3
+ import { IResponse } from '../type-message/response';
4
+
5
+ export interface IGetPanelData {
6
+ panel: IPanel;
7
+ }
8
+ export type IGetPanelResponse = IResponse<IGetPanelData>;
9
+
10
+ export type IPaginatePanelResponse = IResponse<BasePaginate<IPanel>>;
11
+
12
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
13
+ export interface IDeletePanelData {}
14
+ export type IDeletePanelResponse = IResponse<IDeletePanelData>;
15
+
16
+ export interface ICreatePanelData {
17
+ panel: IPanel;
18
+ }
19
+ export type ICreatePanelResponse = IResponse<ICreatePanelData>;
20
+
21
+ export interface IUpdatePanelData {
22
+ panel: IPanel;
23
+ }
24
+ export type IUpdatePanelResponse = IResponse<IUpdatePanelData>;
@@ -0,0 +1,4 @@
1
+ import { IResponse } from '../type-message/response';
2
+
3
+ export type ICheckIntegrityStorageAdminData = Record<string, never>;
4
+ export type ICheckIntegrityStorageAdminResponse = IResponse<ICheckIntegrityStorageAdminData>;
@@ -0,0 +1,18 @@
1
+ import { BasePaginate, IResponse, IUser } from '../..';
2
+
3
+ export interface IGetUserAdminData {
4
+ user: IUser;
5
+ }
6
+ export type IGetUserAdminResponse = IResponse<IGetUserAdminData>;
7
+
8
+ export type IPaginateUserAdminResponse = IResponse<BasePaginate<IUser>>;
9
+
10
+ export interface IUpdateUserAdminData {
11
+ user: IUser;
12
+ }
13
+ export type IUpdateUserAdminResponse = IResponse<IUpdateUserAdminData>;
14
+
15
+ export interface IResetApiKeyUserAdminData {
16
+ user: IUser;
17
+ }
18
+ export type IResetApiKeyUserAdminResponse = IResponse<IResetApiKeyUserAdminData>;
@@ -0,0 +1,16 @@
1
+ import { IResponse, IUser } from '../..';
2
+
3
+ export interface IMeUserData {
4
+ user: IUser;
5
+ }
6
+ export type IMeUserResponse = IResponse<IMeUserData>;
7
+
8
+ export interface IResetApiKeyUserData {
9
+ user: IUser;
10
+ }
11
+ export type IResetApiKeyUserResponse = IResponse<IResetApiKeyUserData>;
12
+
13
+ export interface IUpdateUserData {
14
+ user: IUser;
15
+ }
16
+ export type IUpdateUserResponse = IResponse<IUpdateUserData>;
@@ -0,0 +1,9 @@
1
+ import { Code, ErrorType } from '../../../enum';
2
+
3
+ export interface IApiError {
4
+ type: ErrorType;
5
+ code: Code;
6
+ message: string;
7
+ params?: string;
8
+ field?: string;
9
+ }
@@ -0,0 +1,4 @@
1
+ export interface BaseOrder {
2
+ orderBy?: string;
3
+ descending?: boolean;
4
+ }
@@ -0,0 +1,11 @@
1
+ export interface BasePaginate<T> {
2
+ maxPages: number;
3
+ currentPage: number;
4
+ totalItems: number;
5
+ data: T[];
6
+ }
7
+
8
+ export interface QueryPaginate {
9
+ page?: number;
10
+ limit?: number;
11
+ }
@@ -0,0 +1,6 @@
1
+ import { IApiError } from './api-error';
2
+
3
+ export interface IResponse<T> {
4
+ data: T;
5
+ error?: IApiError | Error;
6
+ }
@@ -0,0 +1,15 @@
1
+ export * from './models/user.model';
2
+ export * from './models/aggregator-link.model';
3
+ export * from './models/bank-connection.model';
4
+ export * from './models/bank-account.model';
5
+ export * from './models/bank-account-history.model';
6
+ export * from './models/account-transaction.model';
7
+ export * from './models/aggregator-bank.model';
8
+ export * from './models/category.model';
9
+ export * from './models/transaction-category.model';
10
+ export * from './models/categorization-rule.model';
11
+ export * from './models/categorization-rule-category.model';
12
+ export * from './models/panel.model';
13
+
14
+ // API Request
15
+ export * from './api';
@@ -0,0 +1,53 @@
1
+ import { IBankAccount } from './bank-account.model';
2
+ import { ITransactionCategory } from './transaction-category.model';
3
+
4
+ export type AccountTransactionMetadata = {
5
+ debtorAgent?: string;
6
+ debtorName?: string;
7
+ debtorAccount?: unknown;
8
+
9
+ additionalDataStructured?: unknown;
10
+ additionalInformation?: string;
11
+ additionalInformationStructured?: string;
12
+ bankTransactionCode?: string;
13
+ proprietaryBankTransactionCode?: string;
14
+ currencyExchange?: unknown;
15
+ ultimateCreditor?: string;
16
+ ultimateDebtor?: string;
17
+
18
+ // Note(Mehdi): Already existing in model but possibly not visible
19
+ internalTransactionId?: string;
20
+ transactionId?: string;
21
+ bookingDate?: string;
22
+ bookingDateTime?: string;
23
+ valueDate?: string;
24
+ valueDateTime?: string;
25
+ remittanceInformationUnstructured?: string;
26
+ remittanceInformationUnstructuredArray?: string[];
27
+ remittanceInformationStructured?: string;
28
+ remittanceInformationStructuredArray?: string[];
29
+ };
30
+
31
+ export interface IAccountTransaction {
32
+ id?: string;
33
+ date: Date;
34
+ amount: number;
35
+ currency: string;
36
+ description: string;
37
+ comment: string | null;
38
+ aggregatorTransactionId: string;
39
+ bankAccountId: string;
40
+ mandateId: string | null;
41
+ merchantCategoryCode: string | null;
42
+ entryReference: string | null;
43
+ endToEndId: string | null;
44
+ purposeCode: string | null;
45
+ checkId: string | null;
46
+ metadata: AccountTransactionMetadata;
47
+ updatedAt?: Date;
48
+ createdAt?: Date;
49
+
50
+ // Associations
51
+ bankAccount?: IBankAccount;
52
+ transactionCategory?: ITransactionCategory[];
53
+ }
@@ -0,0 +1,15 @@
1
+ import { AggregatorType } from '../../enum';
2
+
3
+ export interface IAggregatorBank {
4
+ id?: string;
5
+ aggregatorType: AggregatorType;
6
+ aggregatorBankId: string;
7
+ logoUrl: string;
8
+ name: string;
9
+ bic: string;
10
+ countries: string[];
11
+ updatedAt?: Date;
12
+ createdAt?: Date;
13
+
14
+ // Associations
15
+ }
@@ -0,0 +1,15 @@
1
+ import { AggregatorType } from '../../enum';
2
+ import { IBankConnection } from './bank-connection.model';
3
+ import { IUser } from './user.model';
4
+
5
+ export interface IAggregatorLink {
6
+ id?: string;
7
+ type: AggregatorType;
8
+ userId: string;
9
+ updatedAt?: Date;
10
+ createdAt?: Date;
11
+
12
+ // Associations
13
+ user?: IUser;
14
+ bankConnection?: IBankConnection[];
15
+ }
@@ -0,0 +1,14 @@
1
+ import { IBankAccount } from './bank-account.model';
2
+
3
+ export interface IBankAccountHistory {
4
+ id?: string;
5
+ expectedBalance: number;
6
+ availableBalance: number;
7
+ date: Date;
8
+ bankAccountId: string;
9
+ updatedAt?: Date;
10
+ createdAt?: Date;
11
+
12
+ // Associations
13
+ bankAccount?: IBankAccount;
14
+ }
@@ -0,0 +1,29 @@
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
+
6
+ export interface IBankAccount {
7
+ id?: string;
8
+ name: string;
9
+ commonName: string | null;
10
+ ownerName: string | null;
11
+ currency: string;
12
+ iban: string;
13
+ color: string;
14
+ cashAccountType: CashAccountType;
15
+ expectedBalance: number;
16
+ availableBalance: number;
17
+ aggregatorAccountId: string;
18
+ aggregatorCreatedAt: Date;
19
+ bankConnectionId: string;
20
+ lastRefresh: Date | null;
21
+ isMasked: boolean;
22
+ updatedAt?: Date;
23
+ createdAt?: Date;
24
+
25
+ // Associations
26
+ bankConnection?: IBankConnection;
27
+ accountTransaction?: IAccountTransaction[];
28
+ bankAccountHistory?: IBankAccountHistory[];
29
+ }
@@ -0,0 +1,20 @@
1
+ import { BankConnectionStatus } from '../../enum';
2
+ import { IAggregatorLink } from './aggregator-link.model';
3
+ import { IBankAccount } from './bank-account.model';
4
+
5
+ export interface IBankConnection {
6
+ id?: string;
7
+ aggregatorConnectionId: string;
8
+ aggregatorAgreementId: string;
9
+ aggregatorBankId: string; // Note(Mehdi): InstitutionId
10
+ aggregatorLinkId: string;
11
+ status: BankConnectionStatus;
12
+ lastRefresh: Date | null;
13
+ confirmedAt: Date | null;
14
+ updatedAt?: Date;
15
+ createdAt?: Date;
16
+
17
+ // Associations
18
+ aggregatorLink?: IAggregatorLink;
19
+ bankAccount?: IBankAccount[];
20
+ }
@@ -0,0 +1,14 @@
1
+ import { ICategorizationRule } from './categorization-rule.model';
2
+ import { ICategory } from './category.model';
3
+
4
+ export interface ICategorizationRuleCategory {
5
+ id?: string;
6
+ categoryId: string;
7
+ categorizationRuleId: string;
8
+ updatedAt?: Date;
9
+ createdAt?: Date;
10
+
11
+ // Associations
12
+ category?: ICategory;
13
+ categorizationRule?: ICategorizationRule;
14
+ }
@@ -0,0 +1,48 @@
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
+
6
+ export interface ICategorizationRule {
7
+ id?: string;
8
+ name: string;
9
+ description: string | null;
10
+ isActive: boolean;
11
+ rules: CategorizationRules[]; // Note(Mehdi): Category is assigned if at least one of rules is true
12
+ userId: string;
13
+ updatedAt?: Date;
14
+ createdAt?: Date;
15
+ deletedAt?: Date;
16
+
17
+ // Associations
18
+ user?: IUser;
19
+ transactionCategory?: ITransactionCategory[];
20
+ category?: ICategory[];
21
+ categorizationRuleCategory?: ICategorizationRuleCategory[];
22
+ }
23
+
24
+ export type CategorizationRules = {
25
+ label?: {
26
+ shouldEq?: string;
27
+ shouldContains?: string[];
28
+ shouldNotContains?: string[];
29
+ shouldStartsWith?: string[];
30
+ shouldNotStartsWith?: string[];
31
+ shouldEndsWith?: string[];
32
+ shouldNotEndsWith?: string[];
33
+ };
34
+ amount?: {
35
+ min?: number | null;
36
+ minOrEq?: number | null;
37
+ max?: number | null;
38
+ maxOrEq?: number | null;
39
+ };
40
+ date?: {
41
+ before?: Date | null;
42
+ after?: Date | null;
43
+ dayOfMonth?: number[] | null; // Note(Mehdi): One of array
44
+ dayOfWeek?: number[] | null; // Note(Mehdi): One of array
45
+ month?: number[] | null; // Note(Mehdi): One of array
46
+ year?: number[] | null; // Note(Mehdi): One of array
47
+ };
48
+ };
@@ -0,0 +1,17 @@
1
+ import { ICategorizationRule } from './categorization-rule.model';
2
+ import { ITransactionCategory } from './transaction-category.model';
3
+ import { IUser } from './user.model';
4
+
5
+ export interface ICategory {
6
+ id?: string;
7
+ name: string;
8
+ color: string;
9
+ userId: string;
10
+ updatedAt?: Date;
11
+ createdAt?: Date;
12
+
13
+ // Associations
14
+ user?: IUser;
15
+ transactionCategory?: ITransactionCategory[];
16
+ categorizationRule?: ICategorizationRule[];
17
+ }