gotrip-fx-transaction-form 1.0.249-dev → 1.0.251-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.249-dev",
3
+ "version": "1.0.251-dev",
4
4
  "description": "FX Transaction Form ES6 module",
5
5
  "main": "index.js",
6
6
  "types": "types/index.d.ts",
@@ -1,6 +1,7 @@
1
+ import { ReactNode } from 'react';
1
2
  interface PrimaryRadioGroupOption<T extends string> {
2
3
  value: T;
3
- label: string;
4
+ label: ReactNode;
4
5
  disabled?: boolean;
5
6
  }
6
7
  interface PrimaryRadioGroupProps<T extends string> {
@@ -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;
@@ -19,6 +20,11 @@ export declare const useCoupon: (id?: string, isEdit?: boolean) => {
19
20
  formLoading: boolean;
20
21
  saving: boolean;
21
22
  patchingStatus: boolean;
23
+ campaignLoading: boolean;
24
+ campaignRows: TCampaignRow[];
25
+ campaignDetail: TCampaignRow | null;
26
+ campaignDetailLoading: boolean;
27
+ campaignStatusPatching: boolean;
22
28
  fetchCoupon: () => Promise<{
23
29
  ok: true;
24
30
  data: TCouponDetail | undefined;
@@ -28,10 +34,12 @@ export declare const useCoupon: (id?: string, isEdit?: boolean) => {
28
34
  }>;
29
35
  saveCoupon: (payload: unknown) => Promise<{
30
36
  ok: true;
37
+ data: any;
31
38
  error?: undefined;
32
39
  } | {
33
40
  ok: false;
34
41
  error: unknown;
42
+ data?: undefined;
35
43
  }>;
36
44
  patchCouponStatus: (nextStatus: "active" | "inactive") => Promise<{
37
45
  ok: true;
@@ -40,4 +48,48 @@ export declare const useCoupon: (id?: string, isEdit?: boolean) => {
40
48
  ok: false;
41
49
  error: unknown;
42
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
+ exportCampaignCouponsXlsx: (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;
94
+ }>;
43
95
  };
@@ -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;
@@ -15,7 +21,9 @@ export type TCouponConditions = {
15
21
  export type TCouponRow = {
16
22
  id: number;
17
23
  code: string;
18
- name: string;
24
+ name: string | null;
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,14 +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
- name: string;
56
+ name: string | null;
40
57
  description?: string | null;
41
58
  status?: TCouponStatus;
42
59
  startAt: string;
43
60
  expireAt: string;
44
61
  totalUsageLimit: number | null;
45
62
  tenantIds?: number[] | null;
63
+ userIds?: number[] | null;
46
64
  discountType: string;
47
65
  discountValue: number;
48
66
  maxDiscountAmount: number | null;
@@ -1 +0,0 @@
1
- export declare const CouponListing: () => import("react/jsx-runtime").JSX.Element;