gotrip-fx-transaction-form 1.0.269-dev → 1.0.271-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 +22281 -22059
- package/package.json +1 -1
- package/types/components/Admin/AgencyUserSelector/AgencyUserSelector.d.ts +7 -0
- package/types/components/Admin/AgencyUserSelector/AgencyUserSelectorModal.d.ts +10 -0
- package/types/components/Insurance/CreateInsuranceTransactionForm.d.ts +19 -2
- package/types/components/Insurance/StepFourPayment.d.ts +7 -1
- package/types/components/Insurance/StepOneForm.d.ts +2 -1
- package/types/constants/api-urls.d.ts +3 -0
- package/types/hooks/useInsuranceTransaction.d.ts +14 -1
- package/types/hooks/useTenantList.d.ts +1 -1
- package/types/hooks/useUserSearch.d.ts +9 -0
- package/types/pages/admin/CreateOrderOnBehalfTest.d.ts +3 -0
- package/types/pages/admin/insurance/create-insurance-transaction/AdminCreateInsuranceTransactionPage.d.ts +2 -0
- package/types/pages/admin/insurance/edit-insurance-transaction/AdminEditInsuranceTransactionPage.d.ts +1 -0
- package/types/pages/agency/insurance/transaction-approval/InsuranceTransactionApprovalPage.d.ts +1 -0
- package/types/types/insurance-transaction.dto.d.ts +9 -1
- package/types/types/insurance.d.ts +5 -0
- package/types/types/response.dto.d.ts +1 -0
package/package.json
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { IUser } from '../../../types/response.dto';
|
|
3
|
+
interface AgencyUserSelectorProps {
|
|
4
|
+
onUserSelected?: (user: IUser) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const AgencyUserSelector: React.FC<AgencyUserSelectorProps>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { IUser } from '../../../types/response.dto';
|
|
3
|
+
interface AgencyUserSelectorModalProps {
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
onUserSelected: (user: IUser) => void;
|
|
7
|
+
initialUser?: IUser | null;
|
|
8
|
+
}
|
|
9
|
+
export declare const AgencyUserSelectorModal: React.FC<AgencyUserSelectorModalProps>;
|
|
10
|
+
export {};
|
|
@@ -1,11 +1,28 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { TravelPlanFormValues, CoveragePlanPremium, BuyerFormValues, InsuredPerson } from './types';
|
|
1
3
|
import { ETravelScope } from '../../types/insurance';
|
|
4
|
+
import { IUser } from '../../types/response.dto';
|
|
5
|
+
export type InsuranceFormInitialData = {
|
|
6
|
+
formValues: TravelPlanFormValues;
|
|
7
|
+
selectedPlan: CoveragePlanPremium | null;
|
|
8
|
+
buyerInfo: BuyerFormValues | null;
|
|
9
|
+
insuredPeople: InsuredPerson[];
|
|
10
|
+
recalculatedPremium?: CoveragePlanPremium['premium'] | null;
|
|
11
|
+
waitForApproval?: boolean;
|
|
12
|
+
};
|
|
2
13
|
export interface CreateInsuranceTransactionFormProps {
|
|
3
14
|
storageKey: string;
|
|
4
|
-
title?:
|
|
15
|
+
title?: ReactNode;
|
|
5
16
|
travelScope: ETravelScope;
|
|
6
17
|
onBack?: () => void;
|
|
7
18
|
onSuccess?: (transactionData: any) => void;
|
|
8
19
|
scrollable?: boolean;
|
|
9
20
|
recommendBoxHeight?: string;
|
|
21
|
+
isAdminMode?: boolean;
|
|
22
|
+
selectedUser?: IUser | null;
|
|
23
|
+
onOpenUserSelector?: () => void;
|
|
24
|
+
initialData?: InsuranceFormInitialData | null;
|
|
25
|
+
mode?: 'create' | 'edit';
|
|
26
|
+
editingPublicId?: string;
|
|
10
27
|
}
|
|
11
|
-
export declare const CreateInsuranceTransactionForm: ({ storageKey, title, travelScope, onBack, onSuccess, scrollable, recommendBoxHeight, }: CreateInsuranceTransactionFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export declare const CreateInsuranceTransactionForm: ({ storageKey, title, travelScope, onBack, onSuccess, scrollable, recommendBoxHeight, isAdminMode, selectedUser, onOpenUserSelector, initialData, mode, editingPublicId, }: CreateInsuranceTransactionFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -21,5 +21,11 @@ export interface StepFourPaymentProps {
|
|
|
21
21
|
description?: string | null;
|
|
22
22
|
} | null) => void;
|
|
23
23
|
paymentType?: EOrderPaymentType;
|
|
24
|
+
isAdminMode?: boolean;
|
|
25
|
+
waitForApproval?: boolean;
|
|
26
|
+
onWaitForApprovalChange?: (value: boolean) => void;
|
|
27
|
+
hasSelectedUser?: boolean;
|
|
28
|
+
submitLabel?: string;
|
|
29
|
+
showApprovalToggle?: boolean;
|
|
24
30
|
}
|
|
25
|
-
export declare const StepFourPayment: ({ travelScope, travelPlan, selectedPlan, buyerInfo, insuredPeople, onBack, onPayment, isProcessing, onPremiumUpdate, onCouponChange, paymentType: paymentTypeProp, }: StepFourPaymentProps) => import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export declare const StepFourPayment: ({ travelScope, travelPlan, selectedPlan, buyerInfo, insuredPeople, onBack, onPayment, isProcessing, onPremiumUpdate, onCouponChange, paymentType: paymentTypeProp, isAdminMode, waitForApproval, onWaitForApprovalChange, hasSelectedUser, submitLabel, showApprovalToggle, }: StepFourPaymentProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -13,6 +13,7 @@ interface StepOneFormProps {
|
|
|
13
13
|
isSubmitting?: boolean;
|
|
14
14
|
isStepOneReady?: boolean;
|
|
15
15
|
isGuest?: boolean;
|
|
16
|
+
showQuickRecommendations?: boolean;
|
|
16
17
|
}
|
|
17
|
-
export declare const StepOneForm: ({ control, tripStart, tripEnd, setValue, isDomestic, onQuickPlanSelect, recommendBoxHeight, onBack, onNext, isSubmitting, isStepOneReady, isGuest, }: StepOneFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare const StepOneForm: ({ control, tripStart, tripEnd, setValue, isDomestic, onQuickPlanSelect, recommendBoxHeight, onBack, onNext, isSubmitting, isStepOneReady, isGuest, showQuickRecommendations, }: StepOneFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
19
|
export {};
|
|
@@ -246,12 +246,15 @@ export declare const ApiUrls: {
|
|
|
246
246
|
coveragePlans: (provider: string) => string;
|
|
247
247
|
transactionDetail: (publicId: string) => string;
|
|
248
248
|
retryProviderPolicy: (publicId: string) => string;
|
|
249
|
+
approveTransaction: (publicId: string) => string;
|
|
250
|
+
rejectTransaction: (publicId: string) => string;
|
|
249
251
|
transactionList: string;
|
|
250
252
|
coveragePlanQuotes: (provider: string) => string;
|
|
251
253
|
travelInsuranceSettings: string;
|
|
252
254
|
calculatePremium: string;
|
|
253
255
|
calculateSinglePlanPremium: string;
|
|
254
256
|
createTransaction: string;
|
|
257
|
+
updateTransaction: (publicId: string) => string;
|
|
255
258
|
quickRecommendations: string;
|
|
256
259
|
quickRecommendationsByCountry: (countryId: number) => string;
|
|
257
260
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { InsuranceTransaction } from '../types/insurance-transaction.dto';
|
|
2
2
|
import { EPaymentMethod, EOrderPaymentType, TransactionStatus } from '../types/enum';
|
|
3
|
-
import { ETravelScope } from '../types/insurance';
|
|
3
|
+
import { EApprovalStatus, ETravelScope } from '../types/insurance';
|
|
4
4
|
export interface GetInsuranceTransactionListReqDto {
|
|
5
5
|
page?: number;
|
|
6
6
|
limit?: number;
|
|
@@ -15,6 +15,8 @@ export interface GetInsuranceTransactionListReqDto {
|
|
|
15
15
|
primaryInsuredFullName?: string;
|
|
16
16
|
travelScope?: ETravelScope;
|
|
17
17
|
provider?: string;
|
|
18
|
+
approvalStatus?: EApprovalStatus;
|
|
19
|
+
approvalBypassed?: boolean;
|
|
18
20
|
}
|
|
19
21
|
export interface GetInsuranceTransactionListRespDto {
|
|
20
22
|
transactions: InsuranceTransaction[];
|
|
@@ -60,6 +62,9 @@ export interface CreateTransactionPayload {
|
|
|
60
62
|
totalPremium: number;
|
|
61
63
|
premiumPerPerson: number;
|
|
62
64
|
};
|
|
65
|
+
createdOnBehalfOfUserId?: number;
|
|
66
|
+
approvalStatus?: EApprovalStatus | null;
|
|
67
|
+
approvalBypassed?: boolean;
|
|
63
68
|
}
|
|
64
69
|
export declare const useInsuranceTransactionDetail: (publicId: string | undefined) => {
|
|
65
70
|
transaction: InsuranceTransaction | null;
|
|
@@ -102,6 +107,14 @@ export declare const useInsuranceTransaction: (options?: {
|
|
|
102
107
|
retryProviderPolicy: () => Promise<void>;
|
|
103
108
|
};
|
|
104
109
|
createTransaction: (payload: CreateTransactionPayload) => Promise<InsuranceTransaction>;
|
|
110
|
+
updateTransaction: (publicId: string, payload: CreateTransactionPayload) => Promise<InsuranceTransaction>;
|
|
105
111
|
isCreatingTransaction: boolean;
|
|
106
112
|
checkTransactionStatus: (publicId: string) => Promise<InsuranceTransaction>;
|
|
113
|
+
approveTransaction: (publicId: string) => Promise<void>;
|
|
114
|
+
isApprovingTransaction: boolean;
|
|
115
|
+
rejectTransaction: (publicId: string, payload: {
|
|
116
|
+
code: string;
|
|
117
|
+
text?: string;
|
|
118
|
+
}) => Promise<void>;
|
|
119
|
+
isRejectingTransaction: boolean;
|
|
107
120
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IUser } from '../types/response.dto';
|
|
2
|
+
interface UseUserSearchResult {
|
|
3
|
+
users: IUser[];
|
|
4
|
+
loading: boolean;
|
|
5
|
+
error: string | null;
|
|
6
|
+
search: (query: string) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const useUserSearch: (tenantId: number | null, debounceMs?: number) => UseUserSearchResult;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AdminEditInsuranceTransactionPage: () => import("react/jsx-runtime").JSX.Element;
|
package/types/pages/agency/insurance/transaction-approval/InsuranceTransactionApprovalPage.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const InsuranceTransactionApprovalPage: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EGender, EIdType, EInsuranceType, EPersonType, EPolicyStatus, EPolicyType, EQuoteStatus, ERelationToPrimary, ETravelScope, ETravelType } from './insurance';
|
|
1
|
+
import { EGender, EIdType, EInsuranceType, EApprovalStatus, EPersonType, EPolicyStatus, EPolicyType, EQuoteStatus, ERelationToPrimary, ETravelScope, ETravelType } from './insurance';
|
|
2
2
|
import { EOrderPaymentType } from './enum';
|
|
3
3
|
import { ITransaction } from './response.dto';
|
|
4
4
|
export interface InsuranceQuoteInsured {
|
|
@@ -106,6 +106,14 @@ export interface InsuranceTransaction {
|
|
|
106
106
|
paidAmount?: number;
|
|
107
107
|
unpaidAmount?: number;
|
|
108
108
|
isBypassed?: boolean;
|
|
109
|
+
approvalStatus?: EApprovalStatus | null;
|
|
110
|
+
approvalBypassed?: boolean;
|
|
111
|
+
createdByAdminId?: number | null;
|
|
112
|
+
updatedByAdminId?: number | null;
|
|
113
|
+
approvedAt?: string | null;
|
|
114
|
+
rejectedAt?: string | null;
|
|
115
|
+
rejectionReasonCode?: string | null;
|
|
116
|
+
rejectionReasonText?: string | null;
|
|
109
117
|
createdAt: string;
|
|
110
118
|
updatedAt: string;
|
|
111
119
|
quote?: InsuranceQuote;
|
|
@@ -62,6 +62,11 @@ export declare enum EPolicyStatus {
|
|
|
62
62
|
PENDING = "pending",
|
|
63
63
|
FAILED = "failed"
|
|
64
64
|
}
|
|
65
|
+
export declare enum EApprovalStatus {
|
|
66
|
+
PENDING_APPROVAL = "pending_approval",
|
|
67
|
+
APPROVED = "approved",
|
|
68
|
+
REJECTED = "rejected"
|
|
69
|
+
}
|
|
65
70
|
export declare enum EDestination {
|
|
66
71
|
WORLDWIDE = "worldwide",
|
|
67
72
|
ASIA = "asia",
|