@fiado/type-kit 3.396.0 → 3.398.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/bin/loanScoring/dtos/requests/EvaluateSciRequest.d.ts +5 -0
- package/bin/loanScoring/dtos/requests/EvaluateSciRequest.js +6 -0
- package/bin/loanScoring/dtos/responses/ListSciEvaluationsResponse.d.ts +29 -0
- package/bin/loanScoring/dtos/responses/ListSciEvaluationsResponse.js +2 -0
- package/bin/loanScoring/index.d.ts +1 -0
- package/bin/loanScoring/index.js +1 -0
- package/bin/webhookBusiness/dtos/PendingWebhookDeliveryView.d.ts +30 -0
- package/bin/webhookBusiness/dtos/PendingWebhookDeliveryView.js +2 -0
- package/bin/webhookBusiness/dtos/SkippedWebhookRedelivery.d.ts +6 -0
- package/bin/webhookBusiness/dtos/SkippedWebhookRedelivery.js +2 -0
- package/bin/webhookBusiness/dtos/requests/ListPendingWebhookDeliveriesRequest.d.ts +15 -0
- package/bin/webhookBusiness/dtos/requests/ListPendingWebhookDeliveriesRequest.js +58 -0
- package/bin/webhookBusiness/dtos/requests/RedeliverWebhookEventsBatchRequest.d.ts +17 -0
- package/bin/webhookBusiness/dtos/requests/RedeliverWebhookEventsBatchRequest.js +68 -0
- package/bin/webhookBusiness/dtos/responses/ListPendingWebhookDeliveriesResponse.d.ts +12 -0
- package/bin/webhookBusiness/dtos/responses/ListPendingWebhookDeliveriesResponse.js +2 -0
- package/bin/webhookBusiness/dtos/responses/RedeliverWebhookEventsBatchResponse.d.ts +14 -0
- package/bin/webhookBusiness/dtos/responses/RedeliverWebhookEventsBatchResponse.js +2 -0
- package/bin/webhookBusiness/enums/RedeliverySkipReasonEnum.d.ts +7 -0
- package/bin/webhookBusiness/enums/RedeliverySkipReasonEnum.js +11 -0
- package/bin/webhookBusiness/index.d.ts +7 -0
- package/bin/webhookBusiness/index.js +7 -0
- package/package.json +1 -1
- package/src/loanScoring/dtos/requests/EvaluateSciRequest.ts +9 -0
- package/src/loanScoring/dtos/responses/ListSciEvaluationsResponse.ts +31 -0
- package/src/loanScoring/index.ts +1 -0
- package/src/webhookBusiness/dtos/PendingWebhookDeliveryView.ts +31 -0
- package/src/webhookBusiness/dtos/SkippedWebhookRedelivery.ts +7 -0
- package/src/webhookBusiness/dtos/requests/ListPendingWebhookDeliveriesRequest.ts +44 -0
- package/src/webhookBusiness/dtos/requests/RedeliverWebhookEventsBatchRequest.ts +53 -0
- package/src/webhookBusiness/dtos/responses/ListPendingWebhookDeliveriesResponse.ts +13 -0
- package/src/webhookBusiness/dtos/responses/RedeliverWebhookEventsBatchResponse.ts +15 -0
- package/src/webhookBusiness/enums/RedeliverySkipReasonEnum.ts +7 -0
- package/src/webhookBusiness/index.ts +7 -0
|
@@ -8,6 +8,11 @@ import { SciInternalHistoryInput } from './SciInternalHistoryInput';
|
|
|
8
8
|
export declare class EvaluateSciRequest {
|
|
9
9
|
/** Acreditado a evaluar (`LoanBorrower`). La evaluación queda ligada a él en el historial. */
|
|
10
10
|
borrowerId: string;
|
|
11
|
+
/**
|
|
12
|
+
* Cliente retail dueño del acreditado. Se guarda en el snapshot para que el listado del
|
|
13
|
+
* backoffice resuelva el nombre sin volver a preguntarle a loan-credit de quién es.
|
|
14
|
+
*/
|
|
15
|
+
retailCustomerId?: string;
|
|
11
16
|
/** CURP del solicitante (requerido por los proveedores de scoring). */
|
|
12
17
|
curp: string;
|
|
13
18
|
/** Celular del solicitante (requerido por Modelias). */
|
|
@@ -27,6 +27,12 @@ __decorate([
|
|
|
27
27
|
(0, class_validator_1.IsNotEmpty)(),
|
|
28
28
|
__metadata("design:type", String)
|
|
29
29
|
], EvaluateSciRequest.prototype, "borrowerId", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, class_validator_1.IsOptional)(),
|
|
32
|
+
(0, class_validator_1.IsString)(),
|
|
33
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], EvaluateSciRequest.prototype, "retailCustomerId", void 0);
|
|
30
36
|
__decorate([
|
|
31
37
|
(0, class_validator_1.IsString)(),
|
|
32
38
|
(0, class_validator_1.IsNotEmpty)(),
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { PaginatedResult } from '../../../retailOrg/dtos/PaginatedResult';
|
|
2
|
+
import { SciEvaluationResponse } from './SciEvaluationResponse';
|
|
3
|
+
/**
|
|
4
|
+
* Fila lista para pintar del listado de evaluaciones del tenant: la evaluación más el contexto
|
|
5
|
+
* del cliente ya resuelto por el motor. El front no cruza nada.
|
|
6
|
+
*/
|
|
7
|
+
export interface SciEvaluationListItem {
|
|
8
|
+
evaluation: SciEvaluationResponse;
|
|
9
|
+
/** Cliente retail dueño del acreditado. `null` en las evaluaciones anteriores al campo. */
|
|
10
|
+
retailCustomerId: string | null;
|
|
11
|
+
/** `null` cuando el nombre no se pudo resolver; el front pinta el id, nunca un vacío. */
|
|
12
|
+
customerName: string | null;
|
|
13
|
+
/**
|
|
14
|
+
* `null` mientras el lote del padrón no devuelva teléfono: hoy solo proyecta el nombre.
|
|
15
|
+
* Viaja igual para que el contrato de la fila no cambie cuando lo devuelva.
|
|
16
|
+
*/
|
|
17
|
+
customerPhone: string | null;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Página del listado de evaluaciones del tenant, ordenada de la más nueva a la más vieja.
|
|
21
|
+
* Usa el sobre paginado canónico (`items` + `count` + `nextToken` ausente en la última página).
|
|
22
|
+
*/
|
|
23
|
+
export interface ListSciEvaluationsResponse extends PaginatedResult<SciEvaluationListItem> {
|
|
24
|
+
/**
|
|
25
|
+
* Filas con `retailCustomerId` cuyo nombre no se resolvió — porque el padrón no lo tiene o
|
|
26
|
+
* porque no contestó. La pantalla lo anuncia en vez de dejar huecos sin explicación.
|
|
27
|
+
*/
|
|
28
|
+
unresolvedCustomerCount: number;
|
|
29
|
+
}
|
|
@@ -9,3 +9,4 @@ export * from './dtos/requests/EvaluateSciRequest';
|
|
|
9
9
|
export * from './dtos/requests/SciInternalHistoryInput';
|
|
10
10
|
export * from './dtos/responses/EvaluateSciResponse';
|
|
11
11
|
export * from './dtos/responses/SciEvaluationResponse';
|
|
12
|
+
export * from './dtos/responses/ListSciEvaluationsResponse';
|
package/bin/loanScoring/index.js
CHANGED
|
@@ -29,3 +29,4 @@ __exportStar(require("./dtos/requests/SciInternalHistoryInput"), exports);
|
|
|
29
29
|
// Response DTOs
|
|
30
30
|
__exportStar(require("./dtos/responses/EvaluateSciResponse"), exports);
|
|
31
31
|
__exportStar(require("./dtos/responses/SciEvaluationResponse"), exports);
|
|
32
|
+
__exportStar(require("./dtos/responses/ListSciEvaluationsResponse"), exports);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { WebhookEventType } from '../enums/WebhookEventType';
|
|
2
|
+
import type { DeliveryOutcomeEnum } from '../enums/DeliveryOutcomeEnum';
|
|
3
|
+
/**
|
|
4
|
+
* Un evento que un suscriptor todavía no aceptó. Hay una sola fila por par (evento, suscriptor):
|
|
5
|
+
* lleva el desenlace vigente, no cada intento, así el listado no repite el mismo evento.
|
|
6
|
+
*/
|
|
7
|
+
export interface PendingWebhookDeliveryView {
|
|
8
|
+
eventId: string;
|
|
9
|
+
eventType: WebhookEventType;
|
|
10
|
+
/** Lambda que produjo el evento. */
|
|
11
|
+
source: string;
|
|
12
|
+
directoryId: string;
|
|
13
|
+
occurredAt: string;
|
|
14
|
+
/** Último desenlace asentado contra este suscriptor. Nunca `DELIVERED`: eso sale del listado. */
|
|
15
|
+
outcome: DeliveryOutcomeEnum;
|
|
16
|
+
subscriberName?: string;
|
|
17
|
+
url?: string;
|
|
18
|
+
/** Número del último asiento del par (evento, suscriptor). */
|
|
19
|
+
attempt?: number;
|
|
20
|
+
/** Intentos de red gastados en la ronda vigente. Un reenvío explícito la reabre en cero. */
|
|
21
|
+
sendAttempts?: number;
|
|
22
|
+
receiverHttpStatus?: number;
|
|
23
|
+
errorCode?: string;
|
|
24
|
+
failureReason?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Falso cuando el evento en bruto ya venció o nunca se guardó. Reenviarlo exigiría mandar el
|
|
27
|
+
* payload a mano por el endpoint de reposición individual.
|
|
28
|
+
*/
|
|
29
|
+
redeliverable: boolean;
|
|
30
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Query de `GET /private/webhook-deliveries/pending` — lo que un suscriptor todavía no aceptó.
|
|
3
|
+
* Va contra el índice `pendingSubscriberTag-createdAt-index`, que sólo contiene lo pendiente.
|
|
4
|
+
*/
|
|
5
|
+
export declare class ListPendingWebhookDeliveriesRequest {
|
|
6
|
+
/** Tag del suscriptor, con el prefijo reservado `wh:`. */
|
|
7
|
+
tag: string;
|
|
8
|
+
/** Desde cuándo, por fecha del evento. Sin él la ventana arranca en el pendiente más viejo. */
|
|
9
|
+
from?: string;
|
|
10
|
+
to?: string;
|
|
11
|
+
/** Tope de filas de la página. El manager lo recorta a su máximo. */
|
|
12
|
+
limit?: number;
|
|
13
|
+
/** Cursor opaco de la página anterior. Se manda tal cual vino, sin interpretarlo. */
|
|
14
|
+
cursor?: string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
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.ListPendingWebhookDeliveriesRequest = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const WebhookFieldLimits_1 = require("../../constants/WebhookFieldLimits");
|
|
16
|
+
/**
|
|
17
|
+
* Query de `GET /private/webhook-deliveries/pending` — lo que un suscriptor todavía no aceptó.
|
|
18
|
+
* Va contra el índice `pendingSubscriberTag-createdAt-index`, que sólo contiene lo pendiente.
|
|
19
|
+
*/
|
|
20
|
+
class ListPendingWebhookDeliveriesRequest {
|
|
21
|
+
}
|
|
22
|
+
exports.ListPendingWebhookDeliveriesRequest = ListPendingWebhookDeliveriesRequest;
|
|
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.MaxLength)(WebhookFieldLimits_1.WEBHOOK_TAG_MAX_LENGTH),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], ListPendingWebhookDeliveriesRequest.prototype, "tag", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, class_transformer_1.Expose)(),
|
|
32
|
+
(0, class_validator_1.IsOptional)(),
|
|
33
|
+
(0, class_validator_1.IsString)(),
|
|
34
|
+
(0, class_validator_1.IsISO8601)(),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], ListPendingWebhookDeliveriesRequest.prototype, "from", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, class_transformer_1.Expose)(),
|
|
39
|
+
(0, class_validator_1.IsOptional)(),
|
|
40
|
+
(0, class_validator_1.IsString)(),
|
|
41
|
+
(0, class_validator_1.IsISO8601)(),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], ListPendingWebhookDeliveriesRequest.prototype, "to", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, class_transformer_1.Expose)(),
|
|
46
|
+
(0, class_validator_1.IsOptional)(),
|
|
47
|
+
(0, class_transformer_1.Type)(() => Number),
|
|
48
|
+
(0, class_validator_1.IsInt)(),
|
|
49
|
+
(0, class_validator_1.IsPositive)(),
|
|
50
|
+
__metadata("design:type", Number)
|
|
51
|
+
], ListPendingWebhookDeliveriesRequest.prototype, "limit", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, class_transformer_1.Expose)(),
|
|
54
|
+
(0, class_validator_1.IsOptional)(),
|
|
55
|
+
(0, class_validator_1.IsString)(),
|
|
56
|
+
(0, class_validator_1.MaxLength)(2048),
|
|
57
|
+
__metadata("design:type", String)
|
|
58
|
+
], ListPendingWebhookDeliveriesRequest.prototype, "cursor", void 0);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Body de `POST /private/webhook-deliveries/redeliver-batch` — reenvío masivo de lo que un
|
|
3
|
+
* suscriptor todavía no aceptó. La selección sale siempre del índice de pendientes: un evento ya
|
|
4
|
+
* entregado no se puede reenviar por acá.
|
|
5
|
+
*/
|
|
6
|
+
export declare class RedeliverWebhookEventsBatchRequest {
|
|
7
|
+
tag: string;
|
|
8
|
+
/** Ventana por fecha del evento. Sin ella entra todo lo pendiente hasta el tope del lote. */
|
|
9
|
+
from?: string;
|
|
10
|
+
to?: string;
|
|
11
|
+
/** Recorte de la ventana a estos eventos. Los que no estén pendientes no entran. */
|
|
12
|
+
eventIds?: string[];
|
|
13
|
+
/** Cuántos pendientes encolar como mucho. El manager rechaza tipado si se pasa de su tope. */
|
|
14
|
+
limit?: number;
|
|
15
|
+
/** Quién dispara el reenvío, para el log de la reposición. */
|
|
16
|
+
actor?: string;
|
|
17
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
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.RedeliverWebhookEventsBatchRequest = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const WebhookFieldLimits_1 = require("../../constants/WebhookFieldLimits");
|
|
16
|
+
/**
|
|
17
|
+
* Body de `POST /private/webhook-deliveries/redeliver-batch` — reenvío masivo de lo que un
|
|
18
|
+
* suscriptor todavía no aceptó. La selección sale siempre del índice de pendientes: un evento ya
|
|
19
|
+
* entregado no se puede reenviar por acá.
|
|
20
|
+
*/
|
|
21
|
+
class RedeliverWebhookEventsBatchRequest {
|
|
22
|
+
}
|
|
23
|
+
exports.RedeliverWebhookEventsBatchRequest = RedeliverWebhookEventsBatchRequest;
|
|
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.MaxLength)(WebhookFieldLimits_1.WEBHOOK_TAG_MAX_LENGTH),
|
|
29
|
+
__metadata("design:type", String)
|
|
30
|
+
], RedeliverWebhookEventsBatchRequest.prototype, "tag", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, class_transformer_1.Expose)(),
|
|
33
|
+
(0, class_validator_1.IsOptional)(),
|
|
34
|
+
(0, class_validator_1.IsString)(),
|
|
35
|
+
(0, class_validator_1.IsISO8601)(),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], RedeliverWebhookEventsBatchRequest.prototype, "from", 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.IsISO8601)(),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], RedeliverWebhookEventsBatchRequest.prototype, "to", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, class_transformer_1.Expose)(),
|
|
47
|
+
(0, class_validator_1.IsOptional)(),
|
|
48
|
+
(0, class_validator_1.IsArray)(),
|
|
49
|
+
(0, class_validator_1.ArrayNotEmpty)(),
|
|
50
|
+
(0, class_validator_1.IsString)({ each: true }),
|
|
51
|
+
(0, class_validator_1.MaxLength)(WebhookFieldLimits_1.WEBHOOK_EVENT_ID_MAX_LENGTH, { each: true }),
|
|
52
|
+
__metadata("design:type", Array)
|
|
53
|
+
], RedeliverWebhookEventsBatchRequest.prototype, "eventIds", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, class_transformer_1.Expose)(),
|
|
56
|
+
(0, class_validator_1.IsOptional)(),
|
|
57
|
+
(0, class_transformer_1.Type)(() => Number),
|
|
58
|
+
(0, class_validator_1.IsInt)(),
|
|
59
|
+
(0, class_validator_1.IsPositive)(),
|
|
60
|
+
__metadata("design:type", Number)
|
|
61
|
+
], RedeliverWebhookEventsBatchRequest.prototype, "limit", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, class_transformer_1.Expose)(),
|
|
64
|
+
(0, class_validator_1.IsOptional)(),
|
|
65
|
+
(0, class_validator_1.IsString)(),
|
|
66
|
+
(0, class_validator_1.MaxLength)(128),
|
|
67
|
+
__metadata("design:type", String)
|
|
68
|
+
], RedeliverWebhookEventsBatchRequest.prototype, "actor", void 0);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { PendingWebhookDeliveryView } from '../PendingWebhookDeliveryView';
|
|
2
|
+
/**
|
|
3
|
+
* Respuesta de `GET /private/webhook-deliveries/pending`. Un suscriptor al día devuelve la lista
|
|
4
|
+
* vacía y no un 404: no deberle nada es el estado normal.
|
|
5
|
+
*/
|
|
6
|
+
export interface ListPendingWebhookDeliveriesResponse {
|
|
7
|
+
tag: string;
|
|
8
|
+
deliveries: PendingWebhookDeliveryView[];
|
|
9
|
+
count: number;
|
|
10
|
+
/** Cursor de la página siguiente. Ausente cuando no queda nada más pendiente. */
|
|
11
|
+
cursor?: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { SkippedWebhookRedelivery } from '../SkippedWebhookRedelivery';
|
|
2
|
+
/**
|
|
3
|
+
* Respuesta de `POST /private/webhook-deliveries/redeliver-batch`. El lote se encola, así que
|
|
4
|
+
* devuelve cuántos se aceptaron y no cómo terminó cada destino: eso queda en la bitácora.
|
|
5
|
+
*/
|
|
6
|
+
export interface RedeliverWebhookEventsBatchResponse {
|
|
7
|
+
tag: string;
|
|
8
|
+
/** Pendientes que entraron en la selección, antes de descartar los que no se pueden reenviar. */
|
|
9
|
+
selectedCount: number;
|
|
10
|
+
/** Los que quedaron encolados. */
|
|
11
|
+
acceptedCount: number;
|
|
12
|
+
skipped: SkippedWebhookRedelivery[];
|
|
13
|
+
acceptedAt: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Por qué un pendiente del lote no se pudo encolar. El valor es el `code` del error que lo explica. */
|
|
2
|
+
export declare enum RedeliverySkipReasonEnum {
|
|
3
|
+
/** El evento en bruto ya venció: sin payload no queda nada que reenviar. */
|
|
4
|
+
RAW_PAYLOAD_UNAVAILABLE = "WEBHOOK_RAW_PAYLOAD_UNAVAILABLE",
|
|
5
|
+
/** El bruto guardado no cumple el contrato de su tipo y no puede salir sin normalizar. */
|
|
6
|
+
PAYLOAD_INVALID = "WEBHOOK_PAYLOAD_INVALID"
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RedeliverySkipReasonEnum = void 0;
|
|
4
|
+
/** Por qué un pendiente del lote no se pudo encolar. El valor es el `code` del error que lo explica. */
|
|
5
|
+
var RedeliverySkipReasonEnum;
|
|
6
|
+
(function (RedeliverySkipReasonEnum) {
|
|
7
|
+
/** El evento en bruto ya venció: sin payload no queda nada que reenviar. */
|
|
8
|
+
RedeliverySkipReasonEnum["RAW_PAYLOAD_UNAVAILABLE"] = "WEBHOOK_RAW_PAYLOAD_UNAVAILABLE";
|
|
9
|
+
/** El bruto guardado no cumple el contrato de su tipo y no puede salir sin normalizar. */
|
|
10
|
+
RedeliverySkipReasonEnum["PAYLOAD_INVALID"] = "WEBHOOK_PAYLOAD_INVALID";
|
|
11
|
+
})(RedeliverySkipReasonEnum || (exports.RedeliverySkipReasonEnum = RedeliverySkipReasonEnum = {}));
|
|
@@ -3,6 +3,7 @@ export * from './enums/ComplianceDecisionEnum';
|
|
|
3
3
|
export * from './enums/SubscriptionVisibilityEnum';
|
|
4
4
|
export * from './enums/SubscriptionStatusEnum';
|
|
5
5
|
export * from './enums/DeliveryOutcomeEnum';
|
|
6
|
+
export * from './enums/RedeliverySkipReasonEnum';
|
|
6
7
|
export * from './constants/CaseRefPattern';
|
|
7
8
|
export * from './constants/WebhookFieldLimits';
|
|
8
9
|
export * from './events/AccountIssuanceCompletedV1';
|
|
@@ -11,14 +12,20 @@ export * from './dtos/WebhookEventEnvelope';
|
|
|
11
12
|
export * from './dtos/WebhookOutboundMessage';
|
|
12
13
|
export * from './dtos/WebhookSubscriptionView';
|
|
13
14
|
export * from './dtos/WebhookDeliveryView';
|
|
15
|
+
export * from './dtos/PendingWebhookDeliveryView';
|
|
16
|
+
export * from './dtos/SkippedWebhookRedelivery';
|
|
14
17
|
export * from './dtos/requests/UpsertWebhookSubscriptionRequest';
|
|
15
18
|
export * from './dtos/requests/GetWebhookSubscriptionRequest';
|
|
16
19
|
export * from './dtos/requests/DeactivateWebhookSubscriptionRequest';
|
|
17
20
|
export * from './dtos/requests/ListWebhookDeliveriesRequest';
|
|
18
21
|
export * from './dtos/requests/RedeliverWebhookEventRequest';
|
|
22
|
+
export * from './dtos/requests/ListPendingWebhookDeliveriesRequest';
|
|
23
|
+
export * from './dtos/requests/RedeliverWebhookEventsBatchRequest';
|
|
19
24
|
export * from './dtos/responses/UpsertWebhookSubscriptionResponse';
|
|
20
25
|
export * from './dtos/responses/GetWebhookSubscriptionResponse';
|
|
21
26
|
export * from './dtos/responses/ListWebhookSubscriptionsResponse';
|
|
22
27
|
export * from './dtos/responses/DeactivateWebhookSubscriptionResponse';
|
|
23
28
|
export * from './dtos/responses/ListWebhookDeliveriesResponse';
|
|
24
29
|
export * from './dtos/responses/RedeliverWebhookEventResponse';
|
|
30
|
+
export * from './dtos/responses/ListPendingWebhookDeliveriesResponse';
|
|
31
|
+
export * from './dtos/responses/RedeliverWebhookEventsBatchResponse';
|
|
@@ -20,6 +20,7 @@ __exportStar(require("./enums/ComplianceDecisionEnum"), exports);
|
|
|
20
20
|
__exportStar(require("./enums/SubscriptionVisibilityEnum"), exports);
|
|
21
21
|
__exportStar(require("./enums/SubscriptionStatusEnum"), exports);
|
|
22
22
|
__exportStar(require("./enums/DeliveryOutcomeEnum"), exports);
|
|
23
|
+
__exportStar(require("./enums/RedeliverySkipReasonEnum"), exports);
|
|
23
24
|
// Formatos y topes compartidos por los contratos
|
|
24
25
|
__exportStar(require("./constants/CaseRefPattern"), exports);
|
|
25
26
|
__exportStar(require("./constants/WebhookFieldLimits"), exports);
|
|
@@ -32,12 +33,16 @@ __exportStar(require("./dtos/WebhookOutboundMessage"), exports);
|
|
|
32
33
|
// Vistas del padrón y de la bitácora, tal como salen por la API de administración
|
|
33
34
|
__exportStar(require("./dtos/WebhookSubscriptionView"), exports);
|
|
34
35
|
__exportStar(require("./dtos/WebhookDeliveryView"), exports);
|
|
36
|
+
__exportStar(require("./dtos/PendingWebhookDeliveryView"), exports);
|
|
37
|
+
__exportStar(require("./dtos/SkippedWebhookRedelivery"), exports);
|
|
35
38
|
// API privada de administración — requests
|
|
36
39
|
__exportStar(require("./dtos/requests/UpsertWebhookSubscriptionRequest"), exports);
|
|
37
40
|
__exportStar(require("./dtos/requests/GetWebhookSubscriptionRequest"), exports);
|
|
38
41
|
__exportStar(require("./dtos/requests/DeactivateWebhookSubscriptionRequest"), exports);
|
|
39
42
|
__exportStar(require("./dtos/requests/ListWebhookDeliveriesRequest"), exports);
|
|
40
43
|
__exportStar(require("./dtos/requests/RedeliverWebhookEventRequest"), exports);
|
|
44
|
+
__exportStar(require("./dtos/requests/ListPendingWebhookDeliveriesRequest"), exports);
|
|
45
|
+
__exportStar(require("./dtos/requests/RedeliverWebhookEventsBatchRequest"), exports);
|
|
41
46
|
// API privada de administración — responses
|
|
42
47
|
__exportStar(require("./dtos/responses/UpsertWebhookSubscriptionResponse"), exports);
|
|
43
48
|
__exportStar(require("./dtos/responses/GetWebhookSubscriptionResponse"), exports);
|
|
@@ -45,3 +50,5 @@ __exportStar(require("./dtos/responses/ListWebhookSubscriptionsResponse"), expor
|
|
|
45
50
|
__exportStar(require("./dtos/responses/DeactivateWebhookSubscriptionResponse"), exports);
|
|
46
51
|
__exportStar(require("./dtos/responses/ListWebhookDeliveriesResponse"), exports);
|
|
47
52
|
__exportStar(require("./dtos/responses/RedeliverWebhookEventResponse"), exports);
|
|
53
|
+
__exportStar(require("./dtos/responses/ListPendingWebhookDeliveriesResponse"), exports);
|
|
54
|
+
__exportStar(require("./dtos/responses/RedeliverWebhookEventsBatchResponse"), exports);
|
package/package.json
CHANGED
|
@@ -14,6 +14,15 @@ export class EvaluateSciRequest {
|
|
|
14
14
|
@IsNotEmpty()
|
|
15
15
|
borrowerId!: string;
|
|
16
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Cliente retail dueño del acreditado. Se guarda en el snapshot para que el listado del
|
|
19
|
+
* backoffice resuelva el nombre sin volver a preguntarle a loan-credit de quién es.
|
|
20
|
+
*/
|
|
21
|
+
@IsOptional()
|
|
22
|
+
@IsString()
|
|
23
|
+
@IsNotEmpty()
|
|
24
|
+
retailCustomerId?: string;
|
|
25
|
+
|
|
17
26
|
/** CURP del solicitante (requerido por los proveedores de scoring). */
|
|
18
27
|
@IsString()
|
|
19
28
|
@IsNotEmpty()
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { PaginatedResult } from '../../../retailOrg/dtos/PaginatedResult';
|
|
2
|
+
import { SciEvaluationResponse } from './SciEvaluationResponse';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Fila lista para pintar del listado de evaluaciones del tenant: la evaluación más el contexto
|
|
6
|
+
* del cliente ya resuelto por el motor. El front no cruza nada.
|
|
7
|
+
*/
|
|
8
|
+
export interface SciEvaluationListItem {
|
|
9
|
+
evaluation: SciEvaluationResponse;
|
|
10
|
+
/** Cliente retail dueño del acreditado. `null` en las evaluaciones anteriores al campo. */
|
|
11
|
+
retailCustomerId: string | null;
|
|
12
|
+
/** `null` cuando el nombre no se pudo resolver; el front pinta el id, nunca un vacío. */
|
|
13
|
+
customerName: string | null;
|
|
14
|
+
/**
|
|
15
|
+
* `null` mientras el lote del padrón no devuelva teléfono: hoy solo proyecta el nombre.
|
|
16
|
+
* Viaja igual para que el contrato de la fila no cambie cuando lo devuelva.
|
|
17
|
+
*/
|
|
18
|
+
customerPhone: string | null;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Página del listado de evaluaciones del tenant, ordenada de la más nueva a la más vieja.
|
|
23
|
+
* Usa el sobre paginado canónico (`items` + `count` + `nextToken` ausente en la última página).
|
|
24
|
+
*/
|
|
25
|
+
export interface ListSciEvaluationsResponse extends PaginatedResult<SciEvaluationListItem> {
|
|
26
|
+
/**
|
|
27
|
+
* Filas con `retailCustomerId` cuyo nombre no se resolvió — porque el padrón no lo tiene o
|
|
28
|
+
* porque no contestó. La pantalla lo anuncia en vez de dejar huecos sin explicación.
|
|
29
|
+
*/
|
|
30
|
+
unresolvedCustomerCount: number;
|
|
31
|
+
}
|
package/src/loanScoring/index.ts
CHANGED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { WebhookEventType } from '../enums/WebhookEventType';
|
|
2
|
+
import type { DeliveryOutcomeEnum } from '../enums/DeliveryOutcomeEnum';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Un evento que un suscriptor todavía no aceptó. Hay una sola fila por par (evento, suscriptor):
|
|
6
|
+
* lleva el desenlace vigente, no cada intento, así el listado no repite el mismo evento.
|
|
7
|
+
*/
|
|
8
|
+
export interface PendingWebhookDeliveryView {
|
|
9
|
+
eventId: string;
|
|
10
|
+
eventType: WebhookEventType;
|
|
11
|
+
/** Lambda que produjo el evento. */
|
|
12
|
+
source: string;
|
|
13
|
+
directoryId: string;
|
|
14
|
+
occurredAt: string;
|
|
15
|
+
/** Último desenlace asentado contra este suscriptor. Nunca `DELIVERED`: eso sale del listado. */
|
|
16
|
+
outcome: DeliveryOutcomeEnum;
|
|
17
|
+
subscriberName?: string;
|
|
18
|
+
url?: string;
|
|
19
|
+
/** Número del último asiento del par (evento, suscriptor). */
|
|
20
|
+
attempt?: number;
|
|
21
|
+
/** Intentos de red gastados en la ronda vigente. Un reenvío explícito la reabre en cero. */
|
|
22
|
+
sendAttempts?: number;
|
|
23
|
+
receiverHttpStatus?: number;
|
|
24
|
+
errorCode?: string;
|
|
25
|
+
failureReason?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Falso cuando el evento en bruto ya venció o nunca se guardó. Reenviarlo exigiría mandar el
|
|
28
|
+
* payload a mano por el endpoint de reposición individual.
|
|
29
|
+
*/
|
|
30
|
+
redeliverable: boolean;
|
|
31
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { RedeliverySkipReasonEnum } from '../enums/RedeliverySkipReasonEnum';
|
|
2
|
+
|
|
3
|
+
/** Un pendiente que el lote no pudo encolar, con el motivo que lo explica. */
|
|
4
|
+
export interface SkippedWebhookRedelivery {
|
|
5
|
+
eventId: string;
|
|
6
|
+
reason: RedeliverySkipReasonEnum;
|
|
7
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Expose, Type } from 'class-transformer';
|
|
2
|
+
import { IsInt, IsISO8601, IsNotEmpty, IsOptional, IsPositive, IsString, MaxLength } from 'class-validator';
|
|
3
|
+
import { WEBHOOK_TAG_MAX_LENGTH } from '../../constants/WebhookFieldLimits';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Query de `GET /private/webhook-deliveries/pending` — lo que un suscriptor todavía no aceptó.
|
|
7
|
+
* Va contra el índice `pendingSubscriberTag-createdAt-index`, que sólo contiene lo pendiente.
|
|
8
|
+
*/
|
|
9
|
+
export class ListPendingWebhookDeliveriesRequest {
|
|
10
|
+
/** Tag del suscriptor, con el prefijo reservado `wh:`. */
|
|
11
|
+
@Expose()
|
|
12
|
+
@IsString()
|
|
13
|
+
@IsNotEmpty()
|
|
14
|
+
@MaxLength(WEBHOOK_TAG_MAX_LENGTH)
|
|
15
|
+
tag!: string;
|
|
16
|
+
|
|
17
|
+
/** Desde cuándo, por fecha del evento. Sin él la ventana arranca en el pendiente más viejo. */
|
|
18
|
+
@Expose()
|
|
19
|
+
@IsOptional()
|
|
20
|
+
@IsString()
|
|
21
|
+
@IsISO8601()
|
|
22
|
+
from?: string;
|
|
23
|
+
|
|
24
|
+
@Expose()
|
|
25
|
+
@IsOptional()
|
|
26
|
+
@IsString()
|
|
27
|
+
@IsISO8601()
|
|
28
|
+
to?: string;
|
|
29
|
+
|
|
30
|
+
/** Tope de filas de la página. El manager lo recorta a su máximo. */
|
|
31
|
+
@Expose()
|
|
32
|
+
@IsOptional()
|
|
33
|
+
@Type(() => Number)
|
|
34
|
+
@IsInt()
|
|
35
|
+
@IsPositive()
|
|
36
|
+
limit?: number;
|
|
37
|
+
|
|
38
|
+
/** Cursor opaco de la página anterior. Se manda tal cual vino, sin interpretarlo. */
|
|
39
|
+
@Expose()
|
|
40
|
+
@IsOptional()
|
|
41
|
+
@IsString()
|
|
42
|
+
@MaxLength(2048)
|
|
43
|
+
cursor?: string;
|
|
44
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Expose, Type } from 'class-transformer';
|
|
2
|
+
import { ArrayNotEmpty, IsArray, IsInt, IsISO8601, IsNotEmpty, IsOptional, IsPositive, IsString, MaxLength } from 'class-validator';
|
|
3
|
+
import { WEBHOOK_EVENT_ID_MAX_LENGTH, WEBHOOK_TAG_MAX_LENGTH } from '../../constants/WebhookFieldLimits';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Body de `POST /private/webhook-deliveries/redeliver-batch` — reenvío masivo de lo que un
|
|
7
|
+
* suscriptor todavía no aceptó. La selección sale siempre del índice de pendientes: un evento ya
|
|
8
|
+
* entregado no se puede reenviar por acá.
|
|
9
|
+
*/
|
|
10
|
+
export class RedeliverWebhookEventsBatchRequest {
|
|
11
|
+
@Expose()
|
|
12
|
+
@IsString()
|
|
13
|
+
@IsNotEmpty()
|
|
14
|
+
@MaxLength(WEBHOOK_TAG_MAX_LENGTH)
|
|
15
|
+
tag!: string;
|
|
16
|
+
|
|
17
|
+
/** Ventana por fecha del evento. Sin ella entra todo lo pendiente hasta el tope del lote. */
|
|
18
|
+
@Expose()
|
|
19
|
+
@IsOptional()
|
|
20
|
+
@IsString()
|
|
21
|
+
@IsISO8601()
|
|
22
|
+
from?: string;
|
|
23
|
+
|
|
24
|
+
@Expose()
|
|
25
|
+
@IsOptional()
|
|
26
|
+
@IsString()
|
|
27
|
+
@IsISO8601()
|
|
28
|
+
to?: string;
|
|
29
|
+
|
|
30
|
+
/** Recorte de la ventana a estos eventos. Los que no estén pendientes no entran. */
|
|
31
|
+
@Expose()
|
|
32
|
+
@IsOptional()
|
|
33
|
+
@IsArray()
|
|
34
|
+
@ArrayNotEmpty()
|
|
35
|
+
@IsString({ each: true })
|
|
36
|
+
@MaxLength(WEBHOOK_EVENT_ID_MAX_LENGTH, { each: true })
|
|
37
|
+
eventIds?: string[];
|
|
38
|
+
|
|
39
|
+
/** Cuántos pendientes encolar como mucho. El manager rechaza tipado si se pasa de su tope. */
|
|
40
|
+
@Expose()
|
|
41
|
+
@IsOptional()
|
|
42
|
+
@Type(() => Number)
|
|
43
|
+
@IsInt()
|
|
44
|
+
@IsPositive()
|
|
45
|
+
limit?: number;
|
|
46
|
+
|
|
47
|
+
/** Quién dispara el reenvío, para el log de la reposición. */
|
|
48
|
+
@Expose()
|
|
49
|
+
@IsOptional()
|
|
50
|
+
@IsString()
|
|
51
|
+
@MaxLength(128)
|
|
52
|
+
actor?: string;
|
|
53
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { PendingWebhookDeliveryView } from '../PendingWebhookDeliveryView';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Respuesta de `GET /private/webhook-deliveries/pending`. Un suscriptor al día devuelve la lista
|
|
5
|
+
* vacía y no un 404: no deberle nada es el estado normal.
|
|
6
|
+
*/
|
|
7
|
+
export interface ListPendingWebhookDeliveriesResponse {
|
|
8
|
+
tag: string;
|
|
9
|
+
deliveries: PendingWebhookDeliveryView[];
|
|
10
|
+
count: number;
|
|
11
|
+
/** Cursor de la página siguiente. Ausente cuando no queda nada más pendiente. */
|
|
12
|
+
cursor?: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { SkippedWebhookRedelivery } from '../SkippedWebhookRedelivery';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Respuesta de `POST /private/webhook-deliveries/redeliver-batch`. El lote se encola, así que
|
|
5
|
+
* devuelve cuántos se aceptaron y no cómo terminó cada destino: eso queda en la bitácora.
|
|
6
|
+
*/
|
|
7
|
+
export interface RedeliverWebhookEventsBatchResponse {
|
|
8
|
+
tag: string;
|
|
9
|
+
/** Pendientes que entraron en la selección, antes de descartar los que no se pueden reenviar. */
|
|
10
|
+
selectedCount: number;
|
|
11
|
+
/** Los que quedaron encolados. */
|
|
12
|
+
acceptedCount: number;
|
|
13
|
+
skipped: SkippedWebhookRedelivery[];
|
|
14
|
+
acceptedAt: string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Por qué un pendiente del lote no se pudo encolar. El valor es el `code` del error que lo explica. */
|
|
2
|
+
export enum RedeliverySkipReasonEnum {
|
|
3
|
+
/** El evento en bruto ya venció: sin payload no queda nada que reenviar. */
|
|
4
|
+
RAW_PAYLOAD_UNAVAILABLE = 'WEBHOOK_RAW_PAYLOAD_UNAVAILABLE',
|
|
5
|
+
/** El bruto guardado no cumple el contrato de su tipo y no puede salir sin normalizar. */
|
|
6
|
+
PAYLOAD_INVALID = 'WEBHOOK_PAYLOAD_INVALID',
|
|
7
|
+
}
|
|
@@ -4,6 +4,7 @@ export * from './enums/ComplianceDecisionEnum';
|
|
|
4
4
|
export * from './enums/SubscriptionVisibilityEnum';
|
|
5
5
|
export * from './enums/SubscriptionStatusEnum';
|
|
6
6
|
export * from './enums/DeliveryOutcomeEnum';
|
|
7
|
+
export * from './enums/RedeliverySkipReasonEnum';
|
|
7
8
|
|
|
8
9
|
// Formatos y topes compartidos por los contratos
|
|
9
10
|
export * from './constants/CaseRefPattern';
|
|
@@ -20,6 +21,8 @@ export * from './dtos/WebhookOutboundMessage';
|
|
|
20
21
|
// Vistas del padrón y de la bitácora, tal como salen por la API de administración
|
|
21
22
|
export * from './dtos/WebhookSubscriptionView';
|
|
22
23
|
export * from './dtos/WebhookDeliveryView';
|
|
24
|
+
export * from './dtos/PendingWebhookDeliveryView';
|
|
25
|
+
export * from './dtos/SkippedWebhookRedelivery';
|
|
23
26
|
|
|
24
27
|
// API privada de administración — requests
|
|
25
28
|
export * from './dtos/requests/UpsertWebhookSubscriptionRequest';
|
|
@@ -27,6 +30,8 @@ export * from './dtos/requests/GetWebhookSubscriptionRequest';
|
|
|
27
30
|
export * from './dtos/requests/DeactivateWebhookSubscriptionRequest';
|
|
28
31
|
export * from './dtos/requests/ListWebhookDeliveriesRequest';
|
|
29
32
|
export * from './dtos/requests/RedeliverWebhookEventRequest';
|
|
33
|
+
export * from './dtos/requests/ListPendingWebhookDeliveriesRequest';
|
|
34
|
+
export * from './dtos/requests/RedeliverWebhookEventsBatchRequest';
|
|
30
35
|
|
|
31
36
|
// API privada de administración — responses
|
|
32
37
|
export * from './dtos/responses/UpsertWebhookSubscriptionResponse';
|
|
@@ -35,3 +40,5 @@ export * from './dtos/responses/ListWebhookSubscriptionsResponse';
|
|
|
35
40
|
export * from './dtos/responses/DeactivateWebhookSubscriptionResponse';
|
|
36
41
|
export * from './dtos/responses/ListWebhookDeliveriesResponse';
|
|
37
42
|
export * from './dtos/responses/RedeliverWebhookEventResponse';
|
|
43
|
+
export * from './dtos/responses/ListPendingWebhookDeliveriesResponse';
|
|
44
|
+
export * from './dtos/responses/RedeliverWebhookEventsBatchResponse';
|