@abyss-project/banking 1.0.0 → 1.0.1

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 (67) hide show
  1. package/package.json +1 -1
  2. package/src/api/abyss.admin.api.ts +0 -16
  3. package/src/api/banking.admin.api.ts +0 -141
  4. package/src/api/banking.api.ts +0 -197
  5. package/src/api/categorization-rule.admin.api.ts +0 -80
  6. package/src/api/categorization-rule.api.ts +0 -80
  7. package/src/api/category.admin.api.ts +0 -63
  8. package/src/api/category.api.ts +0 -74
  9. package/src/api/index.ts +0 -12
  10. package/src/api/monitor.api.ts +0 -6
  11. package/src/api/panel.admin.api.ts +0 -57
  12. package/src/api/panel.api.ts +0 -45
  13. package/src/api/user.admin.api.ts +0 -44
  14. package/src/api/user.api.ts +0 -20
  15. package/src/index.ts +0 -72
  16. package/src/types/enum/aggregator-type.enum.ts +0 -4
  17. package/src/types/enum/api-error.enum.ts +0 -18
  18. package/src/types/enum/bank-connection-status.enum.ts +0 -6
  19. package/src/types/enum/cash-account-type.enum.ts +0 -54
  20. package/src/types/enum/index.ts +0 -7
  21. package/src/types/enum/panel-component-type.enum.ts +0 -12
  22. package/src/types/enum/period-configuration.enum.ts +0 -7
  23. package/src/types/index.ts +0 -2
  24. package/src/types/interface/api/index.ts +0 -29
  25. package/src/types/interface/api/requests/abyss.admin.request.ts +0 -3
  26. package/src/types/interface/api/requests/banking.admin.request.ts +0 -57
  27. package/src/types/interface/api/requests/banking.request.ts +0 -89
  28. package/src/types/interface/api/requests/categorization-rule.admin.request.ts +0 -40
  29. package/src/types/interface/api/requests/categorization-rule.request.ts +0 -38
  30. package/src/types/interface/api/requests/category.admin.request.ts +0 -27
  31. package/src/types/interface/api/requests/category.request.ts +0 -31
  32. package/src/types/interface/api/requests/panel.admin.request.ts +0 -28
  33. package/src/types/interface/api/requests/panel.request.ts +0 -27
  34. package/src/types/interface/api/requests/user.admin.request.ts +0 -20
  35. package/src/types/interface/api/requests/user.request.ts +0 -2
  36. package/src/types/interface/api/responses/abyss.admin.response.ts +0 -7
  37. package/src/types/interface/api/responses/banking.admin.response.ts +0 -73
  38. package/src/types/interface/api/responses/banking.response.ts +0 -119
  39. package/src/types/interface/api/responses/categorization-rule.admin.response.ts +0 -28
  40. package/src/types/interface/api/responses/categorization-rule.response.ts +0 -28
  41. package/src/types/interface/api/responses/category.admin.response.ts +0 -24
  42. package/src/types/interface/api/responses/category.response.ts +0 -39
  43. package/src/types/interface/api/responses/monitor.response.ts +0 -8
  44. package/src/types/interface/api/responses/panel.admin.response.ts +0 -24
  45. package/src/types/interface/api/responses/panel.response.ts +0 -24
  46. package/src/types/interface/api/responses/storage.admin.response.ts +0 -4
  47. package/src/types/interface/api/responses/user.admin.response.ts +0 -18
  48. package/src/types/interface/api/responses/user.response.ts +0 -16
  49. package/src/types/interface/api/type-message/api-error.ts +0 -9
  50. package/src/types/interface/api/type-message/base-order.ts +0 -4
  51. package/src/types/interface/api/type-message/base-paginate.ts +0 -11
  52. package/src/types/interface/api/type-message/response.ts +0 -6
  53. package/src/types/interface/index.ts +0 -15
  54. package/src/types/interface/models/account-transaction.model.ts +0 -53
  55. package/src/types/interface/models/aggregator-bank.model.ts +0 -15
  56. package/src/types/interface/models/aggregator-link.model.ts +0 -15
  57. package/src/types/interface/models/bank-account-history.model.ts +0 -14
  58. package/src/types/interface/models/bank-account.model.ts +0 -29
  59. package/src/types/interface/models/bank-connection.model.ts +0 -20
  60. package/src/types/interface/models/categorization-rule-category.model.ts +0 -14
  61. package/src/types/interface/models/categorization-rule.model.ts +0 -48
  62. package/src/types/interface/models/category.model.ts +0 -17
  63. package/src/types/interface/models/panel.model.ts +0 -135
  64. package/src/types/interface/models/transaction-category.model.ts +0 -17
  65. package/src/types/interface/models/user.model.ts +0 -16
  66. package/src/utils/error.utils.ts +0 -30
  67. package/src/utils/index.ts +0 -1
@@ -1,29 +0,0 @@
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
- }
@@ -1,20 +0,0 @@
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
- }
@@ -1,14 +0,0 @@
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
- }
@@ -1,48 +0,0 @@
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
- };
@@ -1,17 +0,0 @@
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
- }
@@ -1,135 +0,0 @@
1
- import { PeriodConfiguration } from '../../enum';
2
- import { PanelComponentType } from '../../enum/panel-component-type.enum';
3
- import { IUser } from './user.model';
4
-
5
- export interface IPanel {
6
- id?: string;
7
- name: string;
8
- composition: PanelComposition;
9
- userId: string;
10
- updatedAt?: Date;
11
- createdAt?: Date;
12
-
13
- // Associations
14
- user?: IUser;
15
- }
16
-
17
- export type PanelComposition = {
18
- shouldIncludeHeaderCards: boolean;
19
- config: PanelComponentConfig;
20
- elements: {
21
- id: string;
22
- title?: string;
23
- config: PanelComponentConfig;
24
- components: PanelComponent[];
25
- layout: {
26
- width: number;
27
- };
28
- }[];
29
- };
30
-
31
- export type PanelComponent = {
32
- id: string;
33
- config: PanelComponentConfig;
34
- title?: string;
35
- layout: {
36
- width: number;
37
- };
38
- } & (
39
- | AccountBalancePanelComponent
40
- | AccountCashPositionPanelComponent
41
- | SumPerCategoryPanelComponent
42
- | SumPerCategoryPerMonthPanelComponent
43
- | TransactionPerAccountPanelComponent
44
- | TransactionPerCategoryPanelComponent
45
- | TransactionPerDayPanelComponent
46
- | TransactionTablePanelComponent
47
- | PeriodReportPanelComponent
48
- | MonthlyReportPanelComponent
49
- );
50
-
51
- export type PanelComponentConfig = {
52
- period: {
53
- startDate: Date | null;
54
- endDate: Date | null;
55
- shouldSyncWithRemote: boolean;
56
- periodConfiguration: PeriodConfiguration | null;
57
- };
58
- bankAccount: {
59
- selectedIds: string[] | null;
60
- shouldSyncWithRemote: boolean;
61
- };
62
- currency: {
63
- singleCurrency: string | null;
64
- multipleCurrency: string[] | null;
65
- shouldSyncWithRemote: boolean;
66
- };
67
- transaction: {
68
- shouldIncludeUnCategorized: boolean;
69
- shouldSyncWithRemote: boolean;
70
- categories: {
71
- filterCategories: string[] | null;
72
- shouldSyncWithRemote: boolean;
73
- };
74
- };
75
- menu: {
76
- enableSelectSingleCurrency: boolean;
77
- enableSelectMultipleCurrency: boolean;
78
- enableSelectDate: boolean;
79
- enableSelectCategories: boolean;
80
- enableSelectBankAccountIds: boolean;
81
- enableSelectUnCategorized: boolean;
82
- };
83
- };
84
-
85
- export type AccountBalancePanelComponent = {
86
- type: PanelComponentType.ACCOUNT_BALANCE;
87
- shouldDisplaySelectCurrency?: boolean;
88
- shouldDisplaySelectBankAccounts?: boolean;
89
- };
90
-
91
- export type AccountCashPositionPanelComponent = {
92
- type: PanelComponentType.ACCOUNT_CASH_POSITION;
93
- shouldDisplayTable?: boolean;
94
- };
95
-
96
- export type SumPerCategoryPanelComponent = {
97
- type: PanelComponentType.SUM_PER_CATEGORY;
98
- shouldStack?: boolean;
99
- shouldDisplayCountTransaction?: boolean;
100
- };
101
-
102
- export type SumPerCategoryPerMonthPanelComponent = {
103
- type: PanelComponentType.SUM_PER_CATEGORY_PER_MONTH;
104
- shouldStack?: boolean;
105
- shouldDisplayTable?: boolean;
106
- shouldDisplayCountTransaction?: boolean;
107
- shouldGroupByCategoryByDefault?: boolean;
108
- shouldDisplaySpeedUpByDefault?: boolean;
109
- };
110
-
111
- export type TransactionPerAccountPanelComponent = {
112
- type: PanelComponentType.TRANSACTION_PER_ACCOUNT;
113
- };
114
-
115
- export type TransactionPerCategoryPanelComponent = {
116
- type: PanelComponentType.TRANSACTION_PER_CATEGORY;
117
- shouldDisplaySumTransaction?: boolean;
118
- };
119
-
120
- export type TransactionPerDayPanelComponent = {
121
- type: PanelComponentType.TRANSACTION_PER_DAY;
122
- };
123
-
124
- export type TransactionTablePanelComponent = {
125
- type: PanelComponentType.TRANSACTION_TABLE;
126
- };
127
-
128
- export type PeriodReportPanelComponent = {
129
- type: PanelComponentType.PERIOD_REPORT;
130
- shouldDisplaySelectBankAccounts?: boolean;
131
- };
132
-
133
- export type MonthlyReportPanelComponent = {
134
- type: PanelComponentType.MONTHLY_REPORT;
135
- };
@@ -1,17 +0,0 @@
1
- import { IAccountTransaction } from './account-transaction.model';
2
- import { ICategorizationRule } from './categorization-rule.model';
3
- import { ICategory } from './category.model';
4
-
5
- export interface ITransactionCategory {
6
- id?: string;
7
- categoryId: string;
8
- accountTransactionId: string;
9
- categorizationRuleId: string | null;
10
- updatedAt?: Date;
11
- createdAt?: Date;
12
-
13
- // Associations
14
- accountTransaction?: IAccountTransaction;
15
- category?: ICategory;
16
- categorizationRule?: ICategorizationRule | null;
17
- }
@@ -1,16 +0,0 @@
1
- import { IAggregatorLink } from './aggregator-link.model';
2
- import { ICategory } from './category.model';
3
- import { IPanel } from './panel.model';
4
-
5
- export interface IUser {
6
- id?: string;
7
- isAdmin: boolean;
8
- apiKey: string;
9
- updatedAt?: Date;
10
- createdAt?: Date;
11
-
12
- // Associations
13
- aggregatorLink?: IAggregatorLink[];
14
- panel?: IPanel[];
15
- category?: ICategory[];
16
- }
@@ -1,30 +0,0 @@
1
- import { Code, ErrorType } from '../types';
2
-
3
- type ErrorParams = { code: Code; type: ErrorType; message?: string };
4
-
5
- export class ServiceException extends Error {
6
- private readonly code: Code;
7
-
8
- private readonly type: ErrorType;
9
-
10
- getCode(): Code {
11
- return this.code;
12
- }
13
-
14
- getType(): ErrorType {
15
- return this.type;
16
- }
17
-
18
- constructor(params: ErrorParams) {
19
- super(params.message);
20
- this.code = params.code;
21
- this.type = params.type;
22
- }
23
- }
24
-
25
- export const handleError = (error: Error | ErrorParams, _params?: ErrorParams): Error => {
26
- if (error instanceof Error) {
27
- return error;
28
- }
29
- return new ServiceException(error);
30
- };
@@ -1 +0,0 @@
1
- export * from './error.utils';