@fiado/type-kit 3.667.0 → 3.669.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.
@@ -5,6 +5,7 @@ import { PlatformRbac } from '../../../src/index';
5
5
  import { EnsureCustomerAccountRequest } from '../../../src/platformRbac/dtos/EnsureCustomerAccountRequest';
6
6
  import type { EnsureCustomerAccountResponse } from '../../../src/platformRbac/dtos/EnsureCustomerAccountResponse';
7
7
  import { OtpLoginRequest } from '../../../src/platformRbac/dtos/OtpLoginRequest';
8
+ import type { TenantUserOutcomeValue } from '../../../src/platformRbac/dtos/CreateTenantUserResponse';
8
9
  import type { UserProfileResponse } from '../../../src/platformRbac/dtos/UserProfileResponse';
9
10
 
10
11
  const BODY = {
@@ -87,17 +88,25 @@ describe('OtpLoginRequest', () => {
87
88
  });
88
89
 
89
90
  describe('EnsureCustomerAccountResponse', () => {
90
- it.each(['CREATED', 'EXISTING'] as const)('admite outcome %s', (outcome) => {
91
- const response: EnsureCustomerAccountResponse = { outcome, cognitoSub: 'sub-1' };
91
+ it.each(['CREATED', 'ADOPTED'] as const)('admite outcome %s', (outcome) => {
92
+ const response: EnsureCustomerAccountResponse = { cognitoSub: 'sub-1', status: 'ACTIVE', rolesAssigned: ['role-1'], outcome };
92
93
  expect(response.outcome).toBe(outcome);
93
94
  });
95
+
96
+ it('comparte el desenlace con el alta normal de RBAC', () => {
97
+ const outcome: TenantUserOutcomeValue = 'ADOPTED';
98
+ const response: EnsureCustomerAccountResponse = { cognitoSub: 'sub-1', status: 'ACTIVE', rolesAssigned: [], outcome };
99
+ expect(response.outcome).toBe('ADOPTED');
100
+ });
94
101
  });
95
102
 
96
103
  describe('UserProfileResponse', () => {
97
- it('admite los datos del cliente con valor y en null', () => {
98
- const withData: UserProfileResponse = { cognitoSub: 's', tenantId: 't', retailCustomerId: 'c', directoryId: 'd' };
99
- const empty: UserProfileResponse = { cognitoSub: 's', tenantId: 't', retailCustomerId: null, directoryId: null };
100
- expect(withData.retailCustomerId).toBe('c');
101
- expect(empty.directoryId).toBeNull();
104
+ it('no trae los datos del cliente de SureKeep', () => {
105
+ const profile: UserProfileResponse = { cognitoSub: 's', tenantId: 't' };
106
+ // @ts-expect-error retailCustomerId ya no es parte del perfil
107
+ const withRetail: UserProfileResponse = { cognitoSub: 's', tenantId: 't', retailCustomerId: 'c' };
108
+ // @ts-expect-error directoryId ya no es parte del perfil
109
+ const withDirectory: UserProfileResponse = { cognitoSub: 's', tenantId: 't', directoryId: 'd' };
110
+ expect([profile, withRetail, withDirectory]).toHaveLength(3);
102
111
  });
103
112
  });
@@ -0,0 +1,16 @@
1
+ import 'reflect-metadata';
2
+ import * as Reconciliation from '../../../src/reconciliation';
3
+ import { OperationEnum, TransactionStatusEnum } from '../../../src/transaction';
4
+
5
+ describe('movimiento ejecutado del detalle en vivo', () => {
6
+ it('el detalle en vivo acepta el movimiento de FSA con todos sus campos opcionales', () => {
7
+ const executedTransaction: Reconciliation.ReconciliationExecutedTransaction = {
8
+ transactionNumber: 'PCF-1', status: TransactionStatusEnum.COMPLETED, operation: OperationEnum.SUBSTRACT, walletId: 'acc-1', description: 'SUREKEEP_COLLECTION',
9
+ };
10
+ const detail: Reconciliation.ReconciliationItemLiveDetail = { creditId: 'cr-1', executedTransaction };
11
+ const empty: Reconciliation.ReconciliationExecutedTransaction = {};
12
+
13
+ expect(detail.executedTransaction).toEqual(executedTransaction);
14
+ expect(empty).toEqual({});
15
+ });
16
+ });
@@ -1,5 +1,9 @@
1
- /** Respuesta de POST /internal/tenants/{tenantId}/customer-accounts. */
1
+ import type { TenantUserOutcomeValue } from './CreateTenantUserResponse';
2
+ import type { TenantUserStatusValue } from './TenantUserResponse';
3
+ /** Respuesta de POST /internal/tenants/{tenantId}/customer-accounts; misma forma que el alta normal sin correo ni contraseña. */
2
4
  export interface EnsureCustomerAccountResponse {
3
- outcome: 'CREATED' | 'EXISTING';
4
5
  cognitoSub: string;
6
+ status: TenantUserStatusValue;
7
+ rolesAssigned: string[];
8
+ outcome: TenantUserOutcomeValue;
5
9
  }
@@ -6,6 +6,4 @@ export interface UserProfileResponse {
6
6
  email?: string;
7
7
  phone?: string;
8
8
  status?: string;
9
- retailCustomerId?: string | null;
10
- directoryId?: string | null;
11
9
  }
@@ -1,4 +1,5 @@
1
1
  import { CurrencyId } from '../../currency/enums/CurrencyId';
2
+ import { OperationEnum, TransactionStatusEnum } from '../../transaction';
2
3
  import { ReconciliationFeedConceptEnum } from '../enums/ReconciliationFeedConceptEnum';
3
4
  import { ReconciliationItemStateEnum } from '../enums/ReconciliationItemStateEnum';
4
5
  import { ReconciliationLayerEnum } from '../enums/ReconciliationLayerEnum';
@@ -74,4 +75,15 @@ export interface ReconciliationItemLiveDetail {
74
75
  amountCents?: number;
75
76
  productModel?: string;
76
77
  sellerName?: string;
78
+ /** Movimiento de FSA del lado ejecutado; se omite si la partida no lo trae o la lectura falla. */
79
+ executedTransaction?: ReconciliationExecutedTransaction;
80
+ }
81
+ /** Datos del movimiento del ledger (FiadoTx) leídos en vivo; el que no llega se omite. */
82
+ export interface ReconciliationExecutedTransaction {
83
+ transactionNumber?: string;
84
+ status?: TransactionStatusEnum;
85
+ operation?: OperationEnum;
86
+ walletId?: string;
87
+ /** Código de catálogo del producto (por ejemplo `SUREKEEP_COLLECTION`) o, si no viene, la descripción del detalle. */
88
+ description?: string;
77
89
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/type-kit",
3
- "version": "3.667.0",
3
+ "version": "3.669.0",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -1,5 +1,10 @@
1
- /** Respuesta de POST /internal/tenants/{tenantId}/customer-accounts. */
1
+ import type { TenantUserOutcomeValue } from './CreateTenantUserResponse';
2
+ import type { TenantUserStatusValue } from './TenantUserResponse';
3
+
4
+ /** Respuesta de POST /internal/tenants/{tenantId}/customer-accounts; misma forma que el alta normal sin correo ni contraseña. */
2
5
  export interface EnsureCustomerAccountResponse {
3
- outcome: 'CREATED' | 'EXISTING';
4
6
  cognitoSub: string;
7
+ status: TenantUserStatusValue;
8
+ rolesAssigned: string[];
9
+ outcome: TenantUserOutcomeValue;
5
10
  }
@@ -6,6 +6,4 @@ export interface UserProfileResponse {
6
6
  email?: string;
7
7
  phone?: string;
8
8
  status?: string;
9
- retailCustomerId?: string | null;
10
- directoryId?: string | null;
11
9
  }
@@ -1,4 +1,5 @@
1
1
  import { CurrencyId } from '../../currency/enums/CurrencyId';
2
+ import { OperationEnum, TransactionStatusEnum } from '../../transaction';
2
3
  import { ReconciliationFeedConceptEnum } from '../enums/ReconciliationFeedConceptEnum';
3
4
  import { ReconciliationItemStateEnum } from '../enums/ReconciliationItemStateEnum';
4
5
  import { ReconciliationLayerEnum } from '../enums/ReconciliationLayerEnum';
@@ -81,4 +82,16 @@ export interface ReconciliationItemLiveDetail {
81
82
  amountCents?: number;
82
83
  productModel?: string;
83
84
  sellerName?: string;
85
+ /** Movimiento de FSA del lado ejecutado; se omite si la partida no lo trae o la lectura falla. */
86
+ executedTransaction?: ReconciliationExecutedTransaction;
87
+ }
88
+
89
+ /** Datos del movimiento del ledger (FiadoTx) leídos en vivo; el que no llega se omite. */
90
+ export interface ReconciliationExecutedTransaction {
91
+ transactionNumber?: string;
92
+ status?: TransactionStatusEnum;
93
+ operation?: OperationEnum;
94
+ walletId?: string;
95
+ /** Código de catálogo del producto (por ejemplo `SUREKEEP_COLLECTION`) o, si no viene, la descripción del detalle. */
96
+ description?: string;
84
97
  }