@zorionapp/gg-toolkit 4.71.1 → 4.80.2

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 (43) hide show
  1. package/README.md +1 -1
  2. package/dto/index.d.ts +1 -0
  3. package/dto/index.js +1 -0
  4. package/dto/index.js.map +1 -1
  5. package/dto/merchant-preferences.dto.d.ts +3 -0
  6. package/dto/merchant-preferences.dto.js +24 -0
  7. package/dto/merchant-preferences.dto.js.map +1 -0
  8. package/dto/merchant.dto.d.ts +4 -2
  9. package/dto/merchant.dto.js +13 -5
  10. package/dto/merchant.dto.js.map +1 -1
  11. package/dto/payment-method.dto.d.ts +28 -0
  12. package/dto/payment-method.dto.js +187 -0
  13. package/dto/payment-method.dto.js.map +1 -0
  14. package/models/operation-entity.d.ts +24 -0
  15. package/models/operation-entity.js +126 -0
  16. package/models/operation-entity.js.map +1 -0
  17. package/models/payment-method-entity.d.ts +25 -0
  18. package/models/payment-method-entity.js +91 -0
  19. package/models/payment-method-entity.js.map +1 -0
  20. package/models/transfer-entity.d.ts +22 -0
  21. package/models/transfer-entity.js +121 -0
  22. package/models/transfer-entity.js.map +1 -0
  23. package/nominal-type/money/money.ntype.d.ts +1 -1
  24. package/nominal-type/money/money.ntype.js +5 -2
  25. package/nominal-type/money/money.ntype.js.map +1 -1
  26. package/nominal-type/mop/mop-type.map.js +23 -0
  27. package/nominal-type/mop/mop-type.map.js.map +1 -1
  28. package/package.json +1 -1
  29. package/transformer/index.d.ts +1 -0
  30. package/transformer/index.js +1 -0
  31. package/transformer/index.js.map +1 -1
  32. package/transformer/wallet-id-typeorm.transformer.d.ts +5 -0
  33. package/transformer/wallet-id-typeorm.transformer.js +21 -0
  34. package/transformer/wallet-id-typeorm.transformer.js.map +1 -0
  35. package/util/index.d.ts +2 -0
  36. package/util/index.js +2 -0
  37. package/util/index.js.map +1 -1
  38. package/util/operation-utils.d.ts +5 -0
  39. package/util/operation-utils.js +13 -0
  40. package/util/operation-utils.js.map +1 -0
  41. package/util/payment-request-utils.d.ts +163 -0
  42. package/util/payment-request-utils.js +168 -0
  43. package/util/payment-request-utils.js.map +1 -0
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # gg-toolkit
2
2
 
3
- This library was generated with [Nx](https://nx.dev)
3
+ This library was generated with [Nx](https://nx.dev).
4
4
 
5
5
  ## Building
6
6
 
package/dto/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from './lock.dto';
2
2
  export * from './merchant.dto';
3
+ export * from './merchant-preferences.dto';
3
4
  export * from './meta.dto';
4
5
  export * from './pagination.dto';
5
6
  export * from './user.dto';
package/dto/index.js CHANGED
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./lock.dto"), exports);
5
5
  tslib_1.__exportStar(require("./merchant.dto"), exports);
6
+ tslib_1.__exportStar(require("./merchant-preferences.dto"), exports);
6
7
  tslib_1.__exportStar(require("./meta.dto"), exports);
7
8
  tslib_1.__exportStar(require("./pagination.dto"), exports);
8
9
  tslib_1.__exportStar(require("./user.dto"), exports);
package/dto/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/gg-toolkit/dto/index.ts"],"names":[],"mappings":";;;AAAA,qDAA2B;AAC3B,yDAA+B;AAC/B,qDAA2B;AAC3B,2DAAiC;AACjC,qDAA2B;AAC3B,uDAA6B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/gg-toolkit/dto/index.ts"],"names":[],"mappings":";;;AAAA,qDAA2B;AAC3B,yDAA+B;AAC/B,qEAA2C;AAC3C,qDAA2B;AAC3B,2DAAiC;AACjC,qDAA2B;AAC3B,uDAA6B"}
@@ -0,0 +1,3 @@
1
+ export declare class MerchantPreferencesDto {
2
+ payoutOptionalOTP: boolean;
3
+ }
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MerchantPreferencesDto = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const class_transformer_1 = require("class-transformer");
6
+ const swagger_1 = require("@nestjs/swagger");
7
+ const class_validator_1 = require("class-validator");
8
+ let MerchantPreferencesDto = class MerchantPreferencesDto {
9
+ constructor() {
10
+ this.payoutOptionalOTP = false;
11
+ }
12
+ };
13
+ exports.MerchantPreferencesDto = MerchantPreferencesDto;
14
+ tslib_1.__decorate([
15
+ (0, swagger_1.ApiProperty)(),
16
+ (0, class_validator_1.IsBoolean)(),
17
+ (0, class_validator_1.IsOptional)(),
18
+ (0, class_transformer_1.Expose)(),
19
+ tslib_1.__metadata("design:type", Object)
20
+ ], MerchantPreferencesDto.prototype, "payoutOptionalOTP", void 0);
21
+ exports.MerchantPreferencesDto = MerchantPreferencesDto = tslib_1.__decorate([
22
+ (0, class_transformer_1.Exclude)()
23
+ ], MerchantPreferencesDto);
24
+ //# sourceMappingURL=merchant-preferences.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"merchant-preferences.dto.js","sourceRoot":"","sources":["../../../../libs/gg-toolkit/dto/merchant-preferences.dto.ts"],"names":[],"mappings":";;;;AAAA,yDAAoD;AACpD,6CAA8C;AAC9C,qDAAwD;AAGjD,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAA5B;QAKE,sBAAiB,GAAG,KAAK,CAAC;IACnC,CAAC;CAAA,CAAA;AANY,wDAAsB;AAK1B;IAJN,IAAA,qBAAW,GAAE;IACb,IAAA,2BAAS,GAAE;IACX,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAM,GAAE;;iEACwB;iCALtB,sBAAsB;IADlC,IAAA,2BAAO,GAAE;GACG,sBAAsB,CAMlC"}
@@ -1,5 +1,6 @@
1
- import { WalletDto } from '@zorionapp/gg-toolkit/dto';
2
- import { Merchant } from '@zorionapp/gg-toolkit/enum';
1
+ import { WalletDto } from './wallet.dto';
2
+ import { Merchant } from '../enum/merchant.enums';
3
+ import { MerchantPreferencesDto } from './merchant-preferences.dto';
3
4
  export declare class MerchantDto {
4
5
  id: string;
5
6
  wallet: WalletDto;
@@ -10,6 +11,7 @@ export declare class MerchantDto {
10
11
  compliant: boolean;
11
12
  state: Merchant.State;
12
13
  mcc: number;
14
+ preferences: MerchantPreferencesDto;
13
15
  allowedIps: string[];
14
16
  createdAt: Date;
15
17
  updatedAt: Date;
@@ -2,12 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MerchantDto = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const dto_1 = require("@zorionapp/gg-toolkit/dto");
6
- const enum_1 = require("@zorionapp/gg-toolkit/enum");
7
- const validator_1 = require("@zorionapp/gg-toolkit/validator");
5
+ const wallet_dto_1 = require("./wallet.dto");
6
+ const merchant_enums_1 = require("../enum/merchant.enums");
7
+ const is_valid_enum_validator_1 = require("../validator/is-valid-enum.validator");
8
8
  const swagger_1 = require("@nestjs/swagger");
9
9
  const class_transformer_1 = require("class-transformer");
10
10
  const class_validator_1 = require("class-validator");
11
+ const merchant_preferences_dto_1 = require("./merchant-preferences.dto");
11
12
  let MerchantDto = class MerchantDto {
12
13
  constructor() {
13
14
  this.id = null;
@@ -19,6 +20,7 @@ let MerchantDto = class MerchantDto {
19
20
  this.compliant = null;
20
21
  this.state = null;
21
22
  this.mcc = null;
23
+ this.preferences = null;
22
24
  this.allowedIps = [];
23
25
  this.createdAt = null;
24
26
  this.updatedAt = null;
@@ -35,7 +37,7 @@ tslib_1.__decorate([
35
37
  tslib_1.__decorate([
36
38
  (0, swagger_1.ApiProperty)(),
37
39
  (0, class_transformer_1.Expose)(),
38
- tslib_1.__metadata("design:type", dto_1.WalletDto)
40
+ tslib_1.__metadata("design:type", wallet_dto_1.WalletDto)
39
41
  ], MerchantDto.prototype, "wallet", void 0);
40
42
  tslib_1.__decorate([
41
43
  (0, swagger_1.ApiProperty)(),
@@ -74,7 +76,7 @@ tslib_1.__decorate([
74
76
  ], MerchantDto.prototype, "compliant", void 0);
75
77
  tslib_1.__decorate([
76
78
  (0, swagger_1.ApiProperty)(),
77
- (0, validator_1.IsValidEnum)(enum_1.Merchant.State),
79
+ (0, is_valid_enum_validator_1.IsValidEnum)(merchant_enums_1.Merchant.State),
78
80
  (0, class_validator_1.IsNotEmpty)(),
79
81
  (0, class_transformer_1.Expose)(),
80
82
  tslib_1.__metadata("design:type", String)
@@ -86,6 +88,12 @@ tslib_1.__decorate([
86
88
  (0, class_transformer_1.Expose)(),
87
89
  tslib_1.__metadata("design:type", Number)
88
90
  ], MerchantDto.prototype, "mcc", void 0);
91
+ tslib_1.__decorate([
92
+ (0, swagger_1.ApiProperty)({ type: () => merchant_preferences_dto_1.MerchantPreferencesDto }),
93
+ (0, class_transformer_1.Expose)(),
94
+ (0, class_transformer_1.Type)(() => merchant_preferences_dto_1.MerchantPreferencesDto),
95
+ tslib_1.__metadata("design:type", merchant_preferences_dto_1.MerchantPreferencesDto)
96
+ ], MerchantDto.prototype, "preferences", void 0);
89
97
  tslib_1.__decorate([
90
98
  (0, swagger_1.ApiProperty)(),
91
99
  (0, class_validator_1.IsArray)({ each: true }),
@@ -1 +1 @@
1
- {"version":3,"file":"merchant.dto.js","sourceRoot":"","sources":["../../../../libs/gg-toolkit/dto/merchant.dto.ts"],"names":[],"mappings":";;;;AAAA,mDAAsD;AACtD,qDAAsD;AACtD,+DAA8D;AAC9D,6CAA8C;AAC9C,yDAAoD;AACpD,qDAAyG;AAGlG,IAAM,WAAW,GAAjB,MAAM,WAAW;IAAjB;QAKE,OAAE,GAAW,IAAI,CAAC;QAIlB,WAAM,GAAc,IAAI,CAAC;QAMzB,SAAI,GAAW,IAAI,CAAC;QAMpB,SAAI,GAAW,IAAI,CAAC;QAMpB,UAAK,GAAkB,IAAI,CAAC;QAM5B,UAAK,GAAkB,IAAI,CAAC;QAM5B,cAAS,GAAY,IAAI,CAAC;QAM1B,UAAK,GAAmB,IAAI,CAAC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AAG,EAAE,CAAC,iDAAsB,EAAE,CAAC;IACnD,IAAA,0BAAM,GAAE;IACR,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,iDAAsB,CAAC;sCACf,iDAAsB;gDAAQ;AAM3C;IAJN,IAAA,qBAAW,GAAE;IACb,IAAA,yBAAO,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IACvB,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAM,GAAE;;+CACwB;AAM1B;IAJN,IAAA,qBAAW,GAAE;IACb,IAAA,wBAAM,GAAE;IACR,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAM,GAAE;sCACS,IAAI;8CAAQ;AAMvB;IAJN,IAAA,qBAAW,GAAE;IACb,IAAA,wBAAM,GAAE;IACR,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAM,GAAE;sCACS,IAAI;8CAAQ;sBA1EnB,WAAW;IADvB,IAAA,2BAAO,GAAE;GACG,WAAW,CA2EvB"}
@@ -0,0 +1,28 @@
1
+ import { Payment } from '../enum/payment.enums';
2
+ import { Mop } from '../nominal-type/mop/mop.ntype';
3
+ import { Currency } from '../nominal-type/currency/currency.ntype';
4
+ export declare class PaymentMethodDto {
5
+ id: string;
6
+ name: string;
7
+ mask: string | null;
8
+ value: string;
9
+ methodType: Payment.MethodType;
10
+ userId: string;
11
+ status: string;
12
+ scope: string;
13
+ activePurchase: boolean;
14
+ activeCredit: boolean;
15
+ mop: Mop | null;
16
+ email: string | null;
17
+ phoneNumber: string | null;
18
+ address: string | null;
19
+ customerName: string | null;
20
+ code: string | null;
21
+ issuerBank: string | null;
22
+ issuerCountry: string | null;
23
+ issuerCardType: string | null;
24
+ issuerExpiresAt: Date | null;
25
+ currency: Currency | null;
26
+ createdAt: Date;
27
+ updatedAt: Date;
28
+ }
@@ -0,0 +1,187 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PaymentMethodDto = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const node_crypto_1 = require("node:crypto");
6
+ const class_transformer_1 = require("class-transformer");
7
+ const swagger_1 = require("@nestjs/swagger");
8
+ const class_validator_1 = require("class-validator");
9
+ const is_valid_enum_validator_1 = require("../validator/is-valid-enum.validator");
10
+ const payment_enums_1 = require("../enum/payment.enums");
11
+ const mop_ntype_1 = require("../nominal-type/mop/mop.ntype");
12
+ const currency_ntype_1 = require("../nominal-type/currency/currency.ntype");
13
+ let PaymentMethodDto = class PaymentMethodDto {
14
+ constructor() {
15
+ this.id = (0, node_crypto_1.randomUUID)();
16
+ this.mask = null;
17
+ this.activePurchase = false;
18
+ this.activeCredit = false;
19
+ this.mop = null;
20
+ this.email = null;
21
+ this.phoneNumber = null;
22
+ this.address = null;
23
+ this.customerName = null;
24
+ this.code = null;
25
+ this.issuerBank = null;
26
+ this.issuerCountry = null;
27
+ this.issuerCardType = null;
28
+ this.issuerExpiresAt = null;
29
+ this.currency = null;
30
+ this.createdAt = new Date();
31
+ this.updatedAt = new Date();
32
+ }
33
+ };
34
+ exports.PaymentMethodDto = PaymentMethodDto;
35
+ tslib_1.__decorate([
36
+ (0, swagger_1.ApiProperty)(),
37
+ (0, class_validator_1.IsString)(),
38
+ (0, class_validator_1.IsNotEmpty)(),
39
+ (0, class_transformer_1.Expose)(),
40
+ tslib_1.__metadata("design:type", String)
41
+ ], PaymentMethodDto.prototype, "id", void 0);
42
+ tslib_1.__decorate([
43
+ (0, swagger_1.ApiProperty)(),
44
+ (0, class_validator_1.IsString)(),
45
+ (0, class_validator_1.IsNotEmpty)(),
46
+ (0, class_transformer_1.Expose)(),
47
+ tslib_1.__metadata("design:type", String)
48
+ ], PaymentMethodDto.prototype, "name", void 0);
49
+ tslib_1.__decorate([
50
+ (0, swagger_1.ApiProperty)({ type: 'string', nullable: true }),
51
+ (0, class_validator_1.IsOptional)(),
52
+ (0, class_validator_1.IsString)(),
53
+ (0, class_transformer_1.Expose)(),
54
+ tslib_1.__metadata("design:type", String)
55
+ ], PaymentMethodDto.prototype, "mask", void 0);
56
+ tslib_1.__decorate([
57
+ (0, swagger_1.ApiProperty)(),
58
+ (0, class_validator_1.IsString)(),
59
+ (0, class_validator_1.IsNotEmpty)(),
60
+ (0, class_transformer_1.Expose)(),
61
+ tslib_1.__metadata("design:type", String)
62
+ ], PaymentMethodDto.prototype, "value", void 0);
63
+ tslib_1.__decorate([
64
+ (0, swagger_1.ApiProperty)(),
65
+ (0, is_valid_enum_validator_1.IsValidEnum)(payment_enums_1.Payment.MethodType),
66
+ (0, class_validator_1.IsNotEmpty)(),
67
+ (0, class_transformer_1.Expose)(),
68
+ tslib_1.__metadata("design:type", String)
69
+ ], PaymentMethodDto.prototype, "methodType", void 0);
70
+ tslib_1.__decorate([
71
+ (0, swagger_1.ApiProperty)(),
72
+ (0, class_validator_1.IsString)(),
73
+ (0, class_validator_1.IsNotEmpty)(),
74
+ (0, class_transformer_1.Expose)(),
75
+ tslib_1.__metadata("design:type", String)
76
+ ], PaymentMethodDto.prototype, "userId", void 0);
77
+ tslib_1.__decorate([
78
+ (0, swagger_1.ApiProperty)(),
79
+ (0, class_validator_1.IsString)(),
80
+ (0, class_validator_1.IsNotEmpty)(),
81
+ (0, class_transformer_1.Expose)(),
82
+ tslib_1.__metadata("design:type", String)
83
+ ], PaymentMethodDto.prototype, "status", void 0);
84
+ tslib_1.__decorate([
85
+ (0, swagger_1.ApiProperty)(),
86
+ (0, class_validator_1.IsString)(),
87
+ (0, class_validator_1.IsNotEmpty)(),
88
+ (0, class_transformer_1.Expose)(),
89
+ tslib_1.__metadata("design:type", String)
90
+ ], PaymentMethodDto.prototype, "scope", void 0);
91
+ tslib_1.__decorate([
92
+ (0, swagger_1.ApiProperty)(),
93
+ (0, class_validator_1.IsBoolean)(),
94
+ (0, class_transformer_1.Expose)(),
95
+ tslib_1.__metadata("design:type", Object)
96
+ ], PaymentMethodDto.prototype, "activePurchase", void 0);
97
+ tslib_1.__decorate([
98
+ (0, swagger_1.ApiProperty)(),
99
+ (0, class_validator_1.IsBoolean)(),
100
+ (0, class_transformer_1.Expose)(),
101
+ tslib_1.__metadata("design:type", Object)
102
+ ], PaymentMethodDto.prototype, "activeCredit", void 0);
103
+ tslib_1.__decorate([
104
+ (0, swagger_1.ApiProperty)(),
105
+ (0, class_transformer_1.Expose)(),
106
+ mop_ntype_1.Mop.getResourceDecorators(),
107
+ tslib_1.__metadata("design:type", mop_ntype_1.Mop)
108
+ ], PaymentMethodDto.prototype, "mop", void 0);
109
+ tslib_1.__decorate([
110
+ (0, swagger_1.ApiProperty)({ type: 'string', nullable: true }),
111
+ (0, class_validator_1.IsEmail)(),
112
+ (0, class_transformer_1.Expose)(),
113
+ tslib_1.__metadata("design:type", String)
114
+ ], PaymentMethodDto.prototype, "email", void 0);
115
+ tslib_1.__decorate([
116
+ (0, swagger_1.ApiProperty)({ type: 'string', nullable: true }),
117
+ (0, class_validator_1.IsString)(),
118
+ (0, class_transformer_1.Expose)(),
119
+ tslib_1.__metadata("design:type", String)
120
+ ], PaymentMethodDto.prototype, "phoneNumber", void 0);
121
+ tslib_1.__decorate([
122
+ (0, swagger_1.ApiProperty)({ type: 'string', nullable: true }),
123
+ (0, class_validator_1.IsString)(),
124
+ (0, class_transformer_1.Expose)(),
125
+ tslib_1.__metadata("design:type", String)
126
+ ], PaymentMethodDto.prototype, "address", void 0);
127
+ tslib_1.__decorate([
128
+ (0, swagger_1.ApiProperty)({ type: 'string', nullable: true }),
129
+ (0, class_validator_1.IsString)(),
130
+ (0, class_transformer_1.Expose)(),
131
+ tslib_1.__metadata("design:type", String)
132
+ ], PaymentMethodDto.prototype, "customerName", void 0);
133
+ tslib_1.__decorate([
134
+ (0, swagger_1.ApiProperty)({ type: 'string', nullable: true }),
135
+ (0, class_validator_1.IsString)(),
136
+ (0, class_transformer_1.Expose)(),
137
+ tslib_1.__metadata("design:type", String)
138
+ ], PaymentMethodDto.prototype, "code", void 0);
139
+ tslib_1.__decorate([
140
+ (0, swagger_1.ApiProperty)({ type: 'string', nullable: true }),
141
+ (0, class_validator_1.IsString)(),
142
+ (0, class_transformer_1.Expose)(),
143
+ tslib_1.__metadata("design:type", String)
144
+ ], PaymentMethodDto.prototype, "issuerBank", void 0);
145
+ tslib_1.__decorate([
146
+ (0, swagger_1.ApiProperty)({ type: 'string', nullable: true }),
147
+ (0, class_validator_1.IsString)(),
148
+ (0, class_transformer_1.Expose)(),
149
+ tslib_1.__metadata("design:type", String)
150
+ ], PaymentMethodDto.prototype, "issuerCountry", void 0);
151
+ tslib_1.__decorate([
152
+ (0, swagger_1.ApiProperty)({ type: 'string', nullable: true }),
153
+ (0, class_validator_1.IsString)(),
154
+ (0, class_transformer_1.Expose)(),
155
+ tslib_1.__metadata("design:type", String)
156
+ ], PaymentMethodDto.prototype, "issuerCardType", void 0);
157
+ tslib_1.__decorate([
158
+ (0, swagger_1.ApiProperty)(),
159
+ (0, class_validator_1.IsDate)(),
160
+ (0, class_validator_1.IsNotEmpty)(),
161
+ (0, class_transformer_1.Expose)(),
162
+ tslib_1.__metadata("design:type", Date)
163
+ ], PaymentMethodDto.prototype, "issuerExpiresAt", void 0);
164
+ tslib_1.__decorate([
165
+ (0, swagger_1.ApiProperty)(),
166
+ currency_ntype_1.Currency.getResourceDecorators(),
167
+ (0, class_transformer_1.Expose)(),
168
+ tslib_1.__metadata("design:type", currency_ntype_1.Currency)
169
+ ], PaymentMethodDto.prototype, "currency", void 0);
170
+ tslib_1.__decorate([
171
+ (0, swagger_1.ApiProperty)(),
172
+ (0, class_validator_1.IsDate)(),
173
+ (0, class_validator_1.IsNotEmpty)(),
174
+ (0, class_transformer_1.Expose)(),
175
+ tslib_1.__metadata("design:type", Date)
176
+ ], PaymentMethodDto.prototype, "createdAt", void 0);
177
+ tslib_1.__decorate([
178
+ (0, swagger_1.ApiProperty)(),
179
+ (0, class_validator_1.IsDate)(),
180
+ (0, class_validator_1.IsNotEmpty)(),
181
+ (0, class_transformer_1.Expose)(),
182
+ tslib_1.__metadata("design:type", Date)
183
+ ], PaymentMethodDto.prototype, "updatedAt", void 0);
184
+ exports.PaymentMethodDto = PaymentMethodDto = tslib_1.__decorate([
185
+ (0, class_transformer_1.Exclude)()
186
+ ], PaymentMethodDto);
187
+ //# sourceMappingURL=payment-method.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payment-method.dto.js","sourceRoot":"","sources":["../../../../libs/gg-toolkit/dto/payment-method.dto.ts"],"names":[],"mappings":";;;;AAAA,6CAA+C;AAC/C,yDAAoD;AACpD,6CAA8C;AAC9C,qDAA+F;AAC/F,kFAAmE;AACnE,yDAAgD;AAChD,6DAAoD;AACpD,4EAAmE;AAG5D,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAAtB;QAKE,OAAE,GAAW,IAAA,wBAAE,GAAE,CAAC;QAYlB,SAAI,GAAkB,IAAI,CAAC;QAmC3B,mBAAc,GAAG,KAAK,CAAC;QAKvB,iBAAY,GAAG,KAAK,CAAC;QAKrB,QAAG,GAAe,IAAI,CAAC;QAKvB,UAAK,GAAkB,IAAI,CAAC;QAK5B,gBAAW,GAAkB,IAAI,CAAC;QAKlC,YAAO,GAAkB,IAAI,CAAC;QAK9B,iBAAY,GAAkB,IAAI,CAAC;QAKnC,SAAI,GAAkB,IAAI,CAAC;QAK3B,eAAU,GAAkB,IAAI,CAAC;QAKjC,kBAAa,GAAkB,IAAI,CAAC;QAKpC,mBAAc,GAAkB,IAAI,CAAC;QAMrC,oBAAe,GAAgB,IAAI,CAAC;QAKpC,aAAQ,GAAoB,IAAI,CAAC;QAMjC,cAAS,GAAS,IAAI,IAAI,EAAE,CAAC;QAM7B,cAAS,GAAS,IAAI,IAAI,EAAE,CAAC;IACtC,CAAC;CAAA,CAAA;AA9HY,4CAAgB;AAKpB;IAJN,IAAA,qBAAW,GAAE;IACb,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAM,GAAE;;4CACgB;AAMlB;IAJN,IAAA,qBAAW,GAAE;IACb,IAAA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IAAA,0BAAM,GAAE;sCACe,IAAI;yDAAe;AAKpC;IAHN,IAAA,qBAAW,GAAE;IACb,yBAAQ,CAAC,qBAAqB,EAAE;IAChC,IAAA,0BAAM,GAAE;sCACQ,yBAAQ;kDAAe;AAMjC;IAJN,IAAA,qBAAW,GAAE;IACb,IAAA,wBAAM,GAAE;IACR,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAM,GAAE;sCACS,IAAI;mDAAc;AAM7B;IAJN,IAAA,qBAAW,GAAE;IACb,IAAA,wBAAM,GAAE;IACR,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAM,GAAE;sCACS,IAAI;mDAAc;2BA7HzB,gBAAgB;IAD5B,IAAA,2BAAO,GAAE;GACG,gBAAgB,CA8H5B"}
@@ -0,0 +1,24 @@
1
+ import { Collection } from '@mikro-orm/core';
2
+ import { AbstractEntity } from './abstract-entity';
3
+ import { Money, OperationId, WalletId } from '../nominal-type';
4
+ import { Operation, Currency as CurrencyNS } from '../enum';
5
+ import { TransferEntity } from './transfer-entity';
6
+ export declare class OperationEntity extends AbstractEntity {
7
+ operationId: OperationId;
8
+ operationType: Operation.Type;
9
+ status: Operation.Status;
10
+ sourceFee: Money;
11
+ destinationFee: Money;
12
+ exchangeRate: Money;
13
+ comment?: string | null;
14
+ description?: string | null;
15
+ settledAt?: Date | null;
16
+ sourceAmount: Money;
17
+ destinationAmount: Money;
18
+ sourceCurrency: CurrencyNS.Name;
19
+ destinationCurrency: CurrencyNS.Name;
20
+ externalId?: string | null;
21
+ sourceWalletId: WalletId;
22
+ destinationWalletId: WalletId;
23
+ transfers: Collection<TransferEntity, object>;
24
+ }
@@ -0,0 +1,126 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OperationEntity = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const core_1 = require("@mikro-orm/core");
6
+ const abstract_entity_1 = require("./abstract-entity");
7
+ const nominal_type_1 = require("../nominal-type");
8
+ const enum_1 = require("../enum");
9
+ const transfer_entity_1 = require("./transfer-entity");
10
+ let OperationEntity = class OperationEntity extends abstract_entity_1.AbstractEntity {
11
+ constructor() {
12
+ super(...arguments);
13
+ this.operationType = enum_1.Operation.Type.Transfer;
14
+ this.status = enum_1.Operation.Status.Created;
15
+ this.sourceFee = new nominal_type_1.Money({ amount: '0' });
16
+ this.destinationFee = new nominal_type_1.Money({ amount: '0' });
17
+ this.exchangeRate = new nominal_type_1.Money({ amount: '1' });
18
+ this.comment = null;
19
+ this.description = null;
20
+ this.settledAt = null;
21
+ this.sourceCurrency = enum_1.Currency.Name.DEFAULT;
22
+ this.destinationCurrency = enum_1.Currency.Name.DEFAULT;
23
+ this.externalId = null;
24
+ this.transfers = new core_1.Collection(this);
25
+ }
26
+ };
27
+ exports.OperationEntity = OperationEntity;
28
+ tslib_1.__decorate([
29
+ (0, core_1.Property)({
30
+ name: 'operation_id',
31
+ nullable: false,
32
+ }),
33
+ tslib_1.__metadata("design:type", nominal_type_1.OperationId)
34
+ ], OperationEntity.prototype, "operationId", void 0);
35
+ tslib_1.__decorate([
36
+ (0, core_1.Enum)({
37
+ name: 'operation_type',
38
+ items: () => enum_1.Operation.Type,
39
+ nullable: false,
40
+ type: core_1.EnumType,
41
+ default: enum_1.Operation.Type.Transfer,
42
+ }),
43
+ tslib_1.__metadata("design:type", String)
44
+ ], OperationEntity.prototype, "operationType", void 0);
45
+ tslib_1.__decorate([
46
+ (0, core_1.Enum)({
47
+ name: 'operation_status',
48
+ items: () => enum_1.Operation.Status,
49
+ nullable: false,
50
+ type: core_1.EnumType,
51
+ default: enum_1.Operation.Status.Created,
52
+ }),
53
+ tslib_1.__metadata("design:type", String)
54
+ ], OperationEntity.prototype, "status", void 0);
55
+ tslib_1.__decorate([
56
+ (0, core_1.Property)({ name: 'source_fee', nullable: false }),
57
+ tslib_1.__metadata("design:type", nominal_type_1.Money)
58
+ ], OperationEntity.prototype, "sourceFee", void 0);
59
+ tslib_1.__decorate([
60
+ (0, core_1.Property)({ name: 'destination_fee', nullable: false }),
61
+ tslib_1.__metadata("design:type", nominal_type_1.Money)
62
+ ], OperationEntity.prototype, "destinationFee", void 0);
63
+ tslib_1.__decorate([
64
+ (0, core_1.Property)({ name: 'exchange_rate', nullable: false }),
65
+ tslib_1.__metadata("design:type", nominal_type_1.Money)
66
+ ], OperationEntity.prototype, "exchangeRate", void 0);
67
+ tslib_1.__decorate([
68
+ (0, core_1.Property)({ name: 'comment', nullable: true }),
69
+ tslib_1.__metadata("design:type", String)
70
+ ], OperationEntity.prototype, "comment", void 0);
71
+ tslib_1.__decorate([
72
+ (0, core_1.Property)({ name: 'description', nullable: true }),
73
+ tslib_1.__metadata("design:type", String)
74
+ ], OperationEntity.prototype, "description", void 0);
75
+ tslib_1.__decorate([
76
+ (0, core_1.Property)({ name: 'settled_at', nullable: true, type: 'timestamptz' }),
77
+ tslib_1.__metadata("design:type", Date)
78
+ ], OperationEntity.prototype, "settledAt", void 0);
79
+ tslib_1.__decorate([
80
+ (0, core_1.Property)({ name: 'source_amount', nullable: false }),
81
+ tslib_1.__metadata("design:type", nominal_type_1.Money)
82
+ ], OperationEntity.prototype, "sourceAmount", void 0);
83
+ tslib_1.__decorate([
84
+ (0, core_1.Property)({ name: 'destination_amount', nullable: false }),
85
+ tslib_1.__metadata("design:type", nominal_type_1.Money)
86
+ ], OperationEntity.prototype, "destinationAmount", void 0);
87
+ tslib_1.__decorate([
88
+ (0, core_1.Enum)({
89
+ name: 'source_currency',
90
+ items: () => enum_1.Currency.Name,
91
+ nullable: false,
92
+ type: core_1.EnumType,
93
+ default: enum_1.Currency.Name.DEFAULT,
94
+ }),
95
+ tslib_1.__metadata("design:type", String)
96
+ ], OperationEntity.prototype, "sourceCurrency", void 0);
97
+ tslib_1.__decorate([
98
+ (0, core_1.Enum)({
99
+ name: 'destination_currency',
100
+ items: () => enum_1.Currency.Name,
101
+ nullable: false,
102
+ type: core_1.EnumType,
103
+ default: enum_1.Currency.Name.DEFAULT,
104
+ }),
105
+ tslib_1.__metadata("design:type", String)
106
+ ], OperationEntity.prototype, "destinationCurrency", void 0);
107
+ tslib_1.__decorate([
108
+ (0, core_1.Property)({ name: 'external_id', nullable: true, type: 'varchar(255)' }),
109
+ tslib_1.__metadata("design:type", String)
110
+ ], OperationEntity.prototype, "externalId", void 0);
111
+ tslib_1.__decorate([
112
+ (0, core_1.Property)({ name: 'source_wallet_id' }),
113
+ tslib_1.__metadata("design:type", nominal_type_1.WalletId)
114
+ ], OperationEntity.prototype, "sourceWalletId", void 0);
115
+ tslib_1.__decorate([
116
+ (0, core_1.Property)({ name: 'destination_wallet_id' }),
117
+ tslib_1.__metadata("design:type", nominal_type_1.WalletId)
118
+ ], OperationEntity.prototype, "destinationWalletId", void 0);
119
+ tslib_1.__decorate([
120
+ (0, core_1.OneToMany)({ entity: () => transfer_entity_1.TransferEntity, mappedBy: (o) => o.operation, referenceColumnName: 'operation_id' }),
121
+ tslib_1.__metadata("design:type", Object)
122
+ ], OperationEntity.prototype, "transfers", void 0);
123
+ exports.OperationEntity = OperationEntity = tslib_1.__decorate([
124
+ (0, core_1.Entity)()
125
+ ], OperationEntity);
126
+ //# sourceMappingURL=operation-entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operation-entity.js","sourceRoot":"","sources":["../../../../libs/gg-toolkit/models/operation-entity.ts"],"names":[],"mappings":";;;;AAAA,0CAA0F;AAC1F,uDAAmD;AACnD,kDAA+D;AAC/D,kCAA4D;AAC5D,uDAAmD;AAG5C,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,gCAAc;IAA5C;;QAcE,kBAAa,GAAmB,gBAAS,CAAC,IAAI,CAAC,QAAQ,CAAC;QASxD,WAAM,GAAqB,gBAAS,CAAC,MAAM,CAAC,OAAO,CAAC;QAGpD,cAAS,GAAU,IAAI,oBAAK,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;QAG9C,mBAAc,GAAU,IAAI,oBAAK,CAAC,EAAE,MAAM,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Aa,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;;mDAC/B;AAGlC;IADN,IAAA,eAAQ,EAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC;sCAChB,uBAAQ;uDAAC;AAGzB;IADN,IAAA,eAAQ,EAAC,EAAE,IAAI,EAAE,uBAAuB,EAAE,CAAC;sCAChB,uBAAQ;4DAAC;AAG9B;IADN,IAAA,gBAAS,EAAC,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,gCAAc,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,mBAAmB,EAAE,cAAc,EAAE,CAAC;;kDACvD;0BA7E7C,eAAe;IAD3B,IAAA,aAAM,GAAE;GACI,eAAe,CA8E3B"}
@@ -0,0 +1,25 @@
1
+ import { Payment } from '../enum';
2
+ import { Currency } from '../nominal-type';
3
+ export declare enum PaymentMethodStatus {
4
+ Active = "active",
5
+ Pending = "pending",
6
+ Deleted = "deleted"
7
+ }
8
+ export declare class PaymentMethodEntity {
9
+ id: string;
10
+ name: string;
11
+ mask: string | null;
12
+ value: string;
13
+ methodType: Payment.MethodType;
14
+ userId: string;
15
+ status: PaymentMethodStatus;
16
+ scope: 'user' | 'merchant';
17
+ email: string | null;
18
+ phoneNumber: string | null;
19
+ address: string | null;
20
+ customerName: string | null;
21
+ code: string | null;
22
+ currency: Currency | null;
23
+ createdAt: Date;
24
+ updatedAt: Date;
25
+ }
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PaymentMethodEntity = exports.PaymentMethodStatus = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const node_crypto_1 = require("node:crypto");
6
+ const core_1 = require("@mikro-orm/core");
7
+ const enum_1 = require("../enum");
8
+ const nominal_type_1 = require("../nominal-type");
9
+ var PaymentMethodStatus;
10
+ (function (PaymentMethodStatus) {
11
+ PaymentMethodStatus["Active"] = "active";
12
+ PaymentMethodStatus["Pending"] = "pending";
13
+ PaymentMethodStatus["Deleted"] = "deleted";
14
+ })(PaymentMethodStatus || (exports.PaymentMethodStatus = PaymentMethodStatus = {}));
15
+ let PaymentMethodEntity = class PaymentMethodEntity {
16
+ constructor() {
17
+ this.id = (0, node_crypto_1.randomUUID)();
18
+ this.status = PaymentMethodStatus.Pending;
19
+ this.createdAt = new Date();
20
+ this.updatedAt = new Date();
21
+ }
22
+ };
23
+ exports.PaymentMethodEntity = PaymentMethodEntity;
24
+ tslib_1.__decorate([
25
+ (0, core_1.PrimaryKey)({ type: 'uuid' }),
26
+ tslib_1.__metadata("design:type", String)
27
+ ], PaymentMethodEntity.prototype, "id", void 0);
28
+ tslib_1.__decorate([
29
+ (0, core_1.Property)(),
30
+ tslib_1.__metadata("design:type", String)
31
+ ], PaymentMethodEntity.prototype, "name", void 0);
32
+ tslib_1.__decorate([
33
+ (0, core_1.Property)({ nullable: true }),
34
+ tslib_1.__metadata("design:type", String)
35
+ ], PaymentMethodEntity.prototype, "mask", void 0);
36
+ tslib_1.__decorate([
37
+ (0, core_1.Property)(),
38
+ tslib_1.__metadata("design:type", String)
39
+ ], PaymentMethodEntity.prototype, "value", void 0);
40
+ tslib_1.__decorate([
41
+ (0, core_1.Enum)({ items: () => enum_1.Payment.MethodType, name: 'method_type', nullable: false, type: core_1.EnumType }),
42
+ tslib_1.__metadata("design:type", String)
43
+ ], PaymentMethodEntity.prototype, "methodType", void 0);
44
+ tslib_1.__decorate([
45
+ (0, core_1.Property)({ name: 'user_id' }),
46
+ tslib_1.__metadata("design:type", String)
47
+ ], PaymentMethodEntity.prototype, "userId", void 0);
48
+ tslib_1.__decorate([
49
+ (0, core_1.Enum)({ items: () => PaymentMethodStatus, nullable: false, type: core_1.EnumType }),
50
+ tslib_1.__metadata("design:type", String)
51
+ ], PaymentMethodEntity.prototype, "status", void 0);
52
+ tslib_1.__decorate([
53
+ (0, core_1.Property)(),
54
+ tslib_1.__metadata("design:type", String)
55
+ ], PaymentMethodEntity.prototype, "scope", void 0);
56
+ tslib_1.__decorate([
57
+ (0, core_1.Property)({ nullable: true }),
58
+ tslib_1.__metadata("design:type", String)
59
+ ], PaymentMethodEntity.prototype, "email", void 0);
60
+ tslib_1.__decorate([
61
+ (0, core_1.Property)({ name: 'phone_number', nullable: true }),
62
+ tslib_1.__metadata("design:type", String)
63
+ ], PaymentMethodEntity.prototype, "phoneNumber", void 0);
64
+ tslib_1.__decorate([
65
+ (0, core_1.Property)({ nullable: true }),
66
+ tslib_1.__metadata("design:type", String)
67
+ ], PaymentMethodEntity.prototype, "address", void 0);
68
+ tslib_1.__decorate([
69
+ (0, core_1.Property)({ name: 'customer_name', nullable: true }),
70
+ tslib_1.__metadata("design:type", String)
71
+ ], PaymentMethodEntity.prototype, "customerName", void 0);
72
+ tslib_1.__decorate([
73
+ (0, core_1.Property)({ nullable: true }),
74
+ tslib_1.__metadata("design:type", String)
75
+ ], PaymentMethodEntity.prototype, "code", void 0);
76
+ tslib_1.__decorate([
77
+ (0, core_1.Property)({ nullable: true }),
78
+ tslib_1.__metadata("design:type", nominal_type_1.Currency)
79
+ ], PaymentMethodEntity.prototype, "currency", void 0);
80
+ tslib_1.__decorate([
81
+ (0, core_1.Property)({ name: 'created_at', nullable: false, onCreate: () => new Date(), type: 'timestamptz' }),
82
+ tslib_1.__metadata("design:type", Date)
83
+ ], PaymentMethodEntity.prototype, "createdAt", void 0);
84
+ tslib_1.__decorate([
85
+ (0, core_1.Property)({ name: 'updated_at', nullable: false, onUpdate: () => new Date(), type: 'timestamptz' }),
86
+ tslib_1.__metadata("design:type", Date)
87
+ ], PaymentMethodEntity.prototype, "updatedAt", void 0);
88
+ exports.PaymentMethodEntity = PaymentMethodEntity = tslib_1.__decorate([
89
+ (0, core_1.Entity)()
90
+ ], PaymentMethodEntity);
91
+ //# sourceMappingURL=payment-method-entity.js.map