gotrip-fx-transaction-form 1.0.247-dev → 1.0.250-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.247-dev",
3
+ "version": "1.0.250-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 MultiTagComboboxProps = {
8
8
  placeholder?: string;
9
9
  emptyText?: string;
10
10
  onChange: (nextValues: string[]) => void;
11
+ controlBorderRadius?: string;
11
12
  };
12
- export declare const MultiTagCombobox: ({ options, values, placeholder, emptyText, onChange, }: MultiTagComboboxProps) => import("react/jsx-runtime").JSX.Element;
13
+ export declare const MultiTagCombobox: ({ options, values, placeholder, emptyText, onChange, controlBorderRadius, }: MultiTagComboboxProps) => import("react/jsx-runtime").JSX.Element;
13
14
  export {};
@@ -0,0 +1,16 @@
1
+ import { ReactNode } from 'react';
2
+ interface PrimaryRadioGroupOption<T extends string> {
3
+ value: T;
4
+ label: ReactNode;
5
+ disabled?: boolean;
6
+ }
7
+ interface PrimaryRadioGroupProps<T extends string> {
8
+ value: T;
9
+ onValueChange: (value: T) => void;
10
+ options: PrimaryRadioGroupOption<T>[];
11
+ direction?: 'row' | 'column';
12
+ gap?: number;
13
+ disabled?: boolean;
14
+ }
15
+ export declare function PrimaryRadioGroup<T extends string>({ value, onValueChange, options, direction, gap, disabled, }: PrimaryRadioGroupProps<T>): import("react/jsx-runtime").JSX.Element;
16
+ export {};
@@ -11,6 +11,7 @@ type TimeRangeSelectProps = {
11
11
  error?: string;
12
12
  startLabel?: string;
13
13
  endLabel?: string;
14
+ fieldBorderRadius?: string;
14
15
  };
15
- export declare const TimeRangeSelect: ({ startValue, endValue, options, onStartChange, onEndChange, error, startLabel, endLabel, }: TimeRangeSelectProps) => import("react/jsx-runtime").JSX.Element;
16
+ export declare const TimeRangeSelect: ({ startValue, endValue, options, onStartChange, onEndChange, error, startLabel, endLabel, fieldBorderRadius, }: TimeRangeSelectProps) => import("react/jsx-runtime").JSX.Element;
16
17
  export {};
@@ -3,7 +3,7 @@ export interface DatePickerInputProps {
3
3
  value?: string;
4
4
  onClick?: () => void;
5
5
  placeholder?: string;
6
+ borderRadius?: string;
6
7
  }
7
- /** Shared date picker input with calendar icon. Use as customInput for react-datepicker. */
8
8
  export declare const DatePickerInput: import('react').ForwardRefExoticComponent<DatePickerInputProps & import('react').RefAttributes<HTMLInputElement>>;
9
9
  export { DatePicker };
@@ -15,6 +15,7 @@ export interface StepFourPaymentProps {
15
15
  code: string;
16
16
  discountAmount: number;
17
17
  finalAmount: number;
18
+ description?: string | null;
18
19
  } | null) => void;
19
20
  }
20
21
  export declare const StepFourPayment: ({ travelScope, travelPlan, selectedPlan, buyerInfo, insuredPeople, onBack, onPayment, isProcessing, onPremiumUpdate, onCouponChange, }: StepFourPaymentProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,3 @@
1
- export { InsuranceRadioGroup } from './InsuranceRadioGroup';
2
1
  export { PaymentMethodSelector } from './PaymentMethodSelector';
3
2
  export { InfoBlockCard } from './InfoBlockCard';
4
3
  export { StepFooter } from './StepFooter';
@@ -105,6 +105,7 @@ export declare const ApiUrls: {
105
105
  requestOtp: string;
106
106
  changePasswordWithOtp: string;
107
107
  list: string;
108
+ getUserByTenantTypes: string;
108
109
  approveUser: string;
109
110
  bookerList: string;
110
111
  createBooker: string;
@@ -252,6 +253,11 @@ export declare const ApiUrls: {
252
253
  validate: string;
253
254
  list: string;
254
255
  summary: string;
256
+ campaignList: string;
257
+ campaignDetail: (id: number) => string;
258
+ campaignCreate: string;
259
+ campaignExport: (id: number) => string;
260
+ campaignPatchStatus: (id: number) => string;
255
261
  detail: (id: number) => string;
256
262
  create: string;
257
263
  update: (id: number) => string;
@@ -1,4 +1,4 @@
1
- import { TCouponDetail, TCouponRow } from '../types/coupon';
1
+ import { TCampaignRow, TCouponDetail, TCouponRow } from '../types/coupon';
2
2
  export type TCouponListParams = {
3
3
  page?: number;
4
4
  limit?: number;
@@ -6,6 +6,7 @@ export type TCouponListParams = {
6
6
  search?: string;
7
7
  productType?: string;
8
8
  provider?: string;
9
+ campaignId?: number;
9
10
  };
10
11
  export declare const useCoupon: (id?: string, isEdit?: boolean) => {
11
12
  listingLoading: boolean;
@@ -18,6 +19,12 @@ export declare const useCoupon: (id?: string, isEdit?: boolean) => {
18
19
  }>;
19
20
  formLoading: boolean;
20
21
  saving: boolean;
22
+ patchingStatus: boolean;
23
+ campaignLoading: boolean;
24
+ campaignRows: TCampaignRow[];
25
+ campaignDetail: TCampaignRow | null;
26
+ campaignDetailLoading: boolean;
27
+ campaignStatusPatching: boolean;
21
28
  fetchCoupon: () => Promise<{
22
29
  ok: true;
23
30
  data: TCouponDetail | undefined;
@@ -27,9 +34,62 @@ export declare const useCoupon: (id?: string, isEdit?: boolean) => {
27
34
  }>;
28
35
  saveCoupon: (payload: unknown) => Promise<{
29
36
  ok: true;
37
+ data: any;
30
38
  error?: undefined;
31
39
  } | {
32
40
  ok: false;
33
41
  error: unknown;
42
+ data?: undefined;
43
+ }>;
44
+ patchCouponStatus: (nextStatus: "active" | "inactive") => Promise<{
45
+ ok: true;
46
+ error?: undefined;
47
+ } | {
48
+ ok: false;
49
+ error: unknown;
50
+ }>;
51
+ fetchCampaigns: () => Promise<{
52
+ ok: true;
53
+ data: TCampaignRow[];
54
+ } | {
55
+ ok: false;
56
+ data: TCampaignRow[];
57
+ }>;
58
+ createCampaign: (name: string) => Promise<{
59
+ ok: true;
60
+ data: TCampaignRow | undefined;
61
+ error?: undefined;
62
+ } | {
63
+ ok: false;
64
+ error: unknown;
65
+ data?: undefined;
66
+ }>;
67
+ fetchCampaignById: (campaignId: number) => Promise<{
68
+ ok: true;
69
+ data: TCampaignRow | undefined;
70
+ } | {
71
+ ok: false;
72
+ data: undefined;
73
+ }>;
74
+ patchCampaignStatus: (campaignId: number, status: "active" | "inactive") => Promise<{
75
+ ok: true;
76
+ data: TCampaignRow | null;
77
+ error?: undefined;
78
+ } | {
79
+ ok: false;
80
+ error: unknown;
81
+ data?: undefined;
82
+ }>;
83
+ exportCampaignCouponsCsv: (campaignName: string, params: TCouponListParams) => Promise<{
84
+ ok: true;
85
+ data: {
86
+ blob: Blob;
87
+ fileName: string;
88
+ };
89
+ error?: undefined;
90
+ } | {
91
+ ok: false;
92
+ error: unknown;
93
+ data?: undefined;
34
94
  }>;
35
95
  };
@@ -10,6 +10,7 @@ type ValidateCouponResult = {
10
10
  finalAmount: number;
11
11
  couponId: number;
12
12
  couponCode: string;
13
+ description?: string | null;
13
14
  };
14
15
  export declare const useCouponValidation: () => {
15
16
  isApplyingCoupon: boolean;
@@ -0,0 +1,11 @@
1
+ export type TUserByTenantTypeOption = {
2
+ label: string;
3
+ value: string;
4
+ };
5
+ /**
6
+ * Loads all users in tenants of type standalone_booker / travel_agency.
7
+ */
8
+ export declare function useUsersByTenantTypes(): {
9
+ options: TUserByTenantTypeOption[];
10
+ loading: boolean;
11
+ };
@@ -0,0 +1,13 @@
1
+ import { TCouponRow } from '../../../types/coupon';
2
+ type Props = {
3
+ loading: boolean;
4
+ rows: TCouponRow[];
5
+ page: number;
6
+ pageSize: number;
7
+ listTotal: number;
8
+ onEdit: (couponId: number) => void;
9
+ onPageChange: (page: number) => void;
10
+ onPageSizeChange: (size: number) => void;
11
+ };
12
+ export declare const CampaignCouponTable: ({ loading, rows, page, pageSize, listTotal, onEdit, onPageChange, onPageSizeChange, }: Props) => import("react/jsx-runtime").JSX.Element;
13
+ export {};
@@ -0,0 +1 @@
1
+ export declare const CampaignDetailPage: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare const CampaignListing: () => import("react/jsx-runtime").JSX.Element;
@@ -6,6 +6,12 @@ export declare enum ECouponProductType {
6
6
  ESIM = "esim"
7
7
  }
8
8
  export type TCouponStatus = 'active' | 'inactive';
9
+ export type TCampaignStatus = 'active' | 'inactive';
10
+ export type TCampaignRef = {
11
+ id: number;
12
+ name: string;
13
+ status: TCampaignStatus;
14
+ };
9
15
  export type TCouponConditions = {
10
16
  minOrderValue: number | null;
11
17
  firstOrderOnly: boolean;
@@ -16,6 +22,8 @@ export type TCouponRow = {
16
22
  id: number;
17
23
  code: string;
18
24
  name: string;
25
+ campaignId?: number | null;
26
+ campaign?: TCampaignRef | null;
19
27
  status: string;
20
28
  usedCount: number;
21
29
  totalUsageLimit: number | null;
@@ -28,6 +36,14 @@ export type TCouponRow = {
28
36
  productTypes?: string[] | null;
29
37
  providers?: string[] | null;
30
38
  };
39
+ export type TCampaignRow = {
40
+ id: number;
41
+ name: string;
42
+ status: TCampaignStatus;
43
+ totalCoupons: number;
44
+ usedCoupons: number;
45
+ createdAt: string;
46
+ };
31
47
  export type TCouponAdminSummary = {
32
48
  totalCoupons: number;
33
49
  activeCoupons: number;
@@ -35,13 +51,16 @@ export type TCouponAdminSummary = {
35
51
  totalDiscountAmountThisMonth: number;
36
52
  };
37
53
  export type TCouponDetail = {
54
+ campaignId?: number | null;
38
55
  code: string;
39
56
  name: string;
57
+ description?: string | null;
40
58
  status?: TCouponStatus;
41
59
  startAt: string;
42
60
  expireAt: string;
43
61
  totalUsageLimit: number | null;
44
62
  tenantIds?: number[] | null;
63
+ userIds?: number[] | null;
45
64
  discountType: string;
46
65
  discountValue: number;
47
66
  maxDiscountAmount: number | null;
@@ -1,15 +0,0 @@
1
- interface InsuranceRadioGroupOption<T extends string> {
2
- value: T;
3
- label: string;
4
- disabled?: boolean;
5
- }
6
- interface InsuranceRadioGroupProps<T extends string> {
7
- value: T;
8
- onValueChange: (value: T) => void;
9
- options: InsuranceRadioGroupOption<T>[];
10
- direction?: 'row' | 'column';
11
- gap?: number;
12
- disabled?: boolean;
13
- }
14
- export declare function InsuranceRadioGroup<T extends string>({ value, onValueChange, options, direction, gap, disabled, }: InsuranceRadioGroupProps<T>): import("react/jsx-runtime").JSX.Element;
15
- export {};
@@ -1 +0,0 @@
1
- export declare const CouponListing: () => import("react/jsx-runtime").JSX.Element;