gotrip-fx-transaction-form 1.0.242-dev → 1.0.244-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/index.js +25256 -24885
- package/package.json +1 -1
- package/types/components/Insurance/InsuranceSummaryOverview.d.ts +1 -2
- 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/StepThree.d.ts +3 -1
- package/types/components/Insurance/StepThreeInsuredPeople.d.ts +2 -1
- package/types/components/Insurance/insuranceExcelImport.d.ts +13 -0
- package/types/components/Insurance/insuredPeopleImport.d.ts +23 -0
- package/types/components/Insurance/validationUtils.d.ts +2 -0
- package/types/constants/api-urls.d.ts +2 -0
- package/types/hooks/useInsuranceTransaction.d.ts +11 -2
- package/types/hooks/useMotorInsuranceTransaction.d.ts +11 -2
- package/types/types/insurance.d.ts +1 -0
package/package.json
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export type InsuranceSummaryOverviewProps = {
|
|
2
|
-
title?: string;
|
|
3
2
|
summary: {
|
|
4
3
|
totalPremium: number;
|
|
5
4
|
providerLabel: string;
|
|
@@ -19,4 +18,4 @@ export type InsuranceSummaryOverviewProps = {
|
|
|
19
18
|
travellersCount?: number | null;
|
|
20
19
|
};
|
|
21
20
|
};
|
|
22
|
-
export declare const InsuranceSummaryOverview: ({
|
|
21
|
+
export declare const InsuranceSummaryOverview: ({ summary, trip }: InsuranceSummaryOverviewProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { InsuranceQuoteInsured, PolicyInsured } from '../../types/insurance-transaction.dto';
|
|
2
|
+
type Props = {
|
|
3
|
+
insureds: (PolicyInsured | InsuranceQuoteInsured)[];
|
|
4
|
+
};
|
|
5
|
+
export declare const InsuredTravelersTable: ({ insureds }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Request / response captured for one phase (báo giá or đơn hàng). */
|
|
2
|
+
export type ProviderPhasePayload = {
|
|
3
|
+
providerData?: Record<string, unknown> | null;
|
|
4
|
+
providerResponse?: Record<string, unknown> | null;
|
|
5
|
+
};
|
|
6
|
+
export type ProviderApiDebugModalProps = {
|
|
7
|
+
open: boolean;
|
|
8
|
+
onOpenChange: (open: boolean) => void;
|
|
9
|
+
orderOnly?: boolean;
|
|
10
|
+
quoteProviderData?: Record<string, unknown> | null;
|
|
11
|
+
quoteProviderResponse?: Record<string, unknown> | null;
|
|
12
|
+
orderProviderData?: Record<string, unknown> | null;
|
|
13
|
+
orderProviderResponse?: Record<string, unknown> | null;
|
|
14
|
+
};
|
|
15
|
+
export declare const ProviderApiDebugModal: ({ open, onOpenChange, orderOnly, quoteProviderData, quoteProviderResponse, orderProviderData, orderProviderResponse, }: ProviderApiDebugModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export type ProviderApiDebugButtonProps = Omit<ProviderApiDebugModalProps, 'open' | 'onOpenChange'>;
|
|
17
|
+
export declare const ProviderApiDebugButton: ({ orderOnly, quoteProviderData, quoteProviderResponse, orderProviderData, orderProviderResponse, }: ProviderApiDebugButtonProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -2,6 +2,7 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
interface SimpleDetailProps {
|
|
3
3
|
label: string;
|
|
4
4
|
value?: string | ReactNode | null;
|
|
5
|
+
labelColumnMinW?: string;
|
|
5
6
|
}
|
|
6
|
-
export declare const SimpleDetail: ({ label, value }: SimpleDetailProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const SimpleDetail: ({ label, value, labelColumnMinW }: SimpleDetailProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
export {};
|
|
@@ -22,6 +22,8 @@ interface StepThreeProps {
|
|
|
22
22
|
onDatesChange?: (startDate: Date | null, endDate: Date | null) => void;
|
|
23
23
|
buyerInfoFormRef: React.RefObject<HTMLFormElement | null>;
|
|
24
24
|
insuredPeopleFormRef: React.RefObject<HTMLFormElement | null>;
|
|
25
|
+
onInsuredPeopleListUpdate?: (people: InsuredPerson[]) => void;
|
|
26
|
+
insuredPeopleSnapshotRef?: React.MutableRefObject<(() => InsuredPerson[]) | null>;
|
|
25
27
|
}
|
|
26
|
-
export declare const StepThree: ({ control, tripStart, tripEnd, stepThreeChildStep, onStepThreeChildStepClick, selectedPlan, buyerInfo, insuredPeople, insuranceType, adultsCount, teenagersCount, childrenCount, isDomestic, selectedProvider, onBuyerInfoSubmit, onInsuredPeopleSubmit, onStepThreeBack, onDatesChange, buyerInfoFormRef, insuredPeopleFormRef, }: StepThreeProps) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export declare const StepThree: ({ control, tripStart, tripEnd, stepThreeChildStep, onStepThreeChildStepClick, selectedPlan, buyerInfo, insuredPeople, insuranceType, adultsCount, teenagersCount, childrenCount, isDomestic, selectedProvider, onBuyerInfoSubmit, onInsuredPeopleSubmit, onStepThreeBack, onDatesChange, buyerInfoFormRef, insuredPeopleFormRef, onInsuredPeopleListUpdate, insuredPeopleSnapshotRef, }: StepThreeProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
29
|
export {};
|
|
@@ -14,6 +14,7 @@ interface StepThreeInsuredPeopleProps {
|
|
|
14
14
|
onSubmit: (people: InsuredPerson[]) => void;
|
|
15
15
|
onBack: () => void;
|
|
16
16
|
onFormRef?: (form: HTMLFormElement | null) => void;
|
|
17
|
+
insuredPeopleSnapshotRef?: React.MutableRefObject<(() => InsuredPerson[]) | null>;
|
|
17
18
|
}
|
|
18
|
-
export declare const StepThreeInsuredPeople: ({ initialPeople, isDomestic, providerCode, buyerInfo, onSubmit, onFormRef, }: StepThreeInsuredPeopleProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare const StepThreeInsuredPeople: ({ initialPeople, isDomestic, providerCode, buyerInfo, onSubmit, onFormRef, insuredPeopleSnapshotRef, }: StepThreeInsuredPeopleProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
20
|
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { InsuredPerson } from './types';
|
|
2
|
+
export type ParseInsuredExcelResult = {
|
|
3
|
+
ok: true;
|
|
4
|
+
people: InsuredPerson[];
|
|
5
|
+
skippedRows: number;
|
|
6
|
+
} | {
|
|
7
|
+
ok: false;
|
|
8
|
+
error: string;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Parse insured list from Excel (first sheet). Finds header row where column A is "STT".
|
|
12
|
+
*/
|
|
13
|
+
export declare function parseInsuredPeopleFromExcelBuffer(buffer: ArrayBuffer): ParseInsuredExcelResult;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { EIdType, EInsuranceType } from '../../types/insurance';
|
|
2
|
+
import { InsuredPerson } from './types';
|
|
3
|
+
/** Row is treated as an empty slot from plan counts (no name and no document number). */
|
|
4
|
+
export declare function isPlaceholderInsuredPerson(person: InsuredPerson): boolean;
|
|
5
|
+
/** Replace entire list with import only when every current row is a placeholder. */
|
|
6
|
+
export declare function shouldReplaceInsuredListWithImport(current: InsuredPerson[]): boolean;
|
|
7
|
+
export declare function makeIdDocumentKey(idType: EIdType | string | undefined, idNumber: string | undefined): string | null;
|
|
8
|
+
/** CCCD/CMND must pass 9/12 digit format before duplicate checks apply. */
|
|
9
|
+
export declare function isIdDocumentComparableForDuplicates(idType: EIdType | string | undefined, idNumber: string | undefined): boolean;
|
|
10
|
+
/** Row indices that are duplicate (2nd+ occurrence of same idType + idNumber); first row wins. */
|
|
11
|
+
export declare function findDuplicateIdDocumentRowIndices(rows: Array<{
|
|
12
|
+
idType: EIdType;
|
|
13
|
+
idNumber: string;
|
|
14
|
+
}>): Set<number>;
|
|
15
|
+
/**
|
|
16
|
+
* First occurrence per (idType, idNumber) keeps status; later duplicates get NEEDS_CHECK.
|
|
17
|
+
*/
|
|
18
|
+
export declare function markDuplicateInsuredByIdDocument(people: InsuredPerson[]): {
|
|
19
|
+
people: InsuredPerson[];
|
|
20
|
+
duplicateCount: number;
|
|
21
|
+
};
|
|
22
|
+
/** After import/replace: first insured is primary (SELF) for individual policies. */
|
|
23
|
+
export declare function applyFirstPersonSelfForIndividualInsurance(people: InsuredPerson[], insuranceType: EInsuranceType): InsuredPerson[];
|
|
@@ -3,6 +3,8 @@ import { InsuredPersonFormValues } from './types';
|
|
|
3
3
|
export type PersonValidationStatus = EPersonValidationStatus;
|
|
4
4
|
/** Calculate age in full years from date of birth (YYYY-MM-DD). Returns null if invalid. */
|
|
5
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;
|
|
6
8
|
/** Validate date of birth by person type (adult/teenager/children). Same rules for all providers. */
|
|
7
9
|
export declare const validateDateOfBirthByPersonType: (personType: EPersonType, dateOfBirth: string) => string | true;
|
|
8
10
|
export declare const validatePerson: (person: InsuredPersonFormValues) => PersonValidationStatus;
|
|
@@ -232,11 +232,13 @@ export declare const ApiUrls: {
|
|
|
232
232
|
createCarTransaction: (provider: string) => string;
|
|
233
233
|
transactionList: string;
|
|
234
234
|
transactionDetail: (publicId: string) => string;
|
|
235
|
+
retryProviderPolicy: (publicId: string) => string;
|
|
235
236
|
};
|
|
236
237
|
insuranceHandlers: {
|
|
237
238
|
providers: string;
|
|
238
239
|
coveragePlans: (provider: string) => string;
|
|
239
240
|
transactionDetail: (publicId: string) => string;
|
|
241
|
+
retryProviderPolicy: (publicId: string) => string;
|
|
240
242
|
transactionList: string;
|
|
241
243
|
coveragePlanQuotes: (provider: string) => string;
|
|
242
244
|
travelInsuranceSettings: string;
|
|
@@ -14,6 +14,7 @@ export interface GetInsuranceTransactionListReqDto {
|
|
|
14
14
|
publicId?: string;
|
|
15
15
|
primaryInsuredFullName?: string;
|
|
16
16
|
travelScope?: ETravelScope;
|
|
17
|
+
provider?: string;
|
|
17
18
|
}
|
|
18
19
|
export interface GetInsuranceTransactionListRespDto {
|
|
19
20
|
transactions: InsuranceTransaction[];
|
|
@@ -64,7 +65,11 @@ export declare const useInsuranceTransactionDetail: (publicId: string | undefine
|
|
|
64
65
|
planName: string;
|
|
65
66
|
loading: boolean;
|
|
66
67
|
error: string | null;
|
|
67
|
-
refetch: (
|
|
68
|
+
refetch: (options?: {
|
|
69
|
+
silent?: boolean;
|
|
70
|
+
}) => Promise<void>;
|
|
71
|
+
retryProviderLoading: boolean;
|
|
72
|
+
retryProviderPolicy: () => Promise<void>;
|
|
68
73
|
};
|
|
69
74
|
export declare const useInsuranceTransaction: (options?: {
|
|
70
75
|
defaultLimit?: number;
|
|
@@ -89,7 +94,11 @@ export declare const useInsuranceTransaction: (options?: {
|
|
|
89
94
|
planName: string;
|
|
90
95
|
loading: boolean;
|
|
91
96
|
error: string | null;
|
|
92
|
-
refetch: (
|
|
97
|
+
refetch: (options?: {
|
|
98
|
+
silent?: boolean;
|
|
99
|
+
}) => Promise<void>;
|
|
100
|
+
retryProviderLoading: boolean;
|
|
101
|
+
retryProviderPolicy: () => Promise<void>;
|
|
93
102
|
};
|
|
94
103
|
createTransaction: (payload: CreateTransactionPayload) => Promise<InsuranceTransaction>;
|
|
95
104
|
isCreatingTransaction: boolean;
|
|
@@ -57,6 +57,7 @@ export interface GetMotorInsuranceTransactionListReqDto {
|
|
|
57
57
|
publicId?: string;
|
|
58
58
|
ownerName?: string;
|
|
59
59
|
vehicleType?: string;
|
|
60
|
+
provider?: string;
|
|
60
61
|
}
|
|
61
62
|
export interface GetMotorInsuranceTransactionListRespDto {
|
|
62
63
|
transactions: MotorInsuranceTransactionListItem[];
|
|
@@ -68,7 +69,11 @@ export declare const useMotorInsuranceTransactionDetail: (publicId: string | und
|
|
|
68
69
|
transaction: MotorInsuranceTransactionDetail | null;
|
|
69
70
|
loading: boolean;
|
|
70
71
|
error: string | null;
|
|
71
|
-
refetch: (
|
|
72
|
+
refetch: (options?: {
|
|
73
|
+
silent?: boolean;
|
|
74
|
+
}) => Promise<void>;
|
|
75
|
+
retryProviderLoading: boolean;
|
|
76
|
+
retryProviderPolicy: () => Promise<void>;
|
|
72
77
|
};
|
|
73
78
|
export declare const useMotorInsuranceTransaction: (options?: {
|
|
74
79
|
defaultLimit?: number;
|
|
@@ -92,7 +97,11 @@ export declare const useMotorInsuranceTransaction: (options?: {
|
|
|
92
97
|
transaction: MotorInsuranceTransactionDetail | null;
|
|
93
98
|
loading: boolean;
|
|
94
99
|
error: string | null;
|
|
95
|
-
refetch: (
|
|
100
|
+
refetch: (options?: {
|
|
101
|
+
silent?: boolean;
|
|
102
|
+
}) => Promise<void>;
|
|
103
|
+
retryProviderLoading: boolean;
|
|
104
|
+
retryProviderPolicy: () => Promise<void>;
|
|
96
105
|
};
|
|
97
106
|
checkTransactionStatus: (publicId: string) => Promise<MotorInsuranceTransactionDetail | null>;
|
|
98
107
|
};
|
|
@@ -33,6 +33,7 @@ export declare enum EInsuranceProviderType {
|
|
|
33
33
|
PVI = "PVI",
|
|
34
34
|
MIC = "MIC"
|
|
35
35
|
}
|
|
36
|
+
export declare const INSURANCE_PROVIDER_LABELS: Record<EInsuranceProviderType, string>;
|
|
36
37
|
export declare enum EInsuranceType {
|
|
37
38
|
INDIVIDUAL = "individual",
|
|
38
39
|
FAMILY = "family",
|