gotrip-fx-transaction-form 1.0.235-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.
- package/assets/index.css +1 -1
- package/index.js +33966 -30074
- package/package.json +1 -1
- package/types/components/Insurance/InsuranceDatePicker.d.ts +9 -0
- package/types/components/Insurance/{FormElements.d.ts → shared/FormElements.d.ts} +13 -3
- package/types/components/Insurance/shared/InfoBlockCard.d.ts +10 -0
- package/types/components/Insurance/shared/InsuranceRadioGroup.d.ts +14 -0
- package/types/components/Insurance/shared/PaymentMethodSelector.d.ts +8 -0
- package/types/components/Insurance/shared/SimpleSelect.d.ts +14 -0
- package/types/components/Insurance/shared/StepFooter.d.ts +8 -0
- package/types/components/Insurance/shared/index.d.ts +6 -0
- package/types/components/Modal/MotorInsurancePaymentModal.d.ts +11 -0
- package/types/components/MotorInsurance/Bike/BikePremiumSummary.d.ts +7 -0
- package/types/components/MotorInsurance/Bike/BikeStepOneForm.d.ts +10 -0
- package/types/components/MotorInsurance/Bike/BikeStepThreePayment.d.ts +17 -0
- package/types/components/MotorInsurance/Bike/BikeStepTwoVehicleInfo.d.ts +11 -0
- package/types/components/MotorInsurance/Bike/CreateBikeInsuranceForm.d.ts +8 -0
- package/types/components/MotorInsurance/Bike/index.d.ts +5 -0
- package/types/components/MotorInsurance/Car/CarPremiumSummary.d.ts +7 -0
- package/types/components/MotorInsurance/Car/CarStepFourPayment.d.ts +21 -0
- package/types/components/MotorInsurance/Car/CarStepOneForm.d.ts +8 -0
- package/types/components/MotorInsurance/Car/CarStepThreeInfo.d.ts +10 -0
- package/types/components/MotorInsurance/Car/CarStepTwoPlan.d.ts +10 -0
- package/types/components/MotorInsurance/Car/CreateCarInsuranceForm.d.ts +8 -0
- package/types/components/MotorInsurance/Car/car-form.constants.d.ts +23 -0
- package/types/components/MotorInsurance/Car/index.d.ts +6 -0
- package/types/components/MotorInsurance/CreateMotorInsuranceTransactionForm.d.ts +10 -0
- package/types/components/MotorInsurance/index.d.ts +4 -0
- package/types/components/MotorInsurance/motor-insurance.types.d.ts +322 -0
- package/types/constants/api-urls.d.ts +14 -0
- package/types/constants/regex.d.ts +4 -0
- package/types/hooks/useInsuranceData.d.ts +2 -11
- package/types/hooks/useLocationData.d.ts +22 -0
- package/types/hooks/useMotorInsurance.d.ts +16 -0
- package/types/hooks/useMotorInsuranceTransaction.d.ts +94 -0
- package/types/pages/agency/insurance/motor-transaction-create/CreateCarInsuranceTransactionPage.d.ts +1 -0
- package/types/pages/agency/insurance/motor-transaction-create/CreateMotorInsuranceTransactionPage.d.ts +1 -0
- package/types/pages/agency/insurance/motor-transaction-detail/MotorInsuranceTransactionDetailPage.d.ts +1 -0
- package/types/pages/agency/insurance/motor-transaction-list/MotorInsuranceTransactionListPage.d.ts +6 -0
- package/types/pages/guest/motor-insurance-create.d.ts +6 -0
- package/types/types/sdk.d.ts +2 -0
- package/types/util/transaction.util.d.ts +1 -1
|
@@ -223,6 +223,16 @@ export declare const ApiUrls: {
|
|
|
223
223
|
streets: string;
|
|
224
224
|
};
|
|
225
225
|
};
|
|
226
|
+
motorInsurance: {
|
|
227
|
+
motorInsuranceSettings: string;
|
|
228
|
+
providers: string;
|
|
229
|
+
createBikeQuote: (provider: string) => string;
|
|
230
|
+
createBikeTransaction: (provider: string) => string;
|
|
231
|
+
createCarQuote: (provider: string) => string;
|
|
232
|
+
createCarTransaction: (provider: string) => string;
|
|
233
|
+
transactionList: string;
|
|
234
|
+
transactionDetail: (publicId: string) => string;
|
|
235
|
+
};
|
|
226
236
|
insuranceHandlers: {
|
|
227
237
|
providers: string;
|
|
228
238
|
coveragePlans: (provider: string) => string;
|
|
@@ -236,6 +246,10 @@ export declare const ApiUrls: {
|
|
|
236
246
|
quickRecommendations: string;
|
|
237
247
|
quickRecommendationsByCountry: (countryId: number) => string;
|
|
238
248
|
};
|
|
249
|
+
location: {
|
|
250
|
+
provinces: string;
|
|
251
|
+
wards: (stateId: number | string) => string;
|
|
252
|
+
};
|
|
239
253
|
insuranceLocation: {
|
|
240
254
|
countries: string;
|
|
241
255
|
provinces: string;
|
|
@@ -2,3 +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 motorcycle license plate: XXXX-XXX.XX | XXXX-XXXXX | XXXXXXXX | XXXXXXXXX */
|
|
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
|
|
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;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BikePolicyRequestDto, BikePolicyResponseDto, BikeQuoteRequestDto, BikeQuoteResponseDto, CarPolicyRequestDto, CarPolicyResponseDto, CarQuoteRequestDto, CarQuoteResponseDto } from '../components/MotorInsurance/motor-insurance.types';
|
|
2
|
+
export declare const useMotorInsurance: () => {
|
|
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>;
|
|
7
|
+
isCreatingQuote: boolean;
|
|
8
|
+
isCreatingPolicy: boolean;
|
|
9
|
+
providers: string[];
|
|
10
|
+
loadingProviders: boolean;
|
|
11
|
+
motorInsuranceSettings: Record<string, any>;
|
|
12
|
+
loadingMotorInsuranceSettings: boolean;
|
|
13
|
+
refetchMotorInsuranceSettings: () => Promise<void>;
|
|
14
|
+
getMotorProviderLogoUrl: (providerCode?: string | null) => string | undefined;
|
|
15
|
+
getMotorProviderTermsAgreeHtml: (providerCode?: string | null) => string | undefined;
|
|
16
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { TransactionStatus } from '../types/enum';
|
|
2
|
+
export interface MotorInsuranceTransactionDetail {
|
|
3
|
+
id: number;
|
|
4
|
+
transactionPublicId: string;
|
|
5
|
+
status: string;
|
|
6
|
+
totalAmount: number;
|
|
7
|
+
providerPolicyId?: string | number;
|
|
8
|
+
providerPolicyNumber?: string;
|
|
9
|
+
errorMessage?: string;
|
|
10
|
+
vehicleType?: string;
|
|
11
|
+
ownerName?: string;
|
|
12
|
+
licensePlate?: string;
|
|
13
|
+
startDate?: string;
|
|
14
|
+
endDate?: string;
|
|
15
|
+
provider: string;
|
|
16
|
+
chassisNumber?: string;
|
|
17
|
+
engineNumber?: string;
|
|
18
|
+
metadata?: Record<string, unknown>;
|
|
19
|
+
transaction?: {
|
|
20
|
+
status: string;
|
|
21
|
+
publicId: string;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export interface MotorInsuranceTransactionListItem {
|
|
25
|
+
id: number;
|
|
26
|
+
orderId: number;
|
|
27
|
+
transactionPublicId: string;
|
|
28
|
+
status: TransactionStatus;
|
|
29
|
+
totalAmount: number;
|
|
30
|
+
providerPolicyId?: string | number;
|
|
31
|
+
providerPolicyNumber?: string;
|
|
32
|
+
error?: string;
|
|
33
|
+
createdAt?: string;
|
|
34
|
+
vehicleType?: string;
|
|
35
|
+
ownerName?: string;
|
|
36
|
+
licensePlate?: string;
|
|
37
|
+
provider: string;
|
|
38
|
+
transaction?: {
|
|
39
|
+
status: string;
|
|
40
|
+
publicId: string;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export interface GetMotorInsuranceTransactionListReqDto {
|
|
44
|
+
page?: number;
|
|
45
|
+
limit?: number;
|
|
46
|
+
minValue?: number;
|
|
47
|
+
maxValue?: number;
|
|
48
|
+
startDate?: string;
|
|
49
|
+
endDate?: string;
|
|
50
|
+
sortField?: 'date' | 'value';
|
|
51
|
+
sortDirection?: 'asc' | 'desc';
|
|
52
|
+
status?: TransactionStatus;
|
|
53
|
+
publicId?: string;
|
|
54
|
+
ownerName?: string;
|
|
55
|
+
vehicleType?: string;
|
|
56
|
+
}
|
|
57
|
+
export interface GetMotorInsuranceTransactionListRespDto {
|
|
58
|
+
transactions: MotorInsuranceTransactionListItem[];
|
|
59
|
+
total: number;
|
|
60
|
+
page: number;
|
|
61
|
+
limit: number;
|
|
62
|
+
}
|
|
63
|
+
export declare const useMotorInsuranceTransactionDetail: (publicId: string | undefined) => {
|
|
64
|
+
transaction: MotorInsuranceTransactionDetail | null;
|
|
65
|
+
loading: boolean;
|
|
66
|
+
error: string | null;
|
|
67
|
+
refetch: () => Promise<void>;
|
|
68
|
+
};
|
|
69
|
+
export declare const useMotorInsuranceTransaction: (options?: {
|
|
70
|
+
defaultLimit?: number;
|
|
71
|
+
publicId?: string;
|
|
72
|
+
}) => {
|
|
73
|
+
list: {
|
|
74
|
+
transactions: MotorInsuranceTransactionListItem[];
|
|
75
|
+
total: number;
|
|
76
|
+
loading: boolean;
|
|
77
|
+
page: number;
|
|
78
|
+
limit: number;
|
|
79
|
+
filters: Omit<GetMotorInsuranceTransactionListReqDto, "page" | "limit">;
|
|
80
|
+
refetchData: () => void;
|
|
81
|
+
setPage: import('react').Dispatch<import('react').SetStateAction<number>>;
|
|
82
|
+
setLimit: (nextLimit: number) => void;
|
|
83
|
+
updateFilters: (newFilters: Partial<Omit<GetMotorInsuranceTransactionListReqDto, "page" | "limit">>, options?: {
|
|
84
|
+
replace?: boolean;
|
|
85
|
+
}) => void;
|
|
86
|
+
};
|
|
87
|
+
detail: {
|
|
88
|
+
transaction: MotorInsuranceTransactionDetail | null;
|
|
89
|
+
loading: boolean;
|
|
90
|
+
error: string | null;
|
|
91
|
+
refetch: () => Promise<void>;
|
|
92
|
+
};
|
|
93
|
+
checkTransactionStatus: (publicId: string) => Promise<MotorInsuranceTransactionDetail | null>;
|
|
94
|
+
};
|
package/types/pages/agency/insurance/motor-transaction-create/CreateCarInsuranceTransactionPage.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CreateCarInsuranceTransactionPage: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CreateMotorInsuranceTransactionPage: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MotorInsuranceTransactionDetailPage: () => import("react/jsx-runtime").JSX.Element;
|
package/types/pages/agency/insurance/motor-transaction-list/MotorInsuranceTransactionListPage.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
type Props = {
|
|
2
|
+
defaultLimit?: number;
|
|
3
|
+
};
|
|
4
|
+
export declare const MotorInsuranceTransactionListContent: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare const MotorInsuranceTransactionListPage: () => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -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;
|
package/types/types/sdk.d.ts
CHANGED
|
@@ -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)" | "
|
|
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;
|