gotrip-fx-transaction-form 1.0.239-dev → 1.0.241-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 +18685 -18532
- package/package.json +1 -1
- package/types/components/MotorInsurance/Bike/BikePremiumSummary.d.ts +3 -1
- package/types/components/MotorInsurance/Bike/BikeStepTwoVehicleInfo.d.ts +2 -1
- package/types/components/MotorInsurance/Car/CarPremiumSummary.d.ts +2 -1
- package/types/components/MotorInsurance/Car/CarStepThreeInfo.d.ts +2 -1
- package/types/components/MotorInsurance/motor-insurance.types.d.ts +7 -3
- package/types/components/MotorInsurance/motor-insurance.validation.d.ts +21 -0
- package/types/hooks/useMotorInsurance.d.ts +7 -6
- package/types/hooks/useMotorInsuranceTransaction.d.ts +5 -2
- package/types/types/insurance.d.ts +2 -1
package/package.json
CHANGED
|
@@ -2,6 +2,8 @@ import { MotorPremiumSummary as MotorPremiumSummaryType } from '../motor-insuran
|
|
|
2
2
|
interface BikePremiumSummaryProps {
|
|
3
3
|
summary?: MotorPremiumSummaryType | null;
|
|
4
4
|
isLoading?: boolean;
|
|
5
|
+
/** Provider code (e.g. PVI, MIC) – used to fetch CMS benefits */
|
|
6
|
+
providerCode?: string | null;
|
|
5
7
|
}
|
|
6
|
-
export declare const BikePremiumSummary: ({ summary, isLoading }: BikePremiumSummaryProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const BikePremiumSummary: ({ summary, isLoading, providerCode, }: BikePremiumSummaryProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
9
|
export {};
|
|
@@ -3,9 +3,10 @@ interface BikeStepTwoVehicleInfoProps {
|
|
|
3
3
|
initialValues?: Partial<VehicleInfoFormValues>;
|
|
4
4
|
premiumSummary?: MotorPremiumSummaryType | null;
|
|
5
5
|
isLoadingQuote?: boolean;
|
|
6
|
+
provider?: string;
|
|
6
7
|
onSubmit: (values: VehicleInfoFormValues) => void;
|
|
7
8
|
onBack: () => void;
|
|
8
9
|
formRef?: (form: HTMLFormElement | null) => void;
|
|
9
10
|
}
|
|
10
|
-
export declare const BikeStepTwoVehicleInfo: ({ initialValues, premiumSummary, isLoadingQuote, onSubmit, formRef, }: BikeStepTwoVehicleInfoProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare const BikeStepTwoVehicleInfo: ({ initialValues, premiumSummary, isLoadingQuote, provider, onSubmit, formRef, }: BikeStepTwoVehicleInfoProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
12
|
export {};
|
|
@@ -2,6 +2,7 @@ import { MotorPremiumSummary as MotorPremiumSummaryType } from '../motor-insuran
|
|
|
2
2
|
interface CarPremiumSummaryProps {
|
|
3
3
|
summary: MotorPremiumSummaryType | null | undefined;
|
|
4
4
|
isLoading?: boolean;
|
|
5
|
+
providerCode?: string | null;
|
|
5
6
|
}
|
|
6
|
-
export declare const CarPremiumSummary: ({ summary, isLoading }: CarPremiumSummaryProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const CarPremiumSummary: ({ summary, isLoading, providerCode }: CarPremiumSummaryProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
export {};
|
|
@@ -3,8 +3,9 @@ interface CarStepThreeInfoProps {
|
|
|
3
3
|
initialValues?: Partial<CarVehicleInfoFormValues>;
|
|
4
4
|
premiumSummary: MotorPremiumSummaryType | null;
|
|
5
5
|
isLoadingQuote?: boolean;
|
|
6
|
+
provider?: string;
|
|
6
7
|
onSubmit: (values: CarVehicleInfoFormValues) => void;
|
|
7
8
|
formRef?: (form: HTMLFormElement | null) => void;
|
|
8
9
|
}
|
|
9
|
-
export declare const CarStepThreeInfo: ({ initialValues, premiumSummary, isLoadingQuote, onSubmit, formRef, }: CarStepThreeInfoProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const CarStepThreeInfo: ({ initialValues, premiumSummary, isLoadingQuote, provider, onSubmit, formRef, }: CarStepThreeInfoProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
11
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Control, UseFormSetValue } from 'react-hook-form';
|
|
2
2
|
import { EPaymentMethod } from '../../types/enum';
|
|
3
|
+
import { EInsuranceProviderType } from '../../types/insurance';
|
|
3
4
|
export declare enum EMotorVehicleType {
|
|
4
5
|
BIKE = "bike",
|
|
5
6
|
CAR = "car"
|
|
@@ -47,7 +48,7 @@ export declare enum EVehicleTypeCode {
|
|
|
47
48
|
BUS = "BUS",
|
|
48
49
|
CARGO_STANDARD = "CARGO_STANDARD"
|
|
49
50
|
}
|
|
50
|
-
export type EMotorProvider =
|
|
51
|
+
export type EMotorProvider = EInsuranceProviderType.PVI | EInsuranceProviderType.MIC;
|
|
51
52
|
export type MotorPlanFormValues = {
|
|
52
53
|
vehicleType: EBikeVehicleType;
|
|
53
54
|
durationYears: 1 | 2 | 3;
|
|
@@ -77,6 +78,7 @@ export interface BikeQuoteResponseDto {
|
|
|
77
78
|
success: boolean;
|
|
78
79
|
totalPremium?: number;
|
|
79
80
|
mandatoryPremium?: number;
|
|
81
|
+
tax?: number;
|
|
80
82
|
occupantAccidentPremium?: number;
|
|
81
83
|
error?: string;
|
|
82
84
|
}
|
|
@@ -101,6 +103,7 @@ export interface BikePolicyRequestDto {
|
|
|
101
103
|
insuredOccupantCount?: number;
|
|
102
104
|
occupantAccidentPremium?: number;
|
|
103
105
|
totalPremium?: number;
|
|
106
|
+
tax?: number;
|
|
104
107
|
paymentMode: EPaymentMethod;
|
|
105
108
|
}
|
|
106
109
|
/**
|
|
@@ -196,8 +199,7 @@ export type CarPlanFormValues = {
|
|
|
196
199
|
};
|
|
197
200
|
export type MotorPremiumSummary = {
|
|
198
201
|
mandatoryPremium: number;
|
|
199
|
-
|
|
200
|
-
tndsPropertyCompensation: number;
|
|
202
|
+
tax: number;
|
|
201
203
|
passengerAccidentPremium: number;
|
|
202
204
|
passengerAccidentLevel: number;
|
|
203
205
|
passengerAccidentPeopleCount: number;
|
|
@@ -232,6 +234,7 @@ export interface CarQuoteResponseDto {
|
|
|
232
234
|
success: boolean;
|
|
233
235
|
totalPremium?: number;
|
|
234
236
|
mandatoryPremium?: number;
|
|
237
|
+
tax?: number;
|
|
235
238
|
occupantAccidentPremium?: number;
|
|
236
239
|
vehicleTypeCode?: string;
|
|
237
240
|
error?: string;
|
|
@@ -270,6 +273,7 @@ export interface CarPolicyRequestDto {
|
|
|
270
273
|
chassisNumber: string;
|
|
271
274
|
engineNumber: string;
|
|
272
275
|
mandatoryPremium: number;
|
|
276
|
+
tax?: number;
|
|
273
277
|
occupantAccidentSumInsured?: number;
|
|
274
278
|
insuredOccupantCount?: number;
|
|
275
279
|
occupantAccidentPremium?: number;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** Alphanumeric pattern for chassis number */
|
|
2
|
+
export declare const CHASSIS_ALPHANUMERIC_REGEX: RegExp;
|
|
3
|
+
/** Engine number: uppercase letters, digits, hyphen. Len 5-20. */
|
|
4
|
+
export declare const ENGINE_NUMBER_REGEX: RegExp;
|
|
5
|
+
export declare const ENGINE_NUMBER_MIN_LEN = 5;
|
|
6
|
+
export declare const ENGINE_NUMBER_MAX_LEN = 20;
|
|
7
|
+
export declare const CAR_CHASSIS_LEN = 17;
|
|
8
|
+
export declare const BIKE_CHASSIS_MIN_LEN = 12;
|
|
9
|
+
export declare const BIKE_CHASSIS_MAX_LEN = 17;
|
|
10
|
+
/**
|
|
11
|
+
* Validate car chassis number: exactly 17 chars, alphanumeric.
|
|
12
|
+
*/
|
|
13
|
+
export declare function validateCarChassisNumber(value: unknown): true | string;
|
|
14
|
+
/**
|
|
15
|
+
* Validate bike chassis number: 12-17 chars, alphanumeric.
|
|
16
|
+
*/
|
|
17
|
+
export declare function validateBikeChassisNumber(value: unknown): true | string;
|
|
18
|
+
/**
|
|
19
|
+
* Validate engine number (car and bike): 5-20 chars, [A-Z0-9-].
|
|
20
|
+
*/
|
|
21
|
+
export declare function validateEngineNumber(value: unknown): true | string;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { BikePolicyRequestDto, BikePolicyResponseDto, BikeQuoteRequestDto, BikeQuoteResponseDto, CarPolicyRequestDto, CarPolicyResponseDto, CarQuoteRequestDto, CarQuoteResponseDto } from '../components/MotorInsurance/motor-insurance.types';
|
|
1
|
+
import { BikePolicyRequestDto, BikePolicyResponseDto, BikeQuoteRequestDto, BikeQuoteResponseDto, CarPolicyRequestDto, CarPolicyResponseDto, CarQuoteRequestDto, CarQuoteResponseDto, EMotorProvider, EMotorVehicleType } from '../components/MotorInsurance/motor-insurance.types';
|
|
2
2
|
export declare const useMotorInsurance: () => {
|
|
3
|
-
createQuoteBike: (provider:
|
|
4
|
-
createPolicyBike: (provider:
|
|
5
|
-
createQuoteCar: (provider:
|
|
6
|
-
createPolicyCar: (provider:
|
|
3
|
+
createQuoteBike: (provider: EMotorProvider, body: BikeQuoteRequestDto) => Promise<BikeQuoteResponseDto | null>;
|
|
4
|
+
createPolicyBike: (provider: EMotorProvider, body: BikePolicyRequestDto) => Promise<BikePolicyResponseDto | null>;
|
|
5
|
+
createQuoteCar: (provider: EMotorProvider, body: CarQuoteRequestDto) => Promise<CarQuoteResponseDto | null>;
|
|
6
|
+
createPolicyCar: (provider: EMotorProvider, body: CarPolicyRequestDto) => Promise<CarPolicyResponseDto | null>;
|
|
7
7
|
isCreatingQuote: boolean;
|
|
8
8
|
isCreatingPolicy: boolean;
|
|
9
|
-
providers:
|
|
9
|
+
providers: EMotorProvider[];
|
|
10
10
|
loadingProviders: boolean;
|
|
11
11
|
motorInsuranceSettings: Record<string, any>;
|
|
12
12
|
loadingMotorInsuranceSettings: boolean;
|
|
13
13
|
refetchMotorInsuranceSettings: () => Promise<void>;
|
|
14
14
|
getMotorProviderLogoUrl: (providerCode?: string | null) => string | undefined;
|
|
15
15
|
getMotorProviderTermsAgreeHtml: (providerCode?: string | null) => string | undefined;
|
|
16
|
+
getMotorProviderMandatoryPremiumBenefitsHtml: (vehicleType: EMotorVehicleType, providerCode?: string | null) => string | undefined;
|
|
16
17
|
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { TransactionStatus } from '../types/enum';
|
|
2
|
+
import { EMotorProvider } from '../components/MotorInsurance/motor-insurance.types';
|
|
2
3
|
export interface MotorInsuranceTransactionDetail {
|
|
3
4
|
id: number;
|
|
4
5
|
transactionPublicId: string;
|
|
5
6
|
status: string;
|
|
6
7
|
totalAmount: number;
|
|
8
|
+
tax?: number;
|
|
7
9
|
providerPolicyId?: string | number;
|
|
8
10
|
providerPolicyNumber?: string;
|
|
9
11
|
errorMessage?: string;
|
|
@@ -12,7 +14,7 @@ export interface MotorInsuranceTransactionDetail {
|
|
|
12
14
|
licensePlate?: string;
|
|
13
15
|
startDate?: string;
|
|
14
16
|
endDate?: string;
|
|
15
|
-
provider:
|
|
17
|
+
provider: EMotorProvider;
|
|
16
18
|
chassisNumber?: string;
|
|
17
19
|
engineNumber?: string;
|
|
18
20
|
metadata?: Record<string, unknown>;
|
|
@@ -27,6 +29,7 @@ export interface MotorInsuranceTransactionListItem {
|
|
|
27
29
|
transactionPublicId: string;
|
|
28
30
|
status: TransactionStatus;
|
|
29
31
|
totalAmount: number;
|
|
32
|
+
tax?: number;
|
|
30
33
|
providerPolicyId?: string | number;
|
|
31
34
|
providerPolicyNumber?: string;
|
|
32
35
|
error?: string;
|
|
@@ -35,7 +38,7 @@ export interface MotorInsuranceTransactionListItem {
|
|
|
35
38
|
tenantName?: string;
|
|
36
39
|
ownerName?: string;
|
|
37
40
|
licensePlate?: string;
|
|
38
|
-
provider:
|
|
41
|
+
provider: EMotorProvider;
|
|
39
42
|
transaction?: {
|
|
40
43
|
status: string;
|
|
41
44
|
publicId: string;
|