@fiado/type-kit 3.310.1 → 3.311.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/retailCards/cardStockRequests.test.ts +148 -0
- package/bin/retailCards/dtos/requests/RegisterCardBatchRequest.d.ts +7 -3
- package/bin/retailCards/dtos/requests/RegisterCardBatchRequest.js +8 -7
- package/bin/retailCards/dtos/requests/RegisterCardDeliveryRequest.d.ts +11 -0
- package/bin/{retailWizard/dtos/requests/MarkPcfCardDeliveredRequest.js → retailCards/dtos/requests/RegisterCardDeliveryRequest.js} +21 -7
- package/bin/retailCards/dtos/requests/ReverseCardMovementRequest.d.ts +9 -0
- package/bin/retailCards/dtos/requests/{AssignCardRequest.js → ReverseCardMovementRequest.js} +9 -11
- package/bin/retailCards/dtos/requests/WriteOffCardStockRequest.d.ts +7 -0
- package/bin/{retailWizard/dtos/requests/CompleteSaleRequest.js → retailCards/dtos/requests/WriteOffCardStockRequest.js} +15 -12
- package/bin/retailCards/dtos/responses/CardBatchResponse.d.ts +10 -12
- package/bin/retailCards/dtos/responses/CardDeliveryResponse.d.ts +11 -0
- package/bin/retailCards/dtos/responses/CardStockBalanceResponse.d.ts +13 -0
- package/bin/retailCards/dtos/responses/CardStockMovementResponse.d.ts +19 -0
- package/bin/retailCards/dtos/responses/CardStockResponse.d.ts +12 -0
- package/bin/retailCards/enums/CardStockMovementTypeEnum.d.ts +15 -0
- package/bin/retailCards/enums/CardStockMovementTypeEnum.js +19 -0
- package/bin/retailCards/enums/CardWriteOffReasonEnum.d.ts +13 -0
- package/bin/retailCards/enums/CardWriteOffReasonEnum.js +17 -0
- package/bin/retailCards/events/CardBatchReceivedV1.d.ts +5 -3
- package/bin/retailCards/index.d.ts +9 -9
- package/bin/retailCards/index.js +9 -9
- package/bin/retailWizard/dtos/Sale.d.ts +2 -1
- package/bin/retailWizard/index.d.ts +0 -2
- package/bin/retailWizard/index.js +0 -2
- package/package.json +1 -1
- package/src/retailCards/dtos/requests/RegisterCardBatchRequest.ts +9 -7
- package/src/retailCards/dtos/requests/RegisterCardDeliveryRequest.ts +21 -0
- package/src/retailCards/dtos/requests/ReverseCardMovementRequest.ts +14 -0
- package/src/retailCards/dtos/requests/WriteOffCardStockRequest.ts +16 -0
- package/src/retailCards/dtos/responses/CardBatchResponse.ts +10 -13
- package/src/retailCards/dtos/responses/CardDeliveryResponse.ts +11 -0
- package/src/retailCards/dtos/responses/CardStockBalanceResponse.ts +13 -0
- package/src/retailCards/dtos/responses/CardStockMovementResponse.ts +20 -0
- package/src/retailCards/dtos/responses/CardStockResponse.ts +13 -0
- package/src/retailCards/enums/CardStockMovementTypeEnum.ts +15 -0
- package/src/retailCards/enums/CardWriteOffReasonEnum.ts +13 -0
- package/src/retailCards/events/CardBatchReceivedV1.ts +5 -3
- package/src/retailCards/index.ts +9 -9
- package/src/retailWizard/dtos/Sale.ts +2 -1
- package/src/retailWizard/index.ts +0 -2
- package/bin/retailCards/dtos/requests/AssignCardRequest.d.ts +0 -6
- package/bin/retailCards/dtos/requests/CancelCardRequest.d.ts +0 -5
- package/bin/retailCards/dtos/requests/CancelCardRequest.js +0 -22
- package/bin/retailCards/dtos/responses/RetailCardResponse.d.ts +0 -12
- package/bin/retailCards/enums/CardBatchStatusEnum.d.ts +0 -17
- package/bin/retailCards/enums/CardBatchStatusEnum.js +0 -21
- package/bin/retailCards/enums/CardCancelReasonEnum.d.ts +0 -13
- package/bin/retailCards/enums/CardCancelReasonEnum.js +0 -17
- package/bin/retailCards/enums/RetailCardStatusEnum.d.ts +0 -13
- package/bin/retailCards/enums/RetailCardStatusEnum.js +0 -17
- package/bin/retailCards/events/RetailCardAssignedV1.d.ts +0 -10
- package/bin/retailCards/events/RetailCardCancelledV1.d.ts +0 -9
- package/bin/retailCards/events/RetailCardReleasedV1.d.ts +0 -7
- package/bin/retailWizard/dtos/requests/CompleteSaleRequest.d.ts +0 -9
- package/bin/retailWizard/dtos/requests/MarkPcfCardDeliveredRequest.d.ts +0 -4
- package/src/retailCards/dtos/requests/AssignCardRequest.ts +0 -14
- package/src/retailCards/dtos/requests/CancelCardRequest.ts +0 -8
- package/src/retailCards/dtos/responses/RetailCardResponse.ts +0 -13
- package/src/retailCards/enums/CardBatchStatusEnum.ts +0 -17
- package/src/retailCards/enums/CardCancelReasonEnum.ts +0 -13
- package/src/retailCards/enums/RetailCardStatusEnum.ts +0 -13
- package/src/retailCards/events/RetailCardAssignedV1.ts +0 -10
- package/src/retailCards/events/RetailCardCancelledV1.ts +0 -10
- package/src/retailCards/events/RetailCardReleasedV1.ts +0 -7
- package/src/retailWizard/dtos/requests/CompleteSaleRequest.ts +0 -15
- package/src/retailWizard/dtos/requests/MarkPcfCardDeliveredRequest.ts +0 -9
- /package/bin/retailCards/dtos/responses/{RetailCardResponse.js → CardDeliveryResponse.js} +0 -0
- /package/bin/retailCards/{events/RetailCardAssignedV1.js → dtos/responses/CardStockBalanceResponse.js} +0 -0
- /package/bin/retailCards/{events/RetailCardCancelledV1.js → dtos/responses/CardStockMovementResponse.js} +0 -0
- /package/bin/retailCards/{events/RetailCardReleasedV1.js → dtos/responses/CardStockResponse.js} +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { IsOptional, IsString } from 'class-validator';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Body de la entrega de una tarjeta física a un cliente. Descuenta el saldo de la tienda y asienta el
|
|
5
|
+
* movimiento en una sola operación: en mostrador asignar y entregar son el mismo acto.
|
|
6
|
+
*/
|
|
7
|
+
export class RegisterCardDeliveryRequest {
|
|
8
|
+
@IsString()
|
|
9
|
+
customerId!: string;
|
|
10
|
+
|
|
11
|
+
@IsString()
|
|
12
|
+
deliveredByUserId!: string;
|
|
13
|
+
|
|
14
|
+
/** Clave de idempotencia de la entrega: un reintento devuelve el `deliveryId` original. */
|
|
15
|
+
@IsString()
|
|
16
|
+
sessionId!: string;
|
|
17
|
+
|
|
18
|
+
@IsOptional()
|
|
19
|
+
@IsString()
|
|
20
|
+
creditId?: string;
|
|
21
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IsString } from 'class-validator';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Body del contraasiento que revierte un movimiento del libro mayor. No borra el asiento original:
|
|
5
|
+
* escribe uno nuevo que lo compensa.
|
|
6
|
+
*/
|
|
7
|
+
export class ReverseCardMovementRequest {
|
|
8
|
+
/** `sk` del asiento que se revierte (`MOV#<isoTs>#<uuid>`). */
|
|
9
|
+
@IsString()
|
|
10
|
+
movementSk!: string;
|
|
11
|
+
|
|
12
|
+
@IsString()
|
|
13
|
+
reason!: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IsEnum, IsInt, IsOptional, IsString, Min } from 'class-validator';
|
|
2
|
+
import { CardWriteOffReasonEnum } from '../../enums/CardWriteOffReasonEnum';
|
|
3
|
+
|
|
4
|
+
/** Body de la baja de inventario de tarjetas de una tienda, por cantidad. */
|
|
5
|
+
export class WriteOffCardStockRequest {
|
|
6
|
+
@IsInt()
|
|
7
|
+
@Min(1)
|
|
8
|
+
quantity!: number;
|
|
9
|
+
|
|
10
|
+
@IsEnum(CardWriteOffReasonEnum)
|
|
11
|
+
reason!: CardWriteOffReasonEnum;
|
|
12
|
+
|
|
13
|
+
@IsOptional()
|
|
14
|
+
@IsString()
|
|
15
|
+
notes?: string | null;
|
|
16
|
+
}
|
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Lote de tarjetas recibido por una tienda (`sk = BATCH#<isoTs>#<uuid>`). Es un hecho histórico: el
|
|
3
|
+
* lote no cambia de estado ni lleva conteos, esos viven en el saldo.
|
|
4
|
+
*/
|
|
4
5
|
export interface CardBatchResponse {
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
batchSk: string;
|
|
7
|
+
/** Folio de la remesa del proveedor. */
|
|
8
|
+
supplierBatchRef: string;
|
|
7
9
|
storeId: string;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
availableCount: number;
|
|
12
|
-
assignedCount: number;
|
|
13
|
-
cancelledCount: number;
|
|
14
|
-
status: CardBatchStatusEnum;
|
|
10
|
+
retailerId: string;
|
|
11
|
+
quantity: number;
|
|
12
|
+
notes: string | null;
|
|
15
13
|
receivedAt: string;
|
|
16
14
|
receivedByUserId: string;
|
|
17
|
-
notes: string | null;
|
|
18
15
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resultado de entregar una tarjeta física a un cliente. Un reintento con el mismo `sessionId`
|
|
3
|
+
* devuelve este mismo `deliveryId` con 200, no un error.
|
|
4
|
+
*/
|
|
5
|
+
export interface CardDeliveryResponse {
|
|
6
|
+
deliveryId: string;
|
|
7
|
+
movementSk: string;
|
|
8
|
+
/** Saldo disponible que quedó en la tienda después de descontar la entrega. */
|
|
9
|
+
availableAfter: number;
|
|
10
|
+
occurredAt: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Saldo vigente de tarjetas físicas de una tienda (`sk = BALANCE`). Es reconstruible sumando los
|
|
3
|
+
* asientos del libro mayor.
|
|
4
|
+
*/
|
|
5
|
+
export interface CardStockBalanceResponse {
|
|
6
|
+
storeId: string;
|
|
7
|
+
retailerId: string;
|
|
8
|
+
/** Unidades disponibles para entregar. Sin saldo no hay entrega. */
|
|
9
|
+
available: number;
|
|
10
|
+
deliveredTotal: number;
|
|
11
|
+
writtenOffTotal: number;
|
|
12
|
+
updatedAt: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { CardStockMovementTypeEnum } from '../../enums/CardStockMovementTypeEnum';
|
|
2
|
+
import { CardWriteOffReasonEnum } from '../../enums/CardWriteOffReasonEnum';
|
|
3
|
+
|
|
4
|
+
/** Asiento del libro mayor de tarjetas de una tienda (`sk = MOV#<isoTs>#<uuid>`). */
|
|
5
|
+
export interface CardStockMovementResponse {
|
|
6
|
+
movementSk: string;
|
|
7
|
+
type: CardStockMovementTypeEnum;
|
|
8
|
+
/** Con signo: positiva en las entradas, negativa en las salidas. */
|
|
9
|
+
quantity: number;
|
|
10
|
+
occurredAt: string;
|
|
11
|
+
actorUserId: string;
|
|
12
|
+
/** Cliente que recibió la tarjeta; solo en `OUT_DELIVERY`. */
|
|
13
|
+
customerId: string | null;
|
|
14
|
+
/** Motivo catalogado de la baja; solo en `OUT_WRITE_OFF`. */
|
|
15
|
+
reason: CardWriteOffReasonEnum | null;
|
|
16
|
+
/** Explicación libre del contraasiento; solo en `REVERSAL`. */
|
|
17
|
+
reversalReason: string | null;
|
|
18
|
+
/** `sk` referenciado: el lote en `IN_BATCH`, el asiento revertido en `REVERSAL`. */
|
|
19
|
+
refSk: string | null;
|
|
20
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CardStockBalanceResponse } from './CardStockBalanceResponse';
|
|
2
|
+
import { CardStockMovementResponse } from './CardStockMovementResponse';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Pantalla de inventario de una tienda: el saldo vigente más una página de asientos. Ambos salen de
|
|
6
|
+
* la misma partición, así que viajan en una sola respuesta.
|
|
7
|
+
*/
|
|
8
|
+
export interface CardStockResponse {
|
|
9
|
+
balance: CardStockBalanceResponse;
|
|
10
|
+
movements: CardStockMovementResponse[];
|
|
11
|
+
count: number;
|
|
12
|
+
nextToken?: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tipo de asiento del libro mayor de tarjetas físicas (`sk = MOV#<isoTs>#<uuid>`).
|
|
3
|
+
* @enum {string}
|
|
4
|
+
*
|
|
5
|
+
* @property {string} IN_BATCH - Entrada por recepción de un lote del proveedor (cantidad positiva).
|
|
6
|
+
* @property {string} OUT_DELIVERY - Salida por entrega de una tarjeta a un cliente en mostrador.
|
|
7
|
+
* @property {string} OUT_WRITE_OFF - Salida por baja de inventario (plástico dañado, extravío, robo).
|
|
8
|
+
* @property {string} REVERSAL - Contraasiento que revierte un movimiento previo vía `refSk`.
|
|
9
|
+
*/
|
|
10
|
+
export enum CardStockMovementTypeEnum {
|
|
11
|
+
IN_BATCH = 'IN_BATCH',
|
|
12
|
+
OUT_DELIVERY = 'OUT_DELIVERY',
|
|
13
|
+
OUT_WRITE_OFF = 'OUT_WRITE_OFF',
|
|
14
|
+
REVERSAL = 'REVERSAL',
|
|
15
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Motivo de una baja de inventario de tarjetas físicas por cantidad.
|
|
3
|
+
* @enum {string}
|
|
4
|
+
*
|
|
5
|
+
* @property {string} PLASTIC_DAMAGED - Plásticos dañados, inservibles para entregar.
|
|
6
|
+
* @property {string} LOST - Unidades extraviadas en la tienda.
|
|
7
|
+
* @property {string} STOLEN - Unidades robadas del inventario de la tienda.
|
|
8
|
+
*/
|
|
9
|
+
export enum CardWriteOffReasonEnum {
|
|
10
|
+
PLASTIC_DAMAGED = 'PLASTIC_DAMAGED',
|
|
11
|
+
LOST = 'LOST',
|
|
12
|
+
STOLEN = 'STOLEN',
|
|
13
|
+
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
/** Emitido cuando un lote de tarjetas
|
|
1
|
+
/** Emitido cuando una tienda recibe un lote de tarjetas físicas. */
|
|
2
2
|
export interface CardBatchReceivedV1 {
|
|
3
|
-
|
|
3
|
+
/** `sk` del lote en la partición de la tienda (`BATCH#<isoTs>#<uuid>`). */
|
|
4
|
+
batchSk: string;
|
|
5
|
+
supplierBatchRef: string;
|
|
4
6
|
retailerId: string;
|
|
5
7
|
storeId: string;
|
|
6
|
-
|
|
8
|
+
quantity: number;
|
|
7
9
|
receivedByUserId: string;
|
|
8
10
|
occurredAt: string;
|
|
9
11
|
}
|
package/src/retailCards/index.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
export * from './enums/
|
|
2
|
-
export * from './enums/
|
|
3
|
-
export * from './enums/CardCancelReasonEnum';
|
|
1
|
+
export * from './enums/CardStockMovementTypeEnum';
|
|
2
|
+
export * from './enums/CardWriteOffReasonEnum';
|
|
4
3
|
|
|
5
4
|
// Request DTOs (input validado por endpoint)
|
|
6
5
|
export * from './dtos/requests/RegisterCardBatchRequest';
|
|
7
|
-
export * from './dtos/requests/
|
|
8
|
-
export * from './dtos/requests/
|
|
6
|
+
export * from './dtos/requests/RegisterCardDeliveryRequest';
|
|
7
|
+
export * from './dtos/requests/WriteOffCardStockRequest';
|
|
8
|
+
export * from './dtos/requests/ReverseCardMovementRequest';
|
|
9
9
|
|
|
10
10
|
// Response DTOs
|
|
11
11
|
export * from './dtos/responses/CardBatchResponse';
|
|
12
|
-
export * from './dtos/responses/
|
|
12
|
+
export * from './dtos/responses/CardDeliveryResponse';
|
|
13
|
+
export * from './dtos/responses/CardStockBalanceResponse';
|
|
14
|
+
export * from './dtos/responses/CardStockMovementResponse';
|
|
15
|
+
export * from './dtos/responses/CardStockResponse';
|
|
13
16
|
export * from './dtos/responses/StockAlertItem';
|
|
14
17
|
export * from './dtos/responses/StockAlertsResponse';
|
|
15
18
|
|
|
16
19
|
// Contratos de eventos (PascalCase + sufijo V1)
|
|
17
20
|
export * from './events/CardBatchReceivedV1';
|
|
18
|
-
export * from './events/RetailCardAssignedV1';
|
|
19
|
-
export * from './events/RetailCardReleasedV1';
|
|
20
|
-
export * from './events/RetailCardCancelledV1';
|
|
@@ -43,7 +43,8 @@ export interface Sale {
|
|
|
43
43
|
folio: string;
|
|
44
44
|
paymentDetail: SalePaymentDetail | null;
|
|
45
45
|
soldAt: string;
|
|
46
|
-
|
|
46
|
+
/** Puntero a la entrega de la tarjeta física en `retail-cards-business`. */
|
|
47
|
+
cardDeliveryId: string | null;
|
|
47
48
|
centralSyncStatus: CentralSyncStatusEnum;
|
|
48
49
|
centralTag: string | null;
|
|
49
50
|
status: SaleStatusEnum;
|
|
@@ -60,9 +60,7 @@ export * from './dtos/requests/DeleteProductRequest';
|
|
|
60
60
|
export * from './dtos/requests/SetPaymentMethodRequest';
|
|
61
61
|
export * from './dtos/requests/ExternalReferralRequest';
|
|
62
62
|
export * from './dtos/requests/RegisterPaymentRequest';
|
|
63
|
-
export * from './dtos/requests/CompleteSaleRequest';
|
|
64
63
|
export * from './dtos/requests/AppInstallLinkRequest';
|
|
65
|
-
export * from './dtos/requests/MarkPcfCardDeliveredRequest';
|
|
66
64
|
export * from './dtos/requests/ConfirmAddressRequest';
|
|
67
65
|
export * from './dtos/requests/ProfileQuestionsRequest';
|
|
68
66
|
export * from './dtos/requests/SaveBeneficiaryRequest';
|
|
@@ -1,22 +0,0 @@
|
|
|
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.CancelCardRequest = void 0;
|
|
13
|
-
const class_validator_1 = require("class-validator");
|
|
14
|
-
const CardCancelReasonEnum_1 = require("../../enums/CardCancelReasonEnum");
|
|
15
|
-
/** Body de la cancelación (anulación) de una tarjeta física. */
|
|
16
|
-
class CancelCardRequest {
|
|
17
|
-
}
|
|
18
|
-
exports.CancelCardRequest = CancelCardRequest;
|
|
19
|
-
__decorate([
|
|
20
|
-
(0, class_validator_1.IsEnum)(CardCancelReasonEnum_1.CardCancelReasonEnum),
|
|
21
|
-
__metadata("design:type", String)
|
|
22
|
-
], CancelCardRequest.prototype, "reason", void 0);
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { RetailCardStatusEnum } from '../../enums/RetailCardStatusEnum';
|
|
2
|
-
/** Representación de una tarjeta física hacia el cliente. */
|
|
3
|
-
export interface RetailCardResponse {
|
|
4
|
-
cardNumber: string;
|
|
5
|
-
retailerId: string;
|
|
6
|
-
batchId: string;
|
|
7
|
-
storeId: string;
|
|
8
|
-
status: RetailCardStatusEnum;
|
|
9
|
-
assignedToCustomerId: string | null;
|
|
10
|
-
assignedAt: string | null;
|
|
11
|
-
assignedByUserId: string | null;
|
|
12
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Estado de un lote de tarjetas.
|
|
3
|
-
* @enum {string}
|
|
4
|
-
*
|
|
5
|
-
* @property {string} RECEIVING - Transitorio, carga en curso (DEC-004/DEC-008).
|
|
6
|
-
* @property {string} RECEIVED - Carga completada, lote atado a una tienda (happy-path F1).
|
|
7
|
-
* @property {string} FAILED - Terminal, la carga del lote falló (DEC-004/DEC-008).
|
|
8
|
-
* @property {string} DISTRIBUTED - Reservado F1 — lote centralizado repartido a varias tiendas (TD-008).
|
|
9
|
-
* @property {string} CLOSED - Reservado F1 — cierre manual del lote (TD-008).
|
|
10
|
-
*/
|
|
11
|
-
export declare enum CardBatchStatusEnum {
|
|
12
|
-
RECEIVING = "RECEIVING",
|
|
13
|
-
RECEIVED = "RECEIVED",
|
|
14
|
-
FAILED = "FAILED",
|
|
15
|
-
DISTRIBUTED = "DISTRIBUTED",
|
|
16
|
-
CLOSED = "CLOSED"
|
|
17
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CardBatchStatusEnum = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Estado de un lote de tarjetas.
|
|
6
|
-
* @enum {string}
|
|
7
|
-
*
|
|
8
|
-
* @property {string} RECEIVING - Transitorio, carga en curso (DEC-004/DEC-008).
|
|
9
|
-
* @property {string} RECEIVED - Carga completada, lote atado a una tienda (happy-path F1).
|
|
10
|
-
* @property {string} FAILED - Terminal, la carga del lote falló (DEC-004/DEC-008).
|
|
11
|
-
* @property {string} DISTRIBUTED - Reservado F1 — lote centralizado repartido a varias tiendas (TD-008).
|
|
12
|
-
* @property {string} CLOSED - Reservado F1 — cierre manual del lote (TD-008).
|
|
13
|
-
*/
|
|
14
|
-
var CardBatchStatusEnum;
|
|
15
|
-
(function (CardBatchStatusEnum) {
|
|
16
|
-
CardBatchStatusEnum["RECEIVING"] = "RECEIVING";
|
|
17
|
-
CardBatchStatusEnum["RECEIVED"] = "RECEIVED";
|
|
18
|
-
CardBatchStatusEnum["FAILED"] = "FAILED";
|
|
19
|
-
CardBatchStatusEnum["DISTRIBUTED"] = "DISTRIBUTED";
|
|
20
|
-
CardBatchStatusEnum["CLOSED"] = "CLOSED";
|
|
21
|
-
})(CardBatchStatusEnum || (exports.CardBatchStatusEnum = CardBatchStatusEnum = {}));
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Motivo de cancelación de una tarjeta física.
|
|
3
|
-
* @enum {string}
|
|
4
|
-
*
|
|
5
|
-
* @property {string} PLASTIC_DAMAGED - Plástico dañado.
|
|
6
|
-
* @property {string} LOST - Tarjeta perdida.
|
|
7
|
-
* @property {string} THEFT_REPORTED - Robo reportado.
|
|
8
|
-
*/
|
|
9
|
-
export declare enum CardCancelReasonEnum {
|
|
10
|
-
PLASTIC_DAMAGED = "PLASTIC_DAMAGED",
|
|
11
|
-
LOST = "LOST",
|
|
12
|
-
THEFT_REPORTED = "THEFT_REPORTED"
|
|
13
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CardCancelReasonEnum = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Motivo de cancelación de una tarjeta física.
|
|
6
|
-
* @enum {string}
|
|
7
|
-
*
|
|
8
|
-
* @property {string} PLASTIC_DAMAGED - Plástico dañado.
|
|
9
|
-
* @property {string} LOST - Tarjeta perdida.
|
|
10
|
-
* @property {string} THEFT_REPORTED - Robo reportado.
|
|
11
|
-
*/
|
|
12
|
-
var CardCancelReasonEnum;
|
|
13
|
-
(function (CardCancelReasonEnum) {
|
|
14
|
-
CardCancelReasonEnum["PLASTIC_DAMAGED"] = "PLASTIC_DAMAGED";
|
|
15
|
-
CardCancelReasonEnum["LOST"] = "LOST";
|
|
16
|
-
CardCancelReasonEnum["THEFT_REPORTED"] = "THEFT_REPORTED";
|
|
17
|
-
})(CardCancelReasonEnum || (exports.CardCancelReasonEnum = CardCancelReasonEnum = {}));
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Estado de una tarjeta física individual.
|
|
3
|
-
* @enum {string}
|
|
4
|
-
*
|
|
5
|
-
* @property {string} AVAILABLE - Cargada en stock, disponible para asignar.
|
|
6
|
-
* @property {string} ASSIGNED - Asignada a un cliente.
|
|
7
|
-
* @property {string} CANCELLED - Anulada (plástico dañado, pérdida o robo). Estado terminal.
|
|
8
|
-
*/
|
|
9
|
-
export declare enum RetailCardStatusEnum {
|
|
10
|
-
AVAILABLE = "AVAILABLE",
|
|
11
|
-
ASSIGNED = "ASSIGNED",
|
|
12
|
-
CANCELLED = "CANCELLED"
|
|
13
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RetailCardStatusEnum = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Estado de una tarjeta física individual.
|
|
6
|
-
* @enum {string}
|
|
7
|
-
*
|
|
8
|
-
* @property {string} AVAILABLE - Cargada en stock, disponible para asignar.
|
|
9
|
-
* @property {string} ASSIGNED - Asignada a un cliente.
|
|
10
|
-
* @property {string} CANCELLED - Anulada (plástico dañado, pérdida o robo). Estado terminal.
|
|
11
|
-
*/
|
|
12
|
-
var RetailCardStatusEnum;
|
|
13
|
-
(function (RetailCardStatusEnum) {
|
|
14
|
-
RetailCardStatusEnum["AVAILABLE"] = "AVAILABLE";
|
|
15
|
-
RetailCardStatusEnum["ASSIGNED"] = "ASSIGNED";
|
|
16
|
-
RetailCardStatusEnum["CANCELLED"] = "CANCELLED";
|
|
17
|
-
})(RetailCardStatusEnum || (exports.RetailCardStatusEnum = RetailCardStatusEnum = {}));
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/** Emitido cuando una tarjeta se asigna a un cliente. */
|
|
2
|
-
export interface RetailCardAssignedV1 {
|
|
3
|
-
cardNumber: string;
|
|
4
|
-
retailerId: string;
|
|
5
|
-
storeId: string;
|
|
6
|
-
assignedToCustomerId: string;
|
|
7
|
-
assignedByUserId: string;
|
|
8
|
-
creditId?: string;
|
|
9
|
-
occurredAt: string;
|
|
10
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { CardCancelReasonEnum } from '../enums/CardCancelReasonEnum';
|
|
2
|
-
/** Emitido cuando una tarjeta se cancela (anula). */
|
|
3
|
-
export interface RetailCardCancelledV1 {
|
|
4
|
-
cardNumber: string;
|
|
5
|
-
retailerId: string;
|
|
6
|
-
storeId: string;
|
|
7
|
-
reason: CardCancelReasonEnum;
|
|
8
|
-
occurredAt: string;
|
|
9
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* POST /wizard/sessions/:id/complete-sale — cierra la venta (saga de 2 pasos, flujo 09). Exige
|
|
3
|
-
* payment registrado (regla dura). Consume el IMEI del silo (SOLD), asigna la tarjeta PCF, persiste
|
|
4
|
-
* la Sale con `UNIQ#FOLIO` y emite el outbox `SaleCompletedV1` en la MISMA tx. Cierra el prospecto
|
|
5
|
-
* vinculado si lo hay. `cardNumber` = tarjeta física entregada en tienda (S7). SureKeep Fase 2 — pista Retail.
|
|
6
|
-
*/
|
|
7
|
-
export declare class CompleteSaleRequest {
|
|
8
|
-
cardNumber?: string;
|
|
9
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { IsOptional, IsString } from 'class-validator';
|
|
2
|
-
|
|
3
|
-
/** Body de la asignación de una tarjeta física a un cliente. */
|
|
4
|
-
export class AssignCardRequest {
|
|
5
|
-
@IsString()
|
|
6
|
-
assignedToCustomerId!: string;
|
|
7
|
-
|
|
8
|
-
@IsString()
|
|
9
|
-
assignedByUserId!: string;
|
|
10
|
-
|
|
11
|
-
@IsOptional()
|
|
12
|
-
@IsString()
|
|
13
|
-
creditId?: string;
|
|
14
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { IsEnum } from 'class-validator';
|
|
2
|
-
import { CardCancelReasonEnum } from '../../enums/CardCancelReasonEnum';
|
|
3
|
-
|
|
4
|
-
/** Body de la cancelación (anulación) de una tarjeta física. */
|
|
5
|
-
export class CancelCardRequest {
|
|
6
|
-
@IsEnum(CardCancelReasonEnum)
|
|
7
|
-
reason!: CardCancelReasonEnum;
|
|
8
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { RetailCardStatusEnum } from '../../enums/RetailCardStatusEnum';
|
|
2
|
-
|
|
3
|
-
/** Representación de una tarjeta física hacia el cliente. */
|
|
4
|
-
export interface RetailCardResponse {
|
|
5
|
-
cardNumber: string;
|
|
6
|
-
retailerId: string;
|
|
7
|
-
batchId: string;
|
|
8
|
-
storeId: string;
|
|
9
|
-
status: RetailCardStatusEnum;
|
|
10
|
-
assignedToCustomerId: string | null;
|
|
11
|
-
assignedAt: string | null;
|
|
12
|
-
assignedByUserId: string | null;
|
|
13
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Estado de un lote de tarjetas.
|
|
3
|
-
* @enum {string}
|
|
4
|
-
*
|
|
5
|
-
* @property {string} RECEIVING - Transitorio, carga en curso (DEC-004/DEC-008).
|
|
6
|
-
* @property {string} RECEIVED - Carga completada, lote atado a una tienda (happy-path F1).
|
|
7
|
-
* @property {string} FAILED - Terminal, la carga del lote falló (DEC-004/DEC-008).
|
|
8
|
-
* @property {string} DISTRIBUTED - Reservado F1 — lote centralizado repartido a varias tiendas (TD-008).
|
|
9
|
-
* @property {string} CLOSED - Reservado F1 — cierre manual del lote (TD-008).
|
|
10
|
-
*/
|
|
11
|
-
export enum CardBatchStatusEnum {
|
|
12
|
-
RECEIVING = 'RECEIVING',
|
|
13
|
-
RECEIVED = 'RECEIVED',
|
|
14
|
-
FAILED = 'FAILED',
|
|
15
|
-
DISTRIBUTED = 'DISTRIBUTED',
|
|
16
|
-
CLOSED = 'CLOSED',
|
|
17
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Motivo de cancelación de una tarjeta física.
|
|
3
|
-
* @enum {string}
|
|
4
|
-
*
|
|
5
|
-
* @property {string} PLASTIC_DAMAGED - Plástico dañado.
|
|
6
|
-
* @property {string} LOST - Tarjeta perdida.
|
|
7
|
-
* @property {string} THEFT_REPORTED - Robo reportado.
|
|
8
|
-
*/
|
|
9
|
-
export enum CardCancelReasonEnum {
|
|
10
|
-
PLASTIC_DAMAGED = 'PLASTIC_DAMAGED',
|
|
11
|
-
LOST = 'LOST',
|
|
12
|
-
THEFT_REPORTED = 'THEFT_REPORTED',
|
|
13
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Estado de una tarjeta física individual.
|
|
3
|
-
* @enum {string}
|
|
4
|
-
*
|
|
5
|
-
* @property {string} AVAILABLE - Cargada en stock, disponible para asignar.
|
|
6
|
-
* @property {string} ASSIGNED - Asignada a un cliente.
|
|
7
|
-
* @property {string} CANCELLED - Anulada (plástico dañado, pérdida o robo). Estado terminal.
|
|
8
|
-
*/
|
|
9
|
-
export enum RetailCardStatusEnum {
|
|
10
|
-
AVAILABLE = 'AVAILABLE',
|
|
11
|
-
ASSIGNED = 'ASSIGNED',
|
|
12
|
-
CANCELLED = 'CANCELLED',
|
|
13
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/** Emitido cuando una tarjeta se asigna a un cliente. */
|
|
2
|
-
export interface RetailCardAssignedV1 {
|
|
3
|
-
cardNumber: string;
|
|
4
|
-
retailerId: string;
|
|
5
|
-
storeId: string;
|
|
6
|
-
assignedToCustomerId: string;
|
|
7
|
-
assignedByUserId: string;
|
|
8
|
-
creditId?: string;
|
|
9
|
-
occurredAt: string;
|
|
10
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { CardCancelReasonEnum } from '../enums/CardCancelReasonEnum';
|
|
2
|
-
|
|
3
|
-
/** Emitido cuando una tarjeta se cancela (anula). */
|
|
4
|
-
export interface RetailCardCancelledV1 {
|
|
5
|
-
cardNumber: string;
|
|
6
|
-
retailerId: string;
|
|
7
|
-
storeId: string;
|
|
8
|
-
reason: CardCancelReasonEnum;
|
|
9
|
-
occurredAt: string;
|
|
10
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Expose } from 'class-transformer';
|
|
2
|
-
import { IsOptional, IsString } from 'class-validator';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* POST /wizard/sessions/:id/complete-sale — cierra la venta (saga de 2 pasos, flujo 09). Exige
|
|
6
|
-
* payment registrado (regla dura). Consume el IMEI del silo (SOLD), asigna la tarjeta PCF, persiste
|
|
7
|
-
* la Sale con `UNIQ#FOLIO` y emite el outbox `SaleCompletedV1` en la MISMA tx. Cierra el prospecto
|
|
8
|
-
* vinculado si lo hay. `cardNumber` = tarjeta física entregada en tienda (S7). SureKeep Fase 2 — pista Retail.
|
|
9
|
-
*/
|
|
10
|
-
export class CompleteSaleRequest {
|
|
11
|
-
@Expose()
|
|
12
|
-
@IsOptional()
|
|
13
|
-
@IsString()
|
|
14
|
-
cardNumber?: string;
|
|
15
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Expose } from 'class-transformer';
|
|
2
|
-
import { IsString } from 'class-validator';
|
|
3
|
-
|
|
4
|
-
/** POST /wizard/sessions/:id/pcf-card/mark-delivered — marca la tarjeta física PCF como entregada (S7). SureKeep Fase 2 — pista Retail. */
|
|
5
|
-
export class MarkPcfCardDeliveredRequest {
|
|
6
|
-
@Expose()
|
|
7
|
-
@IsString()
|
|
8
|
-
cardNumber!: string;
|
|
9
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/bin/retailCards/{events/RetailCardReleasedV1.js → dtos/responses/CardStockResponse.js}
RENAMED
|
File without changes
|