gotrip-fx-transaction-form 1.0.253-dev → 1.0.255-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 +30530 -29886
- package/package.json +1 -1
- package/types/components/Modal/CancelTransactionModal.d.ts +1 -0
- package/types/components/MotorInsurance/Bike/BikeStepOneForm.d.ts +20 -1
- package/types/components/MotorInsurance/Car/CarStepOneForm.d.ts +20 -1
- package/types/components/MotorInsurance/DocumentUploadPreview.d.ts +14 -0
- package/types/components/MotorInsurance/image-storage.utils.d.ts +18 -0
- package/types/components/MotorInsurance/motor-insurance.types.d.ts +4 -0
- package/types/constants/api-urls.d.ts +4 -0
- package/types/hooks/useBankOutsideWorkingHoursNotice.d.ts +5 -0
- package/types/hooks/useMotorQuote.d.ts +15 -0
- package/types/hooks/useVehicleRegistrationScan.d.ts +39 -0
- package/types/pages/agency/home/HomePage.d.ts +1 -0
- package/types/pages/agency/home/constants.d.ts +16 -0
- package/types/types/response.dto.d.ts +14 -0
package/package.json
CHANGED
|
@@ -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,11 +1,30 @@
|
|
|
1
1
|
import { EMotorProvider, MotorPlanFormValues, MotorPremiumSummary as MotorPremiumSummaryType } from '../motor-insurance.types';
|
|
2
2
|
import { Control, UseFormSetValue } from 'react-hook-form';
|
|
3
|
+
import { BikeRegistrationOcrData } from '../../../hooks/useVehicleRegistrationScan';
|
|
3
4
|
type BikeStepOneFormProps = {
|
|
4
5
|
control: Control<MotorPlanFormValues>;
|
|
5
6
|
setValue: UseFormSetValue<MotorPlanFormValues>;
|
|
6
7
|
premiumSummary?: MotorPremiumSummaryType | null;
|
|
7
8
|
isLoadingQuote?: boolean;
|
|
8
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;
|
|
9
28
|
};
|
|
10
|
-
export declare const BikeStepOneForm: ({ control, setValue, premiumSummary, isLoadingQuote, providers, }: BikeStepOneFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
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;
|
|
11
30
|
export {};
|
|
@@ -1,8 +1,27 @@
|
|
|
1
1
|
import { Control, UseFormSetValue } from 'react-hook-form';
|
|
2
2
|
import { CarPlanFormValues } from '../motor-insurance.types';
|
|
3
|
+
import { CarRegistrationOcrData } from '../../../hooks/useVehicleRegistrationScan';
|
|
3
4
|
interface CarStepOneFormProps {
|
|
4
5
|
control: Control<CarPlanFormValues>;
|
|
5
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;
|
|
6
25
|
}
|
|
7
|
-
export declare const CarStepOneForm: ({ control, setValue }: CarStepOneFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export declare const CarStepOneForm: ({ control, setValue, onOcrComplete, onOcrReset, onIdCardComplete, onIdCardReset, vehicleRegImageUrl, idCardImageUrl, onVehicleRegImageCapture, onIdCardImageCapture, onScanningChange, }: CarStepOneFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
27
|
export {};
|
|
@@ -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;
|
|
@@ -105,6 +105,8 @@ export interface BikePolicyRequestDto {
|
|
|
105
105
|
totalPremium?: number;
|
|
106
106
|
tax?: number;
|
|
107
107
|
paymentMode: EPaymentMethod;
|
|
108
|
+
vehicleRegImageUrl?: string;
|
|
109
|
+
idCardImageUrl?: string;
|
|
108
110
|
}
|
|
109
111
|
/**
|
|
110
112
|
* DTO for bike policy response (BikePolicyResponse).
|
|
@@ -284,6 +286,8 @@ export interface CarPolicyRequestDto {
|
|
|
284
286
|
hideLicensePlate?: boolean;
|
|
285
287
|
hidePremium?: boolean;
|
|
286
288
|
paymentMode: EPaymentMethod;
|
|
289
|
+
vehicleRegImageUrl?: string;
|
|
290
|
+
idCardImageUrl?: string;
|
|
287
291
|
}
|
|
288
292
|
/**
|
|
289
293
|
* DTO for car policy response (MotorCreatePolicyResponse).
|
|
@@ -70,6 +70,10 @@ export declare const ApiUrls: {
|
|
|
70
70
|
uploadIdentityDocuments: string;
|
|
71
71
|
saveReaderHistory: string;
|
|
72
72
|
getReaderHistories: string;
|
|
73
|
+
extractCarRegistration: string;
|
|
74
|
+
extractCarRegistrationFromBase64: string;
|
|
75
|
+
extractBikeRegistration: string;
|
|
76
|
+
extractBikeRegistrationFromBase64: string;
|
|
73
77
|
};
|
|
74
78
|
bid: {
|
|
75
79
|
list: string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CarPlanFormValues, CarPremiumSummary, MotorPlanFormValues, MotorPremiumSummary, EMotorProvider } from '../components/MotorInsurance/motor-insurance.types';
|
|
2
|
+
interface UseCarQuoteResult {
|
|
3
|
+
quoteResult: CarPremiumSummary | null;
|
|
4
|
+
quoteResultRef: React.MutableRefObject<CarPremiumSummary | null>;
|
|
5
|
+
calculateQuote: (planValues: CarPlanFormValues, createQuoteCar: (provider: EMotorProvider, payload: any) => Promise<any>) => void;
|
|
6
|
+
resetQuote: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const useCarQuote: () => UseCarQuoteResult;
|
|
9
|
+
interface UseBikeQuoteResult {
|
|
10
|
+
quoteResult: MotorPremiumSummary | null;
|
|
11
|
+
calculateQuote: (planValues: MotorPlanFormValues, createQuoteBike: (provider: EMotorProvider, payload: any) => Promise<any>) => void;
|
|
12
|
+
resetQuote: () => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const useBikeQuote: () => UseBikeQuoteResult;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export interface CarRegistrationOcrData {
|
|
2
|
+
licensePlate: string;
|
|
3
|
+
chassisNumber: string;
|
|
4
|
+
engineNumber: string;
|
|
5
|
+
manufacturingYear: number | null;
|
|
6
|
+
seatCount: number | null;
|
|
7
|
+
ownerName: string;
|
|
8
|
+
brand: string;
|
|
9
|
+
model: string;
|
|
10
|
+
color: string;
|
|
11
|
+
registrationDate: string;
|
|
12
|
+
isCommercialTransport: boolean;
|
|
13
|
+
gcsUrl?: string;
|
|
14
|
+
filePath?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface BikeRegistrationOcrData {
|
|
17
|
+
licensePlate: string;
|
|
18
|
+
chassisNumber: string;
|
|
19
|
+
engineNumber: string;
|
|
20
|
+
ownerName: string;
|
|
21
|
+
address: string;
|
|
22
|
+
brand: string;
|
|
23
|
+
model: string;
|
|
24
|
+
color: string;
|
|
25
|
+
engineCapacity: number | null;
|
|
26
|
+
registrationDate: string;
|
|
27
|
+
gcsUrl?: string;
|
|
28
|
+
filePath?: string;
|
|
29
|
+
}
|
|
30
|
+
export declare const useCarRegistrationScan: () => {
|
|
31
|
+
scanCarRegistration: (file: File) => Promise<CarRegistrationOcrData | null>;
|
|
32
|
+
isScanning: boolean;
|
|
33
|
+
scanError: string | null;
|
|
34
|
+
};
|
|
35
|
+
export declare const useBikeRegistrationScan: () => {
|
|
36
|
+
scanBikeRegistration: (file: File) => Promise<BikeRegistrationOcrData | null>;
|
|
37
|
+
isScanning: boolean;
|
|
38
|
+
scanError: string | null;
|
|
39
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const HomePage: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type AgencyHomeCard = {
|
|
2
|
+
key: string;
|
|
3
|
+
title: string;
|
|
4
|
+
description: string;
|
|
5
|
+
actionLabel: string;
|
|
6
|
+
path?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
iconUrl?: string;
|
|
9
|
+
};
|
|
10
|
+
export type AgencyHomeSection = {
|
|
11
|
+
key: string;
|
|
12
|
+
title: string;
|
|
13
|
+
cards: AgencyHomeCard[];
|
|
14
|
+
};
|
|
15
|
+
export declare const TEMP_PRODUCT_IMAGE = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='280' height='160' viewBox='0 0 280 160'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0%25' stop-color='%23edf2ff'/%3E%3Cstop offset='100%25' stop-color='%23dbeafe'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='280' height='160' rx='18' fill='url(%23g)'/%3E%3Crect x='36' y='38' width='120' height='84' rx='14' fill='%23ffffff' stroke='%239bb4ff' stroke-width='3'/%3E%3Ccircle cx='206' cy='54' r='24' fill='%23bfdbfe'/%3E%3Ccircle cx='230' cy='82' r='20' fill='%2393c5fd'/%3E%3Cpath d='M68 82h56M68 98h70' stroke='%233b82f6' stroke-width='7' stroke-linecap='round'/%3E%3C/svg%3E";
|
|
16
|
+
export declare const AGENCY_HOME_SECTIONS: AgencyHomeSection[];
|
|
@@ -106,6 +106,20 @@ export type ITransaction = {
|
|
|
106
106
|
fileUrls?: IFileUrls;
|
|
107
107
|
cancelledAt?: string;
|
|
108
108
|
cancelledResponse?: Record<string, any>;
|
|
109
|
+
cancelledBy?: string;
|
|
110
|
+
cancelledUser?: {
|
|
111
|
+
id: number;
|
|
112
|
+
email?: string;
|
|
113
|
+
firstName?: string;
|
|
114
|
+
lastName?: string;
|
|
115
|
+
};
|
|
116
|
+
approvedBy?: string;
|
|
117
|
+
approvedUser?: {
|
|
118
|
+
id: number;
|
|
119
|
+
email?: string;
|
|
120
|
+
firstName?: string;
|
|
121
|
+
lastName?: string;
|
|
122
|
+
};
|
|
109
123
|
assignedUserId?: number;
|
|
110
124
|
assignedUser?: {
|
|
111
125
|
id: number;
|