@fiado/type-kit 3.610.0 → 3.612.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_test_/unit/gsfConnector/gsfMessages.test.ts +233 -0
- package/_test_/unit/loanCredit/customerReadDtos.test.ts +22 -0
- package/_test_/unit/retailLoan/contract.test.ts +5 -0
- package/bin/gsfConnector/constants/GsfPatterns.d.ts +15 -0
- package/bin/gsfConnector/constants/GsfPatterns.js +18 -0
- package/bin/gsfConnector/constants/GsfPaymentOperations.d.ts +6 -0
- package/bin/gsfConnector/constants/GsfPaymentOperations.js +16 -0
- package/bin/gsfConnector/dtos/GsfAddress.d.ts +13 -0
- package/bin/gsfConnector/dtos/GsfAddress.js +81 -0
- package/bin/gsfConnector/dtos/GsfCreateCreditMessage.d.ts +17 -0
- package/bin/gsfConnector/dtos/GsfCreateCreditMessage.js +78 -0
- package/bin/gsfConnector/dtos/GsfCreditTerms.d.ts +17 -0
- package/bin/gsfConnector/dtos/GsfCreditTerms.js +71 -0
- package/bin/gsfConnector/dtos/GsfCustomer.d.ts +15 -0
- package/bin/gsfConnector/dtos/GsfCustomer.js +80 -0
- package/bin/gsfConnector/dtos/GsfExpectedState.d.ts +8 -0
- package/bin/gsfConnector/dtos/GsfExpectedState.js +38 -0
- package/bin/gsfConnector/dtos/GsfPayment.d.ts +16 -0
- package/bin/gsfConnector/dtos/GsfPayment.js +75 -0
- package/bin/gsfConnector/dtos/GsfPaymentMessage.d.ts +16 -0
- package/bin/gsfConnector/dtos/GsfPaymentMessage.js +74 -0
- package/bin/gsfConnector/dtos/GsfScheduleInstallment.d.ts +9 -0
- package/bin/gsfConnector/dtos/GsfScheduleInstallment.js +60 -0
- package/bin/gsfConnector/enums/GsfOperationEnum.d.ts +11 -0
- package/bin/gsfConnector/enums/GsfOperationEnum.js +15 -0
- package/bin/gsfConnector/enums/GsfPaymentChannelEnum.d.ts +11 -0
- package/bin/gsfConnector/enums/GsfPaymentChannelEnum.js +15 -0
- package/bin/gsfConnector/enums/GsfPaymentKindEnum.d.ts +11 -0
- package/bin/gsfConnector/enums/GsfPaymentKindEnum.js +15 -0
- package/bin/gsfConnector/enums/GsfPaymentPeriodicityEnum.d.ts +6 -0
- package/bin/gsfConnector/enums/GsfPaymentPeriodicityEnum.js +10 -0
- package/bin/gsfConnector/index.d.ts +17 -0
- package/bin/gsfConnector/index.js +37 -0
- package/bin/gsfConnector/validators/IsGsfCalendarDate.d.ts +6 -0
- package/bin/gsfConnector/validators/IsGsfCalendarDate.js +29 -0
- package/bin/gsfConnector/validators/IsGsfPaymentKindForOperation.d.ts +6 -0
- package/bin/gsfConnector/validators/IsGsfPaymentKindForOperation.js +31 -0
- package/bin/gsfConnector/validators/IsGsfPrepaymentScheduleProvided.d.ts +6 -0
- package/bin/gsfConnector/validators/IsGsfPrepaymentScheduleProvided.js +28 -0
- package/bin/index.d.ts +1 -0
- package/bin/index.js +3 -2
- package/bin/loanCredit/dtos/responses/LoanCustomerCreditDocument.d.ts +9 -0
- package/bin/loanCredit/dtos/responses/LoanCustomerCreditDocument.js +2 -0
- package/bin/loanCredit/dtos/responses/LoanCustomerCreditDocumentUrl.d.ts +9 -0
- package/bin/loanCredit/dtos/responses/LoanCustomerCreditDocumentUrl.js +2 -0
- package/bin/loanCredit/index.d.ts +2 -0
- package/bin/loanCredit/index.js +2 -0
- package/bin/retailLoan/dtos/MyDocument.d.ts +2 -1
- package/bin/retailLoan/enums/MyDocumentGroupIdEnum.d.ts +2 -1
- package/bin/retailLoan/enums/MyDocumentGroupIdEnum.js +1 -0
- package/bin/retailLoan/enums/MyDocumentKindEnum.d.ts +2 -1
- package/bin/retailLoan/enums/MyDocumentKindEnum.js +1 -0
- package/package.json +1 -1
- package/src/gsfConnector/constants/GsfPatterns.ts +21 -0
- package/src/gsfConnector/constants/GsfPaymentOperations.ts +17 -0
- package/src/gsfConnector/dtos/GsfAddress.ts +60 -0
- package/src/gsfConnector/dtos/GsfCreateCreditMessage.ts +60 -0
- package/src/gsfConnector/dtos/GsfCreditTerms.ts +55 -0
- package/src/gsfConnector/dtos/GsfCustomer.ts +60 -0
- package/src/gsfConnector/dtos/GsfExpectedState.ts +25 -0
- package/src/gsfConnector/dtos/GsfPayment.ts +57 -0
- package/src/gsfConnector/dtos/GsfPaymentMessage.ts +58 -0
- package/src/gsfConnector/dtos/GsfScheduleInstallment.ts +41 -0
- package/src/gsfConnector/enums/GsfOperationEnum.ts +11 -0
- package/src/gsfConnector/enums/GsfPaymentChannelEnum.ts +11 -0
- package/src/gsfConnector/enums/GsfPaymentKindEnum.ts +11 -0
- package/src/gsfConnector/enums/GsfPaymentPeriodicityEnum.ts +6 -0
- package/src/gsfConnector/index.ts +24 -0
- package/src/gsfConnector/validators/IsGsfCalendarDate.ts +19 -0
- package/src/gsfConnector/validators/IsGsfPaymentKindForOperation.ts +21 -0
- package/src/gsfConnector/validators/IsGsfPrepaymentScheduleProvided.ts +18 -0
- package/src/index.ts +1 -0
- package/src/loanCredit/dtos/responses/LoanCustomerCreditDocument.ts +10 -0
- package/src/loanCredit/dtos/responses/LoanCustomerCreditDocumentUrl.ts +10 -0
- package/src/loanCredit/index.ts +2 -0
- package/src/retailLoan/dtos/MyDocument.ts +2 -1
- package/src/retailLoan/enums/MyDocumentGroupIdEnum.ts +1 -0
- package/src/retailLoan/enums/MyDocumentKindEnum.ts +1 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.GsfCustomer = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const InputPatterns_1 = require("../../common/constants/InputPatterns");
|
|
16
|
+
const regex_1 = require("../../helpers/constans/regex");
|
|
17
|
+
const GsfAddress_1 = require("./GsfAddress");
|
|
18
|
+
const GsfPatterns_1 = require("../constants/GsfPatterns");
|
|
19
|
+
const IsGsfCalendarDate_1 = require("../validators/IsGsfCalendarDate");
|
|
20
|
+
/** Cliente persona física. Lleva datos personales: nunca se loguea. */
|
|
21
|
+
class GsfCustomer {
|
|
22
|
+
}
|
|
23
|
+
exports.GsfCustomer = GsfCustomer;
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, class_transformer_1.Expose)(),
|
|
26
|
+
(0, class_validator_1.IsString)(),
|
|
27
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
28
|
+
(0, class_validator_1.Matches)(GsfPatterns_1.GSF_NOT_BLANK_PATTERN),
|
|
29
|
+
__metadata("design:type", String)
|
|
30
|
+
], GsfCustomer.prototype, "names", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, class_transformer_1.Expose)(),
|
|
33
|
+
(0, class_validator_1.IsString)(),
|
|
34
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
35
|
+
(0, class_validator_1.Matches)(GsfPatterns_1.GSF_NOT_BLANK_PATTERN),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], GsfCustomer.prototype, "paternalLastName", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, class_transformer_1.Expose)(),
|
|
40
|
+
(0, class_validator_1.IsOptional)(),
|
|
41
|
+
(0, class_validator_1.IsString)(),
|
|
42
|
+
(0, class_validator_1.Matches)(GsfPatterns_1.GSF_NOT_BLANK_PATTERN),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], GsfCustomer.prototype, "maternalLastName", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, class_transformer_1.Expose)(),
|
|
47
|
+
(0, class_validator_1.Matches)(GsfPatterns_1.GSF_RFC_PF_PATTERN),
|
|
48
|
+
__metadata("design:type", String)
|
|
49
|
+
], GsfCustomer.prototype, "rfc", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, class_transformer_1.Expose)(),
|
|
52
|
+
(0, class_validator_1.Matches)(regex_1.regexCurp),
|
|
53
|
+
__metadata("design:type", String)
|
|
54
|
+
], GsfCustomer.prototype, "curp", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, class_transformer_1.Expose)(),
|
|
57
|
+
(0, class_validator_1.Validate)(IsGsfCalendarDate_1.IsGsfCalendarDate),
|
|
58
|
+
__metadata("design:type", String)
|
|
59
|
+
], GsfCustomer.prototype, "birthDate", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, class_transformer_1.Expose)(),
|
|
62
|
+
(0, class_validator_1.IsOptional)(),
|
|
63
|
+
(0, class_validator_1.Matches)(InputPatterns_1.EMAIL_PATTERN),
|
|
64
|
+
(0, class_validator_1.MaxLength)(InputPatterns_1.EMAIL_MAX_LENGTH),
|
|
65
|
+
__metadata("design:type", String)
|
|
66
|
+
], GsfCustomer.prototype, "email", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
(0, class_transformer_1.Expose)(),
|
|
69
|
+
(0, class_validator_1.IsOptional)(),
|
|
70
|
+
(0, class_validator_1.Matches)(InputPatterns_1.PHONE_MX_ACCEPTED_PATTERN),
|
|
71
|
+
__metadata("design:type", String)
|
|
72
|
+
], GsfCustomer.prototype, "mobilePhone", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, class_transformer_1.Expose)(),
|
|
75
|
+
(0, class_validator_1.IsDefined)(),
|
|
76
|
+
(0, class_validator_1.IsObject)(),
|
|
77
|
+
(0, class_validator_1.ValidateNested)(),
|
|
78
|
+
(0, class_transformer_1.Type)(() => GsfAddress_1.GsfAddress),
|
|
79
|
+
__metadata("design:type", GsfAddress_1.GsfAddress)
|
|
80
|
+
], GsfCustomer.prototype, "address", void 0);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { GsfScheduleInstallment } from './GsfScheduleInstallment';
|
|
2
|
+
/** Cómo debe quedar el crédito en GSF después del pago, según el origen. */
|
|
3
|
+
export declare class GsfExpectedState {
|
|
4
|
+
/** Capital pendiente del crédito después del pago. */
|
|
5
|
+
principalAfterCents?: number;
|
|
6
|
+
/** Cuotas que el pago recalculó (abono a capital), con sus importes nuevos. */
|
|
7
|
+
schedule?: GsfScheduleInstallment[];
|
|
8
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.GsfExpectedState = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const GsfScheduleInstallment_1 = require("./GsfScheduleInstallment");
|
|
16
|
+
const GsfPatterns_1 = require("../constants/GsfPatterns");
|
|
17
|
+
/** Cómo debe quedar el crédito en GSF después del pago, según el origen. */
|
|
18
|
+
class GsfExpectedState {
|
|
19
|
+
}
|
|
20
|
+
exports.GsfExpectedState = GsfExpectedState;
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, class_transformer_1.Expose)(),
|
|
23
|
+
(0, class_validator_1.IsOptional)(),
|
|
24
|
+
(0, class_validator_1.IsInt)(),
|
|
25
|
+
(0, class_validator_1.Min)(0),
|
|
26
|
+
(0, class_validator_1.Max)(GsfPatterns_1.GSF_MAX_CENTS),
|
|
27
|
+
__metadata("design:type", Number)
|
|
28
|
+
], GsfExpectedState.prototype, "principalAfterCents", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, class_transformer_1.Expose)(),
|
|
31
|
+
(0, class_validator_1.IsOptional)(),
|
|
32
|
+
(0, class_validator_1.IsArray)(),
|
|
33
|
+
(0, class_validator_1.ArrayMinSize)(1),
|
|
34
|
+
(0, class_validator_1.ArrayUnique)((installment) => installment?.installmentNumber),
|
|
35
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
36
|
+
(0, class_transformer_1.Type)(() => GsfScheduleInstallment_1.GsfScheduleInstallment),
|
|
37
|
+
__metadata("design:type", Array)
|
|
38
|
+
], GsfExpectedState.prototype, "schedule", void 0);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { GsfPaymentKindEnum } from '../enums/GsfPaymentKindEnum';
|
|
2
|
+
import { GsfPaymentChannelEnum } from '../enums/GsfPaymentChannelEnum';
|
|
3
|
+
/** Un pago ya aplicado en el sistema de origen. */
|
|
4
|
+
export declare class GsfPayment {
|
|
5
|
+
/** Id del pago en el origen: el conector no aplica dos veces el mismo. */
|
|
6
|
+
externalPaymentId: string;
|
|
7
|
+
kind: GsfPaymentKindEnum;
|
|
8
|
+
channel: GsfPaymentChannelEnum;
|
|
9
|
+
amountCents: number;
|
|
10
|
+
/** Día del pago en la zona del origen. */
|
|
11
|
+
appliedOn: string;
|
|
12
|
+
/** Desglose que aplicó el origen; sirve para conciliar. */
|
|
13
|
+
capitalCents?: number;
|
|
14
|
+
interestCents?: number;
|
|
15
|
+
ivaCents?: number;
|
|
16
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.GsfPayment = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const GsfPaymentKindEnum_1 = require("../enums/GsfPaymentKindEnum");
|
|
16
|
+
const GsfPaymentChannelEnum_1 = require("../enums/GsfPaymentChannelEnum");
|
|
17
|
+
const GsfPatterns_1 = require("../constants/GsfPatterns");
|
|
18
|
+
const IsGsfCalendarDate_1 = require("../validators/IsGsfCalendarDate");
|
|
19
|
+
/** Un pago ya aplicado en el sistema de origen. */
|
|
20
|
+
class GsfPayment {
|
|
21
|
+
}
|
|
22
|
+
exports.GsfPayment = GsfPayment;
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, class_transformer_1.Expose)(),
|
|
25
|
+
(0, class_validator_1.IsString)(),
|
|
26
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
27
|
+
(0, class_validator_1.Matches)(GsfPatterns_1.GSF_NOT_BLANK_PATTERN),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], GsfPayment.prototype, "externalPaymentId", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, class_transformer_1.Expose)(),
|
|
32
|
+
(0, class_validator_1.IsEnum)(GsfPaymentKindEnum_1.GsfPaymentKindEnum),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], GsfPayment.prototype, "kind", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, class_transformer_1.Expose)(),
|
|
37
|
+
(0, class_validator_1.IsEnum)(GsfPaymentChannelEnum_1.GsfPaymentChannelEnum),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], GsfPayment.prototype, "channel", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, class_transformer_1.Expose)(),
|
|
42
|
+
(0, class_validator_1.IsInt)(),
|
|
43
|
+
(0, class_validator_1.Min)(1),
|
|
44
|
+
(0, class_validator_1.Max)(GsfPatterns_1.GSF_MAX_CENTS),
|
|
45
|
+
__metadata("design:type", Number)
|
|
46
|
+
], GsfPayment.prototype, "amountCents", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, class_transformer_1.Expose)(),
|
|
49
|
+
(0, class_validator_1.Validate)(IsGsfCalendarDate_1.IsGsfCalendarDate),
|
|
50
|
+
__metadata("design:type", String)
|
|
51
|
+
], GsfPayment.prototype, "appliedOn", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, class_transformer_1.Expose)(),
|
|
54
|
+
(0, class_validator_1.IsOptional)(),
|
|
55
|
+
(0, class_validator_1.IsInt)(),
|
|
56
|
+
(0, class_validator_1.Min)(0),
|
|
57
|
+
(0, class_validator_1.Max)(GsfPatterns_1.GSF_MAX_CENTS),
|
|
58
|
+
__metadata("design:type", Number)
|
|
59
|
+
], GsfPayment.prototype, "capitalCents", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, class_transformer_1.Expose)(),
|
|
62
|
+
(0, class_validator_1.IsOptional)(),
|
|
63
|
+
(0, class_validator_1.IsInt)(),
|
|
64
|
+
(0, class_validator_1.Min)(0),
|
|
65
|
+
(0, class_validator_1.Max)(GsfPatterns_1.GSF_MAX_CENTS),
|
|
66
|
+
__metadata("design:type", Number)
|
|
67
|
+
], GsfPayment.prototype, "interestCents", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, class_transformer_1.Expose)(),
|
|
70
|
+
(0, class_validator_1.IsOptional)(),
|
|
71
|
+
(0, class_validator_1.IsInt)(),
|
|
72
|
+
(0, class_validator_1.Min)(0),
|
|
73
|
+
(0, class_validator_1.Max)(GsfPatterns_1.GSF_MAX_CENTS),
|
|
74
|
+
__metadata("design:type", Number)
|
|
75
|
+
], GsfPayment.prototype, "ivaCents", void 0);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { GsfPayment } from './GsfPayment';
|
|
2
|
+
import { GsfExpectedState } from './GsfExpectedState';
|
|
3
|
+
import { GsfPaymentOperation } from '../constants/GsfPaymentOperations';
|
|
4
|
+
/**
|
|
5
|
+
* Mensaje de pago de `GsfSyncQueue.fifo`: `APPLY_PAYMENT`, `APPLY_PREPAYMENT` o `SETTLE_CREDIT`. Llega
|
|
6
|
+
* después del `CREATE_CREDIT` del mismo crédito porque comparten MessageGroupId (`externalCreditId`).
|
|
7
|
+
*/
|
|
8
|
+
export declare class GsfPaymentMessage {
|
|
9
|
+
account: string;
|
|
10
|
+
operation: GsfPaymentOperation;
|
|
11
|
+
messageId: string;
|
|
12
|
+
externalCreditId: string;
|
|
13
|
+
payment: GsfPayment;
|
|
14
|
+
/** Obligatorio en `APPLY_PREPAYMENT`, con la tabla recalculada. */
|
|
15
|
+
expected?: GsfExpectedState;
|
|
16
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.GsfPaymentMessage = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const GsfOperationEnum_1 = require("../enums/GsfOperationEnum");
|
|
16
|
+
const GsfPayment_1 = require("./GsfPayment");
|
|
17
|
+
const GsfExpectedState_1 = require("./GsfExpectedState");
|
|
18
|
+
const GsfPaymentOperations_1 = require("../constants/GsfPaymentOperations");
|
|
19
|
+
const GsfPatterns_1 = require("../constants/GsfPatterns");
|
|
20
|
+
const IsGsfPaymentKindForOperation_1 = require("../validators/IsGsfPaymentKindForOperation");
|
|
21
|
+
const IsGsfPrepaymentScheduleProvided_1 = require("../validators/IsGsfPrepaymentScheduleProvided");
|
|
22
|
+
/**
|
|
23
|
+
* Mensaje de pago de `GsfSyncQueue.fifo`: `APPLY_PAYMENT`, `APPLY_PREPAYMENT` o `SETTLE_CREDIT`. Llega
|
|
24
|
+
* después del `CREATE_CREDIT` del mismo crédito porque comparten MessageGroupId (`externalCreditId`).
|
|
25
|
+
*/
|
|
26
|
+
class GsfPaymentMessage {
|
|
27
|
+
}
|
|
28
|
+
exports.GsfPaymentMessage = GsfPaymentMessage;
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, class_transformer_1.Expose)(),
|
|
31
|
+
(0, class_validator_1.Matches)(GsfPatterns_1.GSF_ACCOUNT_PATTERN),
|
|
32
|
+
(0, class_validator_1.MaxLength)(GsfPatterns_1.GSF_ACCOUNT_MAX_LENGTH),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], GsfPaymentMessage.prototype, "account", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, class_transformer_1.Expose)(),
|
|
37
|
+
(0, class_validator_1.IsIn)([...GsfPaymentOperations_1.GSF_PAYMENT_OPERATIONS]),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], GsfPaymentMessage.prototype, "operation", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, class_transformer_1.Expose)(),
|
|
42
|
+
(0, class_validator_1.IsString)(),
|
|
43
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
44
|
+
(0, class_validator_1.Matches)(GsfPatterns_1.GSF_NOT_BLANK_PATTERN),
|
|
45
|
+
(0, class_validator_1.MaxLength)(GsfPatterns_1.GSF_QUEUE_ID_MAX_LENGTH),
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], GsfPaymentMessage.prototype, "messageId", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, class_transformer_1.Expose)(),
|
|
50
|
+
(0, class_validator_1.IsString)(),
|
|
51
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
52
|
+
(0, class_validator_1.Matches)(GsfPatterns_1.GSF_NOT_BLANK_PATTERN),
|
|
53
|
+
(0, class_validator_1.MaxLength)(GsfPatterns_1.GSF_QUEUE_ID_MAX_LENGTH),
|
|
54
|
+
__metadata("design:type", String)
|
|
55
|
+
], GsfPaymentMessage.prototype, "externalCreditId", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, class_transformer_1.Expose)(),
|
|
58
|
+
(0, class_validator_1.IsDefined)(),
|
|
59
|
+
(0, class_validator_1.IsObject)(),
|
|
60
|
+
(0, class_validator_1.ValidateNested)(),
|
|
61
|
+
(0, class_transformer_1.Type)(() => GsfPayment_1.GsfPayment),
|
|
62
|
+
(0, class_validator_1.Validate)(IsGsfPaymentKindForOperation_1.IsGsfPaymentKindForOperation),
|
|
63
|
+
__metadata("design:type", GsfPayment_1.GsfPayment)
|
|
64
|
+
], GsfPaymentMessage.prototype, "payment", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, class_transformer_1.Expose)(),
|
|
67
|
+
(0, class_validator_1.ValidateIf)((message) => message.operation === GsfOperationEnum_1.GsfOperationEnum.APPLY_PREPAYMENT || message.expected != null),
|
|
68
|
+
(0, class_validator_1.IsDefined)(),
|
|
69
|
+
(0, class_validator_1.IsObject)(),
|
|
70
|
+
(0, class_validator_1.ValidateNested)(),
|
|
71
|
+
(0, class_transformer_1.Type)(() => GsfExpectedState_1.GsfExpectedState),
|
|
72
|
+
(0, class_validator_1.Validate)(IsGsfPrepaymentScheduleProvided_1.IsGsfPrepaymentScheduleProvided),
|
|
73
|
+
__metadata("design:type", GsfExpectedState_1.GsfExpectedState)
|
|
74
|
+
], GsfPaymentMessage.prototype, "expected", void 0);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Una cuota como la calculó el sistema de origen; el conector la compara contra la de GSF. */
|
|
2
|
+
export declare class GsfScheduleInstallment {
|
|
3
|
+
installmentNumber: number;
|
|
4
|
+
dueDate: string;
|
|
5
|
+
capitalCents: number;
|
|
6
|
+
interestCents: number;
|
|
7
|
+
ivaCents: number;
|
|
8
|
+
totalCents: number;
|
|
9
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.GsfScheduleInstallment = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const GsfPatterns_1 = require("../constants/GsfPatterns");
|
|
16
|
+
const IsGsfCalendarDate_1 = require("../validators/IsGsfCalendarDate");
|
|
17
|
+
/** Una cuota como la calculó el sistema de origen; el conector la compara contra la de GSF. */
|
|
18
|
+
class GsfScheduleInstallment {
|
|
19
|
+
}
|
|
20
|
+
exports.GsfScheduleInstallment = GsfScheduleInstallment;
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, class_transformer_1.Expose)(),
|
|
23
|
+
(0, class_validator_1.IsInt)(),
|
|
24
|
+
(0, class_validator_1.Min)(1),
|
|
25
|
+
(0, class_validator_1.Max)(GsfPatterns_1.GSF_MAX_INSTALLMENTS),
|
|
26
|
+
__metadata("design:type", Number)
|
|
27
|
+
], GsfScheduleInstallment.prototype, "installmentNumber", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, class_transformer_1.Expose)(),
|
|
30
|
+
(0, class_validator_1.Validate)(IsGsfCalendarDate_1.IsGsfCalendarDate),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], GsfScheduleInstallment.prototype, "dueDate", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, class_transformer_1.Expose)(),
|
|
35
|
+
(0, class_validator_1.IsInt)(),
|
|
36
|
+
(0, class_validator_1.Min)(0),
|
|
37
|
+
(0, class_validator_1.Max)(GsfPatterns_1.GSF_MAX_CENTS),
|
|
38
|
+
__metadata("design:type", Number)
|
|
39
|
+
], GsfScheduleInstallment.prototype, "capitalCents", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, class_transformer_1.Expose)(),
|
|
42
|
+
(0, class_validator_1.IsInt)(),
|
|
43
|
+
(0, class_validator_1.Min)(0),
|
|
44
|
+
(0, class_validator_1.Max)(GsfPatterns_1.GSF_MAX_CENTS),
|
|
45
|
+
__metadata("design:type", Number)
|
|
46
|
+
], GsfScheduleInstallment.prototype, "interestCents", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, class_transformer_1.Expose)(),
|
|
49
|
+
(0, class_validator_1.IsInt)(),
|
|
50
|
+
(0, class_validator_1.Min)(0),
|
|
51
|
+
(0, class_validator_1.Max)(GsfPatterns_1.GSF_MAX_CENTS),
|
|
52
|
+
__metadata("design:type", Number)
|
|
53
|
+
], GsfScheduleInstallment.prototype, "ivaCents", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, class_transformer_1.Expose)(),
|
|
56
|
+
(0, class_validator_1.IsInt)(),
|
|
57
|
+
(0, class_validator_1.Min)(0),
|
|
58
|
+
(0, class_validator_1.Max)(GsfPatterns_1.GSF_MAX_CENTS),
|
|
59
|
+
__metadata("design:type", Number)
|
|
60
|
+
], GsfScheduleInstallment.prototype, "totalCents", void 0);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Operación que pide un mensaje de `GsfSyncQueue.fifo`. */
|
|
2
|
+
export declare enum GsfOperationEnum {
|
|
3
|
+
/** Alta del cliente y del crédito ya activo, con la tabla que se espera ver en GSF. */
|
|
4
|
+
CREATE_CREDIT = "CREATE_CREDIT",
|
|
5
|
+
/** Pago de una cuota, adelanto de cuotas o liquidación parcial. */
|
|
6
|
+
APPLY_PAYMENT = "APPLY_PAYMENT",
|
|
7
|
+
/** Abono a capital: GSF reestructura la tabla y se compara con la esperada. */
|
|
8
|
+
APPLY_PREPAYMENT = "APPLY_PREPAYMENT",
|
|
9
|
+
/** Pago que liquida el crédito. */
|
|
10
|
+
SETTLE_CREDIT = "SETTLE_CREDIT"
|
|
11
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GsfOperationEnum = void 0;
|
|
4
|
+
/** Operación que pide un mensaje de `GsfSyncQueue.fifo`. */
|
|
5
|
+
var GsfOperationEnum;
|
|
6
|
+
(function (GsfOperationEnum) {
|
|
7
|
+
/** Alta del cliente y del crédito ya activo, con la tabla que se espera ver en GSF. */
|
|
8
|
+
GsfOperationEnum["CREATE_CREDIT"] = "CREATE_CREDIT";
|
|
9
|
+
/** Pago de una cuota, adelanto de cuotas o liquidación parcial. */
|
|
10
|
+
GsfOperationEnum["APPLY_PAYMENT"] = "APPLY_PAYMENT";
|
|
11
|
+
/** Abono a capital: GSF reestructura la tabla y se compara con la esperada. */
|
|
12
|
+
GsfOperationEnum["APPLY_PREPAYMENT"] = "APPLY_PREPAYMENT";
|
|
13
|
+
/** Pago que liquida el crédito. */
|
|
14
|
+
GsfOperationEnum["SETTLE_CREDIT"] = "SETTLE_CREDIT";
|
|
15
|
+
})(GsfOperationEnum || (exports.GsfOperationEnum = GsfOperationEnum = {}));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Por dónde entró el dinero de un pago. */
|
|
2
|
+
export declare enum GsfPaymentChannelEnum {
|
|
3
|
+
/** Cargo automático a la tarjeta del cliente. */
|
|
4
|
+
AUTOMATIC_CARD_CHARGE = "AUTOMATIC_CARD_CHARGE",
|
|
5
|
+
/** Efectivo en ventanilla o caja. */
|
|
6
|
+
CASH = "CASH",
|
|
7
|
+
/** Tarjeta en ventanilla o caja. */
|
|
8
|
+
CARD = "CARD",
|
|
9
|
+
/** Transferencia bancaria. */
|
|
10
|
+
WIRE_TRANSFER = "WIRE_TRANSFER"
|
|
11
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GsfPaymentChannelEnum = void 0;
|
|
4
|
+
/** Por dónde entró el dinero de un pago. */
|
|
5
|
+
var GsfPaymentChannelEnum;
|
|
6
|
+
(function (GsfPaymentChannelEnum) {
|
|
7
|
+
/** Cargo automático a la tarjeta del cliente. */
|
|
8
|
+
GsfPaymentChannelEnum["AUTOMATIC_CARD_CHARGE"] = "AUTOMATIC_CARD_CHARGE";
|
|
9
|
+
/** Efectivo en ventanilla o caja. */
|
|
10
|
+
GsfPaymentChannelEnum["CASH"] = "CASH";
|
|
11
|
+
/** Tarjeta en ventanilla o caja. */
|
|
12
|
+
GsfPaymentChannelEnum["CARD"] = "CARD";
|
|
13
|
+
/** Transferencia bancaria. */
|
|
14
|
+
GsfPaymentChannelEnum["WIRE_TRANSFER"] = "WIRE_TRANSFER";
|
|
15
|
+
})(GsfPaymentChannelEnum || (exports.GsfPaymentChannelEnum = GsfPaymentChannelEnum = {}));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Para qué se aplicó un pago en el sistema de origen. */
|
|
2
|
+
export declare enum GsfPaymentKindEnum {
|
|
3
|
+
/** Cuota del periodo. */
|
|
4
|
+
INSTALLMENT = "INSTALLMENT",
|
|
5
|
+
/** Cuotas futuras cubiertas tal cual: la tabla no cambia. */
|
|
6
|
+
ADVANCE = "ADVANCE",
|
|
7
|
+
/** Abono a capital: baja las cuotas restantes. */
|
|
8
|
+
PREPAYMENT = "PREPAYMENT",
|
|
9
|
+
/** Liquidación del crédito. */
|
|
10
|
+
SETTLEMENT = "SETTLEMENT"
|
|
11
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GsfPaymentKindEnum = void 0;
|
|
4
|
+
/** Para qué se aplicó un pago en el sistema de origen. */
|
|
5
|
+
var GsfPaymentKindEnum;
|
|
6
|
+
(function (GsfPaymentKindEnum) {
|
|
7
|
+
/** Cuota del periodo. */
|
|
8
|
+
GsfPaymentKindEnum["INSTALLMENT"] = "INSTALLMENT";
|
|
9
|
+
/** Cuotas futuras cubiertas tal cual: la tabla no cambia. */
|
|
10
|
+
GsfPaymentKindEnum["ADVANCE"] = "ADVANCE";
|
|
11
|
+
/** Abono a capital: baja las cuotas restantes. */
|
|
12
|
+
GsfPaymentKindEnum["PREPAYMENT"] = "PREPAYMENT";
|
|
13
|
+
/** Liquidación del crédito. */
|
|
14
|
+
GsfPaymentKindEnum["SETTLEMENT"] = "SETTLEMENT";
|
|
15
|
+
})(GsfPaymentKindEnum || (exports.GsfPaymentKindEnum = GsfPaymentKindEnum = {}));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GsfPaymentPeriodicityEnum = void 0;
|
|
4
|
+
/** Periodicidad de las cuotas del crédito. */
|
|
5
|
+
var GsfPaymentPeriodicityEnum;
|
|
6
|
+
(function (GsfPaymentPeriodicityEnum) {
|
|
7
|
+
GsfPaymentPeriodicityEnum["WEEKLY"] = "WEEKLY";
|
|
8
|
+
GsfPaymentPeriodicityEnum["BIWEEKLY"] = "BIWEEKLY";
|
|
9
|
+
GsfPaymentPeriodicityEnum["MONTHLY"] = "MONTHLY";
|
|
10
|
+
})(GsfPaymentPeriodicityEnum || (exports.GsfPaymentPeriodicityEnum = GsfPaymentPeriodicityEnum = {}));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export * from './enums/GsfOperationEnum';
|
|
2
|
+
export * from './enums/GsfPaymentKindEnum';
|
|
3
|
+
export * from './enums/GsfPaymentChannelEnum';
|
|
4
|
+
export * from './enums/GsfPaymentPeriodicityEnum';
|
|
5
|
+
export * from './constants/GsfPatterns';
|
|
6
|
+
export * from './constants/GsfPaymentOperations';
|
|
7
|
+
export * from './validators/IsGsfCalendarDate';
|
|
8
|
+
export * from './validators/IsGsfPaymentKindForOperation';
|
|
9
|
+
export * from './validators/IsGsfPrepaymentScheduleProvided';
|
|
10
|
+
export * from './dtos/GsfAddress';
|
|
11
|
+
export * from './dtos/GsfCustomer';
|
|
12
|
+
export * from './dtos/GsfScheduleInstallment';
|
|
13
|
+
export * from './dtos/GsfCreditTerms';
|
|
14
|
+
export * from './dtos/GsfPayment';
|
|
15
|
+
export * from './dtos/GsfExpectedState';
|
|
16
|
+
export * from './dtos/GsfCreateCreditMessage';
|
|
17
|
+
export * from './dtos/GsfPaymentMessage';
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
// Enums
|
|
18
|
+
__exportStar(require("./enums/GsfOperationEnum"), exports);
|
|
19
|
+
__exportStar(require("./enums/GsfPaymentKindEnum"), exports);
|
|
20
|
+
__exportStar(require("./enums/GsfPaymentChannelEnum"), exports);
|
|
21
|
+
__exportStar(require("./enums/GsfPaymentPeriodicityEnum"), exports);
|
|
22
|
+
// Constants
|
|
23
|
+
__exportStar(require("./constants/GsfPatterns"), exports);
|
|
24
|
+
__exportStar(require("./constants/GsfPaymentOperations"), exports);
|
|
25
|
+
// Validators
|
|
26
|
+
__exportStar(require("./validators/IsGsfCalendarDate"), exports);
|
|
27
|
+
__exportStar(require("./validators/IsGsfPaymentKindForOperation"), exports);
|
|
28
|
+
__exportStar(require("./validators/IsGsfPrepaymentScheduleProvided"), exports);
|
|
29
|
+
// DTOs del mensaje de GsfSyncQueue.fifo
|
|
30
|
+
__exportStar(require("./dtos/GsfAddress"), exports);
|
|
31
|
+
__exportStar(require("./dtos/GsfCustomer"), exports);
|
|
32
|
+
__exportStar(require("./dtos/GsfScheduleInstallment"), exports);
|
|
33
|
+
__exportStar(require("./dtos/GsfCreditTerms"), exports);
|
|
34
|
+
__exportStar(require("./dtos/GsfPayment"), exports);
|
|
35
|
+
__exportStar(require("./dtos/GsfExpectedState"), exports);
|
|
36
|
+
__exportStar(require("./dtos/GsfCreateCreditMessage"), exports);
|
|
37
|
+
__exportStar(require("./dtos/GsfPaymentMessage"), exports);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ValidationArguments, ValidatorConstraintInterface } from 'class-validator';
|
|
2
|
+
/** `YYYY-MM-DD` de un día que existe: rechaza `2026-02-30` o `2026-13-01`, que el patrón solo no detecta. */
|
|
3
|
+
export declare class IsGsfCalendarDate implements ValidatorConstraintInterface {
|
|
4
|
+
validate(value: unknown, _args: ValidationArguments): boolean;
|
|
5
|
+
defaultMessage(args: ValidationArguments): string;
|
|
6
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.IsGsfCalendarDate = void 0;
|
|
10
|
+
const class_validator_1 = require("class-validator");
|
|
11
|
+
const GsfPatterns_1 = require("../constants/GsfPatterns");
|
|
12
|
+
/** `YYYY-MM-DD` de un día que existe: rechaza `2026-02-30` o `2026-13-01`, que el patrón solo no detecta. */
|
|
13
|
+
let IsGsfCalendarDate = class IsGsfCalendarDate {
|
|
14
|
+
validate(value, _args) {
|
|
15
|
+
if (typeof value !== 'string' || !GsfPatterns_1.GSF_DATE_PATTERN.test(value)) {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
const [year, month, day] = value.split('-').map(Number);
|
|
19
|
+
const date = new Date(Date.UTC(year, month - 1, day));
|
|
20
|
+
return date.getUTCFullYear() === year && date.getUTCMonth() === month - 1 && date.getUTCDate() === day;
|
|
21
|
+
}
|
|
22
|
+
defaultMessage(args) {
|
|
23
|
+
return `${args.property} debe ser una fecha YYYY-MM-DD que exista`;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
exports.IsGsfCalendarDate = IsGsfCalendarDate;
|
|
27
|
+
exports.IsGsfCalendarDate = IsGsfCalendarDate = __decorate([
|
|
28
|
+
(0, class_validator_1.ValidatorConstraint)({ name: 'isGsfCalendarDate', async: false })
|
|
29
|
+
], IsGsfCalendarDate);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ValidationArguments, ValidatorConstraintInterface } from 'class-validator';
|
|
2
|
+
/** La clase del pago tiene que corresponder a la operación del mensaje: un abono solo viaja como abono. */
|
|
3
|
+
export declare class IsGsfPaymentKindForOperation implements ValidatorConstraintInterface {
|
|
4
|
+
validate(value: unknown, args: ValidationArguments): boolean;
|
|
5
|
+
defaultMessage(args: ValidationArguments): string;
|
|
6
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.IsGsfPaymentKindForOperation = void 0;
|
|
10
|
+
const class_validator_1 = require("class-validator");
|
|
11
|
+
const GsfPaymentOperations_1 = require("../constants/GsfPaymentOperations");
|
|
12
|
+
/** La clase del pago tiene que corresponder a la operación del mensaje: un abono solo viaja como abono. */
|
|
13
|
+
let IsGsfPaymentKindForOperation = class IsGsfPaymentKindForOperation {
|
|
14
|
+
validate(value, args) {
|
|
15
|
+
const operation = args.object.operation;
|
|
16
|
+
// Sin operación válida el error ya lo marca `operation`. Se compara contra la lista para que
|
|
17
|
+
// `constructor` o `__proto__` no lean el prototipo del mapa.
|
|
18
|
+
if (!GsfPaymentOperations_1.GSF_PAYMENT_OPERATIONS.includes(operation)) {
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
const kind = value?.kind;
|
|
22
|
+
return GsfPaymentOperations_1.GSF_PAYMENT_KINDS_BY_OPERATION[operation].includes(kind);
|
|
23
|
+
}
|
|
24
|
+
defaultMessage(args) {
|
|
25
|
+
return `${args.property}.kind no corresponde a la operación del mensaje`;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
exports.IsGsfPaymentKindForOperation = IsGsfPaymentKindForOperation;
|
|
29
|
+
exports.IsGsfPaymentKindForOperation = IsGsfPaymentKindForOperation = __decorate([
|
|
30
|
+
(0, class_validator_1.ValidatorConstraint)({ name: 'isGsfPaymentKindForOperation', async: false })
|
|
31
|
+
], IsGsfPaymentKindForOperation);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ValidationArguments, ValidatorConstraintInterface } from 'class-validator';
|
|
2
|
+
/** Un abono a capital trae la tabla recalculada: sin ella no hay contra qué comparar la reestructura de GSF. */
|
|
3
|
+
export declare class IsGsfPrepaymentScheduleProvided implements ValidatorConstraintInterface {
|
|
4
|
+
validate(value: unknown, args: ValidationArguments): boolean;
|
|
5
|
+
defaultMessage(args: ValidationArguments): string;
|
|
6
|
+
}
|