gotrip-fx-transaction-form 1.0.254-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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gotrip-fx-transaction-form",
3
- "version": "1.0.254-dev",
3
+ "version": "1.0.255-dev",
4
4
  "description": "FX Transaction Form ES6 module",
5
5
  "main": "index.js",
6
6
  "types": "types/index.d.ts",
@@ -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,5 @@
1
+ export type BankOutsideWorkingHoursNotice = {
2
+ show: boolean;
3
+ detail?: string;
4
+ };
5
+ export declare const useBankOutsideWorkingHoursNotice: (bankCode: string | undefined, enabled: boolean) => BankOutsideWorkingHoursNotice;
@@ -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
+ };
@@ -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;