@fiado/type-kit 3.616.0 → 3.618.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/account/BankAccountMCSendTransfer.test.ts +43 -0
- package/_test_/unit/loanRetailAudit/m8AuditCatalog.test.ts +58 -0
- package/_test_/unit/reconciliation/reconciliationCatalogs.test.ts +126 -0
- package/_test_/unit/reconciliation/reconciliationRequests.test.ts +208 -0
- package/_test_/unit/reconciliation/reconciliationShapes.test.ts +74 -0
- package/_test_/unit/retailWizard/privateGetSale.test.ts +59 -0
- package/_test_/unit/transaction/transactionCreateRequestM8.test.ts +27 -0
- package/_test_/unit/transactionProcessor/reconciliationAdjustment.test.ts +63 -0
- package/_test_/unit/transferNote/transferNoteConfigAndPrivate.test.ts +202 -0
- package/_test_/unit/transferNote/transferNoteEventsAndFeeds.test.ts +112 -0
- package/_test_/unit/transferNote/transferNoteRequests.test.ts +138 -0
- package/bin/account/dtos/BankAccountMCSendTransferRequest.d.ts +8 -2
- package/bin/account/dtos/BankAccountMCSendTransferResponse.d.ts +3 -0
- package/bin/index.d.ts +2 -0
- package/bin/index.js +7 -1
- package/bin/loanRetailAudit/enums/AuditTrailActionEnum.d.ts +12 -1
- package/bin/loanRetailAudit/enums/AuditTrailActionEnum.js +12 -0
- package/bin/loanRetailAudit/enums/LoanAuditEntityTypeEnum.d.ts +5 -1
- package/bin/loanRetailAudit/enums/LoanAuditEntityTypeEnum.js +4 -0
- package/bin/reconciliation/constants/reconciliationErrorHttpStatus.d.ts +6 -0
- package/bin/reconciliation/constants/reconciliationErrorHttpStatus.js +23 -0
- package/bin/reconciliation/constants/reconciliationValidation.d.ts +8 -0
- package/bin/reconciliation/constants/reconciliationValidation.js +11 -0
- package/bin/reconciliation/dtos/ReconciliationDefinition.d.ts +42 -0
- package/bin/reconciliation/dtos/ReconciliationDefinition.js +2 -0
- package/bin/reconciliation/dtos/ReconciliationFeedRecord.d.ts +42 -0
- package/bin/reconciliation/dtos/ReconciliationFeedRecord.js +2 -0
- package/bin/reconciliation/dtos/ReconciliationItem.d.ts +77 -0
- package/bin/reconciliation/dtos/ReconciliationItem.js +2 -0
- package/bin/reconciliation/dtos/ReconciliationRun.d.ts +28 -0
- package/bin/reconciliation/dtos/ReconciliationRun.js +2 -0
- package/bin/reconciliation/dtos/requests/PrivateReconciliationRequests.d.ts +80 -0
- package/bin/reconciliation/dtos/requests/PrivateReconciliationRequests.js +215 -0
- package/bin/reconciliation/dtos/requests/ReconciliationActionRequests.d.ts +30 -0
- package/bin/reconciliation/dtos/requests/ReconciliationActionRequests.js +105 -0
- package/bin/reconciliation/dtos/requests/ReconciliationFeedRequests.d.ts +23 -0
- package/bin/reconciliation/dtos/requests/ReconciliationFeedRequests.js +71 -0
- package/bin/reconciliation/dtos/requests/ReconciliationQueries.d.ts +54 -0
- package/bin/reconciliation/dtos/requests/ReconciliationQueries.js +192 -0
- package/bin/reconciliation/dtos/requests/reconciliationRequestDecorators.d.ts +7 -0
- package/bin/reconciliation/dtos/requests/reconciliationRequestDecorators.js +39 -0
- package/bin/reconciliation/dtos/responses/PrivateReconciliationResponses.d.ts +13 -0
- package/bin/reconciliation/dtos/responses/PrivateReconciliationResponses.js +2 -0
- package/bin/reconciliation/dtos/responses/ReconciliationFeedResponses.d.ts +7 -0
- package/bin/reconciliation/dtos/responses/ReconciliationFeedResponses.js +2 -0
- package/bin/reconciliation/dtos/responses/ReconciliationResponses.d.ts +81 -0
- package/bin/reconciliation/dtos/responses/ReconciliationResponses.js +2 -0
- package/bin/reconciliation/enums/ReconciliationDefinitionStatusEnum.d.ts +6 -0
- package/bin/reconciliation/enums/ReconciliationDefinitionStatusEnum.js +10 -0
- package/bin/reconciliation/enums/ReconciliationErrorCodeEnum.d.ts +24 -0
- package/bin/reconciliation/enums/ReconciliationErrorCodeEnum.js +28 -0
- package/bin/reconciliation/enums/ReconciliationExportFormatEnum.d.ts +5 -0
- package/bin/reconciliation/enums/ReconciliationExportFormatEnum.js +9 -0
- package/bin/reconciliation/enums/ReconciliationFeedConceptEnum.d.ts +16 -0
- package/bin/reconciliation/enums/ReconciliationFeedConceptEnum.js +20 -0
- package/bin/reconciliation/enums/ReconciliationFeedErrorCodeEnum.d.ts +4 -0
- package/bin/reconciliation/enums/ReconciliationFeedErrorCodeEnum.js +8 -0
- package/bin/reconciliation/enums/ReconciliationFeedOwnerEnum.d.ts +9 -0
- package/bin/reconciliation/enums/ReconciliationFeedOwnerEnum.js +13 -0
- package/bin/reconciliation/enums/ReconciliationItemStateEnum.d.ts +23 -0
- package/bin/reconciliation/enums/ReconciliationItemStateEnum.js +27 -0
- package/bin/reconciliation/enums/ReconciliationLayerEnum.d.ts +8 -0
- package/bin/reconciliation/enums/ReconciliationLayerEnum.js +12 -0
- package/bin/reconciliation/enums/ReconciliationPeriodEnum.d.ts +6 -0
- package/bin/reconciliation/enums/ReconciliationPeriodEnum.js +10 -0
- package/bin/reconciliation/enums/ReconciliationResolutionArchiveReasonEnum.d.ts +6 -0
- package/bin/reconciliation/enums/ReconciliationResolutionArchiveReasonEnum.js +10 -0
- package/bin/reconciliation/enums/ReconciliationResolutionStatusEnum.d.ts +9 -0
- package/bin/reconciliation/enums/ReconciliationResolutionStatusEnum.js +13 -0
- package/bin/reconciliation/enums/ReconciliationResolutionTypeEnum.d.ts +7 -0
- package/bin/reconciliation/enums/ReconciliationResolutionTypeEnum.js +11 -0
- package/bin/reconciliation/enums/ReconciliationRuleTypeEnum.d.ts +7 -0
- package/bin/reconciliation/enums/ReconciliationRuleTypeEnum.js +11 -0
- package/bin/reconciliation/enums/ReconciliationRunStatusEnum.d.ts +6 -0
- package/bin/reconciliation/enums/ReconciliationRunStatusEnum.js +10 -0
- package/bin/reconciliation/enums/ReconciliationSourceRoleEnum.d.ts +6 -0
- package/bin/reconciliation/enums/ReconciliationSourceRoleEnum.js +10 -0
- package/bin/reconciliation/events/ReconciliationItemMatchedEventDetail.d.ts +22 -0
- package/bin/reconciliation/events/ReconciliationItemMatchedEventDetail.js +14 -0
- package/bin/reconciliation/index.d.ts +29 -0
- package/bin/reconciliation/index.js +51 -0
- package/bin/retailWizard/catalog/privateSaleDetailFields.d.ts +3 -0
- package/bin/retailWizard/catalog/privateSaleDetailFields.js +16 -0
- package/bin/retailWizard/constants/retailWizardValidation.d.ts +2 -0
- package/bin/retailWizard/constants/retailWizardValidation.js +5 -0
- package/bin/retailWizard/dtos/requests/PrivateGetSaleRequest.d.ts +8 -0
- package/bin/retailWizard/dtos/requests/PrivateGetSaleRequest.js +42 -0
- package/bin/retailWizard/dtos/responses/PrivateGetSaleResponse.d.ts +16 -0
- package/bin/retailWizard/dtos/responses/PrivateGetSaleResponse.js +2 -0
- package/bin/retailWizard/index.d.ts +4 -0
- package/bin/retailWizard/index.js +5 -0
- package/bin/transaction/dtos/TransactionCreateRequest.d.ts +4 -0
- package/bin/transaction/dtos/TransactionCreateRequest.js +12 -0
- package/bin/transactionProcessor/dtos/PrivateAuthorizeReconciliationAdjustmentRequest.d.ts +30 -0
- package/bin/transactionProcessor/dtos/PrivateAuthorizeReconciliationAdjustmentRequest.js +107 -0
- package/bin/transactionProcessor/dtos/PrivateAuthorizeReconciliationAdjustmentResponse.d.ts +7 -0
- package/bin/transactionProcessor/dtos/PrivateAuthorizeReconciliationAdjustmentResponse.js +2 -0
- package/bin/transactionProcessor/dtos/ReconciliationAdjustmentReference.d.ts +5 -0
- package/bin/transactionProcessor/dtos/ReconciliationAdjustmentReference.js +30 -0
- package/bin/transactionProcessor/index.d.ts +3 -0
- package/bin/transactionProcessor/index.js +3 -0
- package/bin/transferNote/constants/transferNoteDefaultFees.d.ts +5 -0
- package/bin/transferNote/constants/transferNoteDefaultFees.js +9 -0
- package/bin/transferNote/constants/transferNoteErrorHttpStatus.d.ts +3 -0
- package/bin/transferNote/constants/transferNoteErrorHttpStatus.js +30 -0
- package/bin/transferNote/constants/transferNoteValidation.d.ts +7 -0
- package/bin/transferNote/constants/transferNoteValidation.js +10 -0
- package/bin/transferNote/dtos/TransferNote.d.ts +81 -0
- package/bin/transferNote/dtos/TransferNote.js +2 -0
- package/bin/transferNote/dtos/TransferNoteConfigRecords.d.ts +50 -0
- package/bin/transferNote/dtos/TransferNoteConfigRecords.js +2 -0
- package/bin/transferNote/dtos/TransferNoteFeedRecords.d.ts +38 -0
- package/bin/transferNote/dtos/TransferNoteFeedRecords.js +2 -0
- package/bin/transferNote/dtos/TransferNoteHistoryEntry.d.ts +16 -0
- package/bin/transferNote/dtos/TransferNoteHistoryEntry.js +2 -0
- package/bin/transferNote/dtos/TransferNoteItem.d.ts +36 -0
- package/bin/transferNote/dtos/TransferNoteItem.js +2 -0
- package/bin/transferNote/dtos/TransferNoteSignedUrl.d.ts +5 -0
- package/bin/transferNote/dtos/TransferNoteSignedUrl.js +2 -0
- package/bin/transferNote/dtos/requests/PrivateTransferNoteRequests.d.ts +105 -0
- package/bin/transferNote/dtos/requests/PrivateTransferNoteRequests.js +256 -0
- package/bin/transferNote/dtos/requests/RetailerTransferNoteRequests.d.ts +20 -0
- package/bin/transferNote/dtos/requests/RetailerTransferNoteRequests.js +47 -0
- package/bin/transferNote/dtos/requests/TransferNoteActionRequests.d.ts +33 -0
- package/bin/transferNote/dtos/requests/TransferNoteActionRequests.js +104 -0
- package/bin/transferNote/dtos/requests/TransferNoteConfigRequests.d.ts +38 -0
- package/bin/transferNote/dtos/requests/TransferNoteConfigRequests.js +152 -0
- package/bin/transferNote/dtos/requests/TransferNoteQueries.d.ts +29 -0
- package/bin/transferNote/dtos/requests/TransferNoteQueries.js +107 -0
- package/bin/transferNote/dtos/requests/transferNoteRequestDecorators.d.ts +14 -0
- package/bin/transferNote/dtos/requests/transferNoteRequestDecorators.js +73 -0
- package/bin/transferNote/dtos/responses/PrivateTransferNoteResponses.d.ts +26 -0
- package/bin/transferNote/dtos/responses/PrivateTransferNoteResponses.js +2 -0
- package/bin/transferNote/dtos/responses/RetailerTransferNoteResponses.d.ts +13 -0
- package/bin/transferNote/dtos/responses/RetailerTransferNoteResponses.js +2 -0
- package/bin/transferNote/dtos/responses/TransferNoteConfigResponses.d.ts +6 -0
- package/bin/transferNote/dtos/responses/TransferNoteConfigResponses.js +2 -0
- package/bin/transferNote/dtos/responses/TransferNoteResponses.d.ts +44 -0
- package/bin/transferNote/dtos/responses/TransferNoteResponses.js +2 -0
- package/bin/transferNote/enums/TransferNoteConceptEnum.d.ts +16 -0
- package/bin/transferNote/enums/TransferNoteConceptEnum.js +20 -0
- package/bin/transferNote/enums/TransferNoteConceptSignEnum.d.ts +5 -0
- package/bin/transferNote/enums/TransferNoteConceptSignEnum.js +9 -0
- package/bin/transferNote/enums/TransferNoteConfigRecordTypeEnum.d.ts +7 -0
- package/bin/transferNote/enums/TransferNoteConfigRecordTypeEnum.js +11 -0
- package/bin/transferNote/enums/TransferNoteConfirmationSourceEnum.d.ts +5 -0
- package/bin/transferNote/enums/TransferNoteConfirmationSourceEnum.js +9 -0
- package/bin/transferNote/enums/TransferNoteConfirmationTypeEnum.d.ts +5 -0
- package/bin/transferNote/enums/TransferNoteConfirmationTypeEnum.js +9 -0
- package/bin/transferNote/enums/TransferNoteDisputeCategoryEnum.d.ts +7 -0
- package/bin/transferNote/enums/TransferNoteDisputeCategoryEnum.js +11 -0
- package/bin/transferNote/enums/TransferNoteDisputeDecisionEnum.d.ts +5 -0
- package/bin/transferNote/enums/TransferNoteDisputeDecisionEnum.js +9 -0
- package/bin/transferNote/enums/TransferNoteErrorCodeEnum.d.ts +32 -0
- package/bin/transferNote/enums/TransferNoteErrorCodeEnum.js +36 -0
- package/bin/transferNote/enums/TransferNoteFeedConceptEnum.d.ts +5 -0
- package/bin/transferNote/enums/TransferNoteFeedConceptEnum.js +9 -0
- package/bin/transferNote/enums/TransferNoteHistoryActionEnum.d.ts +13 -0
- package/bin/transferNote/enums/TransferNoteHistoryActionEnum.js +17 -0
- package/bin/transferNote/enums/TransferNoteIssueOriginEnum.d.ts +6 -0
- package/bin/transferNote/enums/TransferNoteIssueOriginEnum.js +10 -0
- package/bin/transferNote/enums/TransferNoteItemStatusEnum.d.ts +5 -0
- package/bin/transferNote/enums/TransferNoteItemStatusEnum.js +9 -0
- package/bin/transferNote/enums/TransferNotePartyTypeEnum.d.ts +6 -0
- package/bin/transferNote/enums/TransferNotePartyTypeEnum.js +10 -0
- package/bin/transferNote/enums/TransferNoteStatusEnum.d.ts +9 -0
- package/bin/transferNote/enums/TransferNoteStatusEnum.js +13 -0
- package/bin/transferNote/events/TransferNoteReconciledEventDetail.d.ts +17 -0
- package/bin/transferNote/events/TransferNoteReconciledEventDetail.js +13 -0
- package/bin/transferNote/index.d.ts +34 -0
- package/bin/transferNote/index.js +56 -0
- package/bin/transferNote/validators/IsTransferNoteSelectionConstraint.d.ts +6 -0
- package/bin/transferNote/validators/IsTransferNoteSelectionConstraint.js +28 -0
- package/package.json +1 -1
- package/src/account/dtos/BankAccountMCSendTransferRequest.ts +8 -2
- package/src/account/dtos/BankAccountMCSendTransferResponse.ts +3 -0
- package/src/index.ts +8 -0
- package/src/loanRetailAudit/enums/AuditTrailActionEnum.ts +12 -0
- package/src/loanRetailAudit/enums/LoanAuditEntityTypeEnum.ts +4 -0
- package/src/reconciliation/constants/reconciliationErrorHttpStatus.ts +22 -0
- package/src/reconciliation/constants/reconciliationValidation.ts +11 -0
- package/src/reconciliation/dtos/ReconciliationDefinition.ts +44 -0
- package/src/reconciliation/dtos/ReconciliationFeedRecord.ts +44 -0
- package/src/reconciliation/dtos/ReconciliationItem.ts +84 -0
- package/src/reconciliation/dtos/ReconciliationRun.ts +31 -0
- package/src/reconciliation/dtos/requests/PrivateReconciliationRequests.ts +166 -0
- package/src/reconciliation/dtos/requests/ReconciliationActionRequests.ts +77 -0
- package/src/reconciliation/dtos/requests/ReconciliationFeedRequests.ts +47 -0
- package/src/reconciliation/dtos/requests/ReconciliationQueries.ts +148 -0
- package/src/reconciliation/dtos/requests/reconciliationRequestDecorators.ts +32 -0
- package/src/reconciliation/dtos/responses/PrivateReconciliationResponses.ts +27 -0
- package/src/reconciliation/dtos/responses/ReconciliationFeedResponses.ts +9 -0
- package/src/reconciliation/dtos/responses/ReconciliationResponses.ts +101 -0
- package/src/reconciliation/enums/ReconciliationDefinitionStatusEnum.ts +6 -0
- package/src/reconciliation/enums/ReconciliationErrorCodeEnum.ts +24 -0
- package/src/reconciliation/enums/ReconciliationExportFormatEnum.ts +5 -0
- package/src/reconciliation/enums/ReconciliationFeedConceptEnum.ts +19 -0
- package/src/reconciliation/enums/ReconciliationFeedErrorCodeEnum.ts +4 -0
- package/src/reconciliation/enums/ReconciliationFeedOwnerEnum.ts +9 -0
- package/src/reconciliation/enums/ReconciliationItemStateEnum.ts +23 -0
- package/src/reconciliation/enums/ReconciliationLayerEnum.ts +8 -0
- package/src/reconciliation/enums/ReconciliationPeriodEnum.ts +6 -0
- package/src/reconciliation/enums/ReconciliationResolutionArchiveReasonEnum.ts +6 -0
- package/src/reconciliation/enums/ReconciliationResolutionStatusEnum.ts +9 -0
- package/src/reconciliation/enums/ReconciliationResolutionTypeEnum.ts +7 -0
- package/src/reconciliation/enums/ReconciliationRuleTypeEnum.ts +7 -0
- package/src/reconciliation/enums/ReconciliationRunStatusEnum.ts +6 -0
- package/src/reconciliation/enums/ReconciliationSourceRoleEnum.ts +6 -0
- package/src/reconciliation/events/ReconciliationItemMatchedEventDetail.ts +25 -0
- package/src/reconciliation/index.ts +40 -0
- package/src/retailWizard/catalog/privateSaleDetailFields.ts +15 -0
- package/src/retailWizard/constants/retailWizardValidation.ts +2 -0
- package/src/retailWizard/dtos/requests/PrivateGetSaleRequest.ts +26 -0
- package/src/retailWizard/dtos/responses/PrivateGetSaleResponse.ts +16 -0
- package/src/retailWizard/index.ts +6 -0
- package/src/transaction/dtos/TransactionCreateRequest.ts +12 -0
- package/src/transactionProcessor/dtos/PrivateAuthorizeReconciliationAdjustmentRequest.ts +101 -0
- package/src/transactionProcessor/dtos/PrivateAuthorizeReconciliationAdjustmentResponse.ts +7 -0
- package/src/transactionProcessor/dtos/ReconciliationAdjustmentReference.ts +15 -0
- package/src/transactionProcessor/index.ts +3 -0
- package/src/transferNote/constants/transferNoteDefaultFees.ts +7 -0
- package/src/transferNote/constants/transferNoteErrorHttpStatus.ts +28 -0
- package/src/transferNote/constants/transferNoteValidation.ts +10 -0
- package/src/transferNote/dtos/TransferNote.ts +89 -0
- package/src/transferNote/dtos/TransferNoteConfigRecords.ts +55 -0
- package/src/transferNote/dtos/TransferNoteFeedRecords.ts +35 -0
- package/src/transferNote/dtos/TransferNoteHistoryEntry.ts +17 -0
- package/src/transferNote/dtos/TransferNoteItem.ts +38 -0
- package/src/transferNote/dtos/TransferNoteSignedUrl.ts +5 -0
- package/src/transferNote/dtos/requests/PrivateTransferNoteRequests.ts +195 -0
- package/src/transferNote/dtos/requests/RetailerTransferNoteRequests.ts +28 -0
- package/src/transferNote/dtos/requests/TransferNoteActionRequests.ts +72 -0
- package/src/transferNote/dtos/requests/TransferNoteConfigRequests.ts +115 -0
- package/src/transferNote/dtos/requests/TransferNoteQueries.ts +78 -0
- package/src/transferNote/dtos/requests/transferNoteRequestDecorators.ts +72 -0
- package/src/transferNote/dtos/responses/PrivateTransferNoteResponses.ts +36 -0
- package/src/transferNote/dtos/responses/RetailerTransferNoteResponses.ts +19 -0
- package/src/transferNote/dtos/responses/TransferNoteConfigResponses.ts +8 -0
- package/src/transferNote/dtos/responses/TransferNoteResponses.ts +51 -0
- package/src/transferNote/enums/TransferNoteConceptEnum.ts +16 -0
- package/src/transferNote/enums/TransferNoteConceptSignEnum.ts +5 -0
- package/src/transferNote/enums/TransferNoteConfigRecordTypeEnum.ts +7 -0
- package/src/transferNote/enums/TransferNoteConfirmationSourceEnum.ts +5 -0
- package/src/transferNote/enums/TransferNoteConfirmationTypeEnum.ts +5 -0
- package/src/transferNote/enums/TransferNoteDisputeCategoryEnum.ts +7 -0
- package/src/transferNote/enums/TransferNoteDisputeDecisionEnum.ts +5 -0
- package/src/transferNote/enums/TransferNoteErrorCodeEnum.ts +34 -0
- package/src/transferNote/enums/TransferNoteFeedConceptEnum.ts +5 -0
- package/src/transferNote/enums/TransferNoteHistoryActionEnum.ts +13 -0
- package/src/transferNote/enums/TransferNoteIssueOriginEnum.ts +6 -0
- package/src/transferNote/enums/TransferNoteItemStatusEnum.ts +5 -0
- package/src/transferNote/enums/TransferNotePartyTypeEnum.ts +6 -0
- package/src/transferNote/enums/TransferNoteStatusEnum.ts +9 -0
- package/src/transferNote/events/TransferNoteReconciledEventDetail.ts +22 -0
- package/src/transferNote/index.ts +45 -0
- package/src/transferNote/validators/IsTransferNoteSelectionConstraint.ts +16 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { BankAccountMCSendTransferRequest, BankAccountMCSendTransferResponse } from '../../../src/account/index';
|
|
3
|
+
import { TransactionStatusEnum } from '../../../src/transaction';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* MC Send directo a una tarjeta del programa (CARD_PUSH_FUNDS): el request admite el cd_ del
|
|
7
|
+
* beneficiario y entonces email y teléfono dejan de ser obligatorios; la respuesta expone el id
|
|
8
|
+
* de la network transfer de CP (mt_) además de los tx_.
|
|
9
|
+
*/
|
|
10
|
+
describe('BankAccountMCSendTransferRequest', () => {
|
|
11
|
+
it('acepta un push directo a tarjeta sin email ni teléfono del beneficiario', () => {
|
|
12
|
+
const request: BankAccountMCSendTransferRequest = {
|
|
13
|
+
transactionNumber: 'T1',
|
|
14
|
+
amount: 1,
|
|
15
|
+
externalAccountId: 'cd_origen',
|
|
16
|
+
beneficiaryExternalAccountId: 'cd_destino',
|
|
17
|
+
};
|
|
18
|
+
expect(request.beneficiaryExternalAccountId).toBe('cd_destino');
|
|
19
|
+
expect(request.beneficiaryEmail).toBeUndefined();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('sigue aceptando la intención por email y teléfono', () => {
|
|
23
|
+
const request: BankAccountMCSendTransferRequest = {
|
|
24
|
+
transactionNumber: 'T2',
|
|
25
|
+
amount: 1,
|
|
26
|
+
beneficiaryEmail: 'a@b.com',
|
|
27
|
+
beneficiaryPhoneNumber: '3055550100',
|
|
28
|
+
};
|
|
29
|
+
expect(request.beneficiaryExternalAccountId).toBeUndefined();
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
describe('BankAccountMCSendTransferResponse', () => {
|
|
34
|
+
it('expone externalTransferId (mt_) junto a externalTransactionId (tx_)', () => {
|
|
35
|
+
const response: BankAccountMCSendTransferResponse = {
|
|
36
|
+
externalTransactionId: 'tx_1|tx_2',
|
|
37
|
+
externalTransferId: 'mt_1',
|
|
38
|
+
transactionStatus: TransactionStatusEnum.COMPLETED,
|
|
39
|
+
transactionNumber: 'T1',
|
|
40
|
+
};
|
|
41
|
+
expect(response.externalTransferId).toBe('mt_1');
|
|
42
|
+
});
|
|
43
|
+
});
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { plainToInstance } from 'class-transformer';
|
|
3
|
+
import { validateSync } from 'class-validator';
|
|
4
|
+
import * as LoanRetailAudit from '../../../src/loanRetailAudit';
|
|
5
|
+
|
|
6
|
+
const { AuditTrailRecordedV1, AuditTrailActionEnum, LoanAuditEntityTypeEnum, AUDIT_TRAIL_ENTITY_TYPES } = LoanRetailAudit;
|
|
7
|
+
|
|
8
|
+
describe('entidades de auditoría de M8', () => {
|
|
9
|
+
it.each(['TRANSFER_NOTE', 'TRANSFER_NOTE_CONFIG', 'RECONCILIATION_DEFINITION', 'RECONCILIATION_ITEM'])(
|
|
10
|
+
'%s existe y la acepta el central',
|
|
11
|
+
(entityType) => {
|
|
12
|
+
expect(Object.values(LoanAuditEntityTypeEnum)).toContain(entityType);
|
|
13
|
+
expect(AUDIT_TRAIL_ENTITY_TYPES).toContain(entityType);
|
|
14
|
+
},
|
|
15
|
+
);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
describe('acciones de auditoría de M8', () => {
|
|
19
|
+
it.each([
|
|
20
|
+
'TRANSFER_NOTE_ISSUE',
|
|
21
|
+
'TRANSFER_NOTE_SPEI_CAPTURE',
|
|
22
|
+
'TRANSFER_NOTE_SPEI_REVERT',
|
|
23
|
+
'TRANSFER_NOTE_RECEPTION_CONFIRM',
|
|
24
|
+
'TRANSFER_NOTE_SETTLEMENT_CONFIRM',
|
|
25
|
+
'TRANSFER_NOTE_CANCEL',
|
|
26
|
+
'TRANSFER_NOTE_DISPUTE',
|
|
27
|
+
'TRANSFER_NOTE_DISPUTE_RESOLVE',
|
|
28
|
+
'RECONCILIATION_ITEM_RESOLVE',
|
|
29
|
+
'RECONCILIATION_ITEM_REACTIVATE',
|
|
30
|
+
'RECONCILIATION_ITEM_NOTE',
|
|
31
|
+
])('%s existe con su mismo valor', (action) => {
|
|
32
|
+
expect((AuditTrailActionEnum as Record<string, string>)[action]).toBe(action);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it('la configuración reusa UPDATE', () => {
|
|
36
|
+
expect(AuditTrailActionEnum.UPDATE).toBe('UPDATE');
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it('el central acepta un evento de nota emitida', () => {
|
|
40
|
+
const dto = plainToInstance(
|
|
41
|
+
AuditTrailRecordedV1,
|
|
42
|
+
{
|
|
43
|
+
eventId: '01JABCDEF0123456789XYZABCD',
|
|
44
|
+
entityType: LoanAuditEntityTypeEnum.TRANSFER_NOTE,
|
|
45
|
+
entityId: 'note-1',
|
|
46
|
+
action: AuditTrailActionEnum.TRANSFER_NOTE_ISSUE,
|
|
47
|
+
changes: [{ field: 'status', newValue: 'ISSUED' }],
|
|
48
|
+
context: [{ key: 'pairKey', value: 'GATEWAY#SOFOM' }],
|
|
49
|
+
performedBy: 'transfer-note-business',
|
|
50
|
+
sourceLambda: 'transfer-note-business',
|
|
51
|
+
occurredAt: '2026-10-29T12:00:00.000Z',
|
|
52
|
+
tenantId: 'surekeep',
|
|
53
|
+
},
|
|
54
|
+
{ excludeExtraneousValues: true },
|
|
55
|
+
);
|
|
56
|
+
expect(validateSync(dto)).toEqual([]);
|
|
57
|
+
});
|
|
58
|
+
});
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import * as Reconciliation from '../../../src/reconciliation';
|
|
3
|
+
import * as TransferNote from '../../../src/transferNote';
|
|
4
|
+
|
|
5
|
+
const {
|
|
6
|
+
ReconciliationRuleTypeEnum,
|
|
7
|
+
ReconciliationDefinitionStatusEnum,
|
|
8
|
+
ReconciliationItemStateEnum,
|
|
9
|
+
ReconciliationResolutionTypeEnum,
|
|
10
|
+
ReconciliationResolutionStatusEnum,
|
|
11
|
+
ReconciliationRunStatusEnum,
|
|
12
|
+
ReconciliationLayerEnum,
|
|
13
|
+
ReconciliationFeedConceptEnum,
|
|
14
|
+
ReconciliationErrorCodeEnum,
|
|
15
|
+
RECONCILIATION_ERROR_HTTP_STATUS,
|
|
16
|
+
ReconciliationFeedErrorCodeEnum,
|
|
17
|
+
RECONCILIATION_FEED_ERROR_HTTP_STATUS,
|
|
18
|
+
RECONCILIATION_EVENTS_SOURCE,
|
|
19
|
+
ReconciliationEventDetailTypeEnum,
|
|
20
|
+
RECONCILIATION_FEED_PAGE_SIZE,
|
|
21
|
+
ReconciliationFeedOwnerEnum,
|
|
22
|
+
} = Reconciliation;
|
|
23
|
+
|
|
24
|
+
describe('catálogos de reconciliation', () => {
|
|
25
|
+
it('los 4 tipos de regla del spec; el agregado es capa, no regla', () => {
|
|
26
|
+
expect(Object.values(ReconciliationRuleTypeEnum)).toEqual(['PAIRWISE', 'COMPLETENESS', 'SETTLEMENT', 'BANK_STATEMENT']);
|
|
27
|
+
expect(Object.values(ReconciliationLayerEnum)).toContain('AGGREGATE');
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it('estados de definición', () => {
|
|
31
|
+
expect(Object.values(ReconciliationDefinitionStatusEnum)).toEqual(['PAUSED', 'SHADOW', 'ACTIVE']);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('estados calculados de partida de las 4 capas, completitud y sandbox', () => {
|
|
35
|
+
expect(Object.values(ReconciliationItemStateEnum).sort()).toEqual(
|
|
36
|
+
[
|
|
37
|
+
'MATCHED',
|
|
38
|
+
'PENDING',
|
|
39
|
+
'MISSING_IN_EXPECTED',
|
|
40
|
+
'MISSING_IN_EXECUTED',
|
|
41
|
+
'AMOUNT_MISMATCH',
|
|
42
|
+
'MISSING_IN_BANK_STATEMENT',
|
|
43
|
+
'UNEXPLAINED_DIFFERENCE',
|
|
44
|
+
'OUT_OF_WINDOW',
|
|
45
|
+
'ACCOUNT_MISMATCH',
|
|
46
|
+
'COMPLETE',
|
|
47
|
+
'INCOMPLETE',
|
|
48
|
+
'TEST',
|
|
49
|
+
].sort(),
|
|
50
|
+
);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it('resolución: tipo aparte de su estado, con ADJUSTING y ADJUSTED', () => {
|
|
54
|
+
expect(Object.values(ReconciliationResolutionTypeEnum)).toEqual(['ACCEPT', 'INVESTIGATE', 'EXCLUDE', 'ADJUST']);
|
|
55
|
+
expect(Object.values(ReconciliationResolutionStatusEnum)).toEqual(
|
|
56
|
+
expect.arrayContaining(['INVESTIGATING', 'CLOSED', 'ADJUSTING', 'ADJUSTED']),
|
|
57
|
+
);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
it('estados de corrida', () => {
|
|
61
|
+
expect(Object.values(ReconciliationRunStatusEnum)).toEqual(['RUNNING', 'COMPLETED', 'FAILED']);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it('conceptos de feed reusan los strings de transferNote', () => {
|
|
65
|
+
expect(ReconciliationFeedConceptEnum.INSTALLMENT_COLLECTION).toBe(TransferNote.TransferNoteConceptEnum.INSTALLMENT_COLLECTION);
|
|
66
|
+
expect(ReconciliationFeedConceptEnum.DEVICE_PAYMENT).toBe(TransferNote.TransferNoteConceptEnum.DEVICE_PAYMENT);
|
|
67
|
+
expect(ReconciliationFeedConceptEnum.TRANSFER_NOTE_ITEM).toBe(TransferNote.TransferNoteFeedConceptEnum.TRANSFER_NOTE_ITEM);
|
|
68
|
+
expect(ReconciliationFeedConceptEnum.TRANSFER_NOTE_SETTLEMENT).toBe(
|
|
69
|
+
TransferNote.TransferNoteFeedConceptEnum.TRANSFER_NOTE_SETTLEMENT,
|
|
70
|
+
);
|
|
71
|
+
expect(Object.values(ReconciliationFeedConceptEnum)).toEqual(expect.arrayContaining(['SIGNED_CREDIT', 'GATEWAY_LEDGER']));
|
|
72
|
+
expect(Object.values(ReconciliationFeedConceptEnum)).not.toContain('ADJUSTMENT');
|
|
73
|
+
expect(RECONCILIATION_FEED_PAGE_SIZE).toBe(500);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
it('cada code del motor tiene su status; el ajuste caído es 502', () => {
|
|
77
|
+
const codes = Object.values(ReconciliationErrorCodeEnum);
|
|
78
|
+
expect(codes).toEqual(
|
|
79
|
+
expect.arrayContaining([
|
|
80
|
+
'DEFINITION_NOT_FOUND',
|
|
81
|
+
'RUN_IN_PROGRESS',
|
|
82
|
+
'ITEM_NOT_FOUND',
|
|
83
|
+
'ITEM_ALREADY_RESOLVED',
|
|
84
|
+
'ADJUSTMENT_IN_PROGRESS',
|
|
85
|
+
'ADJUSTMENT_UNDER_EXECUTED',
|
|
86
|
+
'ADJUSTMENT_NOT_ALLOWED',
|
|
87
|
+
'ADJUSTMENT_REJECTED',
|
|
88
|
+
'ADJUSTMENT_UNAVAILABLE',
|
|
89
|
+
'ITEM_ADJUSTED',
|
|
90
|
+
'AUTHOR_NOT_ALLOWED',
|
|
91
|
+
]),
|
|
92
|
+
);
|
|
93
|
+
for (const code of codes) {
|
|
94
|
+
expect([400, 404, 409, 422, 502]).toContain(RECONCILIATION_ERROR_HTTP_STATUS[code]);
|
|
95
|
+
}
|
|
96
|
+
expect(RECONCILIATION_ERROR_HTTP_STATUS[ReconciliationErrorCodeEnum.ADJUSTMENT_UNAVAILABLE]).toBe(502);
|
|
97
|
+
expect(RECONCILIATION_ERROR_HTTP_STATUS[ReconciliationErrorCodeEnum.ITEM_ALREADY_RESOLVED]).toBe(409);
|
|
98
|
+
expect(RECONCILIATION_ERROR_HTTP_STATUS[ReconciliationErrorCodeEnum.ADJUSTMENT_UNDER_EXECUTED]).toBe(422);
|
|
99
|
+
expect(RECONCILIATION_ERROR_HTTP_STATUS[ReconciliationErrorCodeEnum.ITEM_ADJUSTED]).toBe(409);
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
it('el 404 del feed genérico tiene el mismo string que el de transferNote', () => {
|
|
103
|
+
expect(ReconciliationFeedErrorCodeEnum.FEED_RECORD_NOT_FOUND).toBe(
|
|
104
|
+
TransferNote.TransferNoteErrorCodeEnum.FEED_RECORD_NOT_FOUND,
|
|
105
|
+
);
|
|
106
|
+
expect(RECONCILIATION_FEED_ERROR_HTTP_STATUS[ReconciliationFeedErrorCodeEnum.FEED_RECORD_NOT_FOUND]).toBe(404);
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
it('nombres de los eventos que publica y consume el motor', () => {
|
|
110
|
+
expect(RECONCILIATION_EVENTS_SOURCE).toBe('fiado.reconciliation');
|
|
111
|
+
expect(ReconciliationEventDetailTypeEnum.RECONCILIATION_ITEM_MATCHED).toBe('reconciliation.ReconciliationItemMatched');
|
|
112
|
+
expect(Object.keys(Reconciliation)).not.toContain('TRANSFER_NOTE_EVENTS_SOURCE');
|
|
113
|
+
expect(Object.keys(Reconciliation)).not.toContain('TransferNoteEventDetailTypeEnum');
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
it('los dueños de feed son los lambdas del ciclo, por su nombre', () => {
|
|
117
|
+
expect(Object.values(ReconciliationFeedOwnerEnum).sort()).toEqual([
|
|
118
|
+
'loan-credit-business',
|
|
119
|
+
'loan-offerings-business',
|
|
120
|
+
'retail-customer-business',
|
|
121
|
+
'retail-wizard-business',
|
|
122
|
+
'transaction-business',
|
|
123
|
+
'transfer-note-business',
|
|
124
|
+
]);
|
|
125
|
+
});
|
|
126
|
+
});
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { plainToInstance } from 'class-transformer';
|
|
3
|
+
import { validateSync } from 'class-validator';
|
|
4
|
+
import * as Reconciliation from '../../../src/reconciliation';
|
|
5
|
+
|
|
6
|
+
const {
|
|
7
|
+
ReconciliationDefinitionStatusEnum,
|
|
8
|
+
ReconciliationItemStateEnum,
|
|
9
|
+
ReconciliationResolutionTypeEnum,
|
|
10
|
+
ReconciliationFeedConceptEnum,
|
|
11
|
+
ReconciliationExportFormatEnum,
|
|
12
|
+
ConfigureReconciliationDefinitionRequest,
|
|
13
|
+
ListReconciliationRunsQuery,
|
|
14
|
+
RunReconciliationRequest,
|
|
15
|
+
GetReconciliationMatrixQuery,
|
|
16
|
+
GetReconciliationSummaryQuery,
|
|
17
|
+
ListReconciliationItemsQuery,
|
|
18
|
+
ResolveReconciliationItemRequest,
|
|
19
|
+
ReactivateReconciliationItemRequest,
|
|
20
|
+
AddReconciliationItemNoteRequest,
|
|
21
|
+
PrivateConfigureReconciliationDefinitionRequest,
|
|
22
|
+
PrivateListReconciliationDefinitionsQuery,
|
|
23
|
+
PrivateRunReconciliationRequest,
|
|
24
|
+
PrivateResolveReconciliationItemRequest,
|
|
25
|
+
PrivateAddReconciliationItemNoteRequest,
|
|
26
|
+
PrivateGetReconciliationItemQuery,
|
|
27
|
+
PrivateListReconciliationItemsQuery,
|
|
28
|
+
PrivateListReconciliationFeedQuery,
|
|
29
|
+
PrivateGetReconciliationFeedRecordQuery,
|
|
30
|
+
ReconciliationFeedPathParams,
|
|
31
|
+
} = Reconciliation;
|
|
32
|
+
|
|
33
|
+
function errorsOf<T extends object>(cls: new () => T, payload: Record<string, unknown>): string[] {
|
|
34
|
+
const dto = plainToInstance(cls, payload, { excludeExtraneousValues: true });
|
|
35
|
+
return validateSync(dto).map((e) => e.property);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const operator = { tenantId: 'surekeep', author: 'conciliacion-dashboard', actor: 'operador@fsa.mx' };
|
|
39
|
+
|
|
40
|
+
describe('definiciones', () => {
|
|
41
|
+
it('configurar pide un estado válido y listas de sandbox opcionales', () => {
|
|
42
|
+
expect(
|
|
43
|
+
errorsOf(ConfigureReconciliationDefinitionRequest, {
|
|
44
|
+
status: ReconciliationDefinitionStatusEnum.SHADOW,
|
|
45
|
+
sandboxRetailerIds: ['r-test'],
|
|
46
|
+
sandboxDirectoryIds: ['d-test'],
|
|
47
|
+
}),
|
|
48
|
+
).toEqual([]);
|
|
49
|
+
expect(errorsOf(ConfigureReconciliationDefinitionRequest, { status: 'ON' })).toContain('status');
|
|
50
|
+
expect(
|
|
51
|
+
errorsOf(ConfigureReconciliationDefinitionRequest, {
|
|
52
|
+
status: ReconciliationDefinitionStatusEnum.ACTIVE,
|
|
53
|
+
sandboxRetailerIds: [''],
|
|
54
|
+
}),
|
|
55
|
+
).toContain('sandboxRetailerIds');
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
describe('corridas', () => {
|
|
60
|
+
it('la corrida manual pide definición y periodo diario, semanal o mensual', () => {
|
|
61
|
+
for (const periodKey of ['2026-10-29', '2026-W44', '2026-10']) {
|
|
62
|
+
expect(errorsOf(RunReconciliationRequest, { definitionId: 'm8-gateway-sofom', periodKey })).toEqual([]);
|
|
63
|
+
}
|
|
64
|
+
expect(errorsOf(RunReconciliationRequest, { definitionId: 'm8-gateway-sofom', periodKey: 'octubre' })).toContain(
|
|
65
|
+
'periodKey',
|
|
66
|
+
);
|
|
67
|
+
expect(errorsOf(RunReconciliationRequest, { periodKey: '2026-10' })).toContain('definitionId');
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
it('el listado de corridas pide la definición', () => {
|
|
71
|
+
expect(errorsOf(ListReconciliationRunsQuery, { definitionId: 'm8-gateway-bank', limit: '20' })).toEqual([]);
|
|
72
|
+
expect(errorsOf(ListReconciliationRunsQuery, {})).toContain('definitionId');
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
it('el periodo del listado de corridas es opcional pero con formato', () => {
|
|
76
|
+
expect(errorsOf(ListReconciliationRunsQuery, { definitionId: 'm8-gateway-bank', periodKey: '2026-W44' })).toEqual([]);
|
|
77
|
+
expect(errorsOf(ListReconciliationRunsQuery, { definitionId: 'm8-gateway-bank', periodKey: 'octubre' })).toContain(
|
|
78
|
+
'periodKey',
|
|
79
|
+
);
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
describe('matriz, resumen y partidas', () => {
|
|
84
|
+
it('la matriz pide definición y año', () => {
|
|
85
|
+
expect(errorsOf(GetReconciliationMatrixQuery, { definitionId: 'm8-gateway-sofom', year: '2026' })).toEqual([]);
|
|
86
|
+
expect(errorsOf(GetReconciliationMatrixQuery, { definitionId: 'm8-gateway-sofom', year: 'dos mil' })).toContain(
|
|
87
|
+
'year',
|
|
88
|
+
);
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
it('el resumen por capa pide definición y periodo', () => {
|
|
92
|
+
expect(errorsOf(GetReconciliationSummaryQuery, { definitionId: 'm8-gateway-sofom', periodKey: '2026-W44' })).toEqual(
|
|
93
|
+
[],
|
|
94
|
+
);
|
|
95
|
+
expect(errorsOf(GetReconciliationSummaryQuery, { definitionId: 'm8-gateway-sofom' })).toContain('periodKey');
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
it('las partidas aceptan state=TEST y format=csv', () => {
|
|
99
|
+
expect(
|
|
100
|
+
errorsOf(ListReconciliationItemsQuery, {
|
|
101
|
+
definitionId: 'm8-gateway-sofom',
|
|
102
|
+
state: ReconciliationItemStateEnum.TEST,
|
|
103
|
+
format: ReconciliationExportFormatEnum.CSV,
|
|
104
|
+
month: '2026-10',
|
|
105
|
+
}),
|
|
106
|
+
).toEqual([]);
|
|
107
|
+
expect(ReconciliationExportFormatEnum.CSV).toBe('csv');
|
|
108
|
+
expect(errorsOf(ListReconciliationItemsQuery, { definitionId: 'x', format: 'xlsx' })).toContain('format');
|
|
109
|
+
expect(errorsOf(ListReconciliationItemsQuery, { definitionId: 'x', month: '2026-13' })).toContain('month');
|
|
110
|
+
expect(errorsOf(ListReconciliationItemsQuery, { definitionId: 'x', periodKey: '2026-10' })).toEqual([]);
|
|
111
|
+
expect(errorsOf(ListReconciliationItemsQuery, { definitionId: 'x', periodKey: 'octubre' })).toContain('periodKey');
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
describe('resolución, reactivación y notas', () => {
|
|
116
|
+
it('resolver pide tipo y razón', () => {
|
|
117
|
+
expect(
|
|
118
|
+
errorsOf(ResolveReconciliationItemRequest, {
|
|
119
|
+
type: ReconciliationResolutionTypeEnum.ADJUST,
|
|
120
|
+
reason: 'cobro duplicado del intento',
|
|
121
|
+
}),
|
|
122
|
+
).toEqual([]);
|
|
123
|
+
expect(errorsOf(ResolveReconciliationItemRequest, { type: 'REJECT', reason: 'x' })).toContain('type');
|
|
124
|
+
expect(errorsOf(ResolveReconciliationItemRequest, { type: ReconciliationResolutionTypeEnum.ACCEPT, reason: ' ' })).toContain(
|
|
125
|
+
'reason',
|
|
126
|
+
);
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
it('reactivar pide razón', () => {
|
|
130
|
+
expect(errorsOf(ReactivateReconciliationItemRequest, { reason: 'se aceptó por error' })).toEqual([]);
|
|
131
|
+
expect(errorsOf(ReactivateReconciliationItemRequest, {})).toContain('reason');
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
it('la nota de investigación pide 10+ caracteres sin contar relleno', () => {
|
|
135
|
+
expect(errorsOf(AddReconciliationItemNoteRequest, { text: 'revisar con tesorería' })).toEqual([]);
|
|
136
|
+
expect(errorsOf(AddReconciliationItemNoteRequest, { text: ' corta ' })).toContain('text');
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
describe('espejo privado', () => {
|
|
141
|
+
it('agrega tenantId, author y actor a la versión pública', () => {
|
|
142
|
+
expect(
|
|
143
|
+
errorsOf(PrivateResolveReconciliationItemRequest, {
|
|
144
|
+
...operator,
|
|
145
|
+
type: ReconciliationResolutionTypeEnum.EXCLUDE,
|
|
146
|
+
reason: 'prueba interna',
|
|
147
|
+
}),
|
|
148
|
+
).toEqual([]);
|
|
149
|
+
const missing = errorsOf(PrivateResolveReconciliationItemRequest, {
|
|
150
|
+
type: ReconciliationResolutionTypeEnum.EXCLUDE,
|
|
151
|
+
reason: 'prueba interna',
|
|
152
|
+
});
|
|
153
|
+
expect(missing).toEqual(expect.arrayContaining(['tenantId', 'author', 'actor']));
|
|
154
|
+
expect(errorsOf(PrivateAddReconciliationItemNoteRequest, { ...operator, actor: 'no-es-correo', text: 'revisar con tesorería' })).toContain(
|
|
155
|
+
'actor',
|
|
156
|
+
);
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
it('cubre definiciones, corridas y lecturas', () => {
|
|
160
|
+
expect(
|
|
161
|
+
errorsOf(PrivateConfigureReconciliationDefinitionRequest, {
|
|
162
|
+
...operator,
|
|
163
|
+
status: ReconciliationDefinitionStatusEnum.PAUSED,
|
|
164
|
+
}),
|
|
165
|
+
).toEqual([]);
|
|
166
|
+
expect(errorsOf(PrivateListReconciliationDefinitionsQuery, operator)).toEqual([]);
|
|
167
|
+
expect(errorsOf(PrivateRunReconciliationRequest, { ...operator, definitionId: 'm8-gateway-bank', periodKey: '2026-10-29' })).toEqual(
|
|
168
|
+
[],
|
|
169
|
+
);
|
|
170
|
+
expect(errorsOf(PrivateGetReconciliationItemQuery, { tenantId: 'surekeep', author: 'x' })).toContain('actor');
|
|
171
|
+
expect(errorsOf(PrivateListReconciliationItemsQuery, { ...operator, definitionId: 'm8-gateway-sofom' })).toEqual([]);
|
|
172
|
+
});
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
describe('feed genérico de los dueños', () => {
|
|
176
|
+
it('lista por tenant y ventana, con cursor opcional', () => {
|
|
177
|
+
expect(
|
|
178
|
+
errorsOf(PrivateListReconciliationFeedQuery, {
|
|
179
|
+
tenantId: 'surekeep',
|
|
180
|
+
from: '2026-10-19T06:00:00.000Z',
|
|
181
|
+
to: '2026-10-26T05:59:59.999Z',
|
|
182
|
+
cursor: 'abc',
|
|
183
|
+
}),
|
|
184
|
+
).toEqual([]);
|
|
185
|
+
expect(errorsOf(PrivateListReconciliationFeedQuery, { tenantId: 'surekeep', from: 'ayer' })).toEqual(
|
|
186
|
+
expect.arrayContaining(['from', 'to']),
|
|
187
|
+
);
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
it('el registro por recordId pide tenant y el servicio que llama; el actor es opcional', () => {
|
|
191
|
+
expect(errorsOf(PrivateGetReconciliationFeedRecordQuery, { tenantId: 'surekeep', author: 'reconciliation-engine-business' })).toEqual(
|
|
192
|
+
[],
|
|
193
|
+
);
|
|
194
|
+
expect(
|
|
195
|
+
errorsOf(PrivateGetReconciliationFeedRecordQuery, {
|
|
196
|
+
tenantId: 'surekeep',
|
|
197
|
+
author: 'reconciliation-engine-business',
|
|
198
|
+
actor: 'no-es-correo',
|
|
199
|
+
}),
|
|
200
|
+
).toContain('actor');
|
|
201
|
+
expect(errorsOf(PrivateGetReconciliationFeedRecordQuery, { tenantId: 'surekeep' })).toContain('author');
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
it('el concepto del path es del catálogo de feeds', () => {
|
|
205
|
+
expect(errorsOf(ReconciliationFeedPathParams, { concept: ReconciliationFeedConceptEnum.SIGNED_CREDIT })).toEqual([]);
|
|
206
|
+
expect(errorsOf(ReconciliationFeedPathParams, { concept: 'ADJUSTMENT' })).toContain('concept');
|
|
207
|
+
});
|
|
208
|
+
});
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import * as Reconciliation from '../../../src/reconciliation';
|
|
3
|
+
import * as TransferNote from '../../../src/transferNote';
|
|
4
|
+
import { CurrencyId } from '../../../src/currency/enums/CurrencyId';
|
|
5
|
+
|
|
6
|
+
const { ReconciliationFeedConceptEnum, ReconciliationRuleTypeEnum, ReconciliationItemStateEnum, ReconciliationLayerEnum } =
|
|
7
|
+
Reconciliation;
|
|
8
|
+
|
|
9
|
+
describe('formas del contrato', () => {
|
|
10
|
+
it('una reversa es una fila nueva con signo contrario y refs cerrados', () => {
|
|
11
|
+
const reversal: Reconciliation.ReconciliationFeedRecord = {
|
|
12
|
+
recordId: 'pay-1#rev',
|
|
13
|
+
tenantId: 'surekeep',
|
|
14
|
+
concept: ReconciliationFeedConceptEnum.INSTALLMENT_COLLECTION,
|
|
15
|
+
matchKey: 'att-1',
|
|
16
|
+
amountCents: -15000,
|
|
17
|
+
currency: CurrencyId.MXN,
|
|
18
|
+
occurredAt: '2026-10-20T15:00:00.000Z',
|
|
19
|
+
feedDay: '2026-10-20',
|
|
20
|
+
refs: { attemptId: 'att-1', creditId: 'cr-1', customerId: 'c-1', reversesRecordId: 'pay-1' },
|
|
21
|
+
};
|
|
22
|
+
expect(reversal.refs.reversesRecordId).toBe('pay-1');
|
|
23
|
+
expect(Object.keys(reversal)).not.toContain('sandbox');
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it('el feed de notas usa la misma envoltura con sus registros', () => {
|
|
27
|
+
const page: Reconciliation.PrivateListReconciliationFeedResponse<TransferNote.TransferNoteSettlementFeedRecord> = {
|
|
28
|
+
records: [],
|
|
29
|
+
};
|
|
30
|
+
expect(page.cursor).toBeUndefined();
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it('ReconciliationItemMatched exige refs.noteId', () => {
|
|
34
|
+
const detail: Reconciliation.ReconciliationItemMatchedEventDetail = {
|
|
35
|
+
eventId: 'surekeep#m8-gateway-bank#TRANSFER_NOTE_SETTLEMENT#n-1',
|
|
36
|
+
tenantId: 'surekeep',
|
|
37
|
+
definitionId: 'm8-gateway-bank',
|
|
38
|
+
itemKey: 'TRANSFER_NOTE_SETTLEMENT#n-1',
|
|
39
|
+
ruleType: ReconciliationRuleTypeEnum.BANK_STATEMENT,
|
|
40
|
+
periodKey: '2026-10-29',
|
|
41
|
+
amountCents: 125000,
|
|
42
|
+
matchedAt: '2026-10-29T10:00:00.000Z',
|
|
43
|
+
refs: { noteId: 'n-1', trackingKey: 'BBVA123' },
|
|
44
|
+
};
|
|
45
|
+
expect(detail.refs.noteId).toBe('n-1');
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it('el detalle de completitud trae piezas y omite el campo en vivo que falló', () => {
|
|
49
|
+
const detail: Reconciliation.GetReconciliationItemResponse = {
|
|
50
|
+
tenantId: 'surekeep',
|
|
51
|
+
definitionId: 'm8-sofom-retailer-cycle',
|
|
52
|
+
itemKey: 'SIGNED_CREDIT#cr-1',
|
|
53
|
+
concept: ReconciliationFeedConceptEnum.SIGNED_CREDIT,
|
|
54
|
+
matchKey: 'cr-1',
|
|
55
|
+
layer: ReconciliationLayerEnum.COMPLETENESS,
|
|
56
|
+
periodKey: '2026-10-20',
|
|
57
|
+
state: ReconciliationItemStateEnum.INCOMPLETE,
|
|
58
|
+
currency: CurrencyId.MXN,
|
|
59
|
+
parts: [
|
|
60
|
+
{ partName: 'DEVICE_PAYMENT', concept: ReconciliationFeedConceptEnum.TRANSFER_NOTE_ITEM, recordId: 'it-1' },
|
|
61
|
+
{ partName: 'DOWN_PAYMENT', concept: ReconciliationFeedConceptEnum.TRANSFER_NOTE_ITEM },
|
|
62
|
+
],
|
|
63
|
+
firstSeenRunId: 'run-1',
|
|
64
|
+
lastSeenRunId: 'run-2',
|
|
65
|
+
createdAt: '2026-10-21T10:00:00.000Z',
|
|
66
|
+
updatedAt: '2026-10-28T10:00:00.000Z',
|
|
67
|
+
notes: [],
|
|
68
|
+
resolutionHistory: [],
|
|
69
|
+
liveDetail: { creditId: 'cr-1', amountCents: 450000, productModel: 'Galaxy A15' },
|
|
70
|
+
};
|
|
71
|
+
expect(detail.parts?.[1].recordId).toBeUndefined();
|
|
72
|
+
expect(detail.liveDetail.customerName).toBeUndefined();
|
|
73
|
+
});
|
|
74
|
+
});
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { plainToInstance } from 'class-transformer';
|
|
3
|
+
import { validateSync } from 'class-validator';
|
|
4
|
+
import * as RetailWizard from '../../../src/retailWizard';
|
|
5
|
+
|
|
6
|
+
const { PrivateGetSaleRequest, PRIVATE_SALE_DETAIL_FIELDS, RETAIL_WIZARD_CALLER_SERVICE_PATTERN } = RetailWizard;
|
|
7
|
+
|
|
8
|
+
function errorsOf(payload: Record<string, unknown>): string[] {
|
|
9
|
+
const dto = plainToInstance(PrivateGetSaleRequest, payload, { excludeExtraneousValues: true });
|
|
10
|
+
return validateSync(dto).map((e) => e.property);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const valid = {
|
|
14
|
+
saleId: 'sale-1',
|
|
15
|
+
tenantId: 'surekeep',
|
|
16
|
+
actor: 'operador@fsa.mx',
|
|
17
|
+
callerService: 'reconciliation-engine-business',
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
describe('PrivateGetSaleRequest', () => {
|
|
21
|
+
it('acepta saleId, tenant, actor y callerService', () => {
|
|
22
|
+
expect(errorsOf(valid)).toEqual([]);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it('los cuatro son obligatorios', () => {
|
|
26
|
+
expect(errorsOf({}).sort()).toEqual(['actor', 'callerService', 'saleId', 'tenantId']);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it('callerService es el nombre del lambda en kebab-case', () => {
|
|
30
|
+
expect(errorsOf({ ...valid, callerService: 'Reconciliation Engine' })).toEqual(['callerService']);
|
|
31
|
+
expect(RETAIL_WIZARD_CALLER_SERVICE_PATTERN.test('reconciliation-engine-business')).toBe(true);
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
describe('PRIVATE_SALE_DETAIL_FIELDS', () => {
|
|
36
|
+
it('es la lista cerrada del detalle más ids', () => {
|
|
37
|
+
expect([...PRIVATE_SALE_DETAIL_FIELDS].sort()).toEqual(
|
|
38
|
+
[
|
|
39
|
+
'amountCents',
|
|
40
|
+
'creditId',
|
|
41
|
+
'customerName',
|
|
42
|
+
'customerPhone',
|
|
43
|
+
'productModel',
|
|
44
|
+
'retailCustomerId',
|
|
45
|
+
'retailerId',
|
|
46
|
+
'saleId',
|
|
47
|
+
'sellerName',
|
|
48
|
+
'sellerRetailUserId',
|
|
49
|
+
].sort(),
|
|
50
|
+
);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it('nunca incluye IMEI, CURP ni RFC', () => {
|
|
54
|
+
const fields = PRIVATE_SALE_DETAIL_FIELDS.map((f) => f.toLowerCase());
|
|
55
|
+
for (const forbidden of ['imei', 'customercurp', 'curp', 'rfc', 'email', 'address']) {
|
|
56
|
+
expect(fields).not.toContain(forbidden);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { plainToInstance } from 'class-transformer';
|
|
3
|
+
import { validateSync } from 'class-validator';
|
|
4
|
+
import { TransactionCreateRequest } from '../../../src/transaction';
|
|
5
|
+
|
|
6
|
+
function errorPropsOf(payload: Record<string, unknown>): string[] {
|
|
7
|
+
return validateSync(plainToInstance(TransactionCreateRequest, payload)).map((e) => e.property);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
describe('TransactionCreateRequest · executionId y tenant SOFOM', () => {
|
|
11
|
+
it('ambos son opcionales', () => {
|
|
12
|
+
const props = errorPropsOf({});
|
|
13
|
+
expect(props).not.toContain('executionId');
|
|
14
|
+
expect(props).not.toContain('sofomTenantId');
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it('acepta strings no vacíos', () => {
|
|
18
|
+
const props = errorPropsOf({ executionId: 'exec-1', sofomTenantId: 'surekeep' });
|
|
19
|
+
expect(props).not.toContain('executionId');
|
|
20
|
+
expect(props).not.toContain('sofomTenantId');
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('rechaza tipos que no son string o vacíos', () => {
|
|
24
|
+
expect(errorPropsOf({ executionId: 12 })).toContain('executionId');
|
|
25
|
+
expect(errorPropsOf({ sofomTenantId: '' })).toContain('sofomTenantId');
|
|
26
|
+
});
|
|
27
|
+
});
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { plainToInstance } from 'class-transformer';
|
|
3
|
+
import { validateSync } from 'class-validator';
|
|
4
|
+
import * as TransactionProcessor from '../../../src/transactionProcessor';
|
|
5
|
+
import { OperationEnum } from '../../../src/transaction';
|
|
6
|
+
import { CurrencyId } from '../../../src/currency/enums/CurrencyId';
|
|
7
|
+
|
|
8
|
+
const { PrivateAuthorizeReconciliationAdjustmentRequest } = TransactionProcessor;
|
|
9
|
+
|
|
10
|
+
function errorsOf(payload: Record<string, unknown>): string[] {
|
|
11
|
+
const dto = plainToInstance(PrivateAuthorizeReconciliationAdjustmentRequest, payload, { excludeExtraneousValues: true });
|
|
12
|
+
return validateSync(dto).map((e) => e.property);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const valid = {
|
|
16
|
+
tenantId: 'surekeep',
|
|
17
|
+
adjustmentKey: 'surekeep#INSTALLMENT_COLLECTION_L1#exec-1#1',
|
|
18
|
+
directoryId: '3f2b8c1e-7a4d-4b9e-9c1a-2d5e6f7a8b9c',
|
|
19
|
+
operation: OperationEnum.ADD,
|
|
20
|
+
amountCents: 15000,
|
|
21
|
+
currencyId: CurrencyId.MXN,
|
|
22
|
+
originalTransactionId: 'tx-1',
|
|
23
|
+
executionId: 'exec-1',
|
|
24
|
+
reference: { definitionId: 'INSTALLMENT_COLLECTION_L1', itemKey: 'exec-1' },
|
|
25
|
+
reason: 'cobro duplicado del intento exec-1',
|
|
26
|
+
actor: 'operador@fsa.mx',
|
|
27
|
+
author: 'reconciliation-engine-business',
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
describe('PrivateAuthorizeReconciliationAdjustmentRequest', () => {
|
|
31
|
+
it('acepta un ajuste completo', () => {
|
|
32
|
+
expect(errorsOf(valid)).toEqual([]);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it('executionId es opcional', () => {
|
|
36
|
+
const { executionId, ...rest } = valid;
|
|
37
|
+
expect(errorsOf(rest)).toEqual([]);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it('la llave debe empezar con el tenantId', () => {
|
|
41
|
+
expect(errorsOf({ ...valid, adjustmentKey: 'otro#INSTALLMENT_COLLECTION_L1#exec-1#1' })).toEqual(['adjustmentKey']);
|
|
42
|
+
expect(errorsOf({ ...valid, adjustmentKey: 'INSTALLMENT_COLLECTION_L1#exec-1#1' })).toEqual(['adjustmentKey']);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it('el monto es entero positivo en centavos', () => {
|
|
46
|
+
expect(errorsOf({ ...valid, amountCents: 0 })).toEqual(['amountCents']);
|
|
47
|
+
expect(errorsOf({ ...valid, amountCents: -100 })).toEqual(['amountCents']);
|
|
48
|
+
expect(errorsOf({ ...valid, amountCents: 10.5 })).toEqual(['amountCents']);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('rechaza operación, moneda, directoryId y actor inválidos', () => {
|
|
52
|
+
expect(errorsOf({ ...valid, operation: 'CREDIT' })).toEqual(['operation']);
|
|
53
|
+
expect(errorsOf({ ...valid, currencyId: 'MEX' })).toEqual(['currencyId']);
|
|
54
|
+
expect(errorsOf({ ...valid, directoryId: 'no-uuid' })).toEqual(['directoryId']);
|
|
55
|
+
expect(errorsOf({ ...valid, actor: 'no-email' })).toEqual(['actor']);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it('exige la referencia a la partida y la razón', () => {
|
|
59
|
+
expect(errorsOf({ ...valid, reference: { definitionId: 'X' } })).toEqual(['reference']);
|
|
60
|
+
expect(errorsOf({ ...valid, reason: ' ' })).toEqual(['reason']);
|
|
61
|
+
expect(errorsOf({ ...valid, originalTransactionId: '' })).toEqual(['originalTransactionId']);
|
|
62
|
+
});
|
|
63
|
+
});
|