gotrip-fx-transaction-form 1.0.236-dev → 1.0.237-dev

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 (26) hide show
  1. package/assets/index.css +1 -1
  2. package/index.js +33710 -29842
  3. package/package.json +1 -1
  4. package/types/components/Insurance/shared/FormElements.d.ts +2 -2
  5. package/types/components/MotorInsurance/Bike/CreateBikeInsuranceForm.d.ts +2 -1
  6. package/types/components/MotorInsurance/Car/CarPremiumSummary.d.ts +3 -3
  7. package/types/components/MotorInsurance/Car/CarStepFourPayment.d.ts +21 -0
  8. package/types/components/MotorInsurance/Car/CarStepOneForm.d.ts +5 -6
  9. package/types/components/MotorInsurance/Car/CarStepThreeInfo.d.ts +10 -0
  10. package/types/components/MotorInsurance/Car/CarStepTwoPlan.d.ts +10 -0
  11. package/types/components/MotorInsurance/Car/CreateCarInsuranceForm.d.ts +2 -2
  12. package/types/components/MotorInsurance/Car/car-form.constants.d.ts +23 -0
  13. package/types/components/MotorInsurance/Car/index.d.ts +3 -1
  14. package/types/components/MotorInsurance/CreateMotorInsuranceTransactionForm.d.ts +4 -3
  15. package/types/components/MotorInsurance/index.d.ts +2 -2
  16. package/types/components/MotorInsurance/motor-insurance.types.d.ts +271 -6
  17. package/types/constants/api-urls.d.ts +6 -0
  18. package/types/constants/regex.d.ts +3 -1
  19. package/types/hooks/useInsuranceData.d.ts +2 -11
  20. package/types/hooks/useLocationData.d.ts +22 -0
  21. package/types/hooks/useMotorInsurance.d.ts +5 -51
  22. package/types/pages/agency/insurance/motor-transaction-create/CreateCarInsuranceTransactionPage.d.ts +1 -0
  23. package/types/pages/guest/motor-insurance-create.d.ts +6 -0
  24. package/types/types/sdk.d.ts +2 -0
  25. package/types/util/transaction.util.d.ts +1 -1
  26. package/types/components/MotorInsurance/Car/CarStepTwoVehicleInfo.d.ts +0 -11
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gotrip-fx-transaction-form",
3
- "version": "1.0.236-dev",
3
+ "version": "1.0.237-dev",
4
4
  "description": "FX Transaction Form ES6 module",
5
5
  "main": "index.js",
6
6
  "types": "types/index.d.ts",
@@ -2,7 +2,7 @@ import { Control, FieldPath, FieldValues, RegisterOptions } from 'react-hook-for
2
2
  import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
3
3
  import { EDocumentType, DocumentScanResult } from '../../../hooks/useDocumentScan';
4
4
  export declare const FieldLabel: ({ label, tooltip }: {
5
- label: string;
5
+ label: React.ReactNode;
6
6
  tooltip?: string;
7
7
  }) => import("react/jsx-runtime").JSX.Element;
8
8
  export declare const InfoBanner: ({ children }: {
@@ -33,7 +33,7 @@ export declare enum InputType {
33
33
  interface FormInputFieldProps<T extends FieldValues> {
34
34
  name: FieldPath<T>;
35
35
  control: Control<T>;
36
- label: string;
36
+ label: React.ReactNode;
37
37
  required?: boolean;
38
38
  placeholder?: string;
39
39
  type?: InputType;
@@ -3,5 +3,6 @@ export interface CreateBikeInsuranceFormProps {
3
3
  title?: string;
4
4
  onBack?: () => void;
5
5
  onSuccess?: (transactionData: unknown) => void;
6
+ scrollable?: boolean;
6
7
  }
7
- export declare const CreateBikeInsuranceForm: ({ storageKey, title, onBack, onSuccess, }: CreateBikeInsuranceFormProps) => import("react/jsx-runtime").JSX.Element;
8
+ export declare const CreateBikeInsuranceForm: ({ storageKey, title, onBack, onSuccess, scrollable, }: CreateBikeInsuranceFormProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { MotorPremiumSummary as MotorPremiumSummaryType } from '../motor-insurance.types';
2
2
  interface CarPremiumSummaryProps {
3
- summary: MotorPremiumSummaryType;
3
+ summary: MotorPremiumSummaryType | null | undefined;
4
+ isLoading?: boolean;
4
5
  }
5
- /** Temporary placeholder for car insurance premium summary. */
6
- export declare const CarPremiumSummary: ({ summary }: CarPremiumSummaryProps) => import("react/jsx-runtime").JSX.Element;
6
+ export declare const CarPremiumSummary: ({ summary, isLoading }: CarPremiumSummaryProps) => import("react/jsx-runtime").JSX.Element;
7
7
  export {};
@@ -0,0 +1,21 @@
1
+ import { EPaymentMethod } from '../../../types/enum';
2
+ import { CarPlanFormValues, CarPremiumSummary, CarVehicleInfoFormValues } from '../motor-insurance.types';
3
+ interface CarStepFourPaymentProps {
4
+ planValues: CarPlanFormValues;
5
+ premiumSummary: CarPremiumSummary | null;
6
+ vehicleInfo: CarVehicleInfoFormValues | null;
7
+ buyerCertificateInfo: CarVehicleInfoFormValues | null;
8
+ isLoading: boolean;
9
+ paymentMode: EPaymentMethod;
10
+ onPaymentModeChange: (mode: EPaymentMethod) => void;
11
+ isTermsAgreed: boolean;
12
+ onTermsAgreedChange: (agreed: boolean) => void;
13
+ onPayment: () => void;
14
+ isProcessing: boolean;
15
+ isGuest: boolean;
16
+ onBack: () => void;
17
+ getProviderLogoUrl: (providerCode?: string | null) => string | undefined;
18
+ getTermsAgreeHtml: (providerCode?: string | null) => string | undefined;
19
+ }
20
+ export declare const CarStepFourPayment: ({ planValues, premiumSummary, vehicleInfo, buyerCertificateInfo, isLoading, paymentMode, onPaymentModeChange, isTermsAgreed, onTermsAgreedChange, onPayment, isProcessing, isGuest, onBack, getProviderLogoUrl, getTermsAgreeHtml, }: CarStepFourPaymentProps) => import("react/jsx-runtime").JSX.Element;
21
+ export {};
@@ -1,9 +1,8 @@
1
- import { Control } from 'react-hook-form';
2
- import { MotorPlanFormValues } from '../motor-insurance.types';
1
+ import { Control, UseFormSetValue } from 'react-hook-form';
2
+ import { CarPlanFormValues } from '../motor-insurance.types';
3
3
  interface CarStepOneFormProps {
4
- control: Control<MotorPlanFormValues>;
5
- setValue: (name: keyof MotorPlanFormValues, value: unknown) => void;
4
+ control: Control<CarPlanFormValues>;
5
+ setValue: UseFormSetValue<CarPlanFormValues>;
6
6
  }
7
- /** Temporary placeholder for car insurance step one form. */
8
- export declare const CarStepOneForm: (_props: CarStepOneFormProps) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const CarStepOneForm: ({ control, setValue }: CarStepOneFormProps) => import("react/jsx-runtime").JSX.Element;
9
8
  export {};
@@ -0,0 +1,10 @@
1
+ import { CarVehicleInfoFormValues, MotorPremiumSummary as MotorPremiumSummaryType } from '../motor-insurance.types';
2
+ interface CarStepThreeInfoProps {
3
+ initialValues?: Partial<CarVehicleInfoFormValues>;
4
+ premiumSummary: MotorPremiumSummaryType | null;
5
+ isLoadingQuote?: boolean;
6
+ onSubmit: (values: CarVehicleInfoFormValues) => void;
7
+ formRef?: (form: HTMLFormElement | null) => void;
8
+ }
9
+ export declare const CarStepThreeInfo: ({ initialValues, premiumSummary, isLoadingQuote, onSubmit, formRef, }: CarStepThreeInfoProps) => import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -0,0 +1,10 @@
1
+ import { Control, UseFormSetValue } from 'react-hook-form';
2
+ import { CarPlanFormValues, CarPremiumSummary } from '../motor-insurance.types';
3
+ interface CarStepTwoPlanProps {
4
+ control: Control<CarPlanFormValues>;
5
+ setValue: UseFormSetValue<CarPlanFormValues>;
6
+ premiumSummary: CarPremiumSummary | null;
7
+ isLoadingQuote?: boolean;
8
+ }
9
+ export declare const CarStepTwoPlan: ({ control, setValue, premiumSummary, isLoadingQuote, }: CarStepTwoPlanProps) => import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -3,6 +3,6 @@ export interface CreateCarInsuranceFormProps {
3
3
  title?: string;
4
4
  onBack?: () => void;
5
5
  onSuccess?: (transactionData: unknown) => void;
6
+ scrollable?: boolean;
6
7
  }
7
- /** Temporary placeholder for car insurance transaction form. */
8
- export declare const CreateCarInsuranceForm: ({ title, }: CreateCarInsuranceFormProps) => import("react/jsx-runtime").JSX.Element;
8
+ export declare const CreateCarInsuranceForm: ({ storageKey, title, onBack, onSuccess, scrollable, }: CreateCarInsuranceFormProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,23 @@
1
+ import { EVehicleTypeCode, EVehicleUsageType } from '../motor-insurance.types';
2
+ /** Manufacturing year range: from this year to current year. */
3
+ export declare const MANUFACTURING_YEAR_MIN = 2007;
4
+ export declare const SEAT_COUNT_OPTIONS: readonly [4, 5, 7, 9, 16, 24, 45];
5
+ /** Usage purpose options (mục đích sử dụng) – EVehicleUsageType. */
6
+ export declare const USAGE_PURPOSE_OPTIONS: {
7
+ value: EVehicleUsageType;
8
+ label: string;
9
+ }[];
10
+ /** Vehicle type code options (loại vận chuyển đặc biệt) by purpose + usage. */
11
+ export type VehicleTypeCodeOption = {
12
+ value: EVehicleTypeCode;
13
+ label: string;
14
+ };
15
+ export declare function getVehicleTypeCodeOptions(isCommercialUse: boolean, usagePurposeCode: EVehicleUsageType | null): VehicleTypeCodeOption[];
16
+ /** Seat and load capacity bounds by usage + vehicle type (from business rules). */
17
+ export type SeatLoadBounds = {
18
+ seatMin: number;
19
+ seatMax: number;
20
+ loadMin?: number;
21
+ loadMax?: number;
22
+ };
23
+ export declare function getSeatAndLoadBounds(usagePurposeCode: EVehicleUsageType | null, vehicleTypeCode: EVehicleTypeCode | null): SeatLoadBounds;
@@ -1,4 +1,6 @@
1
1
  export { CarPremiumSummary } from './CarPremiumSummary';
2
2
  export { CarStepOneForm } from './CarStepOneForm';
3
- export { CarStepTwoVehicleInfo } from './CarStepTwoVehicleInfo';
3
+ export { CarStepTwoPlan } from './CarStepTwoPlan';
4
+ export { CarStepThreeInfo } from './CarStepThreeInfo';
5
+ export { CarStepFourPayment } from './CarStepFourPayment';
4
6
  export { CreateCarInsuranceForm } from './CreateCarInsuranceForm';
@@ -1,9 +1,10 @@
1
- import { MotorVehicleType } from './motor-insurance.types';
1
+ import { EMotorVehicleType } from './motor-insurance.types';
2
2
  export interface CreateMotorInsuranceTransactionFormProps {
3
- vehicleType: MotorVehicleType;
3
+ vehicleType: EMotorVehicleType;
4
4
  storageKey: string;
5
5
  title?: string;
6
6
  onBack?: () => void;
7
7
  onSuccess?: (transactionData: unknown) => void;
8
+ scrollable?: boolean;
8
9
  }
9
- export declare const CreateMotorInsuranceTransactionForm: ({ vehicleType, storageKey, title, onBack, onSuccess, }: CreateMotorInsuranceTransactionFormProps) => import("react/jsx-runtime").JSX.Element;
10
+ export declare const CreateMotorInsuranceTransactionForm: ({ vehicleType, storageKey, title, onBack, onSuccess, scrollable, }: CreateMotorInsuranceTransactionFormProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
- export { BikePremiumSummary, BikeStepOneForm, BikeStepTwoVehicleInfo, CreateBikeInsuranceForm } from './Bike';
2
- export { CarPremiumSummary, CarStepOneForm, CarStepTwoVehicleInfo, CreateCarInsuranceForm } from './Car';
1
+ export { BikePremiumSummary, BikeStepOneForm, BikeStepTwoVehicleInfo, CreateBikeInsuranceForm, } from './Bike';
2
+ export { CarPremiumSummary, CarStepOneForm, CreateCarInsuranceForm } from './Car';
3
3
  export { CreateMotorInsuranceTransactionForm } from './CreateMotorInsuranceTransactionForm';
4
4
  export * from './motor-insurance.types';
@@ -1,6 +1,14 @@
1
1
  import { Control, UseFormSetValue } from 'react-hook-form';
2
- export type MotorVehicleType = 'bike' | 'car';
3
- export type EMotorVehicleType = 'under_50cc' | 'over_50cc' | 'three_wheel';
2
+ import { EPaymentMethod } from '../../types/enum';
3
+ export declare enum EMotorVehicleType {
4
+ BIKE = "bike",
5
+ CAR = "car"
6
+ }
7
+ export declare enum EBikeVehicleType {
8
+ UNDER_50CC = "under_50cc",
9
+ OVER_50CC = "over_50cc",
10
+ THREE_WHEEL = "three_wheel"
11
+ }
4
12
  export declare enum EBikeEngineCategory {
5
13
  BELOW_50CC = "BL50",
6
14
  ABOVE_50CC = "AB50",
@@ -8,9 +16,40 @@ export declare enum EBikeEngineCategory {
8
16
  THREE_WHEEL = "3WHL",
9
17
  SIMILAR_MOTOR = "SIM"
10
18
  }
19
+ /**
20
+ * Purpose code.
21
+ */
22
+ export declare enum EPurposeTypeCode {
23
+ BUSINESS = "BUSINESS",
24
+ NON_BUSINESS = "NON_BUSINESS"
25
+ }
26
+ /**
27
+ * Vehicle usage type enum.
28
+ */
29
+ export declare enum EVehicleUsageType {
30
+ PASSENGER = "PASSENGER",
31
+ CARGO = "CARGO",
32
+ PASSENGER_CARGO = "PASSENGER_CARGO",
33
+ SPECIAL_PURPOSE = "SPECIAL_PURPOSE"
34
+ }
35
+ /**
36
+ * High-level vehicle type enum.
37
+ */
38
+ export declare enum EVehicleTypeCode {
39
+ PASSENGER_STANDARD = "PASSENGER_STANDARD",
40
+ DRIVING_TRAINING = "DRIVING_TRAINING",
41
+ TRACTOR_HEAD = "TRACTOR_HEAD",
42
+ AMBULANCE = "AMBULANCE",
43
+ MONEY_TRUCK = "MONEY_TRUCK",
44
+ TRACTOR = "TRACTOR",
45
+ OTHER_SPECIAL_CAR = "OTHER_SPECIAL_CAR",
46
+ TAXI = "TAXI",
47
+ BUS = "BUS",
48
+ CARGO_STANDARD = "CARGO_STANDARD"
49
+ }
11
50
  export type EMotorProvider = 'PVI' | 'DBV' | 'BAO_MINH';
12
51
  export type MotorPlanFormValues = {
13
- vehicleType: EMotorVehicleType;
52
+ vehicleType: EBikeVehicleType;
14
53
  durationYears: 1 | 2 | 3;
15
54
  startDate: Date | null;
16
55
  endDate: Date | null;
@@ -19,6 +58,65 @@ export type MotorPlanFormValues = {
19
58
  passengerAccidentLevel: number;
20
59
  passengerAccidentCount: number;
21
60
  };
61
+ /**
62
+ * DTO for bike quote API (aligned with backend BikeQuoteRequest).
63
+ */
64
+ export interface BikeQuoteRequestDto {
65
+ /** Coverage start date, format yyyy-MM-dd */
66
+ startDate: string;
67
+ /** Coverage end date, format yyyy-MM-dd */
68
+ endDate: string;
69
+ vehicleTypeCode: EBikeEngineCategory;
70
+ occupantAccidentSumInsured?: number;
71
+ insuredOccupantCount?: number;
72
+ }
73
+ /**
74
+ * DTO for bike quote response.
75
+ */
76
+ export interface BikeQuoteResponseDto {
77
+ success: boolean;
78
+ totalPremium?: number;
79
+ mandatoryPremium?: number;
80
+ occupantAccidentPremium?: number;
81
+ error?: string;
82
+ }
83
+ /**
84
+ * DTO for creating bike policy/certificate (BikePolicyRequest).
85
+ */
86
+ export interface BikePolicyRequestDto {
87
+ /** Start date, yyyy-MM-dd or dd/MM/yyyy depending on provider */
88
+ startDate: string;
89
+ endDate: string;
90
+ ownerName: string;
91
+ ownerAddress: string;
92
+ customerEmail: string;
93
+ phoneNumber?: string;
94
+ licensePlate: string;
95
+ engineNumber: string;
96
+ chassisNumber: string;
97
+ vehicleTypeCode: EBikeEngineCategory;
98
+ brand?: string;
99
+ manufacturingYear?: string;
100
+ occupantAccidentSumInsured?: number;
101
+ insuredOccupantCount?: number;
102
+ occupantAccidentPremium?: number;
103
+ totalPremium?: number;
104
+ paymentMode: EPaymentMethod;
105
+ }
106
+ /**
107
+ * DTO for bike policy response (BikePolicyResponse).
108
+ * Includes extra info used for displaying result / QR code.
109
+ */
110
+ export interface BikePolicyResponseDto {
111
+ policyId?: number | string;
112
+ policyNumber?: string;
113
+ transactionPublicId?: string;
114
+ orderId?: number;
115
+ qrCodeUrl?: string;
116
+ totalAmount?: number;
117
+ status?: string;
118
+ error?: string;
119
+ }
22
120
  export type VehicleInfoFormValues = {
23
121
  ownerFullName: string;
24
122
  ownerAddress: string;
@@ -30,8 +128,74 @@ export type VehicleInfoFormValues = {
30
128
  certificatePhone: string;
31
129
  certificateEmail: string;
32
130
  };
131
+ /** Insurance owner type: individual or company */
132
+ export declare enum EOwnerType {
133
+ INDIVIDUAL = "individual",
134
+ COMPANY = "company"
135
+ }
136
+ /**
137
+ * Vehicle info for car policies extends the shared motor vehicle info
138
+ * with optional car-only attributes that may be required by providers.
139
+ */
140
+ export type CarVehicleInfoFormValues = VehicleInfoFormValues & {
141
+ /** Manufacturing year as string (for exact provider mapping if needed) */
142
+ manufacturingYearText?: string;
143
+ /** Years in use */
144
+ yearInUse?: number | null;
145
+ /** Owner type: individual (name, idNumber) or company (companyName, taxNumber) */
146
+ ownerType?: EOwnerType | string;
147
+ /** Company name (when ownerType is company) */
148
+ companyName?: string;
149
+ /** Company tax number (when ownerType is company) */
150
+ companyTaxNumber?: string;
151
+ /** Province/state ID for address */
152
+ stateId?: number | null;
153
+ /** Ward/commune ID for address */
154
+ wardId?: number | null;
155
+ /** Whether user wants hard copy certificate */
156
+ hardCopyEnabled?: boolean;
157
+ /** Address to receive hard copy certificate (when hardCopyEnabled is true) */
158
+ receiveAddress?: string;
159
+ };
160
+ /**
161
+ * Car-specific plan values used across the car motor insurance wizard.
162
+ *
163
+ * Step 1 captures vehicle configuration (manufacturing year, purpose, seats, ...),
164
+ * Step 2 adds provider + duration + effective dates, and optional passenger accident cover.
165
+ *
166
+ * These fields are intentionally generic so they can be mapped to different
167
+ * provider DTOs on the backend (purpose codes, special transport flags, etc.).
168
+ */
169
+ export type CarPlanFormValues = {
170
+ /** Manufacturing year */
171
+ manufacturingYear: number | null;
172
+ /** Whether the car is used for commercial transport */
173
+ isCommercialUse: boolean;
174
+ /** Usage purpose code (from API) */
175
+ usagePurposeCode: EVehicleUsageType | null;
176
+ /** Vehicle type code – sub of purpose + usage (EVehicleTypeCode). */
177
+ vehicleTypeCode: EVehicleTypeCode | null;
178
+ /** Number of seats (1–45) */
179
+ seatCount: number | null;
180
+ /** Load capacity in tons; required when usage is cargo (Chở hàng) */
181
+ loadCapacity: number | null;
182
+ /** Insurance duration in years */
183
+ durationYears: 1 | 2 | 3;
184
+ /** Coverage start date */
185
+ startDate: Date | null;
186
+ /** Coverage end date */
187
+ endDate: Date | null;
188
+ /** Insurance provider */
189
+ provider: EMotorProvider;
190
+ /** Enable/disable passenger accident coverage */
191
+ passengerAccidentEnabled: boolean;
192
+ /** Passenger accident sum insured per person per accident */
193
+ passengerAccidentLevel: number;
194
+ /** Number of passengers covered for accident */
195
+ passengerAccidentCount: number;
196
+ };
33
197
  export type MotorPremiumSummary = {
34
- tndsPremium: number;
198
+ mandatoryPremium: number;
35
199
  tndsPersonCompensation: number;
36
200
  tndsPropertyCompensation: number;
37
201
  passengerAccidentPremium: number;
@@ -39,10 +203,111 @@ export type MotorPremiumSummary = {
39
203
  passengerAccidentPeopleCount: number;
40
204
  totalPremium: number;
41
205
  };
42
- export declare const VEHICLE_TYPE_LABELS: Record<EMotorVehicleType, string>;
206
+ /** Alias for readability when working with car flows. */
207
+ export type CarPremiumSummary = MotorPremiumSummary;
208
+ /**
209
+ * DTO for car quote API (aligned with backend MotorCreateQuoteRequestCar / TESTING_MOTOR_INSURANCE.md).
210
+ */
211
+ export interface CarQuoteRequestDto {
212
+ /** Coverage start date, format yyyy-MM-dd */
213
+ startDate: string;
214
+ /** Coverage end date, format yyyy-MM-dd */
215
+ endDate: string;
216
+ purposeTypeCode: EPurposeTypeCode;
217
+ vehicleUsageType: EVehicleUsageType;
218
+ vehicleTypeCode: EVehicleTypeCode;
219
+ /** Number of seats */
220
+ numberOfSeats: number;
221
+ /** Load capacity in tons */
222
+ loadCapacity?: number;
223
+ /** Passenger accident sum insured */
224
+ occupantAccidentSumInsured?: number;
225
+ /** Number of passengers covered for accident */
226
+ insuredOccupantCount?: number;
227
+ }
228
+ /**
229
+ * DTO for car quote response (MotorCreateQuoteResponse).
230
+ */
231
+ export interface CarQuoteResponseDto {
232
+ success: boolean;
233
+ totalPremium?: number;
234
+ mandatoryPremium?: number;
235
+ occupantAccidentPremium?: number;
236
+ vehicleTypeCode?: string;
237
+ error?: string;
238
+ }
239
+ /**
240
+ * DTO for creating car policy/certificate (aligned with MotorCreatePolicyRequestCar).
241
+ */
242
+ export interface CarPolicyRequestDto {
243
+ totalPremium: number;
244
+ /** Coverage start date, format yyyy-MM-dd */
245
+ startDate: string;
246
+ /** Coverage end date, format yyyy-MM-dd */
247
+ endDate: string;
248
+ ownerName: string;
249
+ ownerAddress: string;
250
+ /** Contact/buyer name: ownerName (individual) or companyName (company) */
251
+ customerName: string;
252
+ customerAddress?: string;
253
+ ownerType?: EOwnerType | string;
254
+ ownerIdNumber?: string;
255
+ companyName?: string;
256
+ companyTaxNumber?: string;
257
+ hardCopyEnabled?: boolean;
258
+ receiveAddress?: string;
259
+ stateId?: number | null;
260
+ wardId?: number | null;
261
+ customerEmail: string;
262
+ phoneNumber?: string;
263
+ purposeTypeCode: EPurposeTypeCode;
264
+ vehicleUsageType: EVehicleUsageType;
265
+ vehicleTypeCode: EVehicleTypeCode;
266
+ numberOfSeats: number;
267
+ /** Load capacity in tons */
268
+ loadCapacity?: number;
269
+ licensePlate: string;
270
+ chassisNumber: string;
271
+ engineNumber: string;
272
+ mandatoryPremium: number;
273
+ occupantAccidentSumInsured?: number;
274
+ insuredOccupantCount?: number;
275
+ occupantAccidentPremium?: number;
276
+ manufacturingYear?: string;
277
+ yearInUse?: string;
278
+ brand?: string;
279
+ model?: string;
280
+ hideLicensePlate?: boolean;
281
+ hidePremium?: boolean;
282
+ paymentMode: EPaymentMethod;
283
+ }
284
+ /**
285
+ * DTO for car policy response (MotorCreatePolicyResponse).
286
+ */
287
+ export interface CarPolicyResponseDto {
288
+ success?: boolean;
289
+ policyId?: number | string;
290
+ policyNumber?: string;
291
+ certificateUrl?: string;
292
+ transactionPublicId?: string;
293
+ qrCodeUrl?: string;
294
+ totalAmount?: number;
295
+ status?: string;
296
+ error?: string;
297
+ }
298
+ export declare const VEHICLE_TYPE_LABELS: Record<EBikeVehicleType, string>;
43
299
  export declare const BIKE_VEHICLE_TYPE_CODE_LABELS: Record<string, string>;
44
300
  export declare const getBikeVehicleTypeCodeLabel: (code?: string | null) => string;
45
- export declare const DURATION_LABELS: Record<1 | 2 | 3, string>;
301
+ /** Car vehicle type code labels (loại vận chuyển đặc biệt) for display. */
302
+ export declare const CAR_VEHICLE_TYPE_CODE_LABELS: Record<string, string>;
303
+ export declare const getVehicleTypeLabel: (vehicleType?: string) => string;
304
+ export declare const getPassengerAccidentLevelLabel: (value?: number | null) => string;
305
+ /** Usage purpose (mục đích sử dụng) labels for display. */
306
+ export declare const USAGE_PURPOSE_LABELS: Record<EVehicleUsageType, string>;
307
+ export declare const getCarUsagePurposeLabel: (code?: string | null) => string;
308
+ export declare const getCarVehicleTypeCodeLabel: (code?: string | null) => string;
309
+ export declare const getOwnerTypeLabel: (ownerType?: string | null) => string;
310
+ export declare const DURATION_LABELS: Record<1 | 1.5 | 2 | 2.5 | 3, string>;
46
311
  export declare const PASSENGER_ACCIDENT_LEVELS: {
47
312
  value: number;
48
313
  label: string;
@@ -228,6 +228,8 @@ export declare const ApiUrls: {
228
228
  providers: string;
229
229
  createBikeQuote: (provider: string) => string;
230
230
  createBikeTransaction: (provider: string) => string;
231
+ createCarQuote: (provider: string) => string;
232
+ createCarTransaction: (provider: string) => string;
231
233
  transactionList: string;
232
234
  transactionDetail: (publicId: string) => string;
233
235
  };
@@ -244,6 +246,10 @@ export declare const ApiUrls: {
244
246
  quickRecommendations: string;
245
247
  quickRecommendationsByCountry: (countryId: number) => string;
246
248
  };
249
+ location: {
250
+ provinces: string;
251
+ wards: (stateId: number | string) => string;
252
+ };
247
253
  insuranceLocation: {
248
254
  countries: string;
249
255
  provinces: string;
@@ -2,5 +2,7 @@ export declare const vietnamPhoneRegex: RegExp;
2
2
  export declare const vietnamLocalPhoneRegex: RegExp;
3
3
  export declare const vietnamInternationalPhoneRegex: RegExp;
4
4
  export declare const idNumberRegex: RegExp;
5
- /** Vietnamese license plate: XXXX-XXX.XX | XXXX-XXXXX | XXXXXXXX | XXXXXXXXX */
5
+ /** Vietnamese motorcycle license plate: XXXX-XXX.XX | XXXX-XXXXX | XXXXXXXX | XXXXXXXXX */
6
6
  export declare const licensePlateRegex: RegExp;
7
+ /** Vietnamese car license plate: XXX-XXX.XX | XXXX-XXX.XX | XXX-XXXXX | XXXX-XXXXX | XXXXXXXX | XXXXXXXXX */
8
+ export declare const carLicensePlateRegex: RegExp;
@@ -1,22 +1,13 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { CoveragePlanQuotesRequestPayload, CoveragePlanQuotesResponse } from '../components/Insurance/types';
3
3
  import { EGender, EInsuranceType, EPolicyType, ERelationToPrimary, ETravelType, EPersonType } from '../types/insurance';
4
+ import { Province, Ward } from './useLocationData';
4
5
  interface Country {
5
6
  id: number;
6
7
  name: string;
7
8
  tmivId: string;
8
9
  }
9
- export interface Province {
10
- id: number;
11
- name: string;
12
- tmivId: string;
13
- }
14
- export interface Ward {
15
- id: number;
16
- name: string;
17
- tmivId: string;
18
- stateId: number;
19
- }
10
+ export type { Province, Ward } from './useLocationData';
20
11
  type InsuranceDataContextValue = {
21
12
  providers: string[];
22
13
  countries: Country[];
@@ -0,0 +1,22 @@
1
+ export interface Province {
2
+ id: number;
3
+ name: string;
4
+ tmivId: string;
5
+ }
6
+ export interface Ward {
7
+ id: number;
8
+ name: string;
9
+ tmivId: string;
10
+ stateId: number;
11
+ }
12
+ export interface UseLocationDataReturn {
13
+ provinces: Province[];
14
+ wardsByState: Record<number, Ward[]>;
15
+ loadingProvinces: boolean;
16
+ loadingWardStateId: number | null;
17
+ provincesError: string | null;
18
+ wardsErrorByState: Record<number, string | undefined>;
19
+ refetchProvinces: () => void;
20
+ fetchWardsByState: (stateId: number) => Promise<void>;
21
+ }
22
+ export declare function useLocationData(): UseLocationDataReturn;
@@ -1,55 +1,9 @@
1
- import { EBikeEngineCategory } from '../components/MotorInsurance/motor-insurance.types';
2
- import { EPaymentMethod, TransactionStatus } from '../types/enum';
3
- /** Bike quote request - matches API CreateQuoteRequestBikeDto */
4
- export interface BikeQuoteRequest {
5
- startDate: string;
6
- endDate: string;
7
- vehicleTypeCode: EBikeEngineCategory;
8
- occupantAccidentSumInsured?: number;
9
- insuredOccupantCount?: number;
10
- }
11
- /** Bike quote response from provider */
12
- export interface BikeQuoteResponse {
13
- success: boolean;
14
- totalPremium?: number;
15
- mandatoryPremium?: number;
16
- occupantAccidentPremium?: number;
17
- error?: string;
18
- }
19
- /** Bike policy request - matches API CreatePolicyRequestBikeDto */
20
- export interface BikePolicyRequest {
21
- startDate: string;
22
- endDate: string;
23
- ownerName: string;
24
- ownerAddress: string;
25
- customerEmail: string;
26
- phoneNumber?: string;
27
- licensePlate: string;
28
- engineNumber: string;
29
- chassisNumber: string;
30
- vehicleTypeCode: EBikeEngineCategory;
31
- brand?: string;
32
- manufacturingYear?: string;
33
- occupantAccidentSumInsured?: number;
34
- insuredOccupantCount?: number;
35
- occupantAccidentPremium?: number;
36
- totalPremium?: number;
37
- paymentMode?: EPaymentMethod;
38
- }
39
- /** Bike policy response - includes transactionPublicId, qrCodeUrl for bank_transfer */
40
- export interface BikePolicyResponse {
41
- policyId?: number | string;
42
- policyNumber?: string;
43
- transactionPublicId?: string;
44
- orderId?: number;
45
- qrCodeUrl?: string;
46
- totalAmount?: number;
47
- status?: TransactionStatus;
48
- error?: string;
49
- }
1
+ import { BikePolicyRequestDto, BikePolicyResponseDto, BikeQuoteRequestDto, BikeQuoteResponseDto, CarPolicyRequestDto, CarPolicyResponseDto, CarQuoteRequestDto, CarQuoteResponseDto } from '../components/MotorInsurance/motor-insurance.types';
50
2
  export declare const useMotorInsurance: () => {
51
- createQuoteBike: (provider: string, body: BikeQuoteRequest) => Promise<BikeQuoteResponse | null>;
52
- createPolicyBike: (provider: string, body: BikePolicyRequest) => Promise<BikePolicyResponse | null>;
3
+ createQuoteBike: (provider: string, body: BikeQuoteRequestDto) => Promise<BikeQuoteResponseDto | null>;
4
+ createPolicyBike: (provider: string, body: BikePolicyRequestDto) => Promise<BikePolicyResponseDto | null>;
5
+ createQuoteCar: (provider: string, body: CarQuoteRequestDto) => Promise<CarQuoteResponseDto | null>;
6
+ createPolicyCar: (provider: string, body: CarPolicyRequestDto) => Promise<CarPolicyResponseDto | null>;
53
7
  isCreatingQuote: boolean;
54
8
  isCreatingPolicy: boolean;
55
9
  providers: string[];
@@ -0,0 +1 @@
1
+ export declare const CreateCarInsuranceTransactionPage: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { EMotorVehicleType } from '../../components/MotorInsurance/motor-insurance.types';
2
+ export interface CreateGuestMotorInsuranceTransactionPageProps {
3
+ vehicleType: EMotorVehicleType;
4
+ scrollable?: boolean;
5
+ }
6
+ export declare const CreateGuestMotorInsuranceTransactionPage: ({ vehicleType, scrollable, }: CreateGuestMotorInsuranceTransactionPageProps) => import("react/jsx-runtime").JSX.Element;
@@ -2,5 +2,7 @@ export declare enum ESdkFormType {
2
2
  FX = "fx",
3
3
  INTERNATIONAL_INSURANCE = "international_insurance",
4
4
  DOMESTIC_INSURANCE = "domestic_insurance",
5
+ MOTOR_INSURANCE_CAR = "motor_insurance_car",
6
+ MOTOR_INSURANCE_BIKE = "motor_insurance_bike",
5
7
  EXCHANGE_RATE_TABLE = "exchange_rate_table"
6
8
  }
@@ -1,4 +1,4 @@
1
1
  import { ESimPackageDataLimitTimeframe, ESimPackageDataLimitUnit, ESimPackageValidityType, ETransactionType } from '../types/response.dto';
2
- export declare const getTransactionType: (type: ETransactionType) => ETransactionType.STUDY | "Du học" | "Du lịch" | "Du lịch (Nhóm)" | "Kinh doanh" | "Di trú";
2
+ export declare const getTransactionType: (type: ETransactionType) => ETransactionType.STUDY | "Du học" | "Kinh doanh" | "Du lịch" | "Du lịch (Nhóm)" | "Di trú";
3
3
  export declare const formatDataLimit: (dataLimit: number, dataLimitUnit: ESimPackageDataLimitUnit, dataLimitTimeframe: ESimPackageDataLimitTimeframe) => string;
4
4
  export declare const formatValidity: (validityPeriod: number, validityType: ESimPackageValidityType) => string;