@fiado/type-kit 3.98.0 → 3.99.1

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.
@@ -8,8 +8,14 @@ export declare class AuthorizeFundingRequest {
8
8
  benefitId: string;
9
9
  leafId: string;
10
10
  productId: string;
11
+ /**
12
+ * `0` = referencia sin expiración (Equality lo acepta como `expirationDate: ""`).
13
+ * `1-30` = referencia que vence en N días.
14
+ * Patrón canónico Fiado: referencias OPEN para wallet-funding son
15
+ * permanentes (1-por-usuario) — el flow normal envía `0`.
16
+ */
11
17
  expirationDays: number;
12
- /** Requerido si el producto resuelto es `mode === OPEN`. */
18
+ /** Opcional. Solo aplica si el producto resuelto es `mode === FIXED`. Para OPEN se ignora. */
13
19
  customAmount?: number;
14
20
  idempotencyKey: string;
15
21
  walletAccountId: string;
@@ -37,14 +37,14 @@ __decorate([
37
37
  ], AuthorizeFundingRequest.prototype, "productId", void 0);
38
38
  __decorate([
39
39
  (0, class_validator_1.IsInt)(),
40
- (0, class_validator_1.Min)(1),
40
+ (0, class_validator_1.Min)(0),
41
41
  (0, class_validator_1.Max)(30),
42
42
  __metadata("design:type", Number)
43
43
  ], AuthorizeFundingRequest.prototype, "expirationDays", void 0);
44
44
  __decorate([
45
45
  (0, class_validator_1.IsOptional)(),
46
46
  (0, class_validator_1.IsNumber)(),
47
- (0, class_validator_1.IsPositive)(),
47
+ (0, class_validator_1.Min)(0),
48
48
  __metadata("design:type", Number)
49
49
  ], AuthorizeFundingRequest.prototype, "customAmount", void 0);
50
50
  __decorate([
@@ -6,8 +6,14 @@ export declare class CreateFundingReferenceRequest {
6
6
  name: string;
7
7
  email: string;
8
8
  mode: WalletFundingModeEnum;
9
+ /** `0` = OPEN (monto se decide en caja). `>0` = FIXED con monto exacto. */
9
10
  amount?: number;
10
11
  currencyCode: string;
12
+ /**
13
+ * ISO 8601 (`2026-06-30T23:59:59Z`) o **vacío `""`** para referencia sin
14
+ * expiración. El connector pasa `""` directo a Equality, que lo acepta
15
+ * (doc V1: "expirationDate opcional").
16
+ */
11
17
  expiresAt: string;
12
18
  idempotencyKey: string;
13
19
  }
@@ -46,7 +46,7 @@ __decorate([
46
46
  __decorate([
47
47
  (0, class_validator_1.IsOptional)(),
48
48
  (0, class_validator_1.IsNumber)(),
49
- (0, class_validator_1.IsPositive)(),
49
+ (0, class_validator_1.Min)(0),
50
50
  __metadata("design:type", Number)
51
51
  ], CreateFundingReferenceRequest.prototype, "amount", void 0);
52
52
  __decorate([
@@ -55,7 +55,7 @@ __decorate([
55
55
  __metadata("design:type", String)
56
56
  ], CreateFundingReferenceRequest.prototype, "currencyCode", void 0);
57
57
  __decorate([
58
- (0, class_validator_1.IsDateString)(),
58
+ (0, class_validator_1.IsString)(),
59
59
  __metadata("design:type", String)
60
60
  ], CreateFundingReferenceRequest.prototype, "expiresAt", void 0);
61
61
  __decorate([
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/type-kit",
3
- "version": "3.98.0",
3
+ "version": "3.99.1",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -13,9 +13,15 @@ export class AuthorizeFundingRequest {
13
13
  @IsString() @MaxLength(128) benefitId!: string;
14
14
  @IsString() @MaxLength(256) leafId!: string;
15
15
  @IsString() @MaxLength(128) productId!: string;
16
- @IsInt() @Min(1) @Max(30) expirationDays!: number;
17
- /** Requerido si el producto resuelto es `mode === OPEN`. */
18
- @IsOptional() @IsNumber() @IsPositive() customAmount?: number;
16
+ /**
17
+ * `0` = referencia sin expiración (Equality lo acepta como `expirationDate: ""`).
18
+ * `1-30` = referencia que vence en N días.
19
+ * Patrón canónico Fiado: referencias OPEN para wallet-funding son
20
+ * permanentes (1-por-usuario) — el flow normal envía `0`.
21
+ */
22
+ @IsInt() @Min(0) @Max(30) expirationDays!: number;
23
+ /** Opcional. Solo aplica si el producto resuelto es `mode === FIXED`. Para OPEN se ignora. */
24
+ @IsOptional() @IsNumber() @Min(0) customAmount?: number;
19
25
  @IsString() @MaxLength(64) idempotencyKey!: string;
20
26
  @IsString() @MaxLength(64) walletAccountId!: string;
21
27
  /** Para Passport (nombre del titular). Si se omite, el marketplace resuelve desde directory. */
@@ -1,6 +1,6 @@
1
1
  import {
2
- IsString, IsEmail, IsEnum, IsOptional, IsNumber, IsPositive,
3
- Length, IsDateString, MaxLength,
2
+ IsString, IsEmail, IsEnum, IsOptional, IsNumber, Min,
3
+ Length, MaxLength,
4
4
  } from "class-validator";
5
5
  import { WalletFundingModeEnum } from "../enums/WalletFundingModeEnum";
6
6
 
@@ -11,8 +11,14 @@ export class CreateFundingReferenceRequest {
11
11
  @IsString() @MaxLength(128) name!: string;
12
12
  @IsEmail() email!: string;
13
13
  @IsEnum(WalletFundingModeEnum) mode!: WalletFundingModeEnum;
14
- @IsOptional() @IsNumber() @IsPositive() amount?: number;
14
+ /** `0` = OPEN (monto se decide en caja). `>0` = FIXED con monto exacto. */
15
+ @IsOptional() @IsNumber() @Min(0) amount?: number;
15
16
  @IsString() @Length(3, 3) currencyCode!: string;
16
- @IsDateString() expiresAt!: string;
17
+ /**
18
+ * ISO 8601 (`2026-06-30T23:59:59Z`) o **vacío `""`** para referencia sin
19
+ * expiración. El connector pasa `""` directo a Equality, que lo acepta
20
+ * (doc V1: "expirationDate opcional").
21
+ */
22
+ @IsString() expiresAt!: string;
17
23
  @IsString() @MaxLength(64) idempotencyKey!: string;
18
24
  }