gotrip-fx-transaction-form 1.0.94 → 1.0.96

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 (41) hide show
  1. package/index.js +29043 -28133
  2. package/package.json +1 -1
  3. package/types/components/AddDepartment/AddDepartmentForm.d.ts +2 -1
  4. package/types/components/AddTransaction/SingularCustomer.d.ts +1 -2
  5. package/types/components/AddUser/AddMemberForm.d.ts +2 -1
  6. package/types/components/Department/AddDepartmentMemberForm.d.ts +2 -1
  7. package/types/components/Menu/Menu.d.ts +6 -1
  8. package/types/components/Menu/MenuItem.d.ts +5 -4
  9. package/types/components/Modal/AddDepartmentMemberModal.d.ts +1 -0
  10. package/types/components/Modal/AddDepartmentModal.d.ts +1 -0
  11. package/types/components/Modal/SendEmailModal.d.ts +8 -0
  12. package/types/components/Modal/UpdateCommissionPolicy.d.ts +2 -1
  13. package/types/components/Modal/UpdateTenantCommissionInputCell.d.ts +31 -0
  14. package/types/components/Modal/UpdateTenantCommissionPolicyModal.d.ts +4 -1
  15. package/types/components/OrganizationFlow/DepartmentNode.d.ts +3 -0
  16. package/types/components/OrganizationFlow/LayoutFlow.d.ts +3 -0
  17. package/types/components/OrganizationFlow/OrganizationLayoutFlow.d.ts +1 -1
  18. package/types/components/Pagination/LimitDropdown.d.ts +2 -1
  19. package/types/constants/api-urls.d.ts +16 -0
  20. package/types/constants/organization-flow.constants.d.ts +33 -0
  21. package/types/constants/regex.d.ts +2 -0
  22. package/types/design-systems/Input/PhoneInput.d.ts +9 -0
  23. package/types/design-systems/Select/SelectSearchable.d.ts +17 -0
  24. package/types/hooks/transactions/useEducation.hook.d.ts +8 -8
  25. package/types/hooks/transactions/useImmigration.hook.d.ts +8 -8
  26. package/types/hooks/useBankList.d.ts +5 -1
  27. package/types/hooks/useComissionPolicies.d.ts +4 -2
  28. package/types/hooks/useEmailHistory.d.ts +25 -0
  29. package/types/hooks/useHeaderMenu.d.ts +2 -2
  30. package/types/hooks/useImportBookers.d.ts +47 -19
  31. package/types/hooks/useImportMembers.d.ts +18 -18
  32. package/types/hooks/useMemberList.d.ts +2 -1
  33. package/types/hooks/useMenuState.d.ts +11 -0
  34. package/types/hooks/usePhoneValidation.d.ts +15 -0
  35. package/types/hooks/useRoleList.d.ts +3 -1
  36. package/types/pages/admin/email-history-listing/EmailHistoryListing.d.ts +6 -0
  37. package/types/pages/agency/esim-listing/ESIMListing.d.ts +1 -6
  38. package/types/pages/agency/tracsaction-list/TransactionList.d.ts +1 -1
  39. package/types/pages/agency/transaction-detail/TransactionDetail.d.ts +1 -3
  40. package/types/types/response.dto.d.ts +19 -0
  41. package/types/util/phone.d.ts +37 -7
@@ -1,14 +1,18 @@
1
1
  import { ChangeEvent } from 'react';
2
+ import { IRole } from '../types/response.dto';
2
3
  import * as yup from 'yup';
3
4
  declare const groupOfBookerSchema: yup.ObjectSchema<{
4
5
  bookers: {
6
+ department?: string | null | undefined;
7
+ agent?: string | null | undefined;
5
8
  uuid?: string | undefined;
9
+ role_id?: number | null | undefined;
6
10
  status: string;
7
11
  phone: string;
8
- email: string;
9
- firstName: string;
10
12
  lastName: string;
13
+ email: string;
11
14
  password: string;
15
+ firstName: string;
12
16
  }[] | undefined;
13
17
  }, yup.AnyObject, {
14
18
  bookers: "";
@@ -17,93 +21,117 @@ export declare const useImportBookers: (onFinish: () => void) => {
17
21
  isLoading: boolean;
18
22
  file: File | null;
19
23
  inputFileRef: import('react').RefObject<HTMLInputElement>;
20
- onSelectFile: (event: ChangeEvent<HTMLInputElement>) => Promise<void>;
24
+ onSelectFile: (event: ChangeEvent<HTMLInputElement>, roles?: IRole[]) => Promise<void>;
21
25
  register: import('react-hook-form').UseFormRegister<{
22
26
  bookers?: {
27
+ department?: string | null | undefined;
28
+ agent?: string | null | undefined;
23
29
  uuid?: string | undefined;
30
+ role_id?: number | null | undefined;
24
31
  status: string;
25
32
  phone: string;
26
- email: string;
27
- firstName: string;
28
33
  lastName: string;
34
+ email: string;
29
35
  password: string;
36
+ firstName: string;
30
37
  }[] | undefined;
31
38
  }>;
32
39
  handleSubmit: import('react-hook-form').UseFormHandleSubmit<{
33
40
  bookers?: {
41
+ department?: string | null | undefined;
42
+ agent?: string | null | undefined;
34
43
  uuid?: string | undefined;
44
+ role_id?: number | null | undefined;
35
45
  status: string;
36
46
  phone: string;
37
- email: string;
38
- firstName: string;
39
47
  lastName: string;
48
+ email: string;
40
49
  password: string;
50
+ firstName: string;
41
51
  }[] | undefined;
42
52
  }, undefined>;
43
53
  errors: import('react-hook-form').FieldErrors<{
44
54
  bookers?: {
55
+ department?: string | null | undefined;
56
+ agent?: string | null | undefined;
45
57
  uuid?: string | undefined;
58
+ role_id?: number | null | undefined;
46
59
  status: string;
47
60
  phone: string;
48
- email: string;
49
- firstName: string;
50
61
  lastName: string;
62
+ email: string;
51
63
  password: string;
64
+ firstName: string;
52
65
  }[] | undefined;
53
66
  }>;
54
67
  getValues: import('react-hook-form').UseFormGetValues<{
55
68
  bookers?: {
69
+ department?: string | null | undefined;
70
+ agent?: string | null | undefined;
56
71
  uuid?: string | undefined;
72
+ role_id?: number | null | undefined;
57
73
  status: string;
58
74
  phone: string;
59
- email: string;
60
- firstName: string;
61
75
  lastName: string;
76
+ email: string;
62
77
  password: string;
78
+ firstName: string;
63
79
  }[] | undefined;
64
80
  }>;
65
81
  setValue: import('react-hook-form').UseFormSetValue<{
66
82
  bookers?: {
83
+ department?: string | null | undefined;
84
+ agent?: string | null | undefined;
67
85
  uuid?: string | undefined;
86
+ role_id?: number | null | undefined;
68
87
  status: string;
69
88
  phone: string;
70
- email: string;
71
- firstName: string;
72
89
  lastName: string;
90
+ email: string;
73
91
  password: string;
92
+ firstName: string;
74
93
  }[] | undefined;
75
94
  }>;
76
95
  watch: import('react-hook-form').UseFormWatch<{
77
96
  bookers?: {
97
+ department?: string | null | undefined;
98
+ agent?: string | null | undefined;
78
99
  uuid?: string | undefined;
100
+ role_id?: number | null | undefined;
79
101
  status: string;
80
102
  phone: string;
81
- email: string;
82
- firstName: string;
83
103
  lastName: string;
104
+ email: string;
84
105
  password: string;
106
+ firstName: string;
85
107
  }[] | undefined;
86
108
  }>;
87
109
  trigger: import('react-hook-form').UseFormTrigger<{
88
110
  bookers?: {
111
+ department?: string | null | undefined;
112
+ agent?: string | null | undefined;
89
113
  uuid?: string | undefined;
114
+ role_id?: number | null | undefined;
90
115
  status: string;
91
116
  phone: string;
92
- email: string;
93
- firstName: string;
94
117
  lastName: string;
118
+ email: string;
95
119
  password: string;
120
+ firstName: string;
96
121
  }[] | undefined;
97
122
  }>;
98
123
  reset: import('react-hook-form').UseFormReset<{
99
124
  bookers?: {
125
+ department?: string | null | undefined;
126
+ agent?: string | null | undefined;
100
127
  uuid?: string | undefined;
128
+ role_id?: number | null | undefined;
101
129
  status: string;
102
130
  phone: string;
103
- email: string;
104
- firstName: string;
105
131
  lastName: string;
132
+ email: string;
106
133
  password: string;
134
+ firstName: string;
107
135
  }[] | undefined;
108
136
  }>;
109
137
  onSubmit: (data: yup.InferType<typeof groupOfBookerSchema>) => Promise<void>;
@@ -5,10 +5,10 @@ declare const groupOfMemberSchema: yup.ObjectSchema<{
5
5
  uuid?: string | undefined;
6
6
  status: string;
7
7
  phone: string;
8
- email: string;
9
- firstName: string;
10
8
  lastName: string;
9
+ email: string;
11
10
  password: string;
11
+ firstName: string;
12
12
  }[] | undefined;
13
13
  }, yup.AnyObject, {
14
14
  members: "";
@@ -23,10 +23,10 @@ export declare const useImportMembers: (onFinish: () => void) => {
23
23
  uuid?: string | undefined;
24
24
  status: string;
25
25
  phone: string;
26
- email: string;
27
- firstName: string;
28
26
  lastName: string;
27
+ email: string;
29
28
  password: string;
29
+ firstName: string;
30
30
  }[] | undefined;
31
31
  }>;
32
32
  handleSubmit: import('react-hook-form').UseFormHandleSubmit<{
@@ -34,10 +34,10 @@ export declare const useImportMembers: (onFinish: () => void) => {
34
34
  uuid?: string | undefined;
35
35
  status: string;
36
36
  phone: string;
37
- email: string;
38
- firstName: string;
39
37
  lastName: string;
38
+ email: string;
40
39
  password: string;
40
+ firstName: string;
41
41
  }[] | undefined;
42
42
  }, undefined>;
43
43
  errors: import('react-hook-form').FieldErrors<{
@@ -45,10 +45,10 @@ export declare const useImportMembers: (onFinish: () => void) => {
45
45
  uuid?: string | undefined;
46
46
  status: string;
47
47
  phone: string;
48
- email: string;
49
- firstName: string;
50
48
  lastName: string;
49
+ email: string;
51
50
  password: string;
51
+ firstName: string;
52
52
  }[] | undefined;
53
53
  }>;
54
54
  getValues: import('react-hook-form').UseFormGetValues<{
@@ -56,10 +56,10 @@ export declare const useImportMembers: (onFinish: () => void) => {
56
56
  uuid?: string | undefined;
57
57
  status: string;
58
58
  phone: string;
59
- email: string;
60
- firstName: string;
61
59
  lastName: string;
60
+ email: string;
62
61
  password: string;
62
+ firstName: string;
63
63
  }[] | undefined;
64
64
  }>;
65
65
  setValue: import('react-hook-form').UseFormSetValue<{
@@ -67,10 +67,10 @@ export declare const useImportMembers: (onFinish: () => void) => {
67
67
  uuid?: string | undefined;
68
68
  status: string;
69
69
  phone: string;
70
- email: string;
71
- firstName: string;
72
70
  lastName: string;
71
+ email: string;
73
72
  password: string;
73
+ firstName: string;
74
74
  }[] | undefined;
75
75
  }>;
76
76
  watch: import('react-hook-form').UseFormWatch<{
@@ -78,10 +78,10 @@ export declare const useImportMembers: (onFinish: () => void) => {
78
78
  uuid?: string | undefined;
79
79
  status: string;
80
80
  phone: string;
81
- email: string;
82
- firstName: string;
83
81
  lastName: string;
82
+ email: string;
84
83
  password: string;
84
+ firstName: string;
85
85
  }[] | undefined;
86
86
  }>;
87
87
  trigger: import('react-hook-form').UseFormTrigger<{
@@ -89,10 +89,10 @@ export declare const useImportMembers: (onFinish: () => void) => {
89
89
  uuid?: string | undefined;
90
90
  status: string;
91
91
  phone: string;
92
- email: string;
93
- firstName: string;
94
92
  lastName: string;
93
+ email: string;
95
94
  password: string;
95
+ firstName: string;
96
96
  }[] | undefined;
97
97
  }>;
98
98
  reset: import('react-hook-form').UseFormReset<{
@@ -100,10 +100,10 @@ export declare const useImportMembers: (onFinish: () => void) => {
100
100
  uuid?: string | undefined;
101
101
  status: string;
102
102
  phone: string;
103
- email: string;
104
- firstName: string;
105
103
  lastName: string;
104
+ email: string;
106
105
  password: string;
106
+ firstName: string;
107
107
  }[] | undefined;
108
108
  }>;
109
109
  onSubmit: (data: yup.InferType<typeof groupOfMemberSchema>) => Promise<void>;
@@ -1,7 +1,8 @@
1
1
  import { IUser } from '../types/response.dto';
2
- export declare const useMemberList: ({ defaultPage, defaultLimit, }?: {
2
+ export declare const useMemberList: ({ defaultPage, defaultLimit, tenantId, }?: {
3
3
  defaultPage?: number;
4
4
  defaultLimit?: number;
5
+ tenantId?: number;
5
6
  }) => {
6
7
  members: IUser[];
7
8
  total: number;
@@ -0,0 +1,11 @@
1
+ interface MenuState {
2
+ [key: string]: boolean;
3
+ }
4
+ export declare const useMenuState: () => {
5
+ menuStates: MenuState;
6
+ saveAccordionState: (key: string, isOpen: boolean) => void;
7
+ getAccordionState: (key: string) => boolean;
8
+ toggleAccordionState: (key: string) => void;
9
+ clearAccordionState: (key: string) => void;
10
+ };
11
+ export {};
@@ -0,0 +1,15 @@
1
+ export interface PhoneValidationOptions {
2
+ allowInternational?: boolean;
3
+ allowLocal?: boolean;
4
+ allow84Format?: boolean;
5
+ required?: boolean;
6
+ customMessage?: string;
7
+ }
8
+ export declare const usePhoneValidation: (options?: PhoneValidationOptions) => {
9
+ validatePhone: (phone: string) => string | undefined;
10
+ normalizePhone: (phone: string, format?: "local" | "international") => string;
11
+ formatPhone: (phone: string) => string;
12
+ isValidVietnamesePhone: (phone: string) => boolean;
13
+ isValidVietnameseLocalPhone: (phone: string) => boolean;
14
+ isValidVietnameseInternationalPhone: (phone: string) => boolean;
15
+ };
@@ -1,5 +1,7 @@
1
1
  import { IRole } from '../types/response.dto';
2
- export declare const useRoleList: () => {
2
+ export declare const useRoleList: ({ tenantId }?: {
3
+ tenantId?: number;
4
+ }) => {
3
5
  roles: IRole[];
4
6
  selectedRole: IRole | null;
5
7
  loading: boolean;
@@ -0,0 +1,6 @@
1
+ type Props = {
2
+ showLayout?: boolean;
3
+ defaultLimit?: number;
4
+ };
5
+ export declare const EmailHistoryListing: ({ showLayout, defaultLimit }: Props) => import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -1,6 +1 @@
1
- type Props = {
2
- showLayout?: boolean;
3
- defaultLimit?: number;
4
- };
5
- export declare const ESimListing: ({ showLayout }: Props) => import("react/jsx-runtime").JSX.Element;
6
- export {};
1
+ export declare const ESimListing: () => import("react/jsx-runtime").JSX.Element;
@@ -5,5 +5,5 @@ type Props = {
5
5
  endDate?: string | null;
6
6
  startDate?: string | null;
7
7
  };
8
- export declare const TransactionList: ({ showLayout, hideAddButton, defaultLimit, endDate, startDate, }: Props) => import("react/jsx-runtime").JSX.Element;
8
+ export declare const TransactionList: ({ hideAddButton, defaultLimit, endDate, startDate, }: Props) => import("react/jsx-runtime").JSX.Element;
9
9
  export {};
@@ -1,3 +1 @@
1
- export declare const TransactionDetail: ({ showLayout }: {
2
- showLayout?: boolean;
3
- }) => import("react/jsx-runtime").JSX.Element;
1
+ export declare const TransactionDetail: () => import("react/jsx-runtime").JSX.Element;
@@ -51,6 +51,11 @@ export type IAgent = {
51
51
  phone: string;
52
52
  identityNumber: string;
53
53
  };
54
+ export declare enum ETicketEntryType {
55
+ MANUAL = "manual",
56
+ IMAGE = "image",
57
+ CODE = "code"
58
+ }
54
59
  export type IZNSInfo = {
55
60
  msgId: string;
56
61
  status?: string;
@@ -284,6 +289,10 @@ export type IUser = {
284
289
  roles?: IRole[];
285
290
  tenant?: ITenant;
286
291
  permissions?: EPermissionKey[];
292
+ balance?: {
293
+ amount: number;
294
+ };
295
+ createdAt?: string;
287
296
  source?: string;
288
297
  };
289
298
  export type IBid = {
@@ -385,4 +394,14 @@ export declare enum EDepartmentType {
385
394
  DEPARTMENT = "department",
386
395
  AGENT = "agent"
387
396
  }
397
+ export interface IEmailHistory {
398
+ id: number;
399
+ email: string;
400
+ title: string;
401
+ content: string;
402
+ settings: Record<string, any>;
403
+ response: Record<string, any>;
404
+ createdAt: string;
405
+ updatedAt: string;
406
+ }
388
407
  export {};
@@ -1,9 +1,15 @@
1
+ /**
2
+ * Removes all special characters and spaces except digits and + from phone number
3
+ * @param phone The phone number to clean
4
+ * @returns The cleaned phone number
5
+ */
6
+ export declare const cleanPhoneNumber: (phone: string) => string;
1
7
  /**
2
8
  * Converts a phone number to Vietnamese local format (starting with 0)
3
9
  * Examples:
4
- * - "+84912345678" -> "0912345678"
5
- * - "84912345678" -> "0912345678"
6
- * - "0912345678" -> "0912345678" (remains unchanged)
10
+ * - "+84 912 345 678" -> "0912 345 678"
11
+ * - "84 912 345 678" -> "0912 345 678"
12
+ * - "0912 345 678" -> "0912 345 678" (remains unchanged)
7
13
  * @param phone The phone number to convert
8
14
  * @returns The converted phone number in local format
9
15
  */
@@ -11,11 +17,35 @@ export declare const toLocalPhoneNumber: (phone: string) => string;
11
17
  /**
12
18
  * Converts a phone number to international format (starting with +84)
13
19
  * Examples:
14
- * - "0912345678" -> "+84912345678"
15
- * - "912345678" -> "+84912345678"
16
- * - "+84912345678" -> "+84912345678" (remains unchanged)
17
- * - "84912345678" -> "+84912345678"
20
+ * - "0912 345 678" -> "+84 912 345 678"
21
+ * - "912 345 678" -> "+84 912 345 678"
22
+ * - "+84 912 345 678" -> "+84 912 345 678" (remains unchanged)
23
+ * - "84 912 345 678" -> "+84 912 345 678"
18
24
  * @param phone The phone number to convert
19
25
  * @returns The converted phone number in international format
20
26
  */
21
27
  export declare const toInternationalPhoneNumber: (phone: string) => string;
28
+ /**
29
+ * Validates if a phone number is a valid Vietnamese phone number
30
+ * @param phone The phone number to validate
31
+ * @returns true if valid, false otherwise
32
+ */
33
+ export declare const isValidVietnamesePhone: (phone: string) => boolean;
34
+ /**
35
+ * Validates if a phone number is a valid Vietnamese local phone number (starts with 0)
36
+ * @param phone The phone number to validate
37
+ * @returns true if valid, false otherwise
38
+ */
39
+ export declare const isValidVietnameseLocalPhone: (phone: string) => boolean;
40
+ /**
41
+ * Validates if a phone number is a valid Vietnamese international phone number (starts with +84)
42
+ * @param phone The phone number to validate
43
+ * @returns true if valid, false otherwise
44
+ */
45
+ export declare const isValidVietnameseInternationalPhone: (phone: string) => boolean;
46
+ /**
47
+ * Formats a phone number for display (adds spaces for better readability)
48
+ * @param phone The phone number to format
49
+ * @returns The formatted phone number
50
+ */
51
+ export declare const formatPhoneForDisplay: (phone: string) => string;