accounting-tools 1.0.22 → 1.0.24

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.
@@ -1,191 +1,191 @@
1
- import { AxiosRequestConfig } from "axios";
2
- import { CrudServiceManager, StandardIdRequestDefinition } from "itrm-tools";
3
- import { IContact } from "./ContactManager";
4
- import { IStatus } from "./StatusManager";
5
- import { IType } from "./TypeManager";
6
- export interface ITransaction {
7
- transactionId?: number;
8
- userId?: string;
9
- typeId?: number;
10
- statusId?: number;
11
- timestamp?: number;
12
- fromDetails?: TransactionFromDetails;
13
- toDetails?: TransactionToDetails;
14
- isVerified?: boolean;
15
- types?: IType;
16
- status?: IStatus;
17
- updatedAt?: string;
18
- createdAt?: string;
19
- config?: AxiosRequestConfig;
20
- }
21
- export type TransactionFromDetails = DispersionFrom | InnerTransferFrom | MonetizeFrom | PseRechargeFrom | WireTransferRechargeFrom;
22
- export type TransactionToDetails = DispersionTo | InnerTransferTo | MonetizeTo | PseRechargeTo | WireTransferRechargeTo;
23
- export interface DispersionFrom {
24
- amount: string;
25
- accountingAccount: string;
26
- verifiedBy?: string;
27
- isNull?: boolean;
28
- nullFrom?: number;
29
- error?: string;
30
- other?: {
31
- companyName?: string;
32
- businessUnit?: string;
33
- channel?: string;
34
- currency?: string;
35
- fundsOrigin?: string;
36
- originBank?: string;
37
- originAccountNumber?: number;
38
- originAccountType?: string;
39
- };
40
- }
41
- export interface DispersionTo {
42
- destinationIdNumber: string;
43
- accountingAccount: string;
44
- contact?: Omit<IContact, "config">;
45
- }
46
- export interface InnerTransferFrom {
47
- amount: string;
48
- accountingAccount: string;
49
- verifiedBy?: string;
50
- isNull?: boolean;
51
- nullFrom?: number;
52
- error?: string;
53
- other?: {
54
- companyName?: string;
55
- businessUnit?: string;
56
- channel?: string;
57
- currency?: string;
58
- fundsOrigin?: string;
59
- originBank?: string;
60
- originAccountNumber?: number;
61
- originAccountType?: string;
62
- };
63
- }
64
- export interface InnerTransferTo {
65
- destinationIdNumber: string;
66
- accountingAccount: string;
67
- contact?: Omit<IContact, "config">;
68
- other?: {
69
- destinationBank?: string;
70
- destinationAccountType?: string;
71
- destinationAccountNumber?: string;
72
- };
73
- }
74
- export interface MonetizeFrom {
75
- originIdNumber: string;
76
- form: string;
77
- formNumber: string;
78
- companyName: string;
79
- amountUsd: string;
80
- amountCop: string;
81
- accountingAccount: string;
82
- verifiedBy?: string;
83
- isNull?: boolean;
84
- nullFrom?: number;
85
- error?: string;
86
- other?: {
87
- currency?: string;
88
- operationType?: string;
89
- companyId?: string;
90
- usdCop?: string;
91
- costs?: string;
92
- subtotalCop?: string;
93
- };
94
- contact?: Omit<IContact, "config">;
95
- }
96
- export interface MonetizeTo {
97
- destinationIdNumber: string;
98
- destinationAccountHolderName: string;
99
- accountingAccount: string;
100
- other?: {
101
- destinationBank?: string;
102
- destinationAccountType?: string;
103
- destinationAccountNumber?: string;
104
- destinationAccountHolderIdType?: string;
105
- validation?: string;
106
- supportLink?: string;
107
- imc?: string;
108
- };
109
- contact?: Omit<IContact, "config">;
110
- }
111
- export interface PseRechargeFrom {
112
- amountCop: string;
113
- verifiedBy?: string;
114
- isNull?: boolean;
115
- nullFrom?: number;
116
- error?: string;
117
- other?: {
118
- transactionId?: string;
119
- reference?: string;
120
- paymentMethod?: string;
121
- gateway?: string;
122
- amountUsdc?: string;
123
- realRate?: string;
124
- buyingRate?: string;
125
- registeredPrice?: string;
126
- fromTicker?: string;
127
- toTicker?: string;
128
- coltepayId?: string;
129
- coltepayTrackId?: string;
130
- };
131
- }
132
- export interface PseRechargeTo {
133
- accountingAccount: string;
134
- destinationIdNumber: string;
135
- contact?: Omit<IContact, "config">;
136
- }
137
- export interface WireTransferRechargeFrom {
138
- amountCop: string;
139
- verifiedBy?: string;
140
- isNull?: boolean;
141
- nullFrom?: number;
142
- error?: string;
143
- other?: {
144
- transactionId?: string;
145
- reference?: string;
146
- paymentMethod?: string;
147
- gateway?: string;
148
- amountUsdc?: string;
149
- realRate?: string;
150
- buyingRate?: string;
151
- registeredPrice?: string;
152
- fromTicker?: string;
153
- toTicker?: string;
154
- coltepayId?: string;
155
- coltepayTrackId?: string;
156
- };
157
- }
158
- export interface WireTransferRechargeTo {
159
- accountingAccount: string;
160
- destinationIdNumber: string;
161
- contact?: Omit<IContact, "config">;
162
- }
163
- export interface ITransactionSearchDetails {
164
- id?: string | number;
165
- userId?: string;
166
- typeId?: number;
167
- statusId?: number;
168
- timestamp?: number;
169
- fromDetails?: TransactionFromDetails;
170
- toDetails?: TransactionToDetails;
171
- isVerified?: boolean;
172
- type?: boolean;
173
- status?: boolean;
174
- values?: ITransaction[];
175
- limit?: number;
176
- offset?: number;
177
- config?: AxiosRequestConfig;
178
- }
179
- export declare class TransactionManager extends CrudServiceManager<ITransactionSearchDetails, ITransaction> {
180
- private readonly url;
181
- constructor(url: string);
182
- find(details: ITransactionSearchDetails): Promise<ITransaction | undefined>;
183
- findById(details: StandardIdRequestDefinition): Promise<ITransaction | undefined>;
184
- count(details: ITransactionSearchDetails): Promise<number>;
185
- findAll(details: ITransactionSearchDetails): Promise<ITransaction[] | undefined>;
186
- private buildRequestUrl;
187
- create(details: ITransactionSearchDetails): Promise<ITransaction | undefined>;
188
- createMany(details: ITransactionSearchDetails): Promise<ITransaction[] | undefined>;
189
- modify(transaction: ITransaction): Promise<ITransaction | undefined>;
190
- destroy(transaction: ITransaction): Promise<void | number>;
191
- }
1
+ import { AxiosRequestConfig } from "axios";
2
+ import { CrudServiceManager, StandardIdRequestDefinition } from "itrm-tools";
3
+ import { IContact } from "./ContactManager";
4
+ import { IStatus } from "./StatusManager";
5
+ import { IType } from "./TypeManager";
6
+ export interface ITransaction {
7
+ transactionId?: number;
8
+ userId?: string;
9
+ typeId?: number;
10
+ statusId?: number;
11
+ timestamp?: number;
12
+ fromDetails?: TransactionFromDetails;
13
+ toDetails?: TransactionToDetails;
14
+ isVerified?: boolean;
15
+ types?: IType;
16
+ status?: IStatus;
17
+ updatedAt?: string;
18
+ createdAt?: string;
19
+ config?: AxiosRequestConfig;
20
+ }
21
+ export type TransactionFromDetails = DispersionFrom | InnerTransferFrom | MonetizeFrom | PseRechargeFrom | WireTransferRechargeFrom;
22
+ export type TransactionToDetails = DispersionTo | InnerTransferTo | MonetizeTo | PseRechargeTo | WireTransferRechargeTo;
23
+ export interface DispersionFrom {
24
+ amount: string;
25
+ accountingAccount: string;
26
+ verifiedBy?: string;
27
+ isNull?: boolean;
28
+ nullFrom?: number;
29
+ error?: string;
30
+ other?: {
31
+ companyName?: string;
32
+ businessUnit?: string;
33
+ channel?: string;
34
+ currency?: string;
35
+ fundsOrigin?: string;
36
+ originBank?: string;
37
+ originAccountNumber?: number;
38
+ originAccountType?: string;
39
+ };
40
+ }
41
+ export interface DispersionTo {
42
+ destinationIdNumber: string;
43
+ accountingAccount: string;
44
+ contact?: Omit<IContact, "config">;
45
+ }
46
+ export interface InnerTransferFrom {
47
+ amount: string;
48
+ accountingAccount: string;
49
+ verifiedBy?: string;
50
+ isNull?: boolean;
51
+ nullFrom?: number;
52
+ error?: string;
53
+ other?: {
54
+ companyName?: string;
55
+ businessUnit?: string;
56
+ channel?: string;
57
+ currency?: string;
58
+ fundsOrigin?: string;
59
+ originBank?: string;
60
+ originAccountNumber?: number;
61
+ originAccountType?: string;
62
+ };
63
+ }
64
+ export interface InnerTransferTo {
65
+ destinationIdNumber: string;
66
+ accountingAccount: string;
67
+ contact?: Omit<IContact, "config">;
68
+ other?: {
69
+ destinationBank?: string;
70
+ destinationAccountType?: string;
71
+ destinationAccountNumber?: string;
72
+ };
73
+ }
74
+ export interface MonetizeFrom {
75
+ originIdNumber: string;
76
+ form: string;
77
+ formNumber: string;
78
+ companyName: string;
79
+ amountUsd: string;
80
+ amountCop: string;
81
+ accountingAccount: string;
82
+ verifiedBy?: string;
83
+ isNull?: boolean;
84
+ nullFrom?: number;
85
+ error?: string;
86
+ other?: {
87
+ currency?: string;
88
+ operationType?: string;
89
+ companyId?: string;
90
+ usdCop?: string;
91
+ costs?: string;
92
+ subtotalCop?: string;
93
+ };
94
+ contact?: Omit<IContact, "config">;
95
+ }
96
+ export interface MonetizeTo {
97
+ destinationIdNumber: string;
98
+ destinationAccountHolderName: string;
99
+ accountingAccount: string;
100
+ other?: {
101
+ destinationBank?: string;
102
+ destinationAccountType?: string;
103
+ destinationAccountNumber?: string;
104
+ destinationAccountHolderIdType?: string;
105
+ validation?: string;
106
+ supportLink?: string;
107
+ imc?: string;
108
+ };
109
+ contact?: Omit<IContact, "config">;
110
+ }
111
+ export interface PseRechargeFrom {
112
+ amountCop: string;
113
+ verifiedBy?: string;
114
+ isNull?: boolean;
115
+ nullFrom?: number;
116
+ error?: string;
117
+ other?: {
118
+ transactionId?: string;
119
+ reference?: string;
120
+ paymentMethod?: string;
121
+ gateway?: string;
122
+ amountUsdc?: string;
123
+ realRate?: string;
124
+ buyingRate?: string;
125
+ registeredPrice?: string;
126
+ fromTicker?: string;
127
+ toTicker?: string;
128
+ coltepayId?: string;
129
+ coltepayTrackId?: string;
130
+ };
131
+ }
132
+ export interface PseRechargeTo {
133
+ accountingAccount: string;
134
+ destinationIdNumber: string;
135
+ contact?: Omit<IContact, "config">;
136
+ }
137
+ export interface WireTransferRechargeFrom {
138
+ amountCop: string;
139
+ verifiedBy?: string;
140
+ isNull?: boolean;
141
+ nullFrom?: number;
142
+ error?: string;
143
+ other?: {
144
+ transactionId?: string;
145
+ reference?: string;
146
+ paymentMethod?: string;
147
+ gateway?: string;
148
+ amountUsdc?: string;
149
+ realRate?: string;
150
+ buyingRate?: string;
151
+ registeredPrice?: string;
152
+ fromTicker?: string;
153
+ toTicker?: string;
154
+ coltepayId?: string;
155
+ coltepayTrackId?: string;
156
+ };
157
+ }
158
+ export interface WireTransferRechargeTo {
159
+ accountingAccount: string;
160
+ destinationIdNumber: string;
161
+ contact?: Omit<IContact, "config">;
162
+ }
163
+ export interface ITransactionSearchDetails {
164
+ id?: string | number;
165
+ userId?: string;
166
+ typeId?: number;
167
+ statusId?: number;
168
+ timestamp?: number;
169
+ fromDetails?: TransactionFromDetails;
170
+ toDetails?: TransactionToDetails;
171
+ isVerified?: boolean;
172
+ type?: boolean;
173
+ status?: boolean;
174
+ values?: ITransaction[];
175
+ limit?: number;
176
+ offset?: number;
177
+ config?: AxiosRequestConfig;
178
+ }
179
+ export declare class TransactionManager extends CrudServiceManager<ITransactionSearchDetails, ITransaction> {
180
+ private readonly url;
181
+ constructor(url: string);
182
+ find(details: ITransactionSearchDetails): Promise<ITransaction | undefined>;
183
+ findById(details: StandardIdRequestDefinition): Promise<ITransaction | undefined>;
184
+ count(details: ITransactionSearchDetails): Promise<number>;
185
+ findAll(details: ITransactionSearchDetails): Promise<ITransaction[] | undefined>;
186
+ private buildRequestUrl;
187
+ create(details: ITransactionSearchDetails): Promise<ITransaction | undefined>;
188
+ createMany(details: ITransactionSearchDetails): Promise<ITransaction[] | undefined>;
189
+ modify(transaction: ITransaction): Promise<ITransaction | undefined>;
190
+ destroy(transaction: ITransaction): Promise<void | number>;
191
+ }
@@ -1,57 +1,57 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TransactionManager = void 0;
4
- const itrm_tools_1 = require("itrm-tools");
5
- class TransactionManager extends itrm_tools_1.CrudServiceManager {
6
- url;
7
- constructor(url) {
8
- super();
9
- this.url = url;
10
- }
11
- find(details) {
12
- return this.sendFinding(`${this.url}/transactions?userId=${details.userId}&typeId=${details.typeId}&statusId=${details.statusId}&timestamp=${details.timestamp}`, details.config);
13
- }
14
- findById(details) {
15
- return this.sendFinding(`${this.url}/transactions?id=${details.id}`, details.config);
16
- }
17
- async count(details) {
18
- let url = this.buildRequestUrl(`${this.url}/transactions`, details);
19
- return (await this.sendCounting(url, details.config)) ?? 0;
20
- }
21
- async findAll(details) {
22
- let transactions = [];
23
- let url = this.buildRequestUrl(`${this.url}/transactions`, details);
24
- if (details.limit) {
25
- transactions = (await this.sendAllFinding(`${url}${url.indexOf('?') !== -1 ? '&' : '?'}limit=${details.limit}&offset=${details.offset}`, details.config)) ?? [];
26
- }
27
- else {
28
- let limit = 5000, offset = 0, isEmpty = false;
29
- do {
30
- let values = await this.sendAllFinding(`${url}${url.indexOf('?') !== -1 ? '&' : '?'}limit=${limit}&offset=${offset}`, details.config);
31
- if (values)
32
- transactions = transactions.concat(values);
33
- isEmpty = values == undefined || values.length == 0;
34
- offset += limit;
35
- } while (!isEmpty);
36
- }
37
- return transactions;
38
- }
39
- buildRequestUrl(url, details) {
40
- let suffix = `${details.id ? `&id=${details.id}` : ""}${details.userId ? `&userId=${details.userId}` : ""}${details.typeId ? `&typeId=${details.typeId}` : ""}${details.statusId ? `&statusId=${details.statusId}` : ""}${details.timestamp ? `&timestamp=${details.timestamp}` : ""}${details.isVerified ? `&isVerified=${details.isVerified}` : ""}${details.type ? `&type=true` : ""}${details.status ? `&status=true` : ""}`;
41
- return `${url}?${suffix.substring(1)}`;
42
- }
43
- create(details) {
44
- return this.sendCreation(`${this.url}/transactions`, { userId: details.userId, typeId: details.typeId, statusId: details.statusId, timestamp: details.timestamp, fromDetails: details.fromDetails, toDetails: details.toDetails, isVerified: details.isVerified }, details.config);
45
- }
46
- createMany(details) {
47
- return this.sendCreationMany(`${this.url}/transactions`, details.values ?? [], details.config);
48
- }
49
- modify(transaction) {
50
- return this.sendModification(`${this.url}/transactions/${transaction.transactionId}`, { userId: transaction.userId, typeId: transaction.typeId, statusId: transaction.statusId, timestamp: transaction.timestamp, fromDetails: transaction.fromDetails, toDetails: transaction.toDetails, isVerified: transaction.isVerified }, transaction.config);
51
- }
52
- destroy(transaction) {
53
- return this.sendDestruction(`${this.url}/transactions/${transaction.transactionId}`, transaction.config);
54
- }
55
- }
56
- exports.TransactionManager = TransactionManager;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TransactionManager = void 0;
4
+ const itrm_tools_1 = require("itrm-tools");
5
+ class TransactionManager extends itrm_tools_1.CrudServiceManager {
6
+ url;
7
+ constructor(url) {
8
+ super();
9
+ this.url = url;
10
+ }
11
+ find(details) {
12
+ return this.sendFinding(`${this.url}/transactions?userId=${details.userId}&typeId=${details.typeId}&statusId=${details.statusId}&timestamp=${details.timestamp}`, details.config);
13
+ }
14
+ findById(details) {
15
+ return this.sendFinding(`${this.url}/transactions?id=${details.id}`, details.config);
16
+ }
17
+ async count(details) {
18
+ let url = this.buildRequestUrl(`${this.url}/transactions`, details);
19
+ return (await this.sendCounting(url, details.config)) ?? 0;
20
+ }
21
+ async findAll(details) {
22
+ let transactions = [];
23
+ let url = this.buildRequestUrl(`${this.url}/transactions`, details);
24
+ if (details.limit) {
25
+ transactions = (await this.sendAllFinding(`${url}${url.indexOf('?') !== -1 ? '&' : '?'}limit=${details.limit}&offset=${details.offset}`, details.config)) ?? [];
26
+ }
27
+ else {
28
+ let limit = 5000, offset = 0, isEmpty = false;
29
+ do {
30
+ let values = await this.sendAllFinding(`${url}${url.indexOf('?') !== -1 ? '&' : '?'}limit=${limit}&offset=${offset}`, details.config);
31
+ if (values)
32
+ transactions = transactions.concat(values);
33
+ isEmpty = values == undefined || values.length == 0;
34
+ offset += limit;
35
+ } while (!isEmpty);
36
+ }
37
+ return transactions;
38
+ }
39
+ buildRequestUrl(url, details) {
40
+ let suffix = `${details.id ? `&id=${details.id}` : ""}${details.userId ? `&userId=${details.userId}` : ""}${details.typeId ? `&typeId=${details.typeId}` : ""}${details.statusId ? `&statusId=${details.statusId}` : ""}${details.timestamp ? `&timestamp=${details.timestamp}` : ""}${details.isVerified ? `&isVerified=${details.isVerified}` : ""}${details.type ? `&type=true` : ""}${details.status ? `&status=true` : ""}`;
41
+ return `${url}?${suffix.substring(1)}`;
42
+ }
43
+ create(details) {
44
+ return this.sendCreation(`${this.url}/transactions`, { userId: details.userId, typeId: details.typeId, statusId: details.statusId, timestamp: details.timestamp, fromDetails: details.fromDetails, toDetails: details.toDetails, isVerified: details.isVerified }, details.config);
45
+ }
46
+ createMany(details) {
47
+ return this.sendCreationMany(`${this.url}/transactions`, details.values ?? [], details.config);
48
+ }
49
+ modify(transaction) {
50
+ return this.sendModification(`${this.url}/transactions/${transaction.transactionId}`, { userId: transaction.userId, typeId: transaction.typeId, statusId: transaction.statusId, timestamp: transaction.timestamp, fromDetails: transaction.fromDetails, toDetails: transaction.toDetails, isVerified: transaction.isVerified }, transaction.config);
51
+ }
52
+ destroy(transaction) {
53
+ return this.sendDestruction(`${this.url}/transactions/${transaction.transactionId}`, transaction.config);
54
+ }
55
+ }
56
+ exports.TransactionManager = TransactionManager;
57
57
  //# sourceMappingURL=TransactionManager.js.map
@@ -1,32 +1,32 @@
1
- import { CrudServiceManager, StandardIdRequestDefinition } from "itrm-tools";
2
- import { AxiosRequestConfig } from "axios";
3
- export interface IType {
4
- typeId?: number;
5
- type?: string;
6
- details?: Record<string, Record<string, any> | string>;
7
- updatedAt?: string;
8
- createdAt?: string;
9
- config?: AxiosRequestConfig;
10
- }
11
- export interface ITypeSearchDetails {
12
- id?: string | number;
13
- type?: string;
14
- details?: any;
15
- values?: IType[];
16
- limit?: number;
17
- offset?: number;
18
- config?: AxiosRequestConfig;
19
- }
20
- export declare class TypeManager extends CrudServiceManager<ITypeSearchDetails, IType> {
21
- private readonly url;
22
- constructor(url: string);
23
- find(details: ITypeSearchDetails): Promise<IType | undefined>;
24
- findById(details: StandardIdRequestDefinition): Promise<IType | undefined>;
25
- count(details: ITypeSearchDetails): Promise<number>;
26
- findAll(details: ITypeSearchDetails): Promise<IType[] | undefined>;
27
- private buildRequestUrl;
28
- create(details: ITypeSearchDetails): Promise<IType | undefined>;
29
- createMany(details: ITypeSearchDetails): Promise<IType[] | undefined>;
30
- modify(type: IType): Promise<IType | undefined>;
31
- destroy(type: IType): Promise<void | number>;
32
- }
1
+ import { CrudServiceManager, StandardIdRequestDefinition } from "itrm-tools";
2
+ import { AxiosRequestConfig } from "axios";
3
+ export interface IType {
4
+ typeId?: number;
5
+ type?: string;
6
+ details?: Record<string, Record<string, any> | string>;
7
+ updatedAt?: string;
8
+ createdAt?: string;
9
+ config?: AxiosRequestConfig;
10
+ }
11
+ export interface ITypeSearchDetails {
12
+ id?: string | number;
13
+ type?: string;
14
+ details?: any;
15
+ values?: IType[];
16
+ limit?: number;
17
+ offset?: number;
18
+ config?: AxiosRequestConfig;
19
+ }
20
+ export declare class TypeManager extends CrudServiceManager<ITypeSearchDetails, IType> {
21
+ private readonly url;
22
+ constructor(url: string);
23
+ find(details: ITypeSearchDetails): Promise<IType | undefined>;
24
+ findById(details: StandardIdRequestDefinition): Promise<IType | undefined>;
25
+ count(details: ITypeSearchDetails): Promise<number>;
26
+ findAll(details: ITypeSearchDetails): Promise<IType[] | undefined>;
27
+ private buildRequestUrl;
28
+ create(details: ITypeSearchDetails): Promise<IType | undefined>;
29
+ createMany(details: ITypeSearchDetails): Promise<IType[] | undefined>;
30
+ modify(type: IType): Promise<IType | undefined>;
31
+ destroy(type: IType): Promise<void | number>;
32
+ }