@wenex/sdk 1.0.18 → 1.0.21

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 (149) hide show
  1. package/common/enums/financial/accounts/index.d.ts +2 -0
  2. package/common/enums/financial/accounts/index.js +19 -0
  3. package/common/enums/financial/accounts/index.js.map +1 -0
  4. package/common/enums/financial/accounts/ownership.enum.d.ts +5 -0
  5. package/common/enums/financial/accounts/ownership.enum.js +10 -0
  6. package/common/enums/financial/accounts/ownership.enum.js.map +1 -0
  7. package/common/enums/financial/accounts/type.enum.d.ts +9 -0
  8. package/common/enums/financial/accounts/type.enum.js +14 -0
  9. package/common/enums/financial/accounts/type.enum.js.map +1 -0
  10. package/common/enums/financial/common/index.d.ts +1 -0
  11. package/common/enums/financial/common/index.js +18 -0
  12. package/common/enums/financial/common/index.js.map +1 -0
  13. package/common/enums/financial/common/pay-type.enum.d.ts +6 -0
  14. package/common/enums/financial/common/pay-type.enum.js +11 -0
  15. package/common/enums/financial/common/pay-type.enum.js.map +1 -0
  16. package/common/enums/financial/currencies/category.enum.d.ts +4 -0
  17. package/common/enums/financial/currencies/category.enum.js +9 -0
  18. package/common/enums/financial/currencies/category.enum.js.map +1 -0
  19. package/common/enums/financial/currencies/index.d.ts +4 -0
  20. package/common/enums/financial/currencies/index.js +21 -0
  21. package/common/enums/financial/currencies/index.js.map +1 -0
  22. package/common/enums/financial/currencies/lib.enum.d.ts +10 -0
  23. package/common/enums/financial/currencies/lib.enum.js +15 -0
  24. package/common/enums/financial/currencies/lib.enum.js.map +1 -0
  25. package/common/enums/financial/currencies/provider.enum.d.ts +3 -0
  26. package/common/enums/financial/currencies/provider.enum.js +8 -0
  27. package/common/enums/financial/currencies/provider.enum.js.map +1 -0
  28. package/common/enums/financial/currencies/type.enum.d.ts +4 -0
  29. package/common/enums/financial/currencies/type.enum.js +9 -0
  30. package/common/enums/financial/currencies/type.enum.js.map +1 -0
  31. package/common/enums/financial/index.d.ts +5 -0
  32. package/common/enums/financial/index.js +22 -0
  33. package/common/enums/financial/index.js.map +1 -0
  34. package/common/enums/financial/invoices/index.d.ts +1 -0
  35. package/common/enums/financial/invoices/index.js +18 -0
  36. package/common/enums/financial/invoices/index.js.map +1 -0
  37. package/common/enums/financial/invoices/type.enum.d.ts +6 -0
  38. package/common/enums/financial/invoices/type.enum.js +11 -0
  39. package/common/enums/financial/invoices/type.enum.js.map +1 -0
  40. package/common/enums/financial/transactions/index.d.ts +3 -0
  41. package/common/enums/financial/transactions/index.js +20 -0
  42. package/common/enums/financial/transactions/index.js.map +1 -0
  43. package/common/enums/financial/transactions/reason.enum.d.ts +7 -0
  44. package/common/enums/financial/transactions/reason.enum.js +12 -0
  45. package/common/enums/financial/transactions/reason.enum.js.map +1 -0
  46. package/common/enums/financial/transactions/state.enum.d.ts +7 -0
  47. package/common/enums/financial/transactions/state.enum.js +12 -0
  48. package/common/enums/financial/transactions/state.enum.js.map +1 -0
  49. package/common/enums/financial/transactions/type.enum.d.ts +5 -0
  50. package/common/enums/financial/transactions/type.enum.js +10 -0
  51. package/common/enums/financial/transactions/type.enum.js.map +1 -0
  52. package/common/interfaces/financial/accounts/account.interface.d.ts +10 -0
  53. package/common/interfaces/financial/accounts/account.interface.js +3 -0
  54. package/common/interfaces/financial/accounts/account.interface.js.map +1 -0
  55. package/common/interfaces/financial/accounts/index.d.ts +1 -0
  56. package/common/interfaces/financial/accounts/index.js +18 -0
  57. package/common/interfaces/financial/accounts/index.js.map +1 -0
  58. package/common/interfaces/financial/common/index.d.ts +1 -0
  59. package/common/interfaces/financial/common/index.js +18 -0
  60. package/common/interfaces/financial/common/index.js.map +1 -0
  61. package/common/interfaces/financial/common/pay.interface.d.ts +9 -0
  62. package/common/interfaces/financial/common/pay.interface.js +3 -0
  63. package/common/interfaces/financial/common/pay.interface.js.map +1 -0
  64. package/common/interfaces/financial/currencies/currency.interface.d.ts +25 -0
  65. package/common/interfaces/financial/currencies/currency.interface.js +3 -0
  66. package/common/interfaces/financial/currencies/currency.interface.js.map +1 -0
  67. package/common/interfaces/financial/currencies/index.d.ts +2 -0
  68. package/common/interfaces/financial/currencies/index.js +19 -0
  69. package/common/interfaces/financial/currencies/index.js.map +1 -0
  70. package/common/interfaces/financial/currencies/unit.interface.d.ts +7 -0
  71. package/common/interfaces/financial/currencies/unit.interface.js +3 -0
  72. package/common/interfaces/financial/currencies/unit.interface.js.map +1 -0
  73. package/common/interfaces/financial/index.d.ts +6 -0
  74. package/common/interfaces/financial/index.js +23 -0
  75. package/common/interfaces/financial/index.js.map +1 -0
  76. package/common/interfaces/financial/invoices/index.d.ts +2 -0
  77. package/common/interfaces/financial/invoices/index.js +19 -0
  78. package/common/interfaces/financial/invoices/index.js.map +1 -0
  79. package/common/interfaces/financial/invoices/invoice.interface.d.ts +25 -0
  80. package/common/interfaces/financial/invoices/invoice.interface.js +3 -0
  81. package/common/interfaces/financial/invoices/invoice.interface.js.map +1 -0
  82. package/common/interfaces/financial/invoices/item.interface.d.ts +8 -0
  83. package/common/interfaces/financial/invoices/item.interface.js +3 -0
  84. package/common/interfaces/financial/invoices/item.interface.js.map +1 -0
  85. package/common/interfaces/financial/transactions/index.d.ts +1 -0
  86. package/common/interfaces/financial/transactions/index.js +18 -0
  87. package/common/interfaces/financial/transactions/index.js.map +1 -0
  88. package/common/interfaces/financial/transactions/transaction.interface.d.ts +23 -0
  89. package/common/interfaces/financial/transactions/transaction.interface.js +3 -0
  90. package/common/interfaces/financial/transactions/transaction.interface.js.map +1 -0
  91. package/common/interfaces/financial/wallets/index.d.ts +1 -0
  92. package/common/interfaces/financial/wallets/index.js +18 -0
  93. package/common/interfaces/financial/wallets/index.js.map +1 -0
  94. package/common/interfaces/financial/wallets/wallet.interface.d.ts +15 -0
  95. package/common/interfaces/financial/wallets/wallet.interface.js +3 -0
  96. package/common/interfaces/financial/wallets/wallet.interface.js.map +1 -0
  97. package/common/interfaces/special/stats/stat.interface.d.ts +1 -0
  98. package/common/utils/financial/constants/index.d.ts +1 -0
  99. package/common/utils/financial/constants/index.js +18 -0
  100. package/common/utils/financial/constants/index.js.map +1 -0
  101. package/common/utils/financial/constants/transactions.constant.d.ts +2 -0
  102. package/common/utils/financial/constants/transactions.constant.js +6 -0
  103. package/common/utils/financial/constants/transactions.constant.js.map +1 -0
  104. package/common/utils/financial/financial.spec.d.ts +1 -0
  105. package/common/utils/financial/financial.spec.js +15 -0
  106. package/common/utils/financial/financial.spec.js.map +1 -0
  107. package/common/utils/financial/financial.util.d.ts +2 -0
  108. package/common/utils/financial/financial.util.js +25 -0
  109. package/common/utils/financial/financial.util.js.map +1 -0
  110. package/common/utils/financial/index.d.ts +4 -0
  111. package/common/utils/financial/index.js +21 -0
  112. package/common/utils/financial/index.js.map +1 -0
  113. package/common/utils/financial/invoice.spec.d.ts +1 -0
  114. package/common/utils/financial/invoice.spec.js +13 -0
  115. package/common/utils/financial/invoice.spec.js.map +1 -0
  116. package/common/utils/financial/invoice.util.d.ts +2 -0
  117. package/common/utils/financial/invoice.util.js +16 -0
  118. package/common/utils/financial/invoice.util.js.map +1 -0
  119. package/common/utils/financial/transfer.util.d.ts +3 -0
  120. package/common/utils/financial/transfer.util.js +8 -0
  121. package/common/utils/financial/transfer.util.js.map +1 -0
  122. package/common/utils/financial/transfer.util.spec.d.ts +1 -0
  123. package/common/utils/financial/transfer.util.spec.js +21 -0
  124. package/common/utils/financial/transfer.util.spec.js.map +1 -0
  125. package/index.d.ts +2 -0
  126. package/index.js +3 -0
  127. package/index.js.map +1 -1
  128. package/package.json +6 -3
  129. package/services/financial/accounts.service.d.ts +8 -0
  130. package/services/financial/accounts.service.js +15 -0
  131. package/services/financial/accounts.service.js.map +1 -0
  132. package/services/financial/currencies.service.d.ts +8 -0
  133. package/services/financial/currencies.service.js +15 -0
  134. package/services/financial/currencies.service.js.map +1 -0
  135. package/services/financial/index.d.ts +26 -0
  136. package/services/financial/index.js +52 -0
  137. package/services/financial/index.js.map +1 -0
  138. package/services/financial/invoices.service.d.ts +8 -0
  139. package/services/financial/invoices.service.js +15 -0
  140. package/services/financial/invoices.service.js.map +1 -0
  141. package/services/financial/transactions.service.d.ts +8 -0
  142. package/services/financial/transactions.service.js +15 -0
  143. package/services/financial/transactions.service.js.map +1 -0
  144. package/services/financial/wallets.service.d.ts +8 -0
  145. package/services/financial/wallets.service.js +15 -0
  146. package/services/financial/wallets.service.js.map +1 -0
  147. package/services/index.d.ts +1 -0
  148. package/services/index.js +1 -0
  149. package/services/index.js.map +1 -1
@@ -0,0 +1,7 @@
1
+ export interface CurrencyUnit {
2
+ name: string;
3
+ rate: number;
4
+ symbol?: string;
5
+ precision?: number;
6
+ }
7
+ export type CurrencyUnitDto = CurrencyUnit;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=unit.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unit.interface.js","sourceRoot":"","sources":["../../../../src/common/interfaces/financial/currencies/unit.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ export * from './accounts';
2
+ export * from './common';
3
+ export * from './currencies';
4
+ export * from './invoices';
5
+ export * from './transactions';
6
+ export * from './wallets';
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./accounts"), exports);
18
+ __exportStar(require("./common"), exports);
19
+ __exportStar(require("./currencies"), exports);
20
+ __exportStar(require("./invoices"), exports);
21
+ __exportStar(require("./transactions"), exports);
22
+ __exportStar(require("./wallets"), exports);
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/interfaces/financial/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,2CAAyB;AACzB,+CAA6B;AAC7B,6CAA2B;AAC3B,iDAA+B;AAC/B,4CAA0B"}
@@ -0,0 +1,2 @@
1
+ export * from './invoice.interface';
2
+ export * from './item.interface';
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./invoice.interface"), exports);
18
+ __exportStar(require("./item.interface"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/common/interfaces/financial/invoices/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,mDAAiC"}
@@ -0,0 +1,25 @@
1
+ import type { Document } from 'mongoose';
2
+ import { Pay, PayDto } from '../common';
3
+ import { InvoiceType } from '../../../enums/financial';
4
+ import { Core, Dto, NesteDto } from '../../../core/interfaces';
5
+ import { InvoiceItem, InvoiceItemDto } from './item.interface';
6
+ export interface Invoice<Properties extends object = object> extends Core<Properties> {
7
+ type: InvoiceType;
8
+ title?: string;
9
+ paid?: number;
10
+ amount: number;
11
+ payees: Pay<Properties>[];
12
+ payers?: Pay<Properties>[];
13
+ currency?: string;
14
+ items?: InvoiceItem<Properties>[];
15
+ closed_at?: Date;
16
+ expires_at?: Date;
17
+ replication?: number;
18
+ subscription?: string;
19
+ }
20
+ export type InvoiceDoc<Properties extends object = object> = Invoice<Properties> & Document;
21
+ export type InvoiceDto<Properties extends object = object> = NesteDto<Dto<Invoice<Properties>, 'type'>, {
22
+ payees: PayDto[];
23
+ payers?: PayDto[];
24
+ items?: InvoiceItemDto[];
25
+ }>;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=invoice.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invoice.interface.js","sourceRoot":"","sources":["../../../../src/common/interfaces/financial/invoices/invoice.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ import { Core, Dto } from '../../../core/interfaces';
2
+ export interface InvoiceItem<Properties extends object = object> extends Core<Properties> {
3
+ title?: string;
4
+ price: number;
5
+ quantity: number;
6
+ measurement?: string;
7
+ }
8
+ export type InvoiceItemDto<Properties extends object = object> = Dto<InvoiceItem<Properties>, 'quantity'>;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=item.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"item.interface.js","sourceRoot":"","sources":["../../../../src/common/interfaces/financial/invoices/item.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ export * from './transaction.interface';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./transaction.interface"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/common/interfaces/financial/transactions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAwC"}
@@ -0,0 +1,23 @@
1
+ import type { Document } from 'mongoose';
2
+ import { Pay, PayDto } from '../common';
3
+ import { Core, Dto, MakeOptional, NesteDto } from '../../../core/interfaces';
4
+ import { TransactionReason, TransactionState, TransactionType } from '../../../enums/financial';
5
+ export interface Transaction<Properties extends object = object> extends Core<Properties> {
6
+ saga: string;
7
+ type: TransactionType;
8
+ state: TransactionState;
9
+ reason: TransactionReason;
10
+ amount: number;
11
+ payees?: Pay<Properties>[];
12
+ payers?: Pay<Properties>[];
13
+ failed_at?: Date;
14
+ verified_at?: Date;
15
+ canceled_at?: Date;
16
+ invoice?: string;
17
+ }
18
+ export type TransactionDoc<Properties extends object = object> = Transaction<Properties> & Document;
19
+ export type TransactionDto<Properties extends object = object> = NesteDto<Dto<Transaction<Properties>, 'type'>, {
20
+ payees?: PayDto[];
21
+ payers?: PayDto[];
22
+ }>;
23
+ export type TransactionInitDto<Properties extends object = object> = MakeOptional<TransactionDto<Properties>, 'saga' | 'state'>;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=transaction.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transaction.interface.js","sourceRoot":"","sources":["../../../../src/common/interfaces/financial/transactions/transaction.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ export * from './wallet.interface';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./wallet.interface"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/common/interfaces/financial/wallets/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC"}
@@ -0,0 +1,15 @@
1
+ import type { Document } from 'mongoose';
2
+ import { Core, Dto } from '../../../core/interfaces';
3
+ export interface Wallet<Properties extends object = object> extends Core<Properties> {
4
+ strict?: boolean;
5
+ account: string;
6
+ currency: string;
7
+ amount: number;
8
+ blocked?: number;
9
+ internal?: number;
10
+ external?: number;
11
+ address?: string;
12
+ private?: string;
13
+ }
14
+ export type WalletDoc<Properties extends object = object> = Wallet<Properties> & Document;
15
+ export type WalletDto<Properties extends object = object> = Dto<Wallet<Properties>>;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=wallet.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wallet.interface.js","sourceRoot":"","sources":["../../../../src/common/interfaces/financial/wallets/wallet.interface.ts"],"names":[],"mappings":""}
@@ -5,6 +5,7 @@ export interface Stat<Properties extends object = object> extends Core<Propertie
5
5
  type: StatType;
6
6
  key: StatKey;
7
7
  obj?: string;
8
+ flag?: string;
8
9
  day?: number;
9
10
  month?: number;
10
11
  year: number;
@@ -0,0 +1 @@
1
+ export * from './transactions.constant';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./transactions.constant"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/common/utils/financial/constants/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAwC"}
@@ -0,0 +1,2 @@
1
+ export declare const MIN_TRANSACTION_TTL = 5;
2
+ export declare const MAX_TRANSACTION_TTL: number;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MAX_TRANSACTION_TTL = exports.MIN_TRANSACTION_TTL = void 0;
4
+ exports.MIN_TRANSACTION_TTL = 5; // 5 sec's
5
+ exports.MAX_TRANSACTION_TTL = 15 * 60; // 15 min's
6
+ //# sourceMappingURL=transactions.constant.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transactions.constant.js","sourceRoot":"","sources":["../../../../src/common/utils/financial/constants/transactions.constant.ts"],"names":[],"mappings":";;;AAAa,QAAA,mBAAmB,GAAG,CAAC,CAAC,CAAC,UAAU;AACnC,QAAA,mBAAmB,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,WAAW"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const financial_util_1 = require("./financial.util");
4
+ describe('libs/common/src/utils/financial/financial.util.ts', () => {
5
+ it('totalPays', () => {
6
+ expect((0, financial_util_1.totalPays)()).toBe(0);
7
+ expect((0, financial_util_1.totalPays)([], 100)).toBe(100);
8
+ expect((0, financial_util_1.totalPays)([{ amount: 100 }])).toBe(100);
9
+ expect((0, financial_util_1.totalPays)([{ fraction: 0.2 }], 500)).toBe(100);
10
+ expect((0, financial_util_1.totalPays)([{ amount: 100, fraction: 0.2 }], 500)).toBe(100);
11
+ expect((0, financial_util_1.totalPays)([{ amount: 100 }, { amount: 100, fraction: 0.2 }], 500)).toBe(200);
12
+ expect((0, financial_util_1.totalPays)([{ amount: 100 }, { amount: 100, fraction: 0.2 }, { fraction: 0.2 }], 500)).toBe(300);
13
+ });
14
+ });
15
+ //# sourceMappingURL=financial.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"financial.spec.js","sourceRoot":"","sources":["../../../src/common/utils/financial/financial.spec.ts"],"names":[],"mappings":";;AAAA,qDAA6C;AAE7C,QAAQ,CAAC,mDAAmD,EAAE,GAAG,EAAE;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" | "fraction">[], amount?: number) => number;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.totalPays = void 0;
4
+ const totalPays = (pairs, amount = 0) => {
5
+ let total = 0;
6
+ if (!pairs?.length)
7
+ return amount;
8
+ for (const { amount: a, fraction: f } of pairs) {
9
+ if (!(typeof a === 'number' || typeof f === 'number'))
10
+ throw new Error('amount or fraction must be defined');
11
+ if (typeof a === 'number')
12
+ if (!(a >= 0))
13
+ throw new Error('amount must be grater than or equal to zero');
14
+ if (typeof f === 'number')
15
+ if (!(f >= 0 && f <= 1))
16
+ throw new Error('fraction must be between zero and one');
17
+ if (typeof a === 'number' && typeof f === 'number')
18
+ if (!(a === f * amount))
19
+ throw new Error('amount and fraction are inconsistent');
20
+ total += a ?? f * amount;
21
+ }
22
+ return total;
23
+ };
24
+ exports.totalPays = totalPays;
25
+ //# sourceMappingURL=financial.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"financial.util.js","sourceRoot":"","sources":["../../../src/common/utils/financial/financial.util.ts"],"names":[],"mappings":";;;AAEO,MAAM,SAAS,GAAG,CAAC,KAA0C,EAAE,MAAM,GAAG,CAAC,EAAU,EAAE;IAC1F,IAAI,KAAK,GAAW,CAAC,CAAC;IACtB,IAAI,CAAC,KAAK,EAAE,MAAM;QAAE,OAAO,MAAM,CAAC;IAClC,KAAK,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,IAAI,KAAK,EAAE,CAAC;QAC/C,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,OAAO,CAAC,KAAK,QAAQ,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;QAC7G,IAAI,OAAO,CAAC,KAAK,QAAQ;YAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;gBAAE,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;QACzG,IAAI,OAAO,CAAC,KAAK,QAAQ;YAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAAE,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;QAC7G,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,OAAO,CAAC,KAAK,QAAQ;YAChD,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC;gBAAE,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;QACnF,KAAK,IAAI,CAAC,IAAI,CAAE,GAAG,MAAM,CAAC;IAC5B,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAZW,QAAA,SAAS,aAYpB"}
@@ -0,0 +1,4 @@
1
+ export * from './constants';
2
+ export * from './financial.util';
3
+ export * from './invoice.util';
4
+ export * from './transfer.util';
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./constants"), exports);
18
+ __exportStar(require("./financial.util"), exports);
19
+ __exportStar(require("./invoice.util"), exports);
20
+ __exportStar(require("./transfer.util"), exports);
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/utils/financial/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAE5B,mDAAiC;AACjC,iDAA+B;AAC/B,kDAAgC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const invoice_util_1 = require("./invoice.util");
4
+ describe('libs/common/src/utils/financial/invoice.util.ts', () => {
5
+ it('totalItems', () => {
6
+ expect((0, invoice_util_1.totalItems)()).toBe(0);
7
+ expect((0, invoice_util_1.totalItems)([], 100)).toBe(100);
8
+ expect((0, invoice_util_1.totalItems)([{ price: 100 }])).toBe(100);
9
+ expect((0, invoice_util_1.totalItems)([{ price: 100, quantity: 2 }])).toBe(200);
10
+ expect((0, invoice_util_1.totalItems)([{ price: 100 }, { price: 100, quantity: 2 }])).toBe(300);
11
+ });
12
+ });
13
+ //# sourceMappingURL=invoice.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invoice.spec.js","sourceRoot":"","sources":["../../../src/common/utils/financial/invoice.spec.ts"],"names":[],"mappings":";;AAAA,iDAA4C;AAE5C,QAAQ,CAAC,iDAAiD,EAAE,GAAG,EAAE;IAC/D,EAAE,CAAC,YAAY,EAAE,GAAG,EAAE;QACpB,MAAM,CAAC,IAAA,yBAAU,GAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC7B,MAAM,CAAC,IAAA,yBAAU,EAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACtC,MAAM,CAAC,IAAA,yBAAU,EAAC,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC/C,MAAM,CAAC,IAAA,yBAAU,EAAC,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC5D,MAAM,CAAC,IAAA,yBAAU,EAAC,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC9E,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { InvoiceItemDto } from '../../interfaces/financial';
2
+ export declare const totalItems: (items?: Pick<InvoiceItemDto, "price" | "quantity">[], amount?: number) => number;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.totalItems = void 0;
4
+ const totalItems = (items, amount = 0) => {
5
+ let total = 0;
6
+ if (!items?.length)
7
+ return amount;
8
+ for (const { price: p, quantity: q } of items) {
9
+ if (!(p >= 0))
10
+ throw new Error('price must be grater than or equal to zero');
11
+ total += p * (q ?? 1);
12
+ }
13
+ return total;
14
+ };
15
+ exports.totalItems = totalItems;
16
+ //# sourceMappingURL=invoice.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invoice.util.js","sourceRoot":"","sources":["../../../src/common/utils/financial/invoice.util.ts"],"names":[],"mappings":";;;AAEO,MAAM,UAAU,GAAG,CAAC,KAAoD,EAAE,MAAM,GAAG,CAAC,EAAE,EAAE;IAC7F,IAAI,KAAK,GAAW,CAAC,CAAC;IACtB,IAAI,CAAC,KAAK,EAAE,MAAM;QAAE,OAAO,MAAM,CAAC;IAClC,KAAK,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,IAAI,KAAK,EAAE,CAAC;QAC9C,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;QAC7E,KAAK,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IACxB,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AARW,QAAA,UAAU,cAQrB"}
@@ -0,0 +1,3 @@
1
+ import { Pay } from '../../interfaces/financial';
2
+ export declare const round: (val: number | string, precision: number) => number;
3
+ export declare const payCalc: (pay: Pick<Pay, "amount" | "fraction">, amount: number, precision: number) => number;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.payCalc = exports.round = void 0;
4
+ const round = (val, precision) => +Number(val).toFixed(precision);
5
+ exports.round = round;
6
+ const payCalc = (pay, amount, precision) => (0, exports.round)(pay.amount ?? (typeof pay.fraction === 'number' ? pay.fraction * amount : amount), precision);
7
+ exports.payCalc = payCalc;
8
+ //# sourceMappingURL=transfer.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transfer.util.js","sourceRoot":"","sources":["../../../src/common/utils/financial/transfer.util.ts"],"names":[],"mappings":";;;AAEO,MAAM,KAAK,GAAG,CAAC,GAAoB,EAAE,SAAiB,EAAU,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAA7F,QAAA,KAAK,SAAwF;AAEnG,MAAM,OAAO,GAAG,CAAC,GAAqC,EAAE,MAAc,EAAE,SAAiB,EAAU,EAAE,CAC1G,IAAA,aAAK,EAAC,GAAG,CAAC,MAAM,IAAI,CAAC,OAAO,GAAG,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,CAAC;AADzF,QAAA,OAAO,WACkF"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const transfer_util_1 = require("./transfer.util");
4
+ describe('libs/common/src/utils/financial/transfer.util.ts', () => {
5
+ it('round', () => {
6
+ expect((0, transfer_util_1.round)(12.12, 0)).toBe(12);
7
+ expect((0, transfer_util_1.round)(12.12, 1)).toBe(12.1);
8
+ expect((0, transfer_util_1.round)(12.12, 2)).toBe(12.12);
9
+ expect((0, transfer_util_1.round)('12.12', 0)).toBe(12);
10
+ expect((0, transfer_util_1.round)('12.12', 1)).toBe(12.1);
11
+ expect((0, transfer_util_1.round)('12.12', 2)).toBe(12.12);
12
+ });
13
+ it('payCalc', () => {
14
+ expect((0, transfer_util_1.payCalc)({ amount: 0 }, 12.12, 2)).toBe(0);
15
+ expect((0, transfer_util_1.payCalc)({ amount: -1 }, 12.12, 2)).toBe(-1);
16
+ expect((0, transfer_util_1.payCalc)({ amount: 100 }, 12.12, 2)).toBe(100);
17
+ expect((0, transfer_util_1.payCalc)({ fraction: 0.1 }, 12.12, 2)).toBe(1.21);
18
+ expect((0, transfer_util_1.payCalc)({ amount: 1.21, fraction: 0.1 }, 12.12, 2)).toBe(1.21);
19
+ });
20
+ });
21
+ //# sourceMappingURL=transfer.util.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transfer.util.spec.js","sourceRoot":"","sources":["../../../src/common/utils/financial/transfer.util.spec.ts"],"names":[],"mappings":";;AAAA,mDAAiD;AAEjD,QAAQ,CAAC,kDAAkD,EAAE,GAAG,EAAE;IAChE,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;QACf,MAAM,CAAC,IAAA,qBAAK,EAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACjC,MAAM,CAAC,IAAA,qBAAK,EAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnC,MAAM,CAAC,IAAA,qBAAK,EAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACpC,MAAM,CAAC,IAAA,qBAAK,EAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACnC,MAAM,CAAC,IAAA,qBAAK,EAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACrC,MAAM,CAAC,IAAA,qBAAK,EAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE;QACjB,MAAM,CAAC,IAAA,uBAAO,EAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACjD,MAAM,CAAC,IAAA,uBAAO,EAAC,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QACnD,MAAM,CAAC,IAAA,uBAAO,EAAC,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACrD,MAAM,CAAC,IAAA,uBAAO,EAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACxD,MAAM,CAAC,IAAA,uBAAO,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACxE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
package/index.d.ts CHANGED
@@ -9,6 +9,7 @@ export declare class Platform<Properties extends object = object> {
9
9
  protected _context?: Services.ContextClient<Properties>;
10
10
  protected _domain?: Services.DomainClient<Properties>;
11
11
  protected _essential?: Services.EssentialClient<Properties>;
12
+ protected _financial?: Services.FinancialClient<Properties>;
12
13
  protected _identity?: Services.IdentityClient<Properties>;
13
14
  protected _special?: Services.SpecialClient<Properties>;
14
15
  protected _touch?: Services.TouchClient<Properties>;
@@ -17,6 +18,7 @@ export declare class Platform<Properties extends object = object> {
17
18
  get context(): Services.ContextClient<Properties>;
18
19
  get domain(): Services.DomainClient<Properties>;
19
20
  get essential(): Services.EssentialClient<Properties>;
21
+ get financial(): Services.FinancialClient<Properties>;
20
22
  get identity(): Services.IdentityClient<Properties>;
21
23
  get special(): Services.SpecialClient<Properties>;
22
24
  get touch(): Services.TouchClient<Properties>;
package/index.js CHANGED
@@ -34,6 +34,9 @@ class Platform {
34
34
  get essential() {
35
35
  return (this._essential = this._essential ?? Services.EssentialClient.build(this.axios));
36
36
  }
37
+ get financial() {
38
+ return (this._financial = this._financial ?? Services.FinancialClient.build(this.axios));
39
+ }
37
40
  get identity() {
38
41
  return (this._identity = this._identity ?? Services.IdentityClient.build(this.axios));
39
42
  }
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAEA,uCAAuC;AACvC,mDAAuD;AAEvD,6CAA2B;AAE3B,MAAa,QAAQ;IAWnB,YAAqB,KAAoB;QAApB,UAAK,GAAL,KAAK,CAAe;IAAG,CAAC;IAE7C,IAAI,IAAI;QACN,OAAO,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAa,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IACxF,CAAC;IAED,IAAI,OAAO;QACT,OAAO,CAAC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAa,IAAI,CAAC,KAAK,CAAC,CAAC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CAAC,KAAK,CAAa,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IACjG,CAAC;IAED,IAAI,KAAK;QACP,OAAO,CAAC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,QAAQ,CAAC,WAAW,CAAC,KAAK,CAAa,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAC3F,CAAC;IAED,IAAI,OAAO;QACT,OAAO,CAAC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,IAAI,wBAAc,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAC7E,CAAC;IAED,MAAM,CAAC,KAAK,CAAqC,KAAoB;QACnE,OAAO,IAAI,QAAQ,CAAa,KAAK,CAAC,CAAC;IACzC,CAAC;CACF;AArDD,4BAqDC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wenex/sdk",
3
- "version": "1.0.18",
3
+ "version": "1.0.21",
4
4
  "description": "Wenex SDK",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -22,14 +22,17 @@
22
22
  "scripts": {
23
23
  "build": "tsc -p ./tsconfig.json",
24
24
  "prebuild": "rimraf tsconfig.tsbuildinfo index.* common services",
25
- "prepare": "husky",
25
+ "prepare": "echo -e prepare for development by: npm run husky",
26
26
  "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
27
27
  "lint": "eslint \"{src,test}/**/*.ts\" --quiet --fix",
28
28
  "test": "jest",
29
+ "husky": "husky",
29
30
  "test:cov": "jest --coverage && npm run make-coverage-badge",
30
31
  "doc": "npx typedoc --entryPointStrategy expand --out docs src/",
31
32
  "check": "madge --circular --warning --ts-config ./tsconfig.json --extensions ts --image circular-dependencies.png ./src",
32
- "make-coverage-badge": "make-coverage-badge --report-path coverage/coverage-summary.json --output-path coverage-badge.svg"
33
+ "make-coverage-badge": "make-coverage-badge --report-path coverage/coverage-summary.json --output-path coverage-badge.svg",
34
+ "git": "bash ./scripts/git-submodule.sh",
35
+ "git:clone": "git submodule update --init --recursive"
33
36
  },
34
37
  "lint-staged": {
35
38
  "*.ts": [
@@ -0,0 +1,8 @@
1
+ import type { AxiosInstance } from 'axios';
2
+ import { RestfulService } from '../../common/core/classes';
3
+ import { Account, AccountDto } from '../../common/interfaces/financial';
4
+ export declare class AccountsService<Properties extends object = object> extends RestfulService<Account<Properties>, AccountDto<Properties>> {
5
+ protected axios: AxiosInstance;
6
+ constructor(axios: AxiosInstance);
7
+ static build<Properties extends object = object>(axios: AxiosInstance): AccountsService<Properties>;
8
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AccountsService = void 0;
4
+ const classes_1 = require("../../common/core/classes");
5
+ class AccountsService extends classes_1.RestfulService {
6
+ constructor(axios) {
7
+ super('accounts', axios);
8
+ this.axios = axios;
9
+ }
10
+ static build(axios) {
11
+ return new AccountsService(axios);
12
+ }
13
+ }
14
+ exports.AccountsService = AccountsService;
15
+ //# sourceMappingURL=accounts.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accounts.service.js","sourceRoot":"","sources":["../../src/services/financial/accounts.service.ts"],"names":[],"mappings":";;;AAEA,uDAA2D;AAG3D,MAAa,eAAoD,SAAQ,wBAGxE;IACC,YAAsB,KAAoB;QACxC,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;QADL,UAAK,GAAL,KAAK,CAAe;IAE1C,CAAC;IAED,MAAM,CAAC,KAAK,CAAqC,KAAoB;QACnE,OAAO,IAAI,eAAe,CAAa,KAAK,CAAC,CAAC;IAChD,CAAC;CACF;AAXD,0CAWC"}
@@ -0,0 +1,8 @@
1
+ import type { AxiosInstance } from 'axios';
2
+ import { RestfulService } from '../../common/core/classes';
3
+ import { Currency, CurrencyDto } from '../../common/interfaces/financial';
4
+ export declare class CurrenciesService<Properties extends object = object> extends RestfulService<Currency<Properties>, CurrencyDto<Properties>> {
5
+ protected axios: AxiosInstance;
6
+ constructor(axios: AxiosInstance);
7
+ static build<Properties extends object = object>(axios: AxiosInstance): CurrenciesService<Properties>;
8
+ }