@fiado/type-kit 3.611.0 → 3.612.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.
Files changed (59) hide show
  1. package/_test_/unit/gsfConnector/gsfMessages.test.ts +233 -0
  2. package/bin/gsfConnector/constants/GsfPatterns.d.ts +15 -0
  3. package/bin/gsfConnector/constants/GsfPatterns.js +18 -0
  4. package/bin/gsfConnector/constants/GsfPaymentOperations.d.ts +6 -0
  5. package/bin/gsfConnector/constants/GsfPaymentOperations.js +16 -0
  6. package/bin/gsfConnector/dtos/GsfAddress.d.ts +13 -0
  7. package/bin/gsfConnector/dtos/GsfAddress.js +81 -0
  8. package/bin/gsfConnector/dtos/GsfCreateCreditMessage.d.ts +17 -0
  9. package/bin/gsfConnector/dtos/GsfCreateCreditMessage.js +78 -0
  10. package/bin/gsfConnector/dtos/GsfCreditTerms.d.ts +17 -0
  11. package/bin/gsfConnector/dtos/GsfCreditTerms.js +71 -0
  12. package/bin/gsfConnector/dtos/GsfCustomer.d.ts +15 -0
  13. package/bin/gsfConnector/dtos/GsfCustomer.js +80 -0
  14. package/bin/gsfConnector/dtos/GsfExpectedState.d.ts +8 -0
  15. package/bin/gsfConnector/dtos/GsfExpectedState.js +38 -0
  16. package/bin/gsfConnector/dtos/GsfPayment.d.ts +16 -0
  17. package/bin/gsfConnector/dtos/GsfPayment.js +75 -0
  18. package/bin/gsfConnector/dtos/GsfPaymentMessage.d.ts +16 -0
  19. package/bin/gsfConnector/dtos/GsfPaymentMessage.js +74 -0
  20. package/bin/gsfConnector/dtos/GsfScheduleInstallment.d.ts +9 -0
  21. package/bin/gsfConnector/dtos/GsfScheduleInstallment.js +60 -0
  22. package/bin/gsfConnector/enums/GsfOperationEnum.d.ts +11 -0
  23. package/bin/gsfConnector/enums/GsfOperationEnum.js +15 -0
  24. package/bin/gsfConnector/enums/GsfPaymentChannelEnum.d.ts +11 -0
  25. package/bin/gsfConnector/enums/GsfPaymentChannelEnum.js +15 -0
  26. package/bin/gsfConnector/enums/GsfPaymentKindEnum.d.ts +11 -0
  27. package/bin/gsfConnector/enums/GsfPaymentKindEnum.js +15 -0
  28. package/bin/gsfConnector/enums/GsfPaymentPeriodicityEnum.d.ts +6 -0
  29. package/bin/gsfConnector/enums/GsfPaymentPeriodicityEnum.js +10 -0
  30. package/bin/gsfConnector/index.d.ts +17 -0
  31. package/bin/gsfConnector/index.js +37 -0
  32. package/bin/gsfConnector/validators/IsGsfCalendarDate.d.ts +6 -0
  33. package/bin/gsfConnector/validators/IsGsfCalendarDate.js +29 -0
  34. package/bin/gsfConnector/validators/IsGsfPaymentKindForOperation.d.ts +6 -0
  35. package/bin/gsfConnector/validators/IsGsfPaymentKindForOperation.js +31 -0
  36. package/bin/gsfConnector/validators/IsGsfPrepaymentScheduleProvided.d.ts +6 -0
  37. package/bin/gsfConnector/validators/IsGsfPrepaymentScheduleProvided.js +28 -0
  38. package/bin/index.d.ts +1 -0
  39. package/bin/index.js +3 -2
  40. package/package.json +1 -1
  41. package/src/gsfConnector/constants/GsfPatterns.ts +21 -0
  42. package/src/gsfConnector/constants/GsfPaymentOperations.ts +17 -0
  43. package/src/gsfConnector/dtos/GsfAddress.ts +60 -0
  44. package/src/gsfConnector/dtos/GsfCreateCreditMessage.ts +60 -0
  45. package/src/gsfConnector/dtos/GsfCreditTerms.ts +55 -0
  46. package/src/gsfConnector/dtos/GsfCustomer.ts +60 -0
  47. package/src/gsfConnector/dtos/GsfExpectedState.ts +25 -0
  48. package/src/gsfConnector/dtos/GsfPayment.ts +57 -0
  49. package/src/gsfConnector/dtos/GsfPaymentMessage.ts +58 -0
  50. package/src/gsfConnector/dtos/GsfScheduleInstallment.ts +41 -0
  51. package/src/gsfConnector/enums/GsfOperationEnum.ts +11 -0
  52. package/src/gsfConnector/enums/GsfPaymentChannelEnum.ts +11 -0
  53. package/src/gsfConnector/enums/GsfPaymentKindEnum.ts +11 -0
  54. package/src/gsfConnector/enums/GsfPaymentPeriodicityEnum.ts +6 -0
  55. package/src/gsfConnector/index.ts +24 -0
  56. package/src/gsfConnector/validators/IsGsfCalendarDate.ts +19 -0
  57. package/src/gsfConnector/validators/IsGsfPaymentKindForOperation.ts +21 -0
  58. package/src/gsfConnector/validators/IsGsfPrepaymentScheduleProvided.ts +18 -0
  59. package/src/index.ts +1 -0
@@ -0,0 +1,18 @@
1
+ import { ValidatorConstraint, ValidationArguments, ValidatorConstraintInterface } from 'class-validator';
2
+ import { GsfOperationEnum } from '../enums/GsfOperationEnum';
3
+
4
+ /** Un abono a capital trae la tabla recalculada: sin ella no hay contra qué comparar la reestructura de GSF. */
5
+ @ValidatorConstraint({ name: 'isGsfPrepaymentScheduleProvided', async: false })
6
+ export class IsGsfPrepaymentScheduleProvided implements ValidatorConstraintInterface {
7
+ validate(value: unknown, args: ValidationArguments): boolean {
8
+ if ((args.object as { operation?: unknown }).operation !== GsfOperationEnum.APPLY_PREPAYMENT) {
9
+ return true;
10
+ }
11
+ const schedule = (value as { schedule?: unknown } | null | undefined)?.schedule;
12
+ return Array.isArray(schedule) && schedule.length > 0;
13
+ }
14
+
15
+ defaultMessage(args: ValidationArguments): string {
16
+ return `${args.property}.schedule es obligatorio en APPLY_PREPAYMENT`;
17
+ }
18
+ }
package/src/index.ts CHANGED
@@ -80,6 +80,7 @@ export * as AiEngine from './aiEngine';
80
80
  export * as Sentry from './sentry';
81
81
  export * as CreditStatements from './credit-statements';
82
82
  export * as CirculoCredito from './circuloCredito';
83
+ export * as GsfConnector from './gsfConnector';
83
84
  export * as MilestoneBusiness from './milestone-business';
84
85
  export * as Mdm from './mdm';
85
86
  export * as MessagesConnector from './messagesConnector';