gotrip-fx-transaction-form 1.0.201-dev → 1.0.201
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 +48010 -39279
- package/package.json +1 -1
- package/types/components/AddTransaction/Agent.d.ts +3 -2
- package/types/components/AddTransaction/FlightInfomation.d.ts +2 -1
- package/types/components/AddTransaction/SelectingBankMessageAlerts.d.ts +5 -0
- package/types/components/Admin/AgencyUserSelector/AgencyUserSelector.d.ts +7 -0
- package/types/components/Admin/AgencyUserSelector/AgencyUserSelectorModal.d.ts +10 -0
- package/types/components/ApprovalStatusBadge.d.ts +7 -0
- package/types/components/Apps/EmbededIndividualApp.d.ts +2 -1
- package/types/components/BankTransferInfo/BankTransferInfoDisplay.d.ts +7 -0
- package/types/components/Common/DateDisplay.d.ts +7 -0
- package/types/components/Common/MultiTagCombobox.d.ts +14 -0
- package/types/components/Common/PrimaryRadioGroup.d.ts +16 -0
- package/types/components/Common/TimeRangeSelect.d.ts +17 -0
- package/types/components/Insurance/CreateInsuranceTransactionForm.d.ts +38 -2
- package/types/components/Insurance/DateRangePicker.d.ts +12 -0
- package/types/components/Insurance/FxInsuranceCouponBox.d.ts +10 -0
- package/types/components/Insurance/InsuranceDatePicker.d.ts +9 -0
- package/types/components/Insurance/InsurancePlans/InsurancePlanList.d.ts +1 -1
- package/types/components/Insurance/InsurancePlans/QuickCoveragePlanCard.d.ts +16 -0
- package/types/components/Insurance/InsurancePlans/QuickRecommendationsSection.d.ts +18 -0
- package/types/components/Insurance/InsuranceSummaryOverview.d.ts +7 -2
- package/types/components/Insurance/InsuranceTypeAndPeopleCountFields.d.ts +10 -0
- package/types/components/Insurance/InsuredTravelersTable.d.ts +6 -0
- package/types/components/Insurance/ProviderApiDebugDialog.d.ts +17 -0
- package/types/components/Insurance/SimpleDetail.d.ts +2 -1
- package/types/components/Insurance/StepFourPayment.d.ts +32 -5
- package/types/components/Insurance/StepOneForm.d.ts +11 -2
- package/types/components/Insurance/StepThree.d.ts +29 -0
- package/types/components/Insurance/StepThreeBuyerInfo.d.ts +4 -1
- package/types/components/Insurance/StepThreeInsuredPeople.d.ts +4 -1
- package/types/components/Insurance/documentScanAutofill.d.ts +37 -0
- package/types/components/Insurance/insuranceExcelImport.d.ts +13 -0
- package/types/components/Insurance/insuredPeopleImport.d.ts +23 -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/PaymentMethodSelector.d.ts +10 -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 +5 -0
- package/types/components/Insurance/types.d.ts +21 -6
- package/types/components/Insurance/validationUtils.d.ts +7 -1
- package/types/components/Modal/CancelTransactionModal.d.ts +1 -0
- package/types/components/Modal/ESimPurchaseModal.d.ts +4 -1
- package/types/components/Modal/EsimBankTransferModal.d.ts +13 -0
- package/types/components/Modal/InsurancePaymentModal.d.ts +2 -0
- package/types/components/Modal/MotorInsurancePaymentModal.d.ts +13 -0
- package/types/components/Modal/ProcessingOrderDialog.d.ts +8 -0
- package/types/components/MotorInsurance/Bike/BikePremiumSummary.d.ts +9 -0
- package/types/components/MotorInsurance/Bike/BikeStepOneForm.d.ts +30 -0
- package/types/components/MotorInsurance/Bike/BikeStepThreePayment.d.ts +26 -0
- package/types/components/MotorInsurance/Bike/BikeStepTwoVehicleInfo.d.ts +12 -0
- package/types/components/MotorInsurance/Bike/CreateBikeInsuranceForm.d.ts +17 -0
- package/types/components/MotorInsurance/Bike/index.d.ts +5 -0
- package/types/components/MotorInsurance/Car/CarPremiumSummary.d.ts +8 -0
- package/types/components/MotorInsurance/Car/CarStepFourPayment.d.ts +30 -0
- package/types/components/MotorInsurance/Car/CarStepOneForm.d.ts +27 -0
- package/types/components/MotorInsurance/Car/CarStepThreeInfo.d.ts +11 -0
- package/types/components/MotorInsurance/Car/CarStepTwoPlan.d.ts +11 -0
- package/types/components/MotorInsurance/Car/CreateCarInsuranceForm.d.ts +17 -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 +17 -0
- package/types/components/MotorInsurance/DocumentUploadPreview.d.ts +14 -0
- package/types/components/MotorInsurance/image-storage.utils.d.ts +18 -0
- package/types/components/MotorInsurance/index.d.ts +4 -0
- package/types/components/MotorInsurance/motor-insurance.types.d.ts +335 -0
- package/types/components/MotorInsurance/motor-insurance.validation.d.ts +21 -0
- package/types/components/Notification/NotificationBell.d.ts +5 -0
- package/types/components/Notification/NotificationItem.d.ts +8 -0
- package/types/components/Notification/NotificationPanel.d.ts +6 -0
- package/types/components/OrderPaymentTypeBadge.d.ts +4 -0
- package/types/components/PolicyGroup/InsurancePolicyGroupFormDialog.d.ts +10 -0
- package/types/components/TransactionList/PublicIdActionMenu.d.ts +3 -1
- package/types/constants/api-urls.d.ts +57 -5
- package/types/constants/business-codes.d.ts +2 -1
- package/types/constants/env.d.ts +3 -0
- package/types/constants/policy-enums.d.ts +11 -0
- package/types/constants/regex.d.ts +4 -0
- package/types/constants/tenant.d.ts +3 -0
- package/types/constants/transaction-status-labels.d.ts +3 -0
- package/types/embeded-main.d.ts +1 -0
- package/types/hooks/fetchEsimTransaction.d.ts +2 -0
- package/types/hooks/transactions/useGroupTransactions.d.ts +10 -10
- package/types/hooks/traveller-confirmation/submit-confirmation.util.d.ts +1 -0
- package/types/hooks/traveller-confirmation/traveller-confirmation-flow.d.ts +4 -0
- package/types/hooks/traveller-confirmation/types.d.ts +22 -0
- package/types/hooks/traveller-confirmation/usePurchaseTravellerConfirmation.d.ts +12 -0
- package/types/hooks/traveller-confirmation/useTravellerConfirmationFetch.d.ts +2 -0
- package/types/hooks/useAdminDashboard.d.ts +19 -0
- package/types/hooks/useAutoSelectBankBranchAndDepartment.d.ts +19 -0
- package/types/hooks/useBankOutsideWorkingHoursNotice.d.ts +5 -0
- package/types/hooks/useConfirmTransaction.d.ts +15 -31
- package/types/hooks/useCoupon.d.ts +95 -0
- package/types/hooks/useCouponValidation.d.ts +29 -0
- package/types/hooks/useCreateAutoCoupon.d.ts +5 -0
- package/types/hooks/useFxPrefill.d.ts +19 -0
- package/types/hooks/useGroupCustomers.d.ts +12 -9
- package/types/hooks/useInsuranceData.d.ts +3 -11
- package/types/hooks/useInsurancePlans.d.ts +13 -1
- package/types/hooks/useInsuranceTransaction.d.ts +34 -4
- package/types/hooks/useLocationData.d.ts +22 -0
- package/types/hooks/useMotorInsurance.d.ts +17 -0
- package/types/hooks/useMotorInsuranceTransaction.d.ts +124 -0
- package/types/hooks/useMotorQuote.d.ts +15 -0
- package/types/hooks/useNotifications.d.ts +10 -0
- package/types/hooks/usePolicyGroups.d.ts +1 -0
- package/types/hooks/useTenantList.d.ts +3 -4
- package/types/hooks/useUserById.d.ts +7 -0
- package/types/hooks/useUserSearch.d.ts +10 -0
- package/types/hooks/useUsersByTenantTypes.d.ts +11 -0
- package/types/hooks/useVehicleRegistrationScan.d.ts +39 -0
- package/types/pages/admin/CreateOrderOnBehalfTest.d.ts +3 -0
- package/types/pages/admin/coupons/CampaignCouponTable.d.ts +13 -0
- package/types/pages/admin/coupons/CampaignDetailPage.d.ts +1 -0
- package/types/pages/admin/coupons/CampaignListPage.d.ts +1 -0
- package/types/pages/admin/coupons/CouponFormPage.d.ts +1 -0
- package/types/pages/admin/insurance/create-insurance-transaction/AdminCreateInsuranceTransactionPage.d.ts +2 -0
- package/types/pages/admin/insurance/edit-insurance-transaction/AdminEditInsuranceTransactionPage.d.ts +1 -0
- package/types/pages/admin/insurance-policy-management/InsurancePolicyManagement.d.ts +1 -0
- package/types/pages/admin/motor-insurance/create-motor-transaction/AdminCreateMotorBikeTransactionPage.d.ts +1 -0
- package/types/pages/admin/motor-insurance/create-motor-transaction/AdminCreateMotorCarTransactionPage.d.ts +1 -0
- package/types/pages/admin/motor-insurance/edit-motor-transaction/AdminEditMotorTransactionPage.d.ts +1 -0
- package/types/pages/admin/motor-insurance-transaction-detail/MotorInsuranceTransactionDetailPage.d.ts +1 -0
- package/types/pages/admin/motor-insurance-transaction-list/MotorInsuranceTransactionListPage.d.ts +5 -0
- package/types/pages/agency/home/HomePage.d.ts +1 -0
- package/types/pages/agency/home/constants.d.ts +16 -0
- package/types/pages/agency/insurance/motor-transaction-approval/MotorInsuranceTransactionApprovalPage.d.ts +1 -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/agency/insurance/transaction-approval/InsuranceTransactionApprovalPage.d.ts +1 -0
- package/types/pages/agency/insurance/transaction-create/CreateInsuranceTransactionPage.d.ts +2 -0
- package/types/pages/agency/traveller-confirmation/PurchaseTravellerConfirmation.d.ts +5 -0
- package/types/pages/agency/traveller-confirmation/TravellerPurchaseConfirmation.d.ts +2 -0
- package/types/pages/guest/insurance-create.d.ts +4 -1
- package/types/pages/guest/motor-insurance-create.d.ts +6 -0
- package/types/providers/AppSettingsProvider.d.ts +1 -0
- package/types/store/useNotificationStore.d.ts +16 -0
- package/types/store/useTenantStore.d.ts +12 -0
- package/types/store/useTrackingStore.d.ts +10 -0
- package/types/types/app-settings.d.ts +13 -1
- package/types/types/coupon.d.ts +70 -0
- package/types/types/enum.d.ts +15 -2
- package/types/types/insurance-transaction.dto.d.ts +22 -1
- package/types/types/insurance.d.ts +19 -2
- package/types/types/notification.d.ts +23 -0
- package/types/types/response.dto.d.ts +53 -5
- package/types/types/sdk.d.ts +5 -1
- package/types/types/tracking.dto.d.ts +21 -0
- package/types/util/booker-display.d.ts +6 -0
- package/types/util/couponErrorMessages.d.ts +2 -0
- package/types/util/debt-report-display.d.ts +4 -0
- package/types/util/formatter.d.ts +6 -0
- package/types/util/fx-travelling-messages.d.ts +1 -0
- package/types/util/fx.d.ts +15 -0
- package/types/util/order-payment-display.d.ts +16 -0
- package/types/util/sim-display.d.ts +2 -0
- package/types/util/tracking.d.ts +19 -0
- package/types/util/transaction.util.d.ts +2 -1
- package/types/utils/bank.d.ts +4 -0
- package/types/utils/transaction-confirmation-link.d.ts +9 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface SimpleSelectOption<T> {
|
|
2
|
+
value: T;
|
|
3
|
+
label: string;
|
|
4
|
+
}
|
|
5
|
+
interface SimpleSelectProps<T> {
|
|
6
|
+
value: T;
|
|
7
|
+
onChange: (value: T) => void;
|
|
8
|
+
options: SimpleSelectOption<T>[];
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
size?: 'sm' | 'md';
|
|
11
|
+
minWidth?: number;
|
|
12
|
+
}
|
|
13
|
+
export declare function SimpleSelect<T extends string | number>({ value, onChange, options, placeholder, size, minWidth, }: SimpleSelectProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface StepFooterProps {
|
|
2
|
+
onBack: () => void;
|
|
3
|
+
onNext?: () => void;
|
|
4
|
+
nextLabel?: string;
|
|
5
|
+
nextDisabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function StepFooter({ onBack, onNext, nextLabel, nextDisabled, }: StepFooterProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { PaymentMethodSelector, type PaymentMethodSelectorVariant } from './PaymentMethodSelector';
|
|
2
|
+
export { InfoBlockCard } from './InfoBlockCard';
|
|
3
|
+
export { StepFooter } from './StepFooter';
|
|
4
|
+
export { SimpleSelect } from './SimpleSelect';
|
|
5
|
+
export { FieldLabel, InfoBanner, OptionCard, DateInput, InputType, FormInputField, FormTextareaField, CountryCombobox, ProvinceCombobox, WardCombobox, } from './FormElements';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EDestination, EGender, EIdType, EInsuranceType, EPolicyType, ERelationToPrimary, ETravelType, EPersonType, EPersonValidationStatus } from '../../types/insurance';
|
|
1
|
+
import { EDestination, EBuyerType, EGender, EIdType, EInsuranceType, EInsuranceProviderType, EPolicyType, ERelationToPrimary, ETravelType, EPersonType, EPersonValidationStatus, ETravelScope } from '../../types/insurance';
|
|
2
2
|
export type InsuranceFormValues = {
|
|
3
3
|
provider: string;
|
|
4
4
|
type: EInsuranceType;
|
|
@@ -79,23 +79,33 @@ export type CoveragePlanQuote = {
|
|
|
79
79
|
};
|
|
80
80
|
export type TravelPlanFormValues = {
|
|
81
81
|
destinationCountryId: number | null;
|
|
82
|
+
provinceFromId: number | null;
|
|
83
|
+
provinceToId: number | null;
|
|
82
84
|
startDate: Date | null;
|
|
83
85
|
endDate: Date | null;
|
|
84
86
|
insuranceType: EInsuranceType;
|
|
85
87
|
adultsCount: number;
|
|
88
|
+
teenagerCount: number;
|
|
86
89
|
childrenCount: number;
|
|
90
|
+
travelScope?: ETravelScope;
|
|
87
91
|
};
|
|
92
|
+
export type InsuranceTypeAndPeopleCountValues = Pick<TravelPlanFormValues, 'insuranceType' | 'adultsCount' | 'teenagerCount' | 'childrenCount'>;
|
|
88
93
|
export type CalculatePremiumRequest = {
|
|
89
|
-
|
|
94
|
+
travelScope: ETravelScope;
|
|
95
|
+
destinationCountryId?: number;
|
|
96
|
+
provinceFromId?: number;
|
|
97
|
+
provinceToId?: number;
|
|
90
98
|
startDate: string;
|
|
91
99
|
endDate: string;
|
|
100
|
+
insuranceType?: EInsuranceType;
|
|
92
101
|
adultsCount: number;
|
|
102
|
+
teenagerCount: number;
|
|
93
103
|
childrenCount: number;
|
|
94
|
-
providers?:
|
|
104
|
+
providers?: EInsuranceProviderType[];
|
|
95
105
|
sortOrder?: 'asc' | 'desc';
|
|
96
106
|
};
|
|
97
107
|
export type CoveragePlanPremium = {
|
|
98
|
-
provider:
|
|
108
|
+
provider: EInsuranceProviderType;
|
|
99
109
|
coveragePlan: {
|
|
100
110
|
id: number;
|
|
101
111
|
planCode: string;
|
|
@@ -107,6 +117,10 @@ export type CoveragePlanPremium = {
|
|
|
107
117
|
premiumPerPerson: number;
|
|
108
118
|
days: number;
|
|
109
119
|
region: string;
|
|
120
|
+
freeTeenagerCount?: number;
|
|
121
|
+
paidTeenagerCount?: number;
|
|
122
|
+
freeChildrenCount?: number;
|
|
123
|
+
paidChildrenCount?: number;
|
|
110
124
|
} | null;
|
|
111
125
|
error: string | null;
|
|
112
126
|
};
|
|
@@ -118,9 +132,10 @@ export type CalculatePremiumResponse = {
|
|
|
118
132
|
plans: CoveragePlanPremium[];
|
|
119
133
|
};
|
|
120
134
|
export type BuyerFormValues = {
|
|
135
|
+
buyerType?: EBuyerType | null;
|
|
121
136
|
fullName: string;
|
|
122
137
|
gender?: EGender;
|
|
123
|
-
dateOfBirth: string;
|
|
138
|
+
dateOfBirth: string | null;
|
|
124
139
|
nationality: number | null;
|
|
125
140
|
idType: EIdType;
|
|
126
141
|
idNumber: string;
|
|
@@ -138,7 +153,7 @@ export type InsuredPersonFormValues = {
|
|
|
138
153
|
gender?: EGender;
|
|
139
154
|
idType: EIdType;
|
|
140
155
|
idNumber: string;
|
|
141
|
-
relationship: ERelationToPrimary;
|
|
156
|
+
relationship: ERelationToPrimary | null;
|
|
142
157
|
nationality: number | null;
|
|
143
158
|
};
|
|
144
159
|
export type InsuredPerson = InsuredPersonFormValues & {
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
import { EPersonValidationStatus } from '../../types/insurance';
|
|
1
|
+
import { EPersonValidationStatus, EPersonType } from '../../types/insurance';
|
|
2
2
|
import { InsuredPersonFormValues } from './types';
|
|
3
3
|
export type PersonValidationStatus = EPersonValidationStatus;
|
|
4
|
+
/** Calculate age in full years from date of birth (YYYY-MM-DD). Returns null if invalid. */
|
|
5
|
+
export declare const calculateAge: (dateOfBirth: string) => number | null;
|
|
6
|
+
/** Map date of birth to insured person type using the same age bands as validation. */
|
|
7
|
+
export declare const getPersonTypeFromDateOfBirth: (dateOfBirth: string) => EPersonType;
|
|
8
|
+
/** Validate date of birth by person type (adult/teenager/children). Same rules for all providers. */
|
|
9
|
+
export declare const validateDateOfBirthByPersonType: (personType: EPersonType, dateOfBirth: string) => string | true;
|
|
4
10
|
export declare const validatePerson: (person: InsuredPersonFormValues) => PersonValidationStatus;
|
|
5
11
|
export declare const hasPersonBeenInteracted: (person: InsuredPersonFormValues | undefined, isFormSubmitted: boolean) => boolean;
|
|
6
12
|
export declare const getFieldBorderColor: (fieldState: {
|
|
@@ -8,6 +8,7 @@ type Props = {
|
|
|
8
8
|
export declare enum CancelReason {
|
|
9
9
|
CUSTOMER_CANCEL = "CUSTOMER_CANCEL",
|
|
10
10
|
BAD_DATA = "BAD_DATA",
|
|
11
|
+
DUPLICATED = "DUPLICATED",
|
|
11
12
|
OTHER = "OTHER"
|
|
12
13
|
}
|
|
13
14
|
export declare const CancelTransactionModal: ({ isOpen, onClose, transaction, onSuccess }: Props) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ESimPackage } from '../../types/response.dto';
|
|
1
|
+
import { ESimPackage, IUser } from '../../types/response.dto';
|
|
2
2
|
import { default as React } from 'react';
|
|
3
3
|
interface ESimPurchaseModalProps {
|
|
4
4
|
selectedPackage: ESimPackage;
|
|
@@ -6,6 +6,9 @@ interface ESimPurchaseModalProps {
|
|
|
6
6
|
open: boolean;
|
|
7
7
|
onClose: () => void;
|
|
8
8
|
onFinish?: () => void;
|
|
9
|
+
isAdminMode?: boolean;
|
|
10
|
+
selectedUser?: IUser | null;
|
|
11
|
+
onChangeBooker?: () => void;
|
|
9
12
|
}
|
|
10
13
|
declare const ESimPurchaseModal: React.FC<ESimPurchaseModalProps>;
|
|
11
14
|
export default ESimPurchaseModal;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BankTransferInfo } from '../../types/response.dto';
|
|
3
|
+
interface EsimBankTransferModalProps {
|
|
4
|
+
open: boolean;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
qrCodeUrl: string;
|
|
7
|
+
transactionPublicId?: string;
|
|
8
|
+
amount: number;
|
|
9
|
+
onSuccess?: () => void;
|
|
10
|
+
bankTransferInfo?: BankTransferInfo;
|
|
11
|
+
}
|
|
12
|
+
declare const EsimBankTransferModal: React.FC<EsimBankTransferModalProps>;
|
|
13
|
+
export default EsimBankTransferModal;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
import { BankTransferInfo } from '../../types/response.dto';
|
|
2
3
|
interface InsurancePaymentModalProps {
|
|
3
4
|
open: boolean;
|
|
4
5
|
onClose: () => void;
|
|
@@ -6,6 +7,7 @@ interface InsurancePaymentModalProps {
|
|
|
6
7
|
transactionPublicId?: string;
|
|
7
8
|
amount: number;
|
|
8
9
|
onSuccess?: () => void;
|
|
10
|
+
bankTransferInfo?: BankTransferInfo;
|
|
9
11
|
}
|
|
10
12
|
declare const InsurancePaymentModal: React.FC<InsurancePaymentModalProps>;
|
|
11
13
|
export default InsurancePaymentModal;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BankTransferInfo } from '../../types/response.dto';
|
|
3
|
+
interface MotorInsurancePaymentModalProps {
|
|
4
|
+
open: boolean;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
qrCodeUrl: string;
|
|
7
|
+
transactionPublicId?: string;
|
|
8
|
+
amount: number;
|
|
9
|
+
onSuccess?: () => void;
|
|
10
|
+
bankTransferInfo?: BankTransferInfo;
|
|
11
|
+
}
|
|
12
|
+
declare const MotorInsurancePaymentModal: React.FC<MotorInsurancePaymentModalProps>;
|
|
13
|
+
export default MotorInsurancePaymentModal;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const DEFAULT_PROCESSING_ORDER_MESSAGE = "\u0110ang x\u1EED l\u00FD \u0111\u01A1n h\u00E0ng, xin vui l\u00F2ng ch\u1EDD...";
|
|
2
|
+
type ProcessingOrderDialogProps = {
|
|
3
|
+
open: boolean;
|
|
4
|
+
/** Defaults to {@link DEFAULT_PROCESSING_ORDER_MESSAGE} */
|
|
5
|
+
message?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const ProcessingOrderDialog: ({ open, message, }: ProcessingOrderDialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MotorPremiumSummary as MotorPremiumSummaryType } from '../motor-insurance.types';
|
|
2
|
+
interface BikePremiumSummaryProps {
|
|
3
|
+
summary?: MotorPremiumSummaryType | null;
|
|
4
|
+
isLoading?: boolean;
|
|
5
|
+
/** Provider code (e.g. PVI, MIC) – used to fetch CMS benefits */
|
|
6
|
+
providerCode?: string | null;
|
|
7
|
+
}
|
|
8
|
+
export declare const BikePremiumSummary: ({ summary, isLoading, providerCode, }: BikePremiumSummaryProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { EMotorProvider, MotorPlanFormValues, MotorPremiumSummary as MotorPremiumSummaryType } from '../motor-insurance.types';
|
|
2
|
+
import { Control, UseFormSetValue } from 'react-hook-form';
|
|
3
|
+
import { BikeRegistrationOcrData } from '../../../hooks/useVehicleRegistrationScan';
|
|
4
|
+
type BikeStepOneFormProps = {
|
|
5
|
+
control: Control<MotorPlanFormValues>;
|
|
6
|
+
setValue: UseFormSetValue<MotorPlanFormValues>;
|
|
7
|
+
premiumSummary?: MotorPremiumSummaryType | null;
|
|
8
|
+
isLoadingQuote?: boolean;
|
|
9
|
+
providers?: EMotorProvider[];
|
|
10
|
+
onOcrComplete?: (data: BikeRegistrationOcrData) => void;
|
|
11
|
+
onOcrReset?: () => void;
|
|
12
|
+
onIdCardComplete?: (data: {
|
|
13
|
+
ownerName: string;
|
|
14
|
+
ownerIdNumber: string;
|
|
15
|
+
}) => void;
|
|
16
|
+
onIdCardReset?: () => void;
|
|
17
|
+
vehicleRegImageUrl?: string | null;
|
|
18
|
+
idCardImageUrl?: string | null;
|
|
19
|
+
onVehicleRegImageCapture?: (imageData: {
|
|
20
|
+
dataUrl: string;
|
|
21
|
+
gcsUrl?: string;
|
|
22
|
+
}) => void;
|
|
23
|
+
onIdCardImageCapture?: (imageData: {
|
|
24
|
+
dataUrl: string;
|
|
25
|
+
gcsUrl?: string;
|
|
26
|
+
}) => void;
|
|
27
|
+
onScanningChange?: (scanning: boolean) => void;
|
|
28
|
+
};
|
|
29
|
+
export declare const BikeStepOneForm: ({ control, setValue, premiumSummary, isLoadingQuote, providers, onOcrComplete, onOcrReset, onIdCardComplete, onIdCardReset, vehicleRegImageUrl, idCardImageUrl, onVehicleRegImageCapture, onIdCardImageCapture, onScanningChange, }: BikeStepOneFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { EOrderPaymentType, EPaymentMethod } from '../../../types/enum';
|
|
2
|
+
import { IUser } from '../../../types/response.dto';
|
|
3
|
+
import { MotorPlanFormValues, MotorPremiumSummary, VehicleInfoFormValues } from '../motor-insurance.types';
|
|
4
|
+
export interface BikeStepThreePaymentProps {
|
|
5
|
+
planValues: MotorPlanFormValues;
|
|
6
|
+
premiumSummary: MotorPremiumSummary | null;
|
|
7
|
+
vehicleInfo: VehicleInfoFormValues | null;
|
|
8
|
+
isLoading: boolean;
|
|
9
|
+
paymentMode: EPaymentMethod;
|
|
10
|
+
onPaymentModeChange: (mode: EPaymentMethod) => void;
|
|
11
|
+
isTermsAgreed: boolean;
|
|
12
|
+
onTermsAgreedChange: (agreed: boolean) => void;
|
|
13
|
+
isPersonalDataConsentAgreed: boolean;
|
|
14
|
+
onPersonalDataConsentChange: (agreed: boolean) => void;
|
|
15
|
+
onPayment: () => void;
|
|
16
|
+
isProcessing: boolean;
|
|
17
|
+
isGuest: boolean;
|
|
18
|
+
onBack: () => void;
|
|
19
|
+
paymentType?: EOrderPaymentType;
|
|
20
|
+
isAdminMode?: boolean;
|
|
21
|
+
selectedUser?: IUser | null;
|
|
22
|
+
waitForApproval?: boolean;
|
|
23
|
+
onWaitForApprovalChange?: (value: boolean) => void;
|
|
24
|
+
mode?: 'create' | 'edit';
|
|
25
|
+
}
|
|
26
|
+
export declare const BikeStepThreePayment: ({ planValues, premiumSummary, vehicleInfo, isLoading, paymentMode, onPaymentModeChange, isTermsAgreed, onTermsAgreedChange, isPersonalDataConsentAgreed, onPersonalDataConsentChange, onPayment, isProcessing, isGuest, onBack, paymentType, isAdminMode, selectedUser, waitForApproval, onWaitForApprovalChange, mode, }: BikeStepThreePaymentProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { VehicleInfoFormValues, MotorPremiumSummary as MotorPremiumSummaryType } from '../motor-insurance.types';
|
|
2
|
+
interface BikeStepTwoVehicleInfoProps {
|
|
3
|
+
initialValues?: Partial<VehicleInfoFormValues>;
|
|
4
|
+
premiumSummary?: MotorPremiumSummaryType | null;
|
|
5
|
+
isLoadingQuote?: boolean;
|
|
6
|
+
provider?: string;
|
|
7
|
+
onSubmit: (values: VehicleInfoFormValues) => void;
|
|
8
|
+
onBack: () => void;
|
|
9
|
+
formRef?: (form: HTMLFormElement | null) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const BikeStepTwoVehicleInfo: ({ initialValues, premiumSummary, isLoadingQuote, provider, onSubmit, formRef, }: BikeStepTwoVehicleInfoProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IUser } from '../../../types/response.dto';
|
|
2
|
+
import { EMotorProvider } from '../motor-insurance.types';
|
|
3
|
+
export interface CreateBikeInsuranceFormProps {
|
|
4
|
+
storageKey: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
onBack?: () => void;
|
|
7
|
+
onSuccess?: (transactionData: unknown) => void;
|
|
8
|
+
scrollable?: boolean;
|
|
9
|
+
allowedProviders?: EMotorProvider[];
|
|
10
|
+
isAdminMode?: boolean;
|
|
11
|
+
selectedUser?: IUser | null;
|
|
12
|
+
onOpenUserSelector?: () => void;
|
|
13
|
+
mode?: 'create' | 'edit';
|
|
14
|
+
editingPublicId?: string;
|
|
15
|
+
initialData?: Record<string, any>;
|
|
16
|
+
}
|
|
17
|
+
export declare const CreateBikeInsuranceForm: ({ storageKey, title, onBack, onSuccess, scrollable, allowedProviders, isAdminMode, selectedUser, onOpenUserSelector, mode, editingPublicId, initialData, }: CreateBikeInsuranceFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { BikePremiumSummary } from './BikePremiumSummary';
|
|
2
|
+
export { BikeStepOneForm } from './BikeStepOneForm';
|
|
3
|
+
export { BikeStepTwoVehicleInfo } from './BikeStepTwoVehicleInfo';
|
|
4
|
+
export { BikeStepThreePayment } from './BikeStepThreePayment';
|
|
5
|
+
export { CreateBikeInsuranceForm } from './CreateBikeInsuranceForm';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { MotorPremiumSummary as MotorPremiumSummaryType } from '../motor-insurance.types';
|
|
2
|
+
interface CarPremiumSummaryProps {
|
|
3
|
+
summary: MotorPremiumSummaryType | null | undefined;
|
|
4
|
+
isLoading?: boolean;
|
|
5
|
+
providerCode?: string | null;
|
|
6
|
+
}
|
|
7
|
+
export declare const CarPremiumSummary: ({ summary, isLoading, providerCode }: CarPremiumSummaryProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { EOrderPaymentType, EPaymentMethod } from '../../../types/enum';
|
|
2
|
+
import { IUser } from '../../../types/response.dto';
|
|
3
|
+
import { CarPlanFormValues, CarPremiumSummary, CarVehicleInfoFormValues } from '../motor-insurance.types';
|
|
4
|
+
interface CarStepFourPaymentProps {
|
|
5
|
+
planValues: CarPlanFormValues;
|
|
6
|
+
premiumSummary: CarPremiumSummary | null;
|
|
7
|
+
vehicleInfo: CarVehicleInfoFormValues | null;
|
|
8
|
+
buyerCertificateInfo: CarVehicleInfoFormValues | null;
|
|
9
|
+
isLoading: boolean;
|
|
10
|
+
paymentMode: EPaymentMethod;
|
|
11
|
+
onPaymentModeChange: (mode: EPaymentMethod) => void;
|
|
12
|
+
isTermsAgreed: boolean;
|
|
13
|
+
onTermsAgreedChange: (agreed: boolean) => void;
|
|
14
|
+
isPersonalDataConsentAgreed: boolean;
|
|
15
|
+
onPersonalDataConsentChange: (agreed: boolean) => void;
|
|
16
|
+
onPayment: () => void;
|
|
17
|
+
isProcessing: boolean;
|
|
18
|
+
isGuest: boolean;
|
|
19
|
+
onBack: () => void;
|
|
20
|
+
getProviderLogoUrl: (providerCode?: string | null) => string | undefined;
|
|
21
|
+
getTermsAgreeHtml: (providerCode?: string | null) => string | undefined;
|
|
22
|
+
paymentType?: EOrderPaymentType;
|
|
23
|
+
isAdminMode?: boolean;
|
|
24
|
+
selectedUser?: IUser | null;
|
|
25
|
+
waitForApproval?: boolean;
|
|
26
|
+
onWaitForApprovalChange?: (value: boolean) => void;
|
|
27
|
+
mode?: 'create' | 'edit';
|
|
28
|
+
}
|
|
29
|
+
export declare const CarStepFourPayment: ({ planValues, premiumSummary, vehicleInfo, buyerCertificateInfo, isLoading, paymentMode, onPaymentModeChange, isTermsAgreed, onTermsAgreedChange, isPersonalDataConsentAgreed, onPersonalDataConsentChange, onPayment, isProcessing, isGuest, onBack, getProviderLogoUrl, getTermsAgreeHtml, paymentType, isAdminMode, selectedUser, waitForApproval, onWaitForApprovalChange, mode, }: CarStepFourPaymentProps) => import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Control, UseFormSetValue } from 'react-hook-form';
|
|
2
|
+
import { CarPlanFormValues } from '../motor-insurance.types';
|
|
3
|
+
import { CarRegistrationOcrData } from '../../../hooks/useVehicleRegistrationScan';
|
|
4
|
+
interface CarStepOneFormProps {
|
|
5
|
+
control: Control<CarPlanFormValues>;
|
|
6
|
+
setValue: UseFormSetValue<CarPlanFormValues>;
|
|
7
|
+
onOcrComplete?: (data: CarRegistrationOcrData) => void;
|
|
8
|
+
onOcrReset?: () => void;
|
|
9
|
+
onIdCardComplete?: (data: {
|
|
10
|
+
ownerName: string;
|
|
11
|
+
ownerIdNumber: string;
|
|
12
|
+
}) => void;
|
|
13
|
+
onIdCardReset?: () => void;
|
|
14
|
+
vehicleRegImageUrl?: string | null;
|
|
15
|
+
idCardImageUrl?: string | null;
|
|
16
|
+
onVehicleRegImageCapture?: (imageData: {
|
|
17
|
+
dataUrl: string;
|
|
18
|
+
gcsUrl?: string;
|
|
19
|
+
}) => void;
|
|
20
|
+
onIdCardImageCapture?: (imageData: {
|
|
21
|
+
dataUrl: string;
|
|
22
|
+
gcsUrl?: string;
|
|
23
|
+
}) => void;
|
|
24
|
+
onScanningChange?: (scanning: boolean) => void;
|
|
25
|
+
}
|
|
26
|
+
export declare const CarStepOneForm: ({ control, setValue, onOcrComplete, onOcrReset, onIdCardComplete, onIdCardReset, vehicleRegImageUrl, idCardImageUrl, onVehicleRegImageCapture, onIdCardImageCapture, onScanningChange, }: CarStepOneFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
provider?: string;
|
|
7
|
+
onSubmit: (values: CarVehicleInfoFormValues) => void;
|
|
8
|
+
formRef?: (form: HTMLFormElement | null) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const CarStepThreeInfo: ({ initialValues, premiumSummary, isLoadingQuote, provider, onSubmit, formRef, }: CarStepThreeInfoProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Control, UseFormSetValue } from 'react-hook-form';
|
|
2
|
+
import { CarPlanFormValues, CarPremiumSummary, EMotorProvider } from '../motor-insurance.types';
|
|
3
|
+
interface CarStepTwoPlanProps {
|
|
4
|
+
control: Control<CarPlanFormValues>;
|
|
5
|
+
setValue: UseFormSetValue<CarPlanFormValues>;
|
|
6
|
+
premiumSummary: CarPremiumSummary | null;
|
|
7
|
+
isLoadingQuote?: boolean;
|
|
8
|
+
providers?: EMotorProvider[];
|
|
9
|
+
}
|
|
10
|
+
export declare const CarStepTwoPlan: ({ control, setValue, premiumSummary, isLoadingQuote, providers, }: CarStepTwoPlanProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IUser } from '../../../types/response.dto';
|
|
2
|
+
import { EMotorProvider } from '../motor-insurance.types';
|
|
3
|
+
export interface CreateCarInsuranceFormProps {
|
|
4
|
+
storageKey: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
onBack?: () => void;
|
|
7
|
+
onSuccess?: (transactionData: unknown) => void;
|
|
8
|
+
scrollable?: boolean;
|
|
9
|
+
allowedProviders?: EMotorProvider[];
|
|
10
|
+
isAdminMode?: boolean;
|
|
11
|
+
selectedUser?: IUser | null;
|
|
12
|
+
onOpenUserSelector?: () => void;
|
|
13
|
+
mode?: 'create' | 'edit';
|
|
14
|
+
editingPublicId?: string;
|
|
15
|
+
initialData?: Record<string, any>;
|
|
16
|
+
}
|
|
17
|
+
export declare const CreateCarInsuranceForm: ({ storageKey, title, onBack, onSuccess, scrollable, allowedProviders, isAdminMode, selectedUser, onOpenUserSelector, mode, editingPublicId, initialData, }: 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;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { CarPremiumSummary } from './CarPremiumSummary';
|
|
2
|
+
export { CarStepOneForm } from './CarStepOneForm';
|
|
3
|
+
export { CarStepTwoPlan } from './CarStepTwoPlan';
|
|
4
|
+
export { CarStepThreeInfo } from './CarStepThreeInfo';
|
|
5
|
+
export { CarStepFourPayment } from './CarStepFourPayment';
|
|
6
|
+
export { CreateCarInsuranceForm } from './CreateCarInsuranceForm';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { EMotorVehicleType } from './motor-insurance.types';
|
|
2
|
+
import { IUser } from '../../types/response.dto';
|
|
3
|
+
export interface CreateMotorInsuranceTransactionFormProps {
|
|
4
|
+
vehicleType: EMotorVehicleType;
|
|
5
|
+
storageKey: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
onBack?: () => void;
|
|
8
|
+
onSuccess?: (transactionData: unknown) => void;
|
|
9
|
+
scrollable?: boolean;
|
|
10
|
+
isAdminMode?: boolean;
|
|
11
|
+
selectedUser?: IUser | null;
|
|
12
|
+
onOpenUserSelector?: () => void;
|
|
13
|
+
mode?: 'create' | 'edit';
|
|
14
|
+
editingPublicId?: string;
|
|
15
|
+
initialData?: Record<string, any>;
|
|
16
|
+
}
|
|
17
|
+
export declare const CreateMotorInsuranceTransactionForm: ({ vehicleType, storageKey, title, onBack, onSuccess, scrollable, isAdminMode, selectedUser, onOpenUserSelector, mode, editingPublicId, initialData, }: CreateMotorInsuranceTransactionFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface DocumentUploadPreviewProps {
|
|
2
|
+
label: string;
|
|
3
|
+
scanningLabel?: string;
|
|
4
|
+
icon: React.ElementType;
|
|
5
|
+
isScanning: boolean;
|
|
6
|
+
file: File | null;
|
|
7
|
+
/** Data URL restored from storage when no File object is available (e.g. after page reload) */
|
|
8
|
+
persistedPreviewUrl?: string | null;
|
|
9
|
+
scanError?: string | null;
|
|
10
|
+
accept?: string;
|
|
11
|
+
onFileSelect: (file: File) => void;
|
|
12
|
+
onRemove: () => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const DocumentUploadPreview: ({ label, scanningLabel, icon, isScanning, file, persistedPreviewUrl, scanError, accept, onFileSelect, onRemove, }: DocumentUploadPreviewProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type StoredImageData = {
|
|
2
|
+
dataUrl?: string | null;
|
|
3
|
+
gcsUrl?: string | null;
|
|
4
|
+
};
|
|
5
|
+
export type ImageCaptureData = {
|
|
6
|
+
dataUrl: string;
|
|
7
|
+
gcsUrl?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const normalizeStoredImageData: (value: unknown) => {
|
|
10
|
+
previewUrl: string | null;
|
|
11
|
+
gcsUrl: string | null;
|
|
12
|
+
};
|
|
13
|
+
export declare const buildStoredImageData: (imageData: ImageCaptureData) => StoredImageData;
|
|
14
|
+
export declare const buildPreviewDataUrlForStorage: (file: File, options?: {
|
|
15
|
+
maxDimension?: number;
|
|
16
|
+
jpegQuality?: number;
|
|
17
|
+
}) => Promise<string>;
|
|
18
|
+
export declare const resolveImageUrlForPayload: (gcsUrl: string | null, previewUrl: string | null) => string | undefined;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { BikePremiumSummary, BikeStepOneForm, BikeStepTwoVehicleInfo, CreateBikeInsuranceForm, } from './Bike';
|
|
2
|
+
export { CarPremiumSummary, CarStepOneForm, CreateCarInsuranceForm } from './Car';
|
|
3
|
+
export { CreateMotorInsuranceTransactionForm } from './CreateMotorInsuranceTransactionForm';
|
|
4
|
+
export * from './motor-insurance.types';
|