gotrip-fx-transaction-form 1.0.43 → 1.0.45

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gotrip-fx-transaction-form",
3
- "version": "1.0.43",
3
+ "version": "1.0.45",
4
4
  "description": "FX Transaction Form ES6 module",
5
5
  "main": "index.js",
6
6
  "types": "types/index.d.ts",
@@ -0,0 +1,13 @@
1
+ export declare enum ValidationErrorCodes {
2
+ InvalidPhoneNumber = "V_001",
3
+ RequiredField = "V_002",
4
+ TypeString = "V_003",
5
+ TypeNumber = "V_004",
6
+ TypeBoolean = "V_005",
7
+ InvalidTicketCode = "V_006",
8
+ InvalidDepartureDate = "V_007",
9
+ InvalidTicketCodeStatus = "V_008",
10
+ VNCountryCodeIsNotAllowed = "V_009",
11
+ InvalidTransactionStatus = "V_010",
12
+ InvalidIdNumber = "V_011"
13
+ }
@@ -1,23 +1,24 @@
1
+ import { ReactNode } from 'react';
1
2
  export type AppState = {
2
3
  isLoading: boolean;
3
4
  modal: {
4
5
  error: {
5
6
  isOpen: boolean;
6
- message: string;
7
+ message: string | ReactNode;
7
8
  };
8
9
  success: {
9
10
  isOpen: boolean;
10
- message: string;
11
+ message: string | ReactNode;
11
12
  };
12
13
  };
13
14
  setIsLoading: (isLoading: boolean) => void;
14
15
  setModalError: (modal: {
15
16
  isOpen: boolean;
16
- message: string;
17
+ message: string | ReactNode;
17
18
  }) => void;
18
19
  setModalSuccess: (modal: {
19
20
  isOpen: boolean;
20
- message: string;
21
+ message: string | ReactNode;
21
22
  }) => void;
22
23
  closeModalError: () => void;
23
24
  closeModalSuccess: () => void;
@@ -1,3 +1,8 @@
1
1
  import { AxiosError } from 'axios';
2
2
  export declare const extractApiErrorCodes: (error: AxiosError) => Record<string, string[]>;
3
3
  export declare const getBusinessMessageFromCode: (code: string) => string;
4
+ export declare const getValidationMessageFromCode: (code: string) => string;
5
+ export declare const fillErrorMessages: (errorMessages: Record<string, string[]>, fieldNames: Record<string, string>) => {
6
+ field: string;
7
+ messages: string[];
8
+ }[];