gotrip-fx-transaction-form 1.0.124 → 1.0.126
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 +20698 -19999
- package/package.json +1 -1
- package/types/components/Modal/ExtendHoldModal.d.ts +14 -0
- package/types/components/PolicyGroup/PolicyGroupActionMenu.d.ts +12 -0
- package/types/components/PolicyGroup/PolicyGroupFormDialog.d.ts +10 -0
- package/types/components/SIM/SIMSearchForm.d.ts +10 -0
- package/types/components/SIM/SIMSelectionGrid.d.ts +17 -0
- package/types/components/SIM/Stepper.d.ts +13 -0
- package/types/components/SimTransactionStatusBadge/SimTransactionStatusBadge.d.ts +6 -0
- package/types/constants/api-urls.d.ts +34 -0
- package/types/constants/business-codes.d.ts +5 -0
- package/types/constants/env.d.ts +0 -4
- package/types/constants/policy-enums.d.ts +28 -0
- package/types/design-systems/Dialog/Dialog.d.ts +2 -0
- package/types/design-systems/Dialog/DialogContext.d.ts +11 -0
- package/types/design-systems/Select/SelectSearchable.d.ts +2 -1
- package/types/hooks/useBookedPhoneNumbers.d.ts +24 -0
- package/types/hooks/useBookedSimList.d.ts +28 -0
- package/types/hooks/useDataOrderList.d.ts +38 -0
- package/types/hooks/useDataPackageSearch.d.ts +17 -0
- package/types/hooks/usePolicyGroups.d.ts +45 -0
- package/types/hooks/useProviderPricing.d.ts +14 -0
- package/types/hooks/useSimGridList.d.ts +43 -0
- package/types/hooks/useSimHandlers.d.ts +58 -0
- package/types/hooks/useSimPackageList.d.ts +123 -0
- package/types/hooks/useSimPricing.d.ts +30 -0
- package/types/hooks/useSimTransactionGroupDetail.d.ts +50 -0
- package/types/hooks/useSimTransactionGrouped.d.ts +44 -0
- package/types/pages/admin/email-history-listing/EmailHistoryListing.d.ts +1 -1
- package/types/pages/admin/esim-listing/ESimListing.d.ts +1 -6
- package/types/pages/admin/esim-transaction-list/ESimTransactionList.d.ts +1 -3
- package/types/pages/admin/policy-management/PolicyManagement.d.ts +1 -0
- package/types/pages/admin/task-list/TaskList.d.ts +1 -2
- package/types/pages/admin/tenant-list/TenantList.d.ts +1 -5
- package/types/pages/admin/transaction-list/TransactionList.d.ts +1 -3
- package/types/pages/agency/booked-numbers/BookedNumbersPage.d.ts +20 -0
- package/types/pages/agency/data-order-list/DataOrderList.d.ts +5 -0
- package/types/pages/agency/data-package/DataPackageConfirmModal.d.ts +12 -0
- package/types/pages/agency/data-package/DataPackagePurchase.d.ts +1 -0
- package/types/pages/agency/group-sim-transaction-detail/GroupSimTransactionDetail.d.ts +1 -0
- package/types/pages/agency/sim-booking-list/SimBookingList.d.ts +6 -0
- package/types/pages/agency/sim-listing/SimSearchList.d.ts +3 -0
- package/types/pages/agency/sim-order/BookedPhoneNumbersModal.d.ts +25 -0
- package/types/pages/agency/sim-order/SimOrderPage.d.ts +3 -0
- package/types/pages/agency/sim-package-search/SimPackageSearchPage.d.ts +3 -0
- package/types/pages/agency/sim-transaction-detail/SimTransactionDetail.d.ts +1 -0
- package/types/pages/agency/sim-transaction-list/Description.d.ts +6 -0
- package/types/pages/agency/sim-transaction-list/SimTransactionList.d.ts +6 -0
- package/types/providers/UnleashProvider.d.ts +4 -0
- package/types/types/booked-numbers.dto.d.ts +32 -0
- package/types/types/enum.d.ts +4 -0
- package/types/types/response.dto.d.ts +30 -1
- package/types/types/sim-transaction.dto.d.ts +64 -0
- package/types/types/sim.dto.d.ts +21 -0
- package/types/util/phone-formatter.d.ts +2 -0
- package/types/util/sim-display.d.ts +9 -0
package/package.json
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface ExtendHoldModalProps {
|
|
3
|
+
isOpen: boolean;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
selectedSims: Array<{
|
|
6
|
+
id: number;
|
|
7
|
+
msisdn: string;
|
|
8
|
+
providerExpiresAt?: Date;
|
|
9
|
+
expiresAt?: Date;
|
|
10
|
+
}>;
|
|
11
|
+
onSuccess?: () => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const ExtendHoldModal: React.FC<ExtendHoldModalProps>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface PolicyGroup {
|
|
2
|
+
id: number;
|
|
3
|
+
active: boolean;
|
|
4
|
+
}
|
|
5
|
+
interface Props {
|
|
6
|
+
group: PolicyGroup;
|
|
7
|
+
onEdit: (group: PolicyGroup) => void;
|
|
8
|
+
onDelete: (id: number) => void;
|
|
9
|
+
onToggleStatus: (id: number) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const PolicyGroupActionMenu: ({ group, onEdit, onDelete, onToggleStatus }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
isOpen: boolean;
|
|
3
|
+
onClose: () => void;
|
|
4
|
+
onSubmit: (payload: any) => Promise<boolean>;
|
|
5
|
+
editingGroup: any | null;
|
|
6
|
+
loading: boolean;
|
|
7
|
+
tenants: any[];
|
|
8
|
+
}
|
|
9
|
+
export declare const PolicyGroupFormDialog: ({ isOpen, onClose, onSubmit, editingGroup, loading, tenants, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ISIMSearchFilters } from '../../types/sim.dto';
|
|
3
|
+
interface SIMSearchFormProps {
|
|
4
|
+
filters: ISIMSearchFilters;
|
|
5
|
+
onFiltersChange: (filters: ISIMSearchFilters) => void;
|
|
6
|
+
onSearch: () => void;
|
|
7
|
+
isLoading?: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare const SIMSearchForm: React.FC<SIMSearchFormProps>;
|
|
10
|
+
export default SIMSearchForm;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ISIMCard, ISIMSearchFilters } from '../../types/sim.dto';
|
|
3
|
+
interface SIMSelectionGridProps {
|
|
4
|
+
sims: ISIMCard[];
|
|
5
|
+
filters: ISIMSearchFilters;
|
|
6
|
+
selectedSims: ISIMCard[];
|
|
7
|
+
onSimSelect: (sim: ISIMCard | ISIMCard[]) => void;
|
|
8
|
+
onDeselectAll: () => void;
|
|
9
|
+
onHoldNumbers: () => void;
|
|
10
|
+
onShowMoreSearch: () => void;
|
|
11
|
+
onLimitChange: (newLimit: number) => void;
|
|
12
|
+
onBackToSearch: () => void;
|
|
13
|
+
isBooking?: boolean;
|
|
14
|
+
isSearching?: boolean;
|
|
15
|
+
}
|
|
16
|
+
declare const SIMSelectionGrid: React.FC<SIMSelectionGridProps>;
|
|
17
|
+
export default SIMSelectionGrid;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface Step {
|
|
3
|
+
id: string;
|
|
4
|
+
title: string;
|
|
5
|
+
description: string;
|
|
6
|
+
}
|
|
7
|
+
interface StepperProps {
|
|
8
|
+
steps: Step[];
|
|
9
|
+
currentStep: number;
|
|
10
|
+
onStepClick: (stepIndex: number) => void;
|
|
11
|
+
}
|
|
12
|
+
declare const CustomStepper: React.FC<StepperProps>;
|
|
13
|
+
export default CustomStepper;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
type SimTransactionStatus = 'created' | 'booked' | 'completed' | 'cancelled' | 'expired' | 'failed';
|
|
2
|
+
interface Props {
|
|
3
|
+
status: SimTransactionStatus;
|
|
4
|
+
}
|
|
5
|
+
export declare const SimTransactionStatusBadge: ({ status }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -9,6 +9,14 @@ export declare const ApiUrls: {
|
|
|
9
9
|
sendEmailVerification: string;
|
|
10
10
|
verifyEmail: string;
|
|
11
11
|
};
|
|
12
|
+
policyHandlers: {
|
|
13
|
+
list: string;
|
|
14
|
+
create: string;
|
|
15
|
+
detail: (id: number) => string;
|
|
16
|
+
update: (id: number) => string;
|
|
17
|
+
delete: (id: number) => string;
|
|
18
|
+
toggleStatus: (id: number) => string;
|
|
19
|
+
};
|
|
12
20
|
transactionHandlers: {
|
|
13
21
|
list: string;
|
|
14
22
|
getSignedUrls: string;
|
|
@@ -168,4 +176,30 @@ export declare const ApiUrls: {
|
|
|
168
176
|
markPaid: (id: number) => string;
|
|
169
177
|
reportIssue: (id: number) => string;
|
|
170
178
|
};
|
|
179
|
+
simHandlers: {
|
|
180
|
+
search: string;
|
|
181
|
+
book: string;
|
|
182
|
+
getBookedStatus: (orderId: string) => string;
|
|
183
|
+
list: string;
|
|
184
|
+
bookingList: string;
|
|
185
|
+
orderList: string;
|
|
186
|
+
simList: string;
|
|
187
|
+
transactionGrouped: string;
|
|
188
|
+
transactionGroupDetail: (groupPublicId: string) => string;
|
|
189
|
+
searchPackages: string;
|
|
190
|
+
searchDataPackages: string;
|
|
191
|
+
purchaseDataPackage: string;
|
|
192
|
+
dataOrderList: string;
|
|
193
|
+
bookedPhoneNumbers: string;
|
|
194
|
+
createOrder: string;
|
|
195
|
+
getProviderPricing: (providerName: string) => string;
|
|
196
|
+
calculatePricing: string;
|
|
197
|
+
bookedSims: string;
|
|
198
|
+
extendHold: string;
|
|
199
|
+
location: {
|
|
200
|
+
provinces: string;
|
|
201
|
+
wards: string;
|
|
202
|
+
streets: string;
|
|
203
|
+
};
|
|
204
|
+
};
|
|
171
205
|
};
|
|
@@ -32,5 +32,10 @@ export declare enum BusinessCodes {
|
|
|
32
32
|
INVALID_BID = "B_125",
|
|
33
33
|
ESIM_PACKAGE_NOT_FOUND = "B_030",
|
|
34
34
|
CREATE_ESIM_TRANSACTION_FAILED = "B_031",
|
|
35
|
+
SIM_TRANSACTION_NOT_FOUND = "B_060",
|
|
36
|
+
SIM_TRANSACTION_NOT_IN_BOOKED_STATUS = "B_061",
|
|
37
|
+
SIM_ORDER_CREATION_FAILED = "B_062",
|
|
38
|
+
SIM_PACKAGE_NOT_FOUND = "B_065",
|
|
39
|
+
SIM_TRANSACTION_GROUP_NOT_FOUND = "B_064",
|
|
35
40
|
BALANCE_INSUFFICIENT = "B_040"
|
|
36
41
|
}
|
package/types/constants/env.d.ts
CHANGED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare enum EPolicyScopeType {
|
|
2
|
+
GLOBAL = "global",
|
|
3
|
+
TENANT = "tenant",
|
|
4
|
+
DEPARTMENT = "department",
|
|
5
|
+
USER = "user"
|
|
6
|
+
}
|
|
7
|
+
export declare enum EPolicyTargetType {
|
|
8
|
+
FX = "fx",
|
|
9
|
+
SIM = "sim",
|
|
10
|
+
INSURANCE = "insurance",
|
|
11
|
+
ALL = "all"
|
|
12
|
+
}
|
|
13
|
+
export declare enum EPolicyActionType {
|
|
14
|
+
PERCENT = "percent",
|
|
15
|
+
FIXED = "fixed"
|
|
16
|
+
}
|
|
17
|
+
export declare enum EPolicyCombineStrategy {
|
|
18
|
+
STACK = "stack",
|
|
19
|
+
MAX = "max",
|
|
20
|
+
PRIORITY = "priority",
|
|
21
|
+
EXCLUSIVE = "exclusive"
|
|
22
|
+
}
|
|
23
|
+
export declare enum EPolicyType {
|
|
24
|
+
PRICING = "pricing",
|
|
25
|
+
COMMISSION = "commission",
|
|
26
|
+
DISCOUNT = "discount",
|
|
27
|
+
BONUS = "bonus"
|
|
28
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface DialogContextType {
|
|
3
|
+
registerDialog: (id: string, onClose: () => void, closeOnEsc: boolean) => void;
|
|
4
|
+
unregisterDialog: (id: string) => void;
|
|
5
|
+
isTopDialog: (id: string) => boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const DialogProvider: React.FC<{
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const useDialogStack: () => DialogContextType;
|
|
11
|
+
export {};
|
|
@@ -3,6 +3,7 @@ export type Option = {
|
|
|
3
3
|
value: string;
|
|
4
4
|
};
|
|
5
5
|
type ChakraSelectSearchableProps = {
|
|
6
|
+
loading?: boolean;
|
|
6
7
|
options: Option[];
|
|
7
8
|
value?: string | number | Option;
|
|
8
9
|
onChange: (value: Option) => void;
|
|
@@ -13,5 +14,5 @@ type ChakraSelectSearchableProps = {
|
|
|
13
14
|
control?: (base: React.CSSProperties) => React.CSSProperties;
|
|
14
15
|
};
|
|
15
16
|
};
|
|
16
|
-
export declare const GTSelectSearchable: ({ options, value, onChange, placeholder, styles, }: ChakraSelectSearchableProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare const GTSelectSearchable: ({ options, value, onChange, placeholder, styles, loading, }: ChakraSelectSearchableProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
18
|
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
interface BookedPhoneNumber {
|
|
2
|
+
id: string;
|
|
3
|
+
msisdn: string;
|
|
4
|
+
transactionId?: number;
|
|
5
|
+
bookingDate: string;
|
|
6
|
+
status: string;
|
|
7
|
+
provider: string;
|
|
8
|
+
paymentType: string;
|
|
9
|
+
customerName?: string;
|
|
10
|
+
customerPhone?: string;
|
|
11
|
+
expiresAt?: string;
|
|
12
|
+
orderAmount?: number;
|
|
13
|
+
}
|
|
14
|
+
interface BookedPhoneNumbersFilter {
|
|
15
|
+
paymentType?: 'prepaid' | 'postpaid';
|
|
16
|
+
provider?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare const useBookedPhoneNumbers: (filter?: BookedPhoneNumbersFilter) => {
|
|
19
|
+
bookedNumbers: BookedPhoneNumber[];
|
|
20
|
+
loading: boolean;
|
|
21
|
+
error: string | null;
|
|
22
|
+
refetch: () => Promise<void>;
|
|
23
|
+
};
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { IBookedSim } from '../types/response.dto';
|
|
2
|
+
interface UseBookedSimListParams {
|
|
3
|
+
defaultLimit?: number;
|
|
4
|
+
}
|
|
5
|
+
interface UseBookedSimListReturn {
|
|
6
|
+
bookedSims: IBookedSim[];
|
|
7
|
+
loading: boolean;
|
|
8
|
+
total: number;
|
|
9
|
+
page: number;
|
|
10
|
+
limit: number;
|
|
11
|
+
status: 'all' | 'expiring' | 'sold';
|
|
12
|
+
expiresIn: string;
|
|
13
|
+
searchText: string;
|
|
14
|
+
debouncedSearchText: string;
|
|
15
|
+
appliedStatus: string;
|
|
16
|
+
appliedExpiresIn: string;
|
|
17
|
+
appliedSearchText: string;
|
|
18
|
+
setPage: (page: number) => void;
|
|
19
|
+
setLimit: (limit: number) => void;
|
|
20
|
+
setStatus: (status: 'all' | 'expiring' | 'sold') => void;
|
|
21
|
+
setExpiresIn: (expiresIn: string) => void;
|
|
22
|
+
setSearchText: (searchText: string) => void;
|
|
23
|
+
handleApplyFilters: () => void;
|
|
24
|
+
handleClearFilters: () => void;
|
|
25
|
+
fetchBookedSims: () => Promise<void>;
|
|
26
|
+
}
|
|
27
|
+
export declare const useBookedSimList: ({ defaultLimit, }?: UseBookedSimListParams) => UseBookedSimListReturn;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export interface IDataOrder {
|
|
2
|
+
id: number;
|
|
3
|
+
phone: string;
|
|
4
|
+
packageCode: string;
|
|
5
|
+
packageName?: string;
|
|
6
|
+
amount: number;
|
|
7
|
+
status: string;
|
|
8
|
+
orderId?: string;
|
|
9
|
+
provider: string;
|
|
10
|
+
createdAt: string;
|
|
11
|
+
updatedAt: string;
|
|
12
|
+
}
|
|
13
|
+
interface GetDataOrderListParams {
|
|
14
|
+
page?: number;
|
|
15
|
+
limit?: number;
|
|
16
|
+
status?: string;
|
|
17
|
+
phone?: string;
|
|
18
|
+
packageCode?: string;
|
|
19
|
+
startDate?: string;
|
|
20
|
+
endDate?: string;
|
|
21
|
+
}
|
|
22
|
+
type Props = {
|
|
23
|
+
defaultLimit?: number;
|
|
24
|
+
defaultFilter?: GetDataOrderListParams | null;
|
|
25
|
+
};
|
|
26
|
+
export declare const useDataOrderList: ({ defaultLimit, defaultFilter }: Props) => {
|
|
27
|
+
orders: IDataOrder[];
|
|
28
|
+
total: number;
|
|
29
|
+
loading: boolean;
|
|
30
|
+
page: number;
|
|
31
|
+
limit: number;
|
|
32
|
+
refetchData: () => void;
|
|
33
|
+
setPage: import('react').Dispatch<import('react').SetStateAction<number>>;
|
|
34
|
+
setLimit: (limit: number) => void;
|
|
35
|
+
setFilter: import('react').Dispatch<import('react').SetStateAction<GetDataOrderListParams>>;
|
|
36
|
+
setLoading: import('react').Dispatch<import('react').SetStateAction<boolean>>;
|
|
37
|
+
};
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface IDataPackage {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
price: number;
|
|
5
|
+
code: string;
|
|
6
|
+
cycle: string;
|
|
7
|
+
description: string;
|
|
8
|
+
provider: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const useDataPackageSearch: () => {
|
|
11
|
+
packages: IDataPackage[];
|
|
12
|
+
loading: boolean;
|
|
13
|
+
purchaseLoading: boolean;
|
|
14
|
+
searched: boolean;
|
|
15
|
+
searchDataPackages: (phone: string, provider?: string) => Promise<void>;
|
|
16
|
+
buyPackage: (pkg: IDataPackage, phone: string) => Promise<boolean>;
|
|
17
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export interface PolicyDto {
|
|
2
|
+
name: string;
|
|
3
|
+
description?: string;
|
|
4
|
+
type: string;
|
|
5
|
+
conditions: Record<string, any>;
|
|
6
|
+
action: {
|
|
7
|
+
type: 'percent' | 'fixed';
|
|
8
|
+
value: number;
|
|
9
|
+
};
|
|
10
|
+
combineStrategy: string;
|
|
11
|
+
priority: number;
|
|
12
|
+
activeFrom?: string;
|
|
13
|
+
activeTo?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface PolicyGroup {
|
|
16
|
+
id: number;
|
|
17
|
+
name: string;
|
|
18
|
+
description?: string;
|
|
19
|
+
targetType: string;
|
|
20
|
+
scopeType: string;
|
|
21
|
+
scopeIds?: number[];
|
|
22
|
+
active: boolean;
|
|
23
|
+
policies?: any[];
|
|
24
|
+
createdAt: string;
|
|
25
|
+
updatedAt: string;
|
|
26
|
+
}
|
|
27
|
+
export interface CreatePolicyGroupPayload {
|
|
28
|
+
name: string;
|
|
29
|
+
description?: string;
|
|
30
|
+
targetType: string;
|
|
31
|
+
scopeType: string;
|
|
32
|
+
scopeIds?: number[];
|
|
33
|
+
policies: PolicyDto[];
|
|
34
|
+
active: boolean;
|
|
35
|
+
}
|
|
36
|
+
export declare const usePolicyGroups: (targetType?: string) => {
|
|
37
|
+
policyGroups: PolicyGroup[];
|
|
38
|
+
loading: boolean;
|
|
39
|
+
error: string | null;
|
|
40
|
+
fetchPolicyGroups: () => Promise<void>;
|
|
41
|
+
createPolicyGroup: (payload: CreatePolicyGroupPayload) => Promise<boolean>;
|
|
42
|
+
updatePolicyGroup: (id: number, payload: Partial<CreatePolicyGroupPayload>) => Promise<boolean>;
|
|
43
|
+
deletePolicyGroup: (id: number) => Promise<boolean>;
|
|
44
|
+
toggleStatus: (id: number) => Promise<boolean>;
|
|
45
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface ProviderPricing {
|
|
2
|
+
activationFee: number;
|
|
3
|
+
eSimPrice: number;
|
|
4
|
+
physicalSimPrice: number;
|
|
5
|
+
shippingFee: number;
|
|
6
|
+
currency: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const useProviderPricing: (providerName: string) => {
|
|
9
|
+
pricing: ProviderPricing | null;
|
|
10
|
+
loading: boolean;
|
|
11
|
+
error: string | null;
|
|
12
|
+
refetch: () => void;
|
|
13
|
+
};
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export interface ISimGridItem {
|
|
2
|
+
id: number;
|
|
3
|
+
msisdn: string;
|
|
4
|
+
status: 'booked' | 'completed' | 'failed' | 'not_purchased';
|
|
5
|
+
provider: string;
|
|
6
|
+
simType: string;
|
|
7
|
+
orderAmount?: number;
|
|
8
|
+
createdAt: string;
|
|
9
|
+
updatedAt: string;
|
|
10
|
+
transactionId?: number;
|
|
11
|
+
groupPublicId?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface GetSimGridListRespDto {
|
|
14
|
+
sims: ISimGridItem[];
|
|
15
|
+
total: number;
|
|
16
|
+
}
|
|
17
|
+
export interface GetSimGridListReqDto {
|
|
18
|
+
page?: number;
|
|
19
|
+
limit?: number;
|
|
20
|
+
status?: string;
|
|
21
|
+
search?: string;
|
|
22
|
+
startDate?: string;
|
|
23
|
+
endDate?: string;
|
|
24
|
+
}
|
|
25
|
+
type Props = {
|
|
26
|
+
defaultLimit?: number;
|
|
27
|
+
defaultFilter?: GetSimGridListReqDto | null;
|
|
28
|
+
startDate?: string | null;
|
|
29
|
+
endDate?: string | null;
|
|
30
|
+
};
|
|
31
|
+
export declare const useSimGridList: ({ defaultLimit, defaultFilter, startDate, endDate }: Props) => {
|
|
32
|
+
sims: ISimGridItem[];
|
|
33
|
+
total: number;
|
|
34
|
+
loading: boolean;
|
|
35
|
+
page: number;
|
|
36
|
+
limit: number;
|
|
37
|
+
refetchData: () => void;
|
|
38
|
+
setPage: import('react').Dispatch<import('react').SetStateAction<number>>;
|
|
39
|
+
setLimit: (limit: number) => void;
|
|
40
|
+
setFilter: import('react').Dispatch<import('react').SetStateAction<GetSimGridListReqDto>>;
|
|
41
|
+
setLoading: import('react').Dispatch<import('react').SetStateAction<boolean>>;
|
|
42
|
+
};
|
|
43
|
+
export {};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { ISIMCard } from '../types/sim.dto';
|
|
2
|
+
interface SearchCondition {
|
|
3
|
+
action: 'include' | 'exclude';
|
|
4
|
+
type: 'starts_with' | 'ends_with' | 'contains';
|
|
5
|
+
value: string;
|
|
6
|
+
}
|
|
7
|
+
interface SearchSimsRequest {
|
|
8
|
+
conditions?: SearchCondition[];
|
|
9
|
+
provider: string;
|
|
10
|
+
simType?: string;
|
|
11
|
+
limit?: number;
|
|
12
|
+
page?: number;
|
|
13
|
+
}
|
|
14
|
+
interface BookSimsRequest {
|
|
15
|
+
sims: Array<{
|
|
16
|
+
msisdn: string;
|
|
17
|
+
additionalData?: Record<string, any>;
|
|
18
|
+
}>;
|
|
19
|
+
provider: string;
|
|
20
|
+
simType?: string;
|
|
21
|
+
}
|
|
22
|
+
interface BookedStatusResponse {
|
|
23
|
+
orderId: string;
|
|
24
|
+
progress: number;
|
|
25
|
+
currentStep: number;
|
|
26
|
+
totalSteps: number;
|
|
27
|
+
status: string;
|
|
28
|
+
transactions: Record<string, any[]>;
|
|
29
|
+
summary: {
|
|
30
|
+
total: number;
|
|
31
|
+
completed: number;
|
|
32
|
+
cancelled: number;
|
|
33
|
+
failed: number;
|
|
34
|
+
booked: number;
|
|
35
|
+
created: number;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export declare const useSimHandlers: () => {
|
|
39
|
+
searchSims: (request: SearchSimsRequest) => Promise<{
|
|
40
|
+
data: ISIMCard[];
|
|
41
|
+
totalCount: number;
|
|
42
|
+
totalPages: number;
|
|
43
|
+
page: number;
|
|
44
|
+
limit: number;
|
|
45
|
+
}>;
|
|
46
|
+
bookSims: (request: BookSimsRequest) => Promise<{
|
|
47
|
+
successfulBookings: any[];
|
|
48
|
+
failedBookings: any[];
|
|
49
|
+
totalBooked: number;
|
|
50
|
+
totalFailed: number;
|
|
51
|
+
groupPublicId?: string;
|
|
52
|
+
}>;
|
|
53
|
+
getBookedStatus: (orderId: string) => Promise<BookedStatusResponse>;
|
|
54
|
+
isSearching: boolean;
|
|
55
|
+
isBooking: boolean;
|
|
56
|
+
isLoadingStatus: boolean;
|
|
57
|
+
};
|
|
58
|
+
export {};
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
export declare enum PaymentType {
|
|
2
|
+
PREPAID = "PREPAID",
|
|
3
|
+
POSTPAID = "POSTPAID"
|
|
4
|
+
}
|
|
5
|
+
export declare enum PackageType {
|
|
6
|
+
HOT = "HOT",
|
|
7
|
+
DATA = "DATA",
|
|
8
|
+
COMBO = "COMBO",
|
|
9
|
+
ON_DEMAND = "ON_DEMAND"
|
|
10
|
+
}
|
|
11
|
+
export declare enum PriceRange {
|
|
12
|
+
UNDER_50K = "UNDER_50K",
|
|
13
|
+
FIFTY_TO_100K = "FIFTY_TO_100K",
|
|
14
|
+
HUNDRED_TO_150K = "HUNDRED_TO_150K",
|
|
15
|
+
HUNDRED_FIFTY_TO_200K = "HUNDRED_FIFTY_TO_200K",
|
|
16
|
+
OVER_200K = "OVER_200K"
|
|
17
|
+
}
|
|
18
|
+
export declare enum DataRange {
|
|
19
|
+
TWO_TO_FIVE_GB = "TWO_TO_FIVE_GB",
|
|
20
|
+
ONE_GB_PER_DAY = "ONE_GB_PER_DAY",
|
|
21
|
+
TWO_GB_PER_DAY = "TWO_GB_PER_DAY",
|
|
22
|
+
THREE_GB_PER_DAY = "THREE_GB_PER_DAY",
|
|
23
|
+
FIVE_GB_PER_DAY = "FIVE_GB_PER_DAY",
|
|
24
|
+
TEN_GB_PER_DAY = "TEN_GB_PER_DAY",
|
|
25
|
+
ONE_GB_PER_MONTH = "ONE_GB_PER_MONTH",
|
|
26
|
+
TWO_GB_PER_MONTH = "TWO_GB_PER_MONTH",
|
|
27
|
+
FIVE_GB_PER_MONTH = "FIVE_GB_PER_MONTH",
|
|
28
|
+
TEN_GB_PER_MONTH = "TEN_GB_PER_MONTH"
|
|
29
|
+
}
|
|
30
|
+
export declare enum CallRange {
|
|
31
|
+
UNDER_100P = "UNDER_100P",
|
|
32
|
+
HUNDRED_TO_200P = "HUNDRED_TO_200P",
|
|
33
|
+
THIRTY_TO_50P = "THIRTY_TO_50P",
|
|
34
|
+
SIXTY_TO_100P = "SIXTY_TO_100P",
|
|
35
|
+
HUNDRED_FIFTY_TO_200P = "HUNDRED_FIFTY_TO_200P",
|
|
36
|
+
OVER_250P = "OVER_250P",
|
|
37
|
+
THOUSAND_TO_1500P = "THOUSAND_TO_1500P",
|
|
38
|
+
OVER_2000P = "OVER_2000P"
|
|
39
|
+
}
|
|
40
|
+
export declare const DISPLAY_MAPPINGS: {
|
|
41
|
+
readonly paymentType: {
|
|
42
|
+
readonly PREPAID: "Trả trước";
|
|
43
|
+
readonly POSTPAID: "Trả sau";
|
|
44
|
+
};
|
|
45
|
+
readonly packageType: {
|
|
46
|
+
readonly HOT: "HOT";
|
|
47
|
+
readonly DATA: "DATA";
|
|
48
|
+
readonly COMBO: "COMBO";
|
|
49
|
+
readonly ON_DEMAND: "Theo nhu cầu";
|
|
50
|
+
};
|
|
51
|
+
readonly priceRange: {
|
|
52
|
+
readonly UNDER_50K: "<50k";
|
|
53
|
+
readonly FIFTY_TO_100K: "50k-100k";
|
|
54
|
+
readonly HUNDRED_TO_150K: "100k-150k";
|
|
55
|
+
readonly HUNDRED_FIFTY_TO_200K: "150k-200k";
|
|
56
|
+
readonly OVER_200K: ">200k";
|
|
57
|
+
};
|
|
58
|
+
readonly dataRange: {
|
|
59
|
+
readonly TWO_TO_FIVE_GB: "2GB - 5GB";
|
|
60
|
+
readonly ONE_GB_PER_DAY: "1GB/ngày";
|
|
61
|
+
readonly TWO_GB_PER_DAY: "2GB/ngày";
|
|
62
|
+
readonly THREE_GB_PER_DAY: "3GB/ngày";
|
|
63
|
+
readonly FIVE_GB_PER_DAY: "5GB/ngày";
|
|
64
|
+
readonly TEN_GB_PER_DAY: "10GB/ngày";
|
|
65
|
+
readonly ONE_GB_PER_MONTH: "1GB/n";
|
|
66
|
+
readonly TWO_GB_PER_MONTH: "2GB/n";
|
|
67
|
+
readonly FIVE_GB_PER_MONTH: "5GB/n";
|
|
68
|
+
readonly TEN_GB_PER_MONTH: "10GB/n";
|
|
69
|
+
};
|
|
70
|
+
readonly callRange: {
|
|
71
|
+
readonly UNDER_100P: "<100p";
|
|
72
|
+
readonly HUNDRED_TO_200P: "100 - 200p";
|
|
73
|
+
readonly THIRTY_TO_50P: "30 - 50p";
|
|
74
|
+
readonly SIXTY_TO_100P: "60 - 100p";
|
|
75
|
+
readonly HUNDRED_FIFTY_TO_200P: "150 - 200p";
|
|
76
|
+
readonly OVER_250P: ">250p";
|
|
77
|
+
readonly THOUSAND_TO_1500P: "1000 - 1500";
|
|
78
|
+
readonly OVER_2000P: ">2000p";
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
export interface SimPackage {
|
|
82
|
+
id: number;
|
|
83
|
+
name: string;
|
|
84
|
+
price: number;
|
|
85
|
+
description: string;
|
|
86
|
+
paymentType: string;
|
|
87
|
+
cycle: string;
|
|
88
|
+
status: string;
|
|
89
|
+
provider: string;
|
|
90
|
+
summary: string;
|
|
91
|
+
additionalData: any;
|
|
92
|
+
}
|
|
93
|
+
interface PackageFilters {
|
|
94
|
+
paymentType?: PaymentType;
|
|
95
|
+
packageType?: PackageType;
|
|
96
|
+
priceRange?: PriceRange;
|
|
97
|
+
prepaidData?: DataRange;
|
|
98
|
+
postpaidData?: DataRange;
|
|
99
|
+
prepaidInNetworkCalls?: CallRange;
|
|
100
|
+
postpaidInNetworkCalls?: CallRange;
|
|
101
|
+
prepaidOutNetworkCalls?: CallRange;
|
|
102
|
+
postpaidOutNetworkCalls?: CallRange;
|
|
103
|
+
}
|
|
104
|
+
interface UseSimPackageListProps {
|
|
105
|
+
defaultLimit?: number;
|
|
106
|
+
defaultFilters?: PackageFilters;
|
|
107
|
+
}
|
|
108
|
+
export declare const useSimPackageList: ({ defaultLimit, defaultFilters, }: UseSimPackageListProps) => {
|
|
109
|
+
packages: SimPackage[];
|
|
110
|
+
total: number;
|
|
111
|
+
loading: boolean;
|
|
112
|
+
loadingMore: boolean;
|
|
113
|
+
page: number;
|
|
114
|
+
limit: number;
|
|
115
|
+
filters: PackageFilters;
|
|
116
|
+
hasMoreResults: boolean;
|
|
117
|
+
setPage: (newPage: number) => void;
|
|
118
|
+
setLimit: (newLimit: number) => void;
|
|
119
|
+
setFilter: (newFilters: PackageFilters) => void;
|
|
120
|
+
refetchData: (isLoadMore?: boolean) => Promise<void>;
|
|
121
|
+
loadMore: () => Promise<void>;
|
|
122
|
+
};
|
|
123
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface SimPricingDetail {
|
|
2
|
+
simNumber: string;
|
|
3
|
+
finalPrice: number;
|
|
4
|
+
currency: string;
|
|
5
|
+
breakdown: {
|
|
6
|
+
activationFee: number;
|
|
7
|
+
baseSimPrice: number;
|
|
8
|
+
finalSimPrice: number;
|
|
9
|
+
simPriceAdjustment: number;
|
|
10
|
+
shippingFee: number;
|
|
11
|
+
packagePrice: number;
|
|
12
|
+
total: number;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export interface CalculateSimPricingResponse {
|
|
16
|
+
success: boolean;
|
|
17
|
+
data: SimPricingDetail[];
|
|
18
|
+
totalAmount: number;
|
|
19
|
+
}
|
|
20
|
+
interface CalculateSimPricingRequest {
|
|
21
|
+
simNumbers: string[];
|
|
22
|
+
provider: string;
|
|
23
|
+
simType: string;
|
|
24
|
+
packagePrice?: number;
|
|
25
|
+
}
|
|
26
|
+
export declare const useSimPricing: () => {
|
|
27
|
+
calculatePricing: (request: CalculateSimPricingRequest) => Promise<CalculateSimPricingResponse>;
|
|
28
|
+
loading: boolean;
|
|
29
|
+
};
|
|
30
|
+
export {};
|