gotrip-fx-transaction-form 1.0.155 → 1.0.156
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 +55435 -43167
- package/package.json +1 -1
- package/types/components/Apps/EmbededIndividualApp.d.ts +4 -1
- package/types/components/Department/DepartmentCard.d.ts +3 -1
- package/types/components/Insurance/CountryWithFlag.d.ts +23 -0
- package/types/components/Insurance/CreateInsuranceTransactionForm.d.ts +8 -0
- package/types/components/Insurance/FormElements.d.ts +36 -3
- package/types/components/Insurance/InsuranceContentRenderer/DynamicRenderer.d.ts +6 -0
- package/types/components/Insurance/InsuranceContentRenderer/blocks/AccordionBlock.d.ts +6 -0
- package/types/components/Insurance/InsuranceContentRenderer/blocks/ActionButtonBlock.d.ts +6 -0
- package/types/components/Insurance/InsuranceContentRenderer/blocks/ContainerBlock.d.ts +6 -0
- package/types/components/Insurance/InsuranceContentRenderer/blocks/DataRowBlock.d.ts +6 -0
- package/types/components/Insurance/InsuranceContentRenderer/blocks/DividerBlock.d.ts +6 -0
- package/types/components/Insurance/InsuranceContentRenderer/blocks/ListGroupBlock.d.ts +6 -0
- package/types/components/Insurance/InsuranceContentRenderer/blocks/TextBlock.d.ts +6 -0
- package/types/components/Insurance/InsuranceContentRenderer/types.d.ts +64 -0
- package/types/components/Insurance/InsuranceContentRenderer/utils/richText.d.ts +14 -0
- package/types/components/Insurance/InsuranceContentRenderer/utils/styleMapper.d.ts +6 -0
- package/types/components/Insurance/InsurancePlans/BenefitDetailsModal.d.ts +11 -0
- package/types/components/Insurance/InsurancePlans/InsurancePlanCard.d.ts +28 -0
- package/types/components/Insurance/InsurancePlans/InsurancePlanFilter.d.ts +12 -0
- package/types/components/Insurance/InsurancePlans/InsurancePlanList.d.ts +21 -0
- package/types/components/Insurance/InsurancePlans/index.d.ts +3 -0
- package/types/components/Insurance/RelationshipSelect.d.ts +22 -0
- package/types/components/Insurance/SimpleDetail.d.ts +2 -1
- package/types/components/Insurance/StepFourPayment.d.ts +14 -0
- package/types/components/Insurance/StepOneForm.d.ts +5 -14
- package/types/components/Insurance/StepThreeBuyerInfo.d.ts +9 -0
- package/types/components/Insurance/StepThreeInsuredPeople.d.ts +17 -0
- package/types/components/Insurance/StepTwoPlans.d.ts +18 -0
- package/types/components/Insurance/countryUtils.d.ts +10 -0
- package/types/components/Insurance/types.d.ts +71 -2
- package/types/components/Insurance/utils.d.ts +2 -2
- package/types/components/Insurance/validationRules.d.ts +4 -0
- package/types/components/Insurance/validationUtils.d.ts +12 -0
- package/types/components/Modal/InsurancePaymentModal.d.ts +11 -0
- package/types/components/Modal/UpdateTenantCommissionInputCell.d.ts +14 -13
- package/types/components/PolicyGroup/CommissionPolicyGroupFormDialog.d.ts +16 -0
- package/types/components/PolicyGroup/CommissionPolicyGroupListView.d.ts +11 -0
- package/types/components/PolicyGroup/PolicyRulesEditor.d.ts +54 -0
- package/types/components/PolicyGroup/PolicyTypes.d.ts +41 -0
- package/types/components/PolicyGroup/PricingPolicyListView.d.ts +11 -0
- package/types/components/StepIndicator/StepIndicatorCard.d.ts +11 -0
- package/types/components/StepIndicator/StepIndicatorHorizontal.d.ts +11 -0
- package/types/components/StepIndicator/index.d.ts +2 -0
- package/types/constants/api-urls.d.ts +23 -10
- package/types/constants/commission-policy-constants.d.ts +5 -0
- package/types/constants/countries.d.ts +2 -0
- package/types/constants/policy-enums.d.ts +7 -1
- package/types/embeded-main.d.ts +3 -0
- package/types/hooks/useBookedSimGrouped.d.ts +38 -0
- package/types/hooks/useBookedTransactionGroupDetail.d.ts +40 -0
- package/types/hooks/useComissionPolicies.d.ts +6 -6
- package/types/hooks/useDocumentScan.d.ts +22 -0
- package/types/hooks/useImportBookers.d.ts +9 -9
- package/types/hooks/useImportMembers.d.ts +9 -9
- package/types/hooks/useInsuranceData.d.ts +4 -19
- package/types/hooks/useInsurancePlans.d.ts +10 -0
- package/types/hooks/useInsuranceTransaction.d.ts +40 -1
- package/types/hooks/useParseDocumentData.d.ts +10 -0
- package/types/hooks/usePolicyGroups.d.ts +16 -1
- package/types/hooks/useTenantList.d.ts +5 -4
- package/types/hooks/useUserList.d.ts +3 -1
- package/types/pages/admin/fx-commission-policy/FxCommissionPolicyManagement.d.ts +1 -0
- package/types/pages/agency/booked-sim-list/BookedSimDescription.d.ts +6 -0
- package/types/pages/agency/booked-sim-list/BookedSimList.d.ts +6 -0
- package/types/pages/agency/booked-sim-transaction-detail/BookedGroupSimTransactionDetail.d.ts +1 -0
- package/types/pages/agency/role-list/RoleList.d.ts +2 -0
- package/types/pages/guest/insurance-create.d.ts +5 -0
- package/types/store/useAuthStore.d.ts +1 -0
- package/types/store/useTenantStore.d.ts +12 -0
- package/types/types/enum.d.ts +10 -2
- package/types/types/insurance-transaction.dto.d.ts +4 -1
- package/types/types/insurance.d.ts +13 -2
- package/types/types/response.dto.d.ts +26 -4
- package/types/types/sdk.d.ts +4 -0
- package/types/types/user.d.ts +5 -1
- package/types/util/insurance.util.d.ts +4 -0
- package/types/components/Insurance/StepFourSummary.d.ts +0 -18
- package/types/components/Insurance/StepIndicator.d.ts +0 -10
- package/types/components/Insurance/StepThreePlanComparison.d.ts +0 -11
- package/types/components/Insurance/StepTwoForm.d.ts +0 -15
- package/types/pages/agency/group-sim-transaction-detail/GroupSimTransactionDetail.d.ts +0 -1
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import { ESdkFormType } from '../../types/sdk';
|
|
1
2
|
export type EmbededIndividualAppProps = {
|
|
2
3
|
apiKey: string;
|
|
3
4
|
externalCssUrl?: string;
|
|
4
5
|
hide?: string[];
|
|
5
6
|
defaultBank?: string;
|
|
6
7
|
displayDefaultBankLogo?: boolean;
|
|
8
|
+
type?: ESdkFormType;
|
|
9
|
+
scrollable?: boolean;
|
|
7
10
|
};
|
|
8
|
-
export declare const EmbededIndividualApp: ({ apiKey, externalCssUrl, hide, defaultBank, displayDefaultBankLogo, }: EmbededIndividualAppProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare const EmbededIndividualApp: ({ apiKey, externalCssUrl, hide, defaultBank, displayDefaultBankLogo, type, scrollable, }: EmbededIndividualAppProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { EDepartmentType, IRole } from '../../types/response.dto';
|
|
2
|
+
import { EDepartmentType, IRole, ITenant } from '../../types/response.dto';
|
|
3
3
|
export interface Department {
|
|
4
4
|
id: number;
|
|
5
5
|
name: string;
|
|
@@ -11,6 +11,8 @@ export interface Department {
|
|
|
11
11
|
transferName?: string;
|
|
12
12
|
transferNumber?: string;
|
|
13
13
|
users: DepartmentMember[];
|
|
14
|
+
tenantId?: number;
|
|
15
|
+
tenant?: Pick<ITenant, 'id' | 'name' | 'shortName' | 'type'>;
|
|
14
16
|
}
|
|
15
17
|
export interface DepartmentMember {
|
|
16
18
|
id: number;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
interface CountryWithFlagProps {
|
|
2
|
+
/**
|
|
3
|
+
* Country name in English or Vietnamese
|
|
4
|
+
*/
|
|
5
|
+
countryName: string | null | undefined;
|
|
6
|
+
fallback?: string;
|
|
7
|
+
flagSize?: {
|
|
8
|
+
width: string;
|
|
9
|
+
height: string;
|
|
10
|
+
};
|
|
11
|
+
textProps?: {
|
|
12
|
+
fontWeight?: string;
|
|
13
|
+
fontSize?: string;
|
|
14
|
+
color?: string;
|
|
15
|
+
};
|
|
16
|
+
gap?: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Reusable component to display country name with flag
|
|
20
|
+
* Automatically converts country name to Vietnamese and displays flag
|
|
21
|
+
*/
|
|
22
|
+
export declare const CountryWithFlag: ({ countryName, fallback, flagSize, textProps, gap, }: CountryWithFlagProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface CreateInsuranceTransactionFormProps {
|
|
2
|
+
storageKey: string;
|
|
3
|
+
title?: string;
|
|
4
|
+
onBack?: () => void;
|
|
5
|
+
onSuccess?: (transactionData: any) => void;
|
|
6
|
+
scrollable?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const CreateInsuranceTransactionForm: ({ storageKey, title, onBack, onSuccess, scrollable, }: CreateInsuranceTransactionFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { Control, FieldPath, FieldValues, RegisterOptions } from 'react-hook-form';
|
|
2
|
+
import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
|
|
3
|
+
import { EDocumentType, DocumentScanResult } from '../../hooks/useDocumentScan';
|
|
1
4
|
export declare const FieldLabel: ({ label, tooltip }: {
|
|
2
5
|
label: string;
|
|
3
6
|
tooltip?: string;
|
|
@@ -22,6 +25,30 @@ interface DateInputProps {
|
|
|
22
25
|
placeholder?: string;
|
|
23
26
|
}
|
|
24
27
|
export declare const DateInput: import('react').ForwardRefExoticComponent<DateInputProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
28
|
+
export declare enum InputType {
|
|
29
|
+
TEXT = "text",
|
|
30
|
+
EMAIL = "email",
|
|
31
|
+
PHONE = "phone"
|
|
32
|
+
}
|
|
33
|
+
interface FormInputFieldProps<T extends FieldValues> {
|
|
34
|
+
name: FieldPath<T>;
|
|
35
|
+
control: Control<T>;
|
|
36
|
+
label: string;
|
|
37
|
+
required?: boolean;
|
|
38
|
+
placeholder?: string;
|
|
39
|
+
type?: InputType;
|
|
40
|
+
rules?: RegisterOptions<T>;
|
|
41
|
+
leftIcon?: IconDefinition;
|
|
42
|
+
rightIcon?: IconDefinition;
|
|
43
|
+
showScanButton?: boolean;
|
|
44
|
+
documentType?: EDocumentType;
|
|
45
|
+
onScanClick?: () => void;
|
|
46
|
+
onScanComplete?: (data: DocumentScanResult) => void;
|
|
47
|
+
showValidationState?: boolean;
|
|
48
|
+
isValid?: (value: any, fieldState: any) => boolean;
|
|
49
|
+
disabled?: boolean;
|
|
50
|
+
}
|
|
51
|
+
export declare function FormInputField<T extends FieldValues>({ name, control, label, required, placeholder, type, rules, leftIcon, rightIcon, showScanButton, documentType, onScanClick, onScanComplete, showValidationState, isValid, disabled, }: FormInputFieldProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
25
52
|
interface CountryComboboxProps {
|
|
26
53
|
options: {
|
|
27
54
|
value: string;
|
|
@@ -31,8 +58,12 @@ interface CountryComboboxProps {
|
|
|
31
58
|
loading?: boolean;
|
|
32
59
|
onChange: (value: string) => void;
|
|
33
60
|
placeholder?: string;
|
|
61
|
+
size?: 'sm' | 'md' | 'lg';
|
|
62
|
+
disabled?: boolean;
|
|
63
|
+
borderColor?: string;
|
|
64
|
+
hasError?: boolean;
|
|
34
65
|
}
|
|
35
|
-
export declare const CountryCombobox: ({ options, value, loading, onChange, placeholder, }: CountryComboboxProps) => import("react/jsx-runtime").JSX.Element;
|
|
66
|
+
export declare const CountryCombobox: ({ options, value, loading, onChange, placeholder, size, disabled, borderColor, hasError, }: CountryComboboxProps) => import("react/jsx-runtime").JSX.Element;
|
|
36
67
|
interface ProvinceComboboxProps {
|
|
37
68
|
options: {
|
|
38
69
|
value: string;
|
|
@@ -43,8 +74,9 @@ interface ProvinceComboboxProps {
|
|
|
43
74
|
onChange: (value: string) => void;
|
|
44
75
|
placeholder?: string;
|
|
45
76
|
disabled?: boolean;
|
|
77
|
+
size?: 'sm' | 'md' | 'lg';
|
|
46
78
|
}
|
|
47
|
-
export declare const ProvinceCombobox: ({ options, value, loading, onChange, placeholder, disabled, }: ProvinceComboboxProps) => import("react/jsx-runtime").JSX.Element;
|
|
79
|
+
export declare const ProvinceCombobox: ({ options, value, loading, onChange, placeholder, disabled, size, }: ProvinceComboboxProps) => import("react/jsx-runtime").JSX.Element;
|
|
48
80
|
interface WardComboboxProps {
|
|
49
81
|
options: {
|
|
50
82
|
value: string;
|
|
@@ -55,6 +87,7 @@ interface WardComboboxProps {
|
|
|
55
87
|
onChange: (value: string) => void;
|
|
56
88
|
placeholder?: string;
|
|
57
89
|
disabled?: boolean;
|
|
90
|
+
size?: 'sm' | 'md' | 'lg';
|
|
58
91
|
}
|
|
59
|
-
export declare const WardCombobox: ({ options, value, loading, onChange, placeholder, disabled, }: WardComboboxProps) => import("react/jsx-runtime").JSX.Element;
|
|
92
|
+
export declare const WardCombobox: ({ options, value, loading, onChange, placeholder, disabled, size, }: WardComboboxProps) => import("react/jsx-runtime").JSX.Element;
|
|
60
93
|
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ActionButtonBlock as ActionButtonBlockType } from '../types';
|
|
2
|
+
interface ActionButtonBlockProps {
|
|
3
|
+
block: ActionButtonBlockType;
|
|
4
|
+
}
|
|
5
|
+
export declare const ActionButtonBlock: ({ block }: ActionButtonBlockProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export type BlockType = 'accordion' | 'data_row' | 'text_block' | 'list_group' | 'divider' | 'action_button' | 'container';
|
|
2
|
+
export interface StyleBlock {
|
|
3
|
+
margin?: [number, number, number, number];
|
|
4
|
+
padding?: [number, number, number, number];
|
|
5
|
+
font_weight?: 'bold' | 'normal' | 'semibold' | 'medium';
|
|
6
|
+
font_style?: 'italic' | 'normal';
|
|
7
|
+
text_color?: string;
|
|
8
|
+
alignment?: 'left' | 'center' | 'right';
|
|
9
|
+
}
|
|
10
|
+
export interface BaseBlock {
|
|
11
|
+
type: BlockType;
|
|
12
|
+
styles?: StyleBlock;
|
|
13
|
+
}
|
|
14
|
+
export interface AccordionBlock extends BaseBlock {
|
|
15
|
+
type: 'accordion';
|
|
16
|
+
title: string;
|
|
17
|
+
value?: string;
|
|
18
|
+
is_expanded?: boolean;
|
|
19
|
+
children?: InsuranceContentBlock[];
|
|
20
|
+
}
|
|
21
|
+
export interface DataRowBlock extends BaseBlock {
|
|
22
|
+
type: 'data_row';
|
|
23
|
+
label: string;
|
|
24
|
+
value: string;
|
|
25
|
+
has_info?: boolean;
|
|
26
|
+
info_content?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface TextBlock extends BaseBlock {
|
|
29
|
+
type: 'text_block';
|
|
30
|
+
content: string;
|
|
31
|
+
text_style?: 'h1' | 'h2' | 'h3' | 'body';
|
|
32
|
+
}
|
|
33
|
+
export interface ListGroupBlock extends BaseBlock {
|
|
34
|
+
type: 'list_group';
|
|
35
|
+
marker_type?: 'disc' | 'decimal' | 'roman';
|
|
36
|
+
items: Array<{
|
|
37
|
+
content: string;
|
|
38
|
+
}>;
|
|
39
|
+
}
|
|
40
|
+
export interface DividerBlock extends BaseBlock {
|
|
41
|
+
type: 'divider';
|
|
42
|
+
line_style?: 'solid' | 'dashed';
|
|
43
|
+
thickness?: number;
|
|
44
|
+
}
|
|
45
|
+
export interface ActionButtonBlock extends BaseBlock {
|
|
46
|
+
type: 'action_button';
|
|
47
|
+
label: string;
|
|
48
|
+
icon?: 'pdf_red' | string;
|
|
49
|
+
action: {
|
|
50
|
+
type: 'open_url';
|
|
51
|
+
payload: string;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
export interface ContainerBlock extends BaseBlock {
|
|
55
|
+
type: 'container';
|
|
56
|
+
layout?: 'vertical' | 'horizontal';
|
|
57
|
+
children: InsuranceContentBlock[];
|
|
58
|
+
}
|
|
59
|
+
export type InsuranceContentBlock = AccordionBlock | DataRowBlock | TextBlock | ListGroupBlock | DividerBlock | ActionButtonBlock | ContainerBlock;
|
|
60
|
+
export interface InsuranceContent {
|
|
61
|
+
benefits?: InsuranceContentBlock[];
|
|
62
|
+
conditions?: InsuranceContentBlock[];
|
|
63
|
+
compensation?: InsuranceContentBlock[];
|
|
64
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts markdown-like rich text formatting to HTML
|
|
3
|
+
* Supports:
|
|
4
|
+
* - **text** -> <strong>text</strong> (bold)
|
|
5
|
+
* - _text_ -> <em>text</em> (italic)
|
|
6
|
+
*/
|
|
7
|
+
export declare const parseRichText: (content: string) => string;
|
|
8
|
+
/**
|
|
9
|
+
* Safely renders rich text with React
|
|
10
|
+
* Returns an object suitable for dangerouslySetInnerHTML
|
|
11
|
+
*/
|
|
12
|
+
export declare const getRichTextHtml: (content: string) => {
|
|
13
|
+
__html: string;
|
|
14
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CoveragePlanPremium, TravelPlanFormValues } from '../types';
|
|
2
|
+
interface BenefitDetailsModalProps {
|
|
3
|
+
isOpen: boolean;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
plan: CoveragePlanPremium | null;
|
|
6
|
+
travelInsuranceSettings?: Record<string, any>;
|
|
7
|
+
onPlanSelect?: (plan: CoveragePlanPremium) => void;
|
|
8
|
+
travelPlan?: TravelPlanFormValues | null;
|
|
9
|
+
}
|
|
10
|
+
export declare const BenefitDetailsModal: ({ isOpen, onClose, plan, travelInsuranceSettings, onPlanSelect, travelPlan, }: BenefitDetailsModalProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { TravelPlanFormValues } from '../types';
|
|
2
|
+
export type PriceDisplayType = 'perPerson' | 'total' | 'custom';
|
|
3
|
+
export interface InsurancePlan {
|
|
4
|
+
id: string | number;
|
|
5
|
+
provider: string;
|
|
6
|
+
name: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
totalPrice: number;
|
|
9
|
+
pricePerPerson?: number;
|
|
10
|
+
priceDisplayType?: PriceDisplayType;
|
|
11
|
+
priceLabel?: string;
|
|
12
|
+
originalPrice?: number;
|
|
13
|
+
discount?: number;
|
|
14
|
+
providerLogoUrl?: string;
|
|
15
|
+
metadata?: Record<string, any>;
|
|
16
|
+
}
|
|
17
|
+
interface InsurancePlanCardProps {
|
|
18
|
+
plan: InsurancePlan;
|
|
19
|
+
isSelected: boolean;
|
|
20
|
+
onSelect: (plan: InsurancePlan) => void;
|
|
21
|
+
variant?: 'default' | 'compact' | 'detailed';
|
|
22
|
+
showDiscount?: boolean;
|
|
23
|
+
actionButtonText?: string;
|
|
24
|
+
travelInsuranceSettings?: Record<string, any>;
|
|
25
|
+
travelPlan?: TravelPlanFormValues | null;
|
|
26
|
+
}
|
|
27
|
+
export declare const InsurancePlanCard: ({ plan, isSelected, onSelect, showDiscount, actionButtonText, travelInsuranceSettings, travelPlan, }: InsurancePlanCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { EInsuranceProviderType } from '../../../types/insurance';
|
|
2
|
+
export type SortOrder = 'asc' | 'desc';
|
|
3
|
+
interface InsurancePlanFilterProps {
|
|
4
|
+
selectedProviders: EInsuranceProviderType[];
|
|
5
|
+
onProviderChange: (providers: EInsuranceProviderType[]) => void;
|
|
6
|
+
sortOrder: SortOrder;
|
|
7
|
+
onSortChange: (order: SortOrder) => void;
|
|
8
|
+
allowedProviders?: EInsuranceProviderType[];
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const InsurancePlanFilter: ({ selectedProviders, onProviderChange, sortOrder, onSortChange, allowedProviders, disabled, }: InsurancePlanFilterProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { InsurancePlan } from './InsurancePlanCard';
|
|
2
|
+
import { TravelPlanFormValues } from '../types';
|
|
3
|
+
interface InsurancePlanListProps {
|
|
4
|
+
plans: InsurancePlan[];
|
|
5
|
+
loading?: boolean;
|
|
6
|
+
selectedPlanId?: string | number | null;
|
|
7
|
+
onPlanSelect: (plan: InsurancePlan) => void;
|
|
8
|
+
title?: string;
|
|
9
|
+
columns?: {
|
|
10
|
+
base?: number;
|
|
11
|
+
md?: number;
|
|
12
|
+
lg?: number;
|
|
13
|
+
};
|
|
14
|
+
emptyMessage?: string;
|
|
15
|
+
showDiscount?: boolean;
|
|
16
|
+
actionButtonText?: string;
|
|
17
|
+
travelInsuranceSettings?: Record<string, any>;
|
|
18
|
+
travelPlan?: TravelPlanFormValues | null;
|
|
19
|
+
}
|
|
20
|
+
export declare const InsurancePlanList: ({ plans, loading, selectedPlanId, onPlanSelect, title, columns, emptyMessage, showDiscount, actionButtonText, travelInsuranceSettings, travelPlan, }: InsurancePlanListProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Control, FieldValues, Path } from 'react-hook-form';
|
|
2
|
+
import { ERelationToPrimary } from '../../types/insurance';
|
|
3
|
+
interface RelationshipSelectProps<T extends FieldValues> {
|
|
4
|
+
name: Path<T>;
|
|
5
|
+
control: Control<T>;
|
|
6
|
+
providerCode?: string | null;
|
|
7
|
+
required?: boolean;
|
|
8
|
+
errorMessage?: string;
|
|
9
|
+
formState?: {
|
|
10
|
+
isSubmitted?: boolean;
|
|
11
|
+
submitCount?: number;
|
|
12
|
+
};
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
disabledOptions?: ERelationToPrimary[];
|
|
15
|
+
allowedOptions?: ERelationToPrimary[];
|
|
16
|
+
}
|
|
17
|
+
export declare const getRelationshipOptionsByProvider: (providerCode?: string | null) => Array<{
|
|
18
|
+
label: string;
|
|
19
|
+
value: ERelationToPrimary;
|
|
20
|
+
}>;
|
|
21
|
+
export declare const RelationshipSelect: <T extends FieldValues>({ name, control, providerCode, required, errorMessage, formState, disabled, disabledOptions, allowedOptions, }: RelationshipSelectProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
interface SimpleDetailProps {
|
|
2
3
|
label: string;
|
|
3
|
-
value?: string | null;
|
|
4
|
+
value?: string | ReactNode | null;
|
|
4
5
|
}
|
|
5
6
|
export declare const SimpleDetail: ({ label, value }: SimpleDetailProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
7
|
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TravelPlanFormValues, CoveragePlanPremium, BuyerFormValues, InsuredPerson } from './types';
|
|
2
|
+
import { EPaymentMethod } from '../../types/enum';
|
|
3
|
+
interface StepFourPaymentProps {
|
|
4
|
+
travelPlan: TravelPlanFormValues;
|
|
5
|
+
selectedPlan: CoveragePlanPremium | null;
|
|
6
|
+
buyerInfo: BuyerFormValues | null;
|
|
7
|
+
insuredPeople: InsuredPerson[];
|
|
8
|
+
onBack?: () => void;
|
|
9
|
+
onPayment?: (paymentMode: EPaymentMethod) => void;
|
|
10
|
+
isProcessing?: boolean;
|
|
11
|
+
onPremiumUpdate?: (premium: CoveragePlanPremium['premium'] | null) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const StepFourPayment: ({ travelPlan, selectedPlan, buyerInfo, insuredPeople, onBack, onPayment, isProcessing, onPremiumUpdate, }: StepFourPaymentProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -1,19 +1,10 @@
|
|
|
1
|
-
import { Control
|
|
2
|
-
import {
|
|
3
|
-
import { EInsuranceType } from '../../types/insurance';
|
|
1
|
+
import { Control } from 'react-hook-form';
|
|
2
|
+
import { TravelPlanFormValues } from './types';
|
|
4
3
|
interface StepOneFormProps {
|
|
5
|
-
control: Control<
|
|
6
|
-
insuranceTypeValue: EInsuranceType;
|
|
7
|
-
isTMIVSelected: boolean;
|
|
8
|
-
isMSIGSelected: boolean;
|
|
9
|
-
providerValue: string;
|
|
10
|
-
destinationIdValue: string;
|
|
11
|
-
updateDestinationId: (value: string | null) => void;
|
|
4
|
+
control: Control<TravelPlanFormValues>;
|
|
12
5
|
tripStart: Date | null;
|
|
13
6
|
tripEnd: Date | null;
|
|
14
|
-
setValue:
|
|
15
|
-
onSubmit: (event: React.FormEvent<HTMLFormElement>) => void;
|
|
16
|
-
formId?: string;
|
|
7
|
+
setValue: (name: keyof TravelPlanFormValues, value: any) => void;
|
|
17
8
|
}
|
|
18
|
-
export declare const StepOneForm: ({ control,
|
|
9
|
+
export declare const StepOneForm: ({ control, tripStart, tripEnd, setValue }: StepOneFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
10
|
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BuyerFormValues } from './types';
|
|
2
|
+
interface StepThreeBuyerInfoProps {
|
|
3
|
+
initialValues?: Partial<BuyerFormValues>;
|
|
4
|
+
onSubmit: (values: BuyerFormValues) => void;
|
|
5
|
+
onBack: () => void;
|
|
6
|
+
onFormRef?: (form: HTMLFormElement | null) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const StepThreeBuyerInfo: ({ initialValues, onSubmit, onBack: _onBack, onFormRef, }: StepThreeBuyerInfoProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { EInsuranceType } from '../../types/insurance';
|
|
2
|
+
import { InsuredPerson } from './types';
|
|
3
|
+
interface StepThreeInsuredPeopleProps {
|
|
4
|
+
initialPeople: InsuredPerson[];
|
|
5
|
+
insuranceType: EInsuranceType;
|
|
6
|
+
adultsCount: number;
|
|
7
|
+
childrenCount: number;
|
|
8
|
+
providerCode?: string | null;
|
|
9
|
+
buyerInfo?: {
|
|
10
|
+
isInsuredPerson?: boolean;
|
|
11
|
+
} | null;
|
|
12
|
+
onSubmit: (people: InsuredPerson[]) => void;
|
|
13
|
+
onBack: () => void;
|
|
14
|
+
onFormRef?: (form: HTMLFormElement | null) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare const StepThreeInsuredPeople: ({ initialPeople, insuranceType, providerCode, buyerInfo, onSubmit, onFormRef, }: StepThreeInsuredPeopleProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SortOrder } from './InsurancePlans';
|
|
2
|
+
import { EInsuranceProviderType } from '../../types/insurance';
|
|
3
|
+
import { CoveragePlanPremium, CalculatePremiumRequest, TravelPlanFormValues } from './types';
|
|
4
|
+
interface StepTwoPlansProps {
|
|
5
|
+
requestPayload: CalculatePremiumRequest | null;
|
|
6
|
+
selectedPlanId?: number | null;
|
|
7
|
+
onPlanSelect: (plan: CoveragePlanPremium) => void;
|
|
8
|
+
insuranceType?: 'travel' | 'car' | 'motorcycle' | string;
|
|
9
|
+
travelPlan?: TravelPlanFormValues | null;
|
|
10
|
+
allowDiscount?: boolean;
|
|
11
|
+
onScrollToTop?: () => void;
|
|
12
|
+
selectedProviders: EInsuranceProviderType[];
|
|
13
|
+
onProviderChange: (providers: EInsuranceProviderType[]) => void;
|
|
14
|
+
sortOrder: SortOrder;
|
|
15
|
+
onSortChange: (sortOrder: SortOrder) => void;
|
|
16
|
+
}
|
|
17
|
+
export declare const StepTwoPlans: ({ requestPayload, selectedPlanId, onPlanSelect, insuranceType, travelPlan, allowDiscount, onScrollToTop, selectedProviders, onProviderChange, sortOrder, onSortChange, }: StepTwoPlansProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface CountryInfo {
|
|
2
|
+
nameVi: string;
|
|
3
|
+
alpha2: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Get Vietnamese name and alpha2 code from country name
|
|
7
|
+
* @param countryName - Country name in English or Vietnamese
|
|
8
|
+
* @returns Country info with Vietnamese name and alpha2 code, or null if not found
|
|
9
|
+
*/
|
|
10
|
+
export declare const getCountryInfo: (countryName: string) => CountryInfo | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EDestination, EGender, EIdType, EInsuranceType, EPolicyType, ERelationToPrimary, ETravelType } from '../../types/insurance';
|
|
1
|
+
import { EDestination, EGender, EIdType, EInsuranceType, EPolicyType, ERelationToPrimary, ETravelType, EPersonType, EPersonValidationStatus } from '../../types/insurance';
|
|
2
2
|
export type InsuranceFormValues = {
|
|
3
3
|
provider: string;
|
|
4
4
|
type: EInsuranceType;
|
|
@@ -29,7 +29,7 @@ export type InsuredMember = {
|
|
|
29
29
|
fullName: string;
|
|
30
30
|
dob: string;
|
|
31
31
|
nationality: number | null;
|
|
32
|
-
|
|
32
|
+
idNumber: string;
|
|
33
33
|
gender?: EGender;
|
|
34
34
|
relationship?: ERelationToPrimary;
|
|
35
35
|
};
|
|
@@ -77,3 +77,72 @@ export type CoveragePlanQuote = {
|
|
|
77
77
|
currency?: string;
|
|
78
78
|
coverageDetails?: string;
|
|
79
79
|
};
|
|
80
|
+
export type TravelPlanFormValues = {
|
|
81
|
+
destinationCountryId: number | null;
|
|
82
|
+
startDate: Date | null;
|
|
83
|
+
endDate: Date | null;
|
|
84
|
+
insuranceType: EInsuranceType;
|
|
85
|
+
adultsCount: number;
|
|
86
|
+
childrenCount: number;
|
|
87
|
+
};
|
|
88
|
+
export type CalculatePremiumRequest = {
|
|
89
|
+
destinationCountryId: number;
|
|
90
|
+
startDate: string;
|
|
91
|
+
endDate: string;
|
|
92
|
+
adultsCount: number;
|
|
93
|
+
childrenCount: number;
|
|
94
|
+
providers?: string[];
|
|
95
|
+
sortOrder?: 'asc' | 'desc';
|
|
96
|
+
};
|
|
97
|
+
export type CoveragePlanPremium = {
|
|
98
|
+
provider: string;
|
|
99
|
+
coveragePlan: {
|
|
100
|
+
id: number;
|
|
101
|
+
planCode: string;
|
|
102
|
+
planName: string;
|
|
103
|
+
coverageDetails: string;
|
|
104
|
+
};
|
|
105
|
+
premium: {
|
|
106
|
+
totalPremium: number;
|
|
107
|
+
premiumPerPerson: number;
|
|
108
|
+
days: number;
|
|
109
|
+
region: string;
|
|
110
|
+
} | null;
|
|
111
|
+
error: string | null;
|
|
112
|
+
};
|
|
113
|
+
export type CalculatePremiumResponse = {
|
|
114
|
+
destinationCountryId: number;
|
|
115
|
+
startDate: string;
|
|
116
|
+
endDate: string;
|
|
117
|
+
numberOfPeople: number;
|
|
118
|
+
plans: CoveragePlanPremium[];
|
|
119
|
+
};
|
|
120
|
+
export type BuyerFormValues = {
|
|
121
|
+
fullName: string;
|
|
122
|
+
gender?: EGender;
|
|
123
|
+
dateOfBirth: string;
|
|
124
|
+
nationality: number | null;
|
|
125
|
+
idType: EIdType;
|
|
126
|
+
idNumber: string;
|
|
127
|
+
phone: string;
|
|
128
|
+
email: string;
|
|
129
|
+
stateId: number | null;
|
|
130
|
+
wardId: number | null;
|
|
131
|
+
countryId: number | null;
|
|
132
|
+
address: string;
|
|
133
|
+
isInsuredPerson: boolean;
|
|
134
|
+
};
|
|
135
|
+
export type InsuredPersonFormValues = {
|
|
136
|
+
fullName: string;
|
|
137
|
+
dateOfBirth: string;
|
|
138
|
+
gender?: EGender;
|
|
139
|
+
idType: EIdType;
|
|
140
|
+
idNumber: string;
|
|
141
|
+
relationship: ERelationToPrimary;
|
|
142
|
+
nationality: number | null;
|
|
143
|
+
};
|
|
144
|
+
export type InsuredPerson = InsuredPersonFormValues & {
|
|
145
|
+
id: string;
|
|
146
|
+
status?: EPersonValidationStatus;
|
|
147
|
+
personType: EPersonType;
|
|
148
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EQuoteStatus } from '../../types/insurance';
|
|
2
2
|
export declare const QUOTE_STATUS_BADGE: Record<EQuoteStatus, {
|
|
3
3
|
label: string;
|
|
4
4
|
color: string;
|
|
5
5
|
}>;
|
|
6
|
-
export declare const POLICY_STATUS_BADGE: Record<
|
|
6
|
+
export declare const POLICY_STATUS_BADGE: Record<EQuoteStatus, {
|
|
7
7
|
label: string;
|
|
8
8
|
color: string;
|
|
9
9
|
}>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { RegisterOptions, FieldValues, Path } from 'react-hook-form';
|
|
2
|
+
export declare const createEmailRules: <TFieldValues extends FieldValues, TFieldName extends Path<TFieldValues> = Path<TFieldValues>>() => RegisterOptions<TFieldValues, TFieldName>;
|
|
3
|
+
export declare const createPhoneRules: <TFieldValues extends FieldValues, TFieldName extends Path<TFieldValues> = Path<TFieldValues>>() => RegisterOptions<TFieldValues, TFieldName>;
|
|
4
|
+
export declare const createIdNumberRules: <TFieldValues extends FieldValues, TFieldName extends Path<TFieldValues> = Path<TFieldValues>>() => RegisterOptions<TFieldValues, TFieldName>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { EPersonValidationStatus } from '../../types/insurance';
|
|
2
|
+
import { InsuredPersonFormValues } from './types';
|
|
3
|
+
export type PersonValidationStatus = EPersonValidationStatus;
|
|
4
|
+
export declare const validatePerson: (person: InsuredPersonFormValues) => PersonValidationStatus;
|
|
5
|
+
export declare const hasPersonBeenInteracted: (person: InsuredPersonFormValues | undefined, isFormSubmitted: boolean) => boolean;
|
|
6
|
+
export declare const getFieldBorderColor: (fieldState: {
|
|
7
|
+
error?: {
|
|
8
|
+
message?: string;
|
|
9
|
+
};
|
|
10
|
+
isTouched?: boolean;
|
|
11
|
+
}, value: any, isValid?: boolean, isFormSubmitted?: boolean) => "gray.300" | "red.500" | "green.500";
|
|
12
|
+
export declare const isFieldValid: (fieldName: string, person: InsuredPersonFormValues | undefined, fieldState: any) => boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface InsurancePaymentModalProps {
|
|
3
|
+
open: boolean;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
qrCodeUrl: string;
|
|
6
|
+
transactionPublicId?: string;
|
|
7
|
+
amount: number;
|
|
8
|
+
onSuccess?: () => void;
|
|
9
|
+
}
|
|
10
|
+
declare const InsurancePaymentModal: React.FC<InsurancePaymentModalProps>;
|
|
11
|
+
export default InsurancePaymentModal;
|