gotrip-fx-transaction-form 1.0.36 → 1.0.37

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 (56) hide show
  1. package/index.js +13419 -13227
  2. package/package.json +1 -1
  3. package/types/components/AddDepartment/AddDepartmentForm.d.ts +6 -0
  4. package/types/components/AddRole/AddRoleForm.d.ts +6 -0
  5. package/types/components/AddTenant/AddTenantForm.d.ts +6 -0
  6. package/types/components/AddTenant/TenantSelectionInput.d.ts +9 -0
  7. package/types/components/AddTenant/TenantTypeSelectionInput.d.ts +6 -0
  8. package/types/components/AddUser/AddMemberForm.d.ts +6 -0
  9. package/types/components/AddUser/AddUserForm.d.ts +6 -0
  10. package/types/components/Department/AddDepartmentMemberForm.d.ts +13 -0
  11. package/types/components/Department/DepartmentCard.d.ts +22 -0
  12. package/types/components/MemberList/SearchTextInput.d.ts +9 -0
  13. package/types/components/PermissionList/PermissionList.d.ts +8 -0
  14. package/types/components/TenantTypeBadge/TenantTypeBadge.d.ts +4 -0
  15. package/types/components/TransactionList/BankSelectionInput.d.ts +2 -2
  16. package/types/components/UpdateTenant/UpdateTenantForm.d.ts +7 -0
  17. package/types/components/UpdateUser/ResetPasswordForm.d.ts +7 -0
  18. package/types/components/UpdateUser/UpdateMemberForm.d.ts +7 -0
  19. package/types/components/UpdateUser/UpdateUserForm.d.ts +7 -0
  20. package/types/components/UserFilter/UserFilter.d.ts +18 -0
  21. package/types/components/ui/spinner-loading.d.ts +6 -0
  22. package/types/constants/api-urls.d.ts +30 -0
  23. package/types/constants/business-codes.d.ts +14 -1
  24. package/types/constants/index.d.ts +1 -0
  25. package/types/constants/tenant.d.ts +5 -0
  26. package/types/design-systems/Button/Button.d.ts +3 -2
  27. package/types/design-systems/Dialog/Dialog.d.ts +11 -0
  28. package/types/hooks/useDepartmentList.d.ts +9 -0
  29. package/types/hooks/useImportBookers.d.ts +18 -18
  30. package/types/hooks/useImportMembers.d.ts +113 -0
  31. package/types/hooks/useMemberList.d.ts +17 -0
  32. package/types/hooks/usePermissionList.d.ts +11 -0
  33. package/types/hooks/useRoleList.d.ts +14 -0
  34. package/types/hooks/useTenantList.d.ts +7 -0
  35. package/types/hooks/useTransactionList.d.ts +2 -2
  36. package/types/hooks/useUserList.d.ts +3 -0
  37. package/types/main.d.ts +0 -1
  38. package/types/pages/admin/add-tenant/AddTenant.d.ts +5 -0
  39. package/types/pages/admin/add-user/AddUser.d.ts +5 -0
  40. package/types/pages/admin/tenant-list/TenantList.d.ts +5 -0
  41. package/types/pages/partner/add-member/AddMember.d.ts +5 -0
  42. package/types/pages/partner/add-member/ImportMember.d.ts +1 -0
  43. package/types/pages/partner/department-detail/AddDepartmentMember.d.ts +8 -0
  44. package/types/pages/partner/department-detail/DepartmentDetail.d.ts +1 -0
  45. package/types/pages/partner/department-list/AddDepartment.d.ts +5 -0
  46. package/types/pages/partner/department-list/DepartmentList.d.ts +2 -0
  47. package/types/pages/partner/role-list/AddRole.d.ts +5 -0
  48. package/types/pages/partner/role-list/RoleList.d.ts +2 -0
  49. package/types/store/useAuthStore.d.ts +5 -0
  50. package/types/types/enum.d.ts +6 -0
  51. package/types/types/response.dto.d.ts +51 -8
  52. package/types/types/user.d.ts +36 -0
  53. package/types/util/formatter.d.ts +1 -0
  54. package/types/util/permission.util.d.ts +14 -0
  55. package/types/hooks/{transanactions → transactions}/useEducation.hook.d.ts +7 -7
  56. package/types/hooks/{transanactions → transactions}/useImmigration.hook.d.ts +7 -7
@@ -0,0 +1,5 @@
1
+ type Props = {
2
+ showLayout?: boolean;
3
+ };
4
+ export declare const TenantList: ({ showLayout }: Props) => import("react/jsx-runtime").JSX.Element;
5
+ export {};
@@ -0,0 +1,5 @@
1
+ type AddMemberProps = {
2
+ onSubmitSuccess: () => void;
3
+ };
4
+ export declare const AddMember: (props: AddMemberProps) => import("react/jsx-runtime").JSX.Element;
5
+ export {};
@@ -0,0 +1 @@
1
+ export declare const ImportMember: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ type AddDepartmentMemberProps = {
2
+ parentId?: number | null;
3
+ departmentId: number;
4
+ joinedMemberIds?: number[];
5
+ onSubmitSuccess: () => void;
6
+ };
7
+ export declare const AddDepartmentMember: ({ parentId, onSubmitSuccess, joinedMemberIds, departmentId, }: AddDepartmentMemberProps) => import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1 @@
1
+ export declare const DepartmentDetail: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ type AddDepartmentProps = {
2
+ onSubmitSuccess: () => void;
3
+ };
4
+ export declare const AddDepartment: ({ onSubmitSuccess }: AddDepartmentProps) => import("react/jsx-runtime").JSX.Element;
5
+ export {};
@@ -0,0 +1,2 @@
1
+ import { default as React } from 'react';
2
+ export declare const DepartmentList: React.FC;
@@ -0,0 +1,5 @@
1
+ type AddRoleProps = {
2
+ onSubmitSuccess: () => void;
3
+ };
4
+ export declare const AddRole: (props: AddRoleProps) => import("react/jsx-runtime").JSX.Element;
5
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare const RoleList: () => import("react/jsx-runtime").JSX.Element;
2
+ export default RoleList;
@@ -1,12 +1,17 @@
1
1
  import { LoginRespDto } from '../types/response.dto';
2
+ import { EPermissionKey } from '../types/user';
2
3
  type AuthUser = LoginRespDto['user'];
3
4
  export type AuthState = {
5
+ loading: boolean;
4
6
  token: string | null;
5
7
  user: AuthUser | null;
6
8
  setToken: (token: string | null) => void;
7
9
  setUser: (user: AuthUser | null) => void;
10
+ checkPermission: (permissions: EPermissionKey[]) => boolean;
11
+ fetchUserInfo: () => Promise<void>;
8
12
  isSupervisor: boolean;
9
13
  isAdmin: boolean;
14
+ departmentDisplay: string;
10
15
  };
11
16
  export declare const useAuthStore: import('zustand').UseBoundStore<import('zustand').StoreApi<AuthState>>;
12
17
  export {};
@@ -16,3 +16,9 @@ export declare enum BankStatus {
16
16
  INACTIVE = "inactive",
17
17
  COMMING_SOON = "comming_soon"
18
18
  }
19
+ export declare enum ETenantType {
20
+ SYSTEM = "system",
21
+ BANK = "bank",
22
+ TRAVEL_AGENCY = "travel_agency",
23
+ STANDALONE_BOOKER = "standalone_booker"
24
+ }
@@ -1,5 +1,5 @@
1
- import { BankStatus, TransactionStatus } from './enum';
2
- import { EUserRole, EUserStatus } from './user';
1
+ import { ETenantType, TransactionStatus } from './enum';
2
+ import { EPermissionKey, EUserRole, EUserStatus } from './user';
3
3
  export type LoginRespDto = {
4
4
  accessToken: string;
5
5
  user: {
@@ -8,7 +8,10 @@ export type LoginRespDto = {
8
8
  lastName?: string;
9
9
  role: EUserRole;
10
10
  refCode: string;
11
- bank?: IBank;
11
+ tenant?: ITenant;
12
+ roles?: string[];
13
+ permissions?: EPermissionKey[];
14
+ department?: IDepartment;
12
15
  isAgency?: boolean;
13
16
  };
14
17
  };
@@ -57,18 +60,20 @@ export type ITransaction = {
57
60
  updatedAt: string;
58
61
  type: ETransactionType;
59
62
  ticket?: ITicket;
60
- bank?: IBank;
63
+ bank?: ITenant;
61
64
  user?: IUser;
62
65
  totalSubTransaction?: number;
63
66
  groupPublicId?: string;
64
67
  documents: any[];
68
+ bankDepartment?: IDepartment;
65
69
  cancelReason?: string;
66
70
  bankResponseLog?: Record<string, any>;
67
71
  };
68
- export type IBank = {
72
+ export type ITenant = {
73
+ id: number;
69
74
  shortName: string;
70
- commonName: string;
71
- status: BankStatus;
75
+ name: string;
76
+ type: ETenantType;
72
77
  };
73
78
  export type GetTransactionListRespDto = {
74
79
  transactions: ITransaction[];
@@ -78,6 +83,9 @@ export type GetUserListRespDto = {
78
83
  users: IUser[];
79
84
  total: number;
80
85
  };
86
+ export type GetTenantListRespDto = {
87
+ tenants: ITenant[];
88
+ };
81
89
  export type INewBooker = {
82
90
  email: string;
83
91
  firstName: string;
@@ -90,6 +98,10 @@ export type GetBookerListRespDto = {
90
98
  bookers: IUser[];
91
99
  total: number;
92
100
  };
101
+ export type GetMemberListRespDto = {
102
+ members: IUser[];
103
+ total: number;
104
+ };
93
105
  export type ExchangeRateHistory = {
94
106
  exchangeRate: string;
95
107
  date: Date;
@@ -98,7 +110,7 @@ export type BankCurrency = {
98
110
  status: string;
99
111
  paymentMethod: string;
100
112
  currencyCode: string;
101
- bank: IBank;
113
+ bank: ITenant;
102
114
  exchangeRateHistories: ExchangeRateHistory[];
103
115
  };
104
116
  export type Currency = {
@@ -114,6 +126,19 @@ export declare enum EBidStatus {
114
126
  ACCEPTED = "accepted",
115
127
  REJECTED = "rejected"
116
128
  }
129
+ export type IDepartment = {
130
+ id: number;
131
+ publicId: string;
132
+ name: string;
133
+ parentId?: number;
134
+ address: string;
135
+ };
136
+ export type IRole = {
137
+ id: number;
138
+ name: string;
139
+ description: string;
140
+ permissions: IPermission[];
141
+ };
117
142
  export type IUser = {
118
143
  id: number;
119
144
  email: string;
@@ -129,6 +154,10 @@ export type IUser = {
129
154
  commissionPolicy?: {
130
155
  commisionRate: number;
131
156
  };
157
+ departments?: IDepartment[];
158
+ roles?: IRole[];
159
+ tenant?: ITenant;
160
+ permissions?: EPermissionKey[];
132
161
  };
133
162
  export type IBid = {
134
163
  id: number;
@@ -158,3 +187,17 @@ export type GetFlightInfoResponseDto = {
158
187
  arriveAirportCode?: string;
159
188
  countryNameDes?: string;
160
189
  };
190
+ type IGlobalPermission = {
191
+ key: string;
192
+ description: string;
193
+ group: string;
194
+ index: number;
195
+ };
196
+ export type IPermission = {
197
+ id: number;
198
+ key: EPermissionKey;
199
+ label: string;
200
+ description: string;
201
+ globalPermission: IGlobalPermission;
202
+ };
203
+ export {};
@@ -9,3 +9,39 @@ export declare enum EUserStatus {
9
9
  ACTIVE = "active",
10
10
  INACTIVE = "inactive"
11
11
  }
12
+ export declare enum EPermissionKey {
13
+ VIEW_FX_TRANSACTION_LIST = "VIEW_FX_TRANSACTION_LIST",
14
+ VIEW_FX_TRANSACTION_DETAIL = "VIEW_FX_TRANSACTION_DETAIL",
15
+ VIEW_MEMBER_LIST = "VIEW_MEMBER_LIST",
16
+ ADD_MEMBER_ONE = "ADD_MEMBER_ONE",
17
+ ADD_MEMBER_MANY = "ADD_MEMBER_MANY",
18
+ UPDATE_MEMBER_INFO = "UPDATE_MEMBER_INFO",
19
+ DELETE_MEMBER = "DELETE_MEMBER",
20
+ UPDATE_PROFILE_INFO = "UPDATE_PROFILE_INFO",
21
+ DEPARTMENT_ADMIN = "DEPARTMENT_ADMIN",
22
+ VIEW_DEPARTMENT_LIST = "VIEW_DEPARTMENT_LIST",
23
+ ADD_DEPARTMENT = "ADD_DEPARTMENT",
24
+ UPDATE_DEPARTMENT = "UPDATE_DEPARTMENT",
25
+ ADD_DEPARTMENT_MEMBER = "ADD_DEPARTMENT_MEMBER",
26
+ DELETE_DEPARTMENT = "DELETE_DEPARTMENT",
27
+ REMOVE_DEPARTMENT_MEMBER = "REMOVE_DEPARTMENT_MEMBER",
28
+ VIEW_ROLE_LIST = "VIEW_ROLE_LIST",
29
+ ADD_ROLE = "ADD_ROLE",
30
+ UPDATE_ROLE = "UPDATE_ROLE",
31
+ DELETE_ROLE = "DELETE_ROLE",
32
+ SET_ROLE_PERMISSION = "SET_ROLE_PERMISSION",
33
+ UPDATE_TRANSACTION = "UPDATE_TRANSACTION",
34
+ BIDDING = "BIDDING",
35
+ CREATE_FX_TRANSACTION_FOR_ONE = "CREATE_FX_TRANSACTION_FOR_ONE",
36
+ CREATE_FX_TRANSACTION_FOR_MANY = "CREATE_FX_TRANSACTION_FOR_MANY",
37
+ UPDATE_FX_TRANSACTION_STATUS = "UPDATE_FX_TRANSACTION_STATUS",
38
+ APPROVE_FX_TRANSACTION = "APPROVE_FX_TRANSACTION",
39
+ REJECT_FX_TRANSACTION = "REJECT_FX_TRANSACTION",
40
+ UPDATE_FX_TRANSACTION_AMOUNT = "UPDATE_FX_TRANSACTION_AMOUNT",
41
+ UPDATE_FX_TRANSACTION_EXCHANGE_RATE = "UPDATE_FX_TRANSACTION_EXCHANGE_RATE",
42
+ DOWNLOAD_FX_TRANSACTION_RELATED_DOCUMENT = "DOWNLOAD_FX_TRANSACTION_RELATED_DOCUMENT",
43
+ TRANSACTION_BID = "TRANSACTION_BID",
44
+ VIEW_REPORT = "VIEW_REPORT",
45
+ ADMIN = "ADMIN",
46
+ PARTNER_ADMIN = "PARTNER_ADMIN"
47
+ }
@@ -1,3 +1,4 @@
1
1
  export declare const formatter: Intl.NumberFormat;
2
2
  export declare const formatCurrencyWithoutVND: (value: number | string) => string;
3
3
  export declare const formatCurrency: (value: number | string) => string;
4
+ export declare const upperFirstLetter: (str: string) => string;
@@ -0,0 +1,14 @@
1
+ import { ETenantType } from '../types/enum';
2
+ import { LoginRespDto } from '../types/response.dto';
3
+ import { EPermissionKey } from '../types/user';
4
+ export type PermissionCheck = {
5
+ permissions: EPermissionKey[];
6
+ role?: string;
7
+ tenantType?: ETenantType;
8
+ };
9
+ export type PermissionCheckGroup = {
10
+ type: 'or' | 'and';
11
+ or?: PermissionCheck[];
12
+ and?: PermissionCheck[];
13
+ };
14
+ export declare const hasPermission: (user: Pick<LoginRespDto["user"], "permissions" | "tenant" | "roles">, condition: PermissionCheckGroup) => boolean | undefined;
@@ -71,9 +71,9 @@ export declare const useEducation: ({ onFinish }: Props) => {
71
71
  }[] | undefined;
72
72
  name: string;
73
73
  phone: string;
74
+ email: string;
74
75
  currency: string;
75
76
  amount: number;
76
- email: string;
77
77
  province: string;
78
78
  }>;
79
79
  handleSubmit: import('react-hook-form').UseFormHandleSubmit<{
@@ -99,9 +99,9 @@ export declare const useEducation: ({ onFinish }: Props) => {
99
99
  }[] | undefined;
100
100
  name: string;
101
101
  phone: string;
102
+ email: string;
102
103
  currency: string;
103
104
  amount: number;
104
- email: string;
105
105
  province: string;
106
106
  }, undefined>;
107
107
  formState: {
@@ -128,9 +128,9 @@ export declare const useEducation: ({ onFinish }: Props) => {
128
128
  }[] | undefined;
129
129
  name: string;
130
130
  phone: string;
131
+ email: string;
131
132
  currency: string;
132
133
  amount: number;
133
- email: string;
134
134
  province: string;
135
135
  }>;
136
136
  };
@@ -157,9 +157,9 @@ export declare const useEducation: ({ onFinish }: Props) => {
157
157
  }[] | undefined;
158
158
  name: string;
159
159
  phone: string;
160
+ email: string;
160
161
  currency: string;
161
162
  amount: number;
162
- email: string;
163
163
  province: string;
164
164
  }>;
165
165
  setValue: import('react-hook-form').UseFormSetValue<{
@@ -185,9 +185,9 @@ export declare const useEducation: ({ onFinish }: Props) => {
185
185
  }[] | undefined;
186
186
  name: string;
187
187
  phone: string;
188
+ email: string;
188
189
  currency: string;
189
190
  amount: number;
190
- email: string;
191
191
  province: string;
192
192
  }>;
193
193
  onSubmit: (data: yup.InferType<typeof educationSchema>) => Promise<void>;
@@ -214,9 +214,9 @@ export declare const useEducation: ({ onFinish }: Props) => {
214
214
  }[] | undefined;
215
215
  name: string;
216
216
  phone: string;
217
+ email: string;
217
218
  currency: string;
218
219
  amount: number;
219
- email: string;
220
220
  province: string;
221
221
  }>;
222
222
  reset: import('react-hook-form').UseFormReset<{
@@ -242,9 +242,9 @@ export declare const useEducation: ({ onFinish }: Props) => {
242
242
  }[] | undefined;
243
243
  name: string;
244
244
  phone: string;
245
+ email: string;
245
246
  currency: string;
246
247
  amount: number;
247
- email: string;
248
248
  province: string;
249
249
  }>;
250
250
  documents: {
@@ -45,9 +45,9 @@ export declare const useImmigration: ({ onFinish }: Props) => {
45
45
  }[] | undefined;
46
46
  name: string;
47
47
  phone: string;
48
+ email: string;
48
49
  currency: string;
49
50
  amount: number;
50
- email: string;
51
51
  province: string;
52
52
  document1: {
53
53
  type: string;
@@ -66,9 +66,9 @@ export declare const useImmigration: ({ onFinish }: Props) => {
66
66
  }[] | undefined;
67
67
  name: string;
68
68
  phone: string;
69
+ email: string;
69
70
  currency: string;
70
71
  amount: number;
71
- email: string;
72
72
  province: string;
73
73
  document1: {
74
74
  type: string;
@@ -88,9 +88,9 @@ export declare const useImmigration: ({ onFinish }: Props) => {
88
88
  }[] | undefined;
89
89
  name: string;
90
90
  phone: string;
91
+ email: string;
91
92
  currency: string;
92
93
  amount: number;
93
- email: string;
94
94
  province: string;
95
95
  document1: {
96
96
  type: string;
@@ -110,9 +110,9 @@ export declare const useImmigration: ({ onFinish }: Props) => {
110
110
  }[] | undefined;
111
111
  name: string;
112
112
  phone: string;
113
+ email: string;
113
114
  currency: string;
114
115
  amount: number;
115
- email: string;
116
116
  province: string;
117
117
  document1: {
118
118
  type: string;
@@ -131,9 +131,9 @@ export declare const useImmigration: ({ onFinish }: Props) => {
131
131
  }[] | undefined;
132
132
  name: string;
133
133
  phone: string;
134
+ email: string;
134
135
  currency: string;
135
136
  amount: number;
136
- email: string;
137
137
  province: string;
138
138
  document1: {
139
139
  type: string;
@@ -153,9 +153,9 @@ export declare const useImmigration: ({ onFinish }: Props) => {
153
153
  }[] | undefined;
154
154
  name: string;
155
155
  phone: string;
156
+ email: string;
156
157
  currency: string;
157
158
  amount: number;
158
- email: string;
159
159
  province: string;
160
160
  document1: {
161
161
  type: string;
@@ -174,9 +174,9 @@ export declare const useImmigration: ({ onFinish }: Props) => {
174
174
  }[] | undefined;
175
175
  name: string;
176
176
  phone: string;
177
+ email: string;
177
178
  currency: string;
178
179
  amount: number;
179
- email: string;
180
180
  province: string;
181
181
  document1: {
182
182
  type: string;