@opexa/portal-components 0.0.123 → 0.0.125
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/dist/components/BetRecords/BetRecords.client.d.ts +13 -0
- package/dist/components/BetRecords/BetRecords.client.js +9 -1
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositContext.d.ts +2 -2
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/useOnlineBankDeposit.d.ts +1 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositContext.d.ts +2 -2
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/useQRPHDeposit.d.ts +1 -1
- package/dist/components/FavoriteGames/FavoriteGames.client.d.ts +7 -1
- package/dist/components/FavoriteGames/FavoriteGames.client.js +24 -5
- package/dist/components/ForgotPassword/ForgotPasswordForm.js +14 -7
- package/dist/components/GameLaunch/GameLaunch.lazy.js +25 -2
- package/dist/components/Games/Game.js +25 -2
- package/dist/components/Jackpots/JackpotsList/JackpotsList.d.ts +12 -1
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemGameProviders.js +14 -7
- package/dist/components/KYC/CaptureSelfie.js +5 -3
- package/dist/components/SignIn/MobileNumberSignIn.js +14 -6
- package/dist/components/SignIn/NameAndPasswordSignIn.js +1 -1
- package/dist/components/SignUp/SignUpForm.js +21 -10
- package/dist/components/Tournaments/TournamentsList/TournamentsList.d.ts +12 -1
- package/dist/components/Tournaments/TournamentsList/TournamentsListItemGameProviders.js +11 -1
- package/dist/components/TransactionRecords/DepositRecordsTable.js +29 -17
- package/dist/components/TransactionRecords/TableFilters.d.ts +5 -1
- package/dist/components/TransactionRecords/TableFilters.js +105 -31
- package/dist/components/TransactionRecords/TransactionRecordsTable.js +21 -9
- package/dist/components/TransactionRecords/WithdrawalRecordsTable.js +29 -17
- package/dist/services/queries.d.ts +5 -5
- package/dist/services/queries.js +13 -18
- package/dist/services/trigger.js +2 -2
- package/dist/services/wallet.d.ts +7 -6
- package/dist/services/wallet.js +14 -12
- package/dist/ui/AlertDialog/AlertDialog.d.ts +121 -121
- package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +11 -11
- package/dist/ui/Avatar/Avatar.d.ts +9 -9
- package/dist/ui/Avatar/avatar.recipe.d.ts +3 -3
- package/dist/ui/Badge/Badge.d.ts +12 -12
- package/dist/ui/Badge/badge.anatomy.d.ts +1 -1
- package/dist/ui/Badge/badge.recipe.d.ts +3 -3
- package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
- package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
- package/dist/ui/Collapsible/Collapsible.d.ts +32 -32
- package/dist/ui/Collapsible/collapsible.recipe.d.ts +8 -8
- package/dist/ui/Combobox/Combobox.d.ts +42 -42
- package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
- package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
- package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
- package/dist/ui/Dialog/Dialog.d.ts +121 -121
- package/dist/ui/Dialog/dialog.recipe.d.ts +11 -11
- package/dist/ui/Drawer/Drawer.d.ts +33 -33
- package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
- package/dist/ui/Field/Field.d.ts +21 -21
- package/dist/ui/Field/field.recipe.d.ts +3 -3
- package/dist/ui/Menu/Menu.d.ts +252 -252
- package/dist/ui/Menu/menu.recipe.d.ts +14 -14
- package/dist/ui/NumberInput/NumberInput.d.ts +24 -24
- package/dist/ui/NumberInput/numberInput.recipe.d.ts +3 -3
- package/dist/ui/Popover/Popover.d.ts +121 -121
- package/dist/ui/Popover/popover.recipe.d.ts +11 -11
- package/dist/ui/Progress/Progress.d.ts +27 -27
- package/dist/ui/Progress/progress.recipe.d.ts +3 -3
- package/dist/ui/QrCode/QrCode.d.ts +25 -25
- package/dist/ui/QrCode/qrCode.recipe.d.ts +5 -5
- package/dist/ui/SegmentGroup/SegmentGroup.d.ts +18 -18
- package/dist/ui/SegmentGroup/segmentGroup.recipe.d.ts +3 -3
- package/dist/ui/Select/Select.d.ts +45 -45
- package/dist/ui/Select/select.recipe.d.ts +3 -3
- package/dist/ui/Table/Table.d.ts +21 -21
- package/dist/ui/Table/table.anatomy.d.ts +1 -1
- package/dist/ui/Table/table.recipe.d.ts +3 -3
- package/dist/ui/Tabs/Tabs.d.ts +15 -15
- package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { tz, TZDateMini } from '@date-fns/tz';
|
|
4
4
|
import { endOfDay, format, startOfDay } from 'date-fns';
|
|
5
|
-
import {
|
|
5
|
+
import { useReducer } from 'react';
|
|
6
6
|
import { twMerge } from 'tailwind-merge';
|
|
7
7
|
import { useDepositRecordsQuery } from '../../client/hooks/useDepositRecordsQuery.js';
|
|
8
8
|
import { useInfiniteQueryHelper } from '../../client/hooks/useInfiniteQueryHelper.js';
|
|
@@ -19,37 +19,49 @@ import { formatNumber } from '../../utils/formatNumber.js';
|
|
|
19
19
|
import { Empty } from '../shared/Empty.js';
|
|
20
20
|
import { TableFilters } from './TableFilters.js';
|
|
21
21
|
export function DepositRecordsTable() {
|
|
22
|
-
const [
|
|
23
|
-
|
|
22
|
+
const [state, setState] = useReducer((prev, next) => ({
|
|
23
|
+
...prev,
|
|
24
|
+
...next,
|
|
25
|
+
}), {});
|
|
24
26
|
const localeInfo = useLocaleInfo();
|
|
25
27
|
const { page, hasNextPage, hasPrevPage, next, prev, rows, totalPages, loading, firstPage, } = useInfiniteQueryHelper(useDepositRecordsQuery, {
|
|
26
28
|
filter: {
|
|
27
|
-
...(
|
|
29
|
+
...(state.type && {
|
|
30
|
+
type: {
|
|
31
|
+
equal: state.type,
|
|
32
|
+
},
|
|
33
|
+
}),
|
|
34
|
+
...(state.status && {
|
|
28
35
|
status: {
|
|
29
|
-
equal:
|
|
36
|
+
equal: state.status,
|
|
30
37
|
},
|
|
31
38
|
}),
|
|
32
|
-
...(timestamp && {
|
|
39
|
+
...(state.timestamp && {
|
|
33
40
|
dateTimeCreated: {
|
|
34
|
-
...(timestamp.start && {
|
|
35
|
-
greaterThanOrEqual: new TZDateMini(startOfDay(timestamp.start), localeInfo.timezone).toISOString(),
|
|
41
|
+
...(state.timestamp.start && {
|
|
42
|
+
greaterThanOrEqual: new TZDateMini(startOfDay(state.timestamp.start), localeInfo.timezone).toISOString(),
|
|
36
43
|
}),
|
|
37
|
-
...(timestamp.end && {
|
|
38
|
-
lesserThanOrEqual: new TZDateMini(endOfDay(timestamp.end), localeInfo.timezone).toISOString(),
|
|
44
|
+
...(state.timestamp.end && {
|
|
45
|
+
lesserThanOrEqual: new TZDateMini(endOfDay(state.timestamp.end), localeInfo.timezone).toISOString(),
|
|
39
46
|
}),
|
|
40
47
|
},
|
|
41
48
|
}),
|
|
42
49
|
},
|
|
43
50
|
});
|
|
44
|
-
return (_jsxs(_Fragment, { children: [_jsx(TableFilters, {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
depositStatus,
|
|
51
|
+
return (_jsxs(_Fragment, { children: [_jsx(TableFilters, { value: {
|
|
52
|
+
timestamp: state.timestamp,
|
|
53
|
+
depositType: state.type,
|
|
54
|
+
depositStatus: state.status,
|
|
49
55
|
}, onChange: (value) => {
|
|
56
|
+
setState({
|
|
57
|
+
type: value.depositType,
|
|
58
|
+
status: value.depositStatus,
|
|
59
|
+
timestamp: value.timestamp,
|
|
60
|
+
});
|
|
50
61
|
firstPage();
|
|
51
|
-
|
|
52
|
-
|
|
62
|
+
}, enabledFilters: {
|
|
63
|
+
depositType: true,
|
|
64
|
+
depositStatus: true,
|
|
53
65
|
} }), rows.length <= 0 && (_jsx(Empty, { icon: loading ? SpinnerIcon : File02Icon, title: loading ? 'Just a moment' : 'No data', message: loading
|
|
54
66
|
? 'Fetching latest deposit records...'
|
|
55
67
|
: 'No data is currently available.', className: "mt-5xl" })), rows.length >= 1 && (_jsxs("div", { className: twMerge('mt-xl', 'border-y', 'border-border-secondary', 'bleed', 'lg:not-bleed', 'lg:mt-3xl', 'lg:w-full', 'lg:rounded-xl', 'lg:border-x'), children: [_jsx("div", { className: "border-border-secondary scrollbar-thumb:bg-bg-quaternary scrollbar-track:bg-transparent scrollbar:h-2 scrollbar-thumb:rounded-full overflow-hidden overflow-x-auto rounded-none border-b lg:rounded-t-xl", children: _jsxs(Table.Root, { className: "border-0", children: [_jsx(Table.Header, { children: _jsxs(Table.Row, { children: [_jsx(Table.Heading, { children: "Deposit No." }), _jsx(Table.Heading, { children: "Reference" }), _jsx(Table.Heading, { children: "Deposit Method" }), _jsx(Table.Heading, { children: "Applied Amount" }), _jsx(Table.Heading, { children: "Recieved Amount" }), _jsx(Table.Heading, { children: "Transaction Fee" }), _jsx(Table.Heading, { children: "Deposit Time" }), _jsx(Table.Heading, { children: "Recieved Time" }), _jsx(Table.Heading, { children: "Status" })] }) }), _jsx(Table.Body, { children: rows.map((data) => (_jsxs(Table.Row, { children: [_jsx(Table.Cell, { className: "!py-1", children: data.depositNumber }), _jsx(Table.Cell, { className: "!py-1", children: data.reference }), _jsx(Table.Cell, { className: "!py-1", children: capitalize(data.type, {
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import type { DateRange, DepositStatus, TransactionType, WithdrawalStatus } from '../../types';
|
|
1
|
+
import type { DateRange, DepositStatus, DepositType, TransactionType, WithdrawalStatus, WithdrawalType } from '../../types';
|
|
2
2
|
interface EnabledFilters {
|
|
3
3
|
timestamp?: boolean;
|
|
4
|
+
depositType?: boolean;
|
|
4
5
|
depositStatus?: boolean;
|
|
6
|
+
withdrawalType?: boolean;
|
|
5
7
|
withdrawalStatus?: boolean;
|
|
6
8
|
transactionType?: boolean;
|
|
7
9
|
}
|
|
8
10
|
interface Value {
|
|
9
11
|
timestamp?: Partial<DateRange> | null;
|
|
12
|
+
depositType?: DepositType | null;
|
|
10
13
|
depositStatus?: DepositStatus | null;
|
|
14
|
+
withdrawalType?: WithdrawalType | null;
|
|
11
15
|
withdrawalStatus?: WithdrawalStatus | null;
|
|
12
16
|
transactionType?: TransactionType | null;
|
|
13
17
|
}
|
|
@@ -15,6 +15,20 @@ import { SegmentGroup } from '../../ui/SegmentGroup/index.js';
|
|
|
15
15
|
import { Select } from '../../ui/Select/index.js';
|
|
16
16
|
import { capitalize } from '../../utils/capitalize.js';
|
|
17
17
|
const TabDefinition = z.enum(['all', 'today', 'custom']).catch('all');
|
|
18
|
+
const DEPOSIT_TYPES = [
|
|
19
|
+
'BANK',
|
|
20
|
+
'GCASH',
|
|
21
|
+
'MAYA',
|
|
22
|
+
'MANUAL_UPI',
|
|
23
|
+
'ONLINE_BANK',
|
|
24
|
+
];
|
|
25
|
+
const DEPOSIT_TYPES_MAP = {
|
|
26
|
+
BANK: 'Bank',
|
|
27
|
+
GCASH: 'GCash',
|
|
28
|
+
MAYA: 'Maya',
|
|
29
|
+
MANUAL_UPI: 'Manual',
|
|
30
|
+
ONLINE_BANK: 'Online Bank',
|
|
31
|
+
};
|
|
18
32
|
const DEPOSIT_STATUSES = [
|
|
19
33
|
'ACCEPTED',
|
|
20
34
|
'APPROVED',
|
|
@@ -24,6 +38,20 @@ const DEPOSIT_STATUSES = [
|
|
|
24
38
|
'PENDING',
|
|
25
39
|
'REJECTED',
|
|
26
40
|
];
|
|
41
|
+
const WITHDRAWAL_TYPES = [
|
|
42
|
+
'BANK',
|
|
43
|
+
'GCASH',
|
|
44
|
+
'INSTAPAY',
|
|
45
|
+
'MAYA_APP',
|
|
46
|
+
'MANUAL_UPI',
|
|
47
|
+
];
|
|
48
|
+
const WITHDRAWAL_TYPES_MAP = {
|
|
49
|
+
BANK: 'Bank',
|
|
50
|
+
GCASH: 'GCash',
|
|
51
|
+
INSTAPAY: 'Instapay',
|
|
52
|
+
MAYA_APP: 'Maya App',
|
|
53
|
+
MANUAL_UPI: 'Manual',
|
|
54
|
+
};
|
|
27
55
|
const WITHDRAWAL_STATUSES = [
|
|
28
56
|
'ACCEPTED',
|
|
29
57
|
'APPROVED',
|
|
@@ -37,36 +65,56 @@ const TRANSACTION_TYPES = [
|
|
|
37
65
|
'DEPOSIT',
|
|
38
66
|
'WITHDRAWAL',
|
|
39
67
|
'BET',
|
|
68
|
+
'PAYOUT',
|
|
69
|
+
'BONUS',
|
|
40
70
|
];
|
|
71
|
+
const TRANSACTION_TYPES_MAP = {
|
|
72
|
+
DEPOSIT: 'Deposit',
|
|
73
|
+
WITHDRAWAL: 'Withdrawal',
|
|
74
|
+
BET: 'Bet',
|
|
75
|
+
PAYOUT: 'Win',
|
|
76
|
+
BONUS: 'Bonus',
|
|
77
|
+
};
|
|
41
78
|
const deviceTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
79
|
+
const depositTypeCollection = createListCollection({
|
|
80
|
+
items: DEPOSIT_TYPES,
|
|
81
|
+
itemToValue: (item) => item,
|
|
82
|
+
itemToString: (item) => DEPOSIT_TYPES_MAP[item],
|
|
83
|
+
});
|
|
84
|
+
const depositStatusCollection = createListCollection({
|
|
85
|
+
items: DEPOSIT_STATUSES,
|
|
86
|
+
itemToValue: (item) => item,
|
|
87
|
+
itemToString: (item) => capitalize(item, {
|
|
88
|
+
delimiter: capitalize.delimiters.UNDERSCORE,
|
|
89
|
+
}),
|
|
90
|
+
});
|
|
91
|
+
const withdrawalTypeCollection = createListCollection({
|
|
92
|
+
items: WITHDRAWAL_TYPES,
|
|
93
|
+
itemToValue: (item) => item,
|
|
94
|
+
itemToString: (item) => WITHDRAWAL_TYPES_MAP[item],
|
|
95
|
+
});
|
|
96
|
+
const withdrawalStatusCollection = createListCollection({
|
|
97
|
+
items: WITHDRAWAL_STATUSES,
|
|
98
|
+
itemToValue: (item) => item,
|
|
99
|
+
itemToString: (item) => capitalize(item, {
|
|
100
|
+
delimiter: capitalize.delimiters.UNDERSCORE,
|
|
101
|
+
}),
|
|
102
|
+
});
|
|
103
|
+
const transactionTypeCollection = createListCollection({
|
|
104
|
+
items: TRANSACTION_TYPES,
|
|
105
|
+
itemToValue: (item) => item,
|
|
106
|
+
itemToString: (item) => TRANSACTION_TYPES_MAP[item],
|
|
107
|
+
});
|
|
42
108
|
export function TableFilters(props) {
|
|
43
|
-
const depositStatusCollection = createListCollection({
|
|
44
|
-
items: DEPOSIT_STATUSES,
|
|
45
|
-
itemToValue: (item) => item,
|
|
46
|
-
itemToString: (item) => capitalize(item, {
|
|
47
|
-
delimiter: capitalize.delimiters.UNDERSCORE,
|
|
48
|
-
}),
|
|
49
|
-
});
|
|
50
|
-
const withdrawalStatusCollection = createListCollection({
|
|
51
|
-
items: WITHDRAWAL_STATUSES,
|
|
52
|
-
itemToValue: (item) => item,
|
|
53
|
-
itemToString: (item) => capitalize(item, {
|
|
54
|
-
delimiter: capitalize.delimiters.UNDERSCORE,
|
|
55
|
-
}),
|
|
56
|
-
});
|
|
57
|
-
const transactionTypeCollection = createListCollection({
|
|
58
|
-
items: TRANSACTION_TYPES,
|
|
59
|
-
itemToValue: (item) => item,
|
|
60
|
-
itemToString: (item) => capitalize(item, {
|
|
61
|
-
delimiter: capitalize.delimiters.UNDERSCORE,
|
|
62
|
-
}),
|
|
63
|
-
});
|
|
64
109
|
const [tab, setTab] = useState('all');
|
|
65
110
|
const handleChange = (next) => {
|
|
66
111
|
const prev = {
|
|
67
112
|
timestamp,
|
|
113
|
+
depositType,
|
|
68
114
|
depositStatus,
|
|
115
|
+
withdrawalType,
|
|
69
116
|
withdrawalStatus,
|
|
117
|
+
transactionType,
|
|
70
118
|
};
|
|
71
119
|
props.onChange?.({
|
|
72
120
|
...prev,
|
|
@@ -80,6 +128,13 @@ export function TableFilters(props) {
|
|
|
80
128
|
handleChange({ timestamp });
|
|
81
129
|
},
|
|
82
130
|
});
|
|
131
|
+
const [depositType, setdepositType] = useControllableState({
|
|
132
|
+
value: props.value?.depositType,
|
|
133
|
+
defaultValue: props.defaultValue?.depositType ?? null,
|
|
134
|
+
onChange(depositType) {
|
|
135
|
+
handleChange({ depositType });
|
|
136
|
+
},
|
|
137
|
+
});
|
|
83
138
|
const [depositStatus, setDepositStatus] = useControllableState({
|
|
84
139
|
value: props.value?.depositStatus,
|
|
85
140
|
defaultValue: props.defaultValue?.depositStatus ?? null,
|
|
@@ -87,6 +142,13 @@ export function TableFilters(props) {
|
|
|
87
142
|
handleChange({ depositStatus });
|
|
88
143
|
},
|
|
89
144
|
});
|
|
145
|
+
const [withdrawalType, setWithdrawalType] = useControllableState({
|
|
146
|
+
value: props.value?.withdrawalType,
|
|
147
|
+
defaultValue: props.defaultValue?.withdrawalType ?? null,
|
|
148
|
+
onChange(withdrawalType) {
|
|
149
|
+
handleChange({ withdrawalType });
|
|
150
|
+
},
|
|
151
|
+
});
|
|
90
152
|
const [withdrawalStatus, setWithdrawalStatus] = useControllableState({
|
|
91
153
|
value: props.value?.withdrawalStatus,
|
|
92
154
|
defaultValue: props.defaultValue?.withdrawalStatus ?? null,
|
|
@@ -130,7 +192,16 @@ export function TableFilters(props) {
|
|
|
130
192
|
setTimestamp(null);
|
|
131
193
|
}
|
|
132
194
|
setTab(value);
|
|
133
|
-
}, className: "w-full lg:w-fit", children: [_jsxs(SegmentGroup.Item, { value: "all", className: "w-full lg:w-auto", children: [_jsx(SegmentGroup.ItemText, { children: "All" }), _jsx(SegmentGroup.ItemControl, {}), _jsx(SegmentGroup.ItemHiddenInput, {})] }), _jsxs(SegmentGroup.Item, { value: "today", className: "w-full lg:w-auto", children: [_jsx(SegmentGroup.ItemText, { children: "Today" }), _jsx(SegmentGroup.ItemControl, {}), _jsx(SegmentGroup.ItemHiddenInput, {})] }), _jsx(DatePicker.Context, { children: (api) => (_jsx(SegmentGroup.Item, { value: "custom", onClick: () => api.setOpen(true), className: "w-full lg:w-auto", children: _jsxs(DatePicker.Control, { children: [_jsx(SegmentGroup.ItemText, { children: "Custom" }), _jsx(SegmentGroup.ItemControl, {}), _jsx(SegmentGroup.ItemHiddenInput, {})] }) })) }), _jsx(SegmentGroup.Indicator, {})] }), _jsx(Portal, { children: _jsx(DatePicker.Positioner, { children: _jsx(DatePicker.Content, { children: _jsx(DatePicker.View, { view: "day", children: _jsx(DatePicker.Context, { children: (api) => (_jsxs(_Fragment, { children: [_jsxs(DatePicker.ViewControl, { children: [_jsx(DatePicker.PrevTrigger, { children: _jsx(ChevronLeftIcon, {}) }), _jsx(DatePicker.ViewTrigger, { children: _jsx(DatePicker.RangeText, {}) }), _jsx(DatePicker.NextTrigger, { children: _jsx(ChevronRightIcon, {}) })] }), _jsxs(DatePicker.Table, { children: [_jsx(DatePicker.TableHead, { children: _jsx(DatePicker.TableRow, { children: api.weekDays.map((weekDay, id) => (_jsx(DatePicker.TableHeader, { children: weekDay.short.substring(0, 2) }, id))) }) }), _jsx(DatePicker.TableBody, { children: api.weeks.map((week, id) => (_jsx(DatePicker.TableRow, { children: week.map((day, id) => (_jsx(DatePicker.TableCell, { value: day, children: _jsx(DatePicker.TableCellTrigger, { children: day.day }) }, id))) }, id))) })] })] })) }) }) }) }) })] }), _jsx("div", { className: "hidden grow lg:block" }), props.enabledFilters?.
|
|
195
|
+
}, className: "w-full lg:w-fit", children: [_jsxs(SegmentGroup.Item, { value: "all", className: "w-full lg:w-auto", children: [_jsx(SegmentGroup.ItemText, { children: "All" }), _jsx(SegmentGroup.ItemControl, {}), _jsx(SegmentGroup.ItemHiddenInput, {})] }), _jsxs(SegmentGroup.Item, { value: "today", className: "w-full lg:w-auto", children: [_jsx(SegmentGroup.ItemText, { children: "Today" }), _jsx(SegmentGroup.ItemControl, {}), _jsx(SegmentGroup.ItemHiddenInput, {})] }), _jsx(DatePicker.Context, { children: (api) => (_jsx(SegmentGroup.Item, { value: "custom", onClick: () => api.setOpen(true), className: "w-full lg:w-auto", children: _jsxs(DatePicker.Control, { children: [_jsx(SegmentGroup.ItemText, { children: "Custom" }), _jsx(SegmentGroup.ItemControl, {}), _jsx(SegmentGroup.ItemHiddenInput, {})] }) })) }), _jsx(SegmentGroup.Indicator, {})] }), _jsx(Portal, { children: _jsx(DatePicker.Positioner, { children: _jsx(DatePicker.Content, { children: _jsx(DatePicker.View, { view: "day", children: _jsx(DatePicker.Context, { children: (api) => (_jsxs(_Fragment, { children: [_jsxs(DatePicker.ViewControl, { children: [_jsx(DatePicker.PrevTrigger, { children: _jsx(ChevronLeftIcon, {}) }), _jsx(DatePicker.ViewTrigger, { children: _jsx(DatePicker.RangeText, {}) }), _jsx(DatePicker.NextTrigger, { children: _jsx(ChevronRightIcon, {}) })] }), _jsxs(DatePicker.Table, { children: [_jsx(DatePicker.TableHead, { children: _jsx(DatePicker.TableRow, { children: api.weekDays.map((weekDay, id) => (_jsx(DatePicker.TableHeader, { children: weekDay.short.substring(0, 2) }, id))) }) }), _jsx(DatePicker.TableBody, { children: api.weeks.map((week, id) => (_jsx(DatePicker.TableRow, { children: week.map((day, id) => (_jsx(DatePicker.TableCell, { value: day, children: _jsx(DatePicker.TableCellTrigger, { children: day.day }) }, id))) }, id))) })] })] })) }) }) }) }) })] }), _jsx("div", { className: "hidden grow lg:block" }), props.enabledFilters?.depositType && (_jsxs(Select.Root, { collection: depositTypeCollection, value: depositType ? [depositType] : [], onValueChange: (details) => {
|
|
196
|
+
const value = z
|
|
197
|
+
.enum(DEPOSIT_TYPES)
|
|
198
|
+
.safeParse(details.value.at(0)).data;
|
|
199
|
+
setdepositType(value ?? null);
|
|
200
|
+
}, lazyMount: true, deselectable: true, positioning: {
|
|
201
|
+
sameWidth: true,
|
|
202
|
+
}, children: [_jsxs(Select.Trigger, { className: "w-full lg:w-[14rem]", children: [_jsx(Select.ValueText, { placeholder: "Type" }), _jsx(Select.Context, { children: (api) => (_jsx(_Fragment, { children: api.value.length ? (_jsx(Select.ClearTrigger, { asChild: true, children: _jsx("span", { onClick: (e) => {
|
|
203
|
+
e.stopPropagation();
|
|
204
|
+
}, children: "Clear" }) })) : (_jsx(Select.Indicator, { asChild: true, children: _jsx(ChevronDownIcon, {}) })) })) })] }), _jsx(Portal, { children: _jsx(Select.Positioner, { children: _jsx(Select.Content, { children: _jsx(Select.ItemGroup, { children: depositTypeCollection.items.map((item) => (_jsxs(Select.Item, { item: item, children: [_jsx(Select.ItemText, { children: depositTypeCollection.stringifyItem(item) }), _jsx(Select.ItemIndicator, { asChild: true, children: _jsx(CheckIcon, {}) })] }, item))) }) }) }) })] })), props.enabledFilters?.depositStatus && (_jsxs(Select.Root, { collection: depositStatusCollection, value: depositStatus ? [depositStatus] : [], onValueChange: (details) => {
|
|
134
205
|
const value = z
|
|
135
206
|
.enum(DEPOSIT_STATUSES)
|
|
136
207
|
.safeParse(details.value.at(0)).data;
|
|
@@ -139,9 +210,16 @@ export function TableFilters(props) {
|
|
|
139
210
|
sameWidth: true,
|
|
140
211
|
}, children: [_jsxs(Select.Trigger, { className: "w-full lg:w-[14rem]", children: [_jsx(Select.ValueText, { placeholder: "Status" }), _jsx(Select.Context, { children: (api) => (_jsx(_Fragment, { children: api.value.length ? (_jsx(Select.ClearTrigger, { asChild: true, children: _jsx("span", { onClick: (e) => {
|
|
141
212
|
e.stopPropagation();
|
|
142
|
-
}, children: "Clear" }) })) : (_jsx(Select.Indicator, { asChild: true, children: _jsx(ChevronDownIcon, {}) })) })) })] }), _jsx(Portal, { children: _jsx(Select.Positioner, { children: _jsx(Select.Content, { children: _jsx(Select.ItemGroup, { children:
|
|
143
|
-
|
|
144
|
-
|
|
213
|
+
}, children: "Clear" }) })) : (_jsx(Select.Indicator, { asChild: true, children: _jsx(ChevronDownIcon, {}) })) })) })] }), _jsx(Portal, { children: _jsx(Select.Positioner, { children: _jsx(Select.Content, { children: _jsx(Select.ItemGroup, { children: depositStatusCollection.items.map((item) => (_jsxs(Select.Item, { item: item, children: [_jsx(Select.ItemText, { children: depositStatusCollection.stringifyItem(item) }), _jsx(Select.ItemIndicator, { asChild: true, children: _jsx(CheckIcon, {}) })] }, item))) }) }) }) })] })), props.enabledFilters?.withdrawalType && (_jsxs(Select.Root, { collection: withdrawalTypeCollection, value: withdrawalType ? [withdrawalType] : [], onValueChange: (details) => {
|
|
214
|
+
const value = z
|
|
215
|
+
.enum(WITHDRAWAL_TYPES)
|
|
216
|
+
.safeParse(details.value.at(0)).data;
|
|
217
|
+
setWithdrawalType(value ?? null);
|
|
218
|
+
}, lazyMount: true, deselectable: true, positioning: {
|
|
219
|
+
sameWidth: true,
|
|
220
|
+
}, children: [_jsxs(Select.Trigger, { className: "w-full lg:w-[14rem]", children: [_jsx(Select.ValueText, { placeholder: "Type" }), _jsx(Select.Context, { children: (api) => (_jsx(_Fragment, { children: api.value.length ? (_jsx(Select.ClearTrigger, { asChild: true, children: _jsx("span", { onClick: (e) => {
|
|
221
|
+
e.stopPropagation();
|
|
222
|
+
}, children: "Clear" }) })) : (_jsx(Select.Indicator, { asChild: true, children: _jsx(ChevronDownIcon, {}) })) })) })] }), _jsx(Portal, { children: _jsx(Select.Positioner, { children: _jsx(Select.Content, { children: _jsx(Select.ItemGroup, { children: withdrawalTypeCollection.items.map((item) => (_jsxs(Select.Item, { item: item, children: [_jsx(Select.ItemText, { children: withdrawalTypeCollection.stringifyItem(item) }), _jsx(Select.ItemIndicator, { asChild: true, children: _jsx(CheckIcon, {}) })] }, item))) }) }) }) })] })), props.enabledFilters?.withdrawalStatus && (_jsxs(Select.Root, { collection: withdrawalStatusCollection, value: withdrawalStatus ? [withdrawalStatus] : [], onValueChange: (details) => {
|
|
145
223
|
const value = z
|
|
146
224
|
.enum(WITHDRAWAL_STATUSES)
|
|
147
225
|
.safeParse(details.value.at(0)).data;
|
|
@@ -150,9 +228,7 @@ export function TableFilters(props) {
|
|
|
150
228
|
sameWidth: true,
|
|
151
229
|
}, children: [_jsxs(Select.Trigger, { className: "w-full lg:w-[14rem]", children: [_jsx(Select.ValueText, { placeholder: "Status" }), _jsx(Select.Context, { children: (api) => (_jsx(_Fragment, { children: api.value.length ? (_jsx(Select.ClearTrigger, { asChild: true, children: _jsx("span", { onClick: (e) => {
|
|
152
230
|
e.stopPropagation();
|
|
153
|
-
}, children: "Clear" }) })) : (_jsx(Select.Indicator, { asChild: true, children: _jsx(ChevronDownIcon, {}) })) })) })] }), _jsx(Portal, { children: _jsx(Select.Positioner, { children: _jsx(Select.Content, { children: _jsx(Select.ItemGroup, { children:
|
|
154
|
-
delimiter: capitalize.delimiters.UNDERSCORE,
|
|
155
|
-
}) }), _jsx(Select.ItemIndicator, { asChild: true, children: _jsx(CheckIcon, {}) })] }, status))) }) }) }) })] })), props.enabledFilters?.transactionType && (_jsxs(Select.Root, { collection: transactionTypeCollection, value: transactionType ? [transactionType] : [], onValueChange: (details) => {
|
|
231
|
+
}, children: "Clear" }) })) : (_jsx(Select.Indicator, { asChild: true, children: _jsx(ChevronDownIcon, {}) })) })) })] }), _jsx(Portal, { children: _jsx(Select.Positioner, { children: _jsx(Select.Content, { children: _jsx(Select.ItemGroup, { children: withdrawalStatusCollection.items.map((item) => (_jsxs(Select.Item, { item: item, children: [_jsx(Select.ItemText, { children: withdrawalStatusCollection.stringifyItem(item) }), _jsx(Select.ItemIndicator, { asChild: true, children: _jsx(CheckIcon, {}) })] }, item))) }) }) }) })] })), props.enabledFilters?.transactionType && (_jsxs(Select.Root, { collection: transactionTypeCollection, value: transactionType ? [transactionType] : [], onValueChange: (details) => {
|
|
156
232
|
const value = z
|
|
157
233
|
.enum(TRANSACTION_TYPES)
|
|
158
234
|
.safeParse(details.value.at(0)).data;
|
|
@@ -161,7 +237,5 @@ export function TableFilters(props) {
|
|
|
161
237
|
sameWidth: true,
|
|
162
238
|
}, children: [_jsxs(Select.Trigger, { className: "w-full lg:w-[14rem]", children: [_jsx(Select.ValueText, { placeholder: "Type" }), _jsx(Select.Context, { children: (api) => (_jsx(_Fragment, { children: api.value.length ? (_jsx(Select.ClearTrigger, { asChild: true, children: _jsx("span", { onClick: (e) => {
|
|
163
239
|
e.stopPropagation();
|
|
164
|
-
}, children: "Clear" }) })) : (_jsx(Select.Indicator, { asChild: true, children: _jsx(ChevronDownIcon, {}) })) })) })] }), _jsx(Portal, { children: _jsx(Select.Positioner, { children: _jsx(Select.Content, { children: _jsx(Select.ItemGroup, { children: transactionTypeCollection.items.map((
|
|
165
|
-
delimiter: capitalize.delimiters.UNDERSCORE,
|
|
166
|
-
}) }), _jsx(Select.ItemIndicator, { asChild: true, children: _jsx(CheckIcon, {}) })] }, type))) }) }) }) })] }))] }));
|
|
240
|
+
}, children: "Clear" }) })) : (_jsx(Select.Indicator, { asChild: true, children: _jsx(ChevronDownIcon, {}) })) })) })] }), _jsx(Portal, { children: _jsx(Select.Positioner, { children: _jsx(Select.Content, { children: _jsx(Select.ItemGroup, { children: transactionTypeCollection.items.map((item) => (_jsxs(Select.Item, { item: item, children: [_jsx(Select.ItemText, { children: transactionTypeCollection.stringifyItem(item) }), _jsx(Select.ItemIndicator, { asChild: true, children: _jsx(CheckIcon, {}) })] }, item))) }) }) }) })] }))] }));
|
|
167
241
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { tz, TZDateMini } from '@date-fns/tz';
|
|
4
4
|
import { endOfDay, format, startOfDay } from 'date-fns';
|
|
5
|
-
import {
|
|
5
|
+
import { useReducer } from 'react';
|
|
6
6
|
import { twMerge } from 'tailwind-merge';
|
|
7
7
|
import { useInfiniteQueryHelper } from '../../client/hooks/useInfiniteQueryHelper.js';
|
|
8
8
|
import { useLocaleInfo } from '../../client/hooks/useLocaleInfo.js';
|
|
@@ -18,26 +18,38 @@ import { formatNumber } from '../../utils/formatNumber.js';
|
|
|
18
18
|
import { Empty } from '../shared/Empty.js';
|
|
19
19
|
import { TableFilters } from './TableFilters.js';
|
|
20
20
|
export function TransactionRecordsTable() {
|
|
21
|
-
const [
|
|
21
|
+
const [state, setState] = useReducer((prev, next) => ({
|
|
22
|
+
...prev,
|
|
23
|
+
...next,
|
|
24
|
+
}), {});
|
|
22
25
|
const localeInfo = useLocaleInfo();
|
|
23
26
|
const { page, hasNextPage, hasPrevPage, next, prev, rows, totalPages, loading, firstPage, } = useInfiniteQueryHelper(useTransactionRecordsQuery, {
|
|
24
27
|
filter: {
|
|
25
|
-
...(
|
|
28
|
+
...(state.type && {
|
|
29
|
+
type: {
|
|
30
|
+
equal: state.type,
|
|
31
|
+
},
|
|
32
|
+
}),
|
|
33
|
+
...(state.timestamp && {
|
|
26
34
|
dateTimeCreated: {
|
|
27
|
-
...(timestamp.start && {
|
|
28
|
-
greaterThanOrEqual: new TZDateMini(startOfDay(timestamp.start), localeInfo.timezone).toISOString(),
|
|
35
|
+
...(state.timestamp.start && {
|
|
36
|
+
greaterThanOrEqual: new TZDateMini(startOfDay(state.timestamp.start), localeInfo.timezone).toISOString(),
|
|
29
37
|
}),
|
|
30
|
-
...(timestamp.end && {
|
|
31
|
-
lesserThanOrEqual: new TZDateMini(endOfDay(timestamp.end), localeInfo.timezone).toISOString(),
|
|
38
|
+
...(state.timestamp.end && {
|
|
39
|
+
lesserThanOrEqual: new TZDateMini(endOfDay(state.timestamp.end), localeInfo.timezone).toISOString(),
|
|
32
40
|
}),
|
|
33
41
|
},
|
|
34
42
|
}),
|
|
35
43
|
},
|
|
36
44
|
});
|
|
37
45
|
return (_jsxs(_Fragment, { children: [_jsx(TableFilters, { value: {
|
|
38
|
-
timestamp,
|
|
46
|
+
timestamp: state.timestamp,
|
|
47
|
+
transactionType: state.type,
|
|
39
48
|
}, onChange: (value) => {
|
|
40
|
-
|
|
49
|
+
setState({
|
|
50
|
+
type: value.transactionType,
|
|
51
|
+
timestamp: value.timestamp,
|
|
52
|
+
});
|
|
41
53
|
firstPage();
|
|
42
54
|
}, enabledFilters: {
|
|
43
55
|
transactionType: true,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { tz, TZDateMini } from '@date-fns/tz';
|
|
4
4
|
import { endOfDay, format, startOfDay } from 'date-fns';
|
|
5
|
-
import {
|
|
5
|
+
import { useReducer } from 'react';
|
|
6
6
|
import { twMerge } from 'tailwind-merge';
|
|
7
7
|
import { useInfiniteQueryHelper } from '../../client/hooks/useInfiniteQueryHelper.js';
|
|
8
8
|
import { useLocaleInfo } from '../../client/hooks/useLocaleInfo.js';
|
|
@@ -19,37 +19,49 @@ import { formatNumber } from '../../utils/formatNumber.js';
|
|
|
19
19
|
import { Empty } from '../shared/Empty.js';
|
|
20
20
|
import { TableFilters } from './TableFilters.js';
|
|
21
21
|
export function WithdrawalRecordsTable() {
|
|
22
|
-
const [
|
|
23
|
-
|
|
22
|
+
const [state, setState] = useReducer((prev, next) => ({
|
|
23
|
+
...prev,
|
|
24
|
+
...next,
|
|
25
|
+
}), {});
|
|
24
26
|
const localeInfo = useLocaleInfo();
|
|
25
27
|
const { page, hasNextPage, hasPrevPage, next, prev, rows, totalPages, loading, firstPage, } = useInfiniteQueryHelper(useWithdrawalRecordsQuery, {
|
|
26
28
|
filter: {
|
|
27
|
-
...(
|
|
29
|
+
...(state.type && {
|
|
30
|
+
type: {
|
|
31
|
+
equal: state.type,
|
|
32
|
+
},
|
|
33
|
+
}),
|
|
34
|
+
...(state.status && {
|
|
28
35
|
status: {
|
|
29
|
-
equal:
|
|
36
|
+
equal: state.status,
|
|
30
37
|
},
|
|
31
38
|
}),
|
|
32
|
-
...(timestamp && {
|
|
39
|
+
...(state.timestamp && {
|
|
33
40
|
dateTimeCreated: {
|
|
34
|
-
...(timestamp.start && {
|
|
35
|
-
greaterThanOrEqual: new TZDateMini(startOfDay(timestamp.start), localeInfo.timezone).toISOString(),
|
|
41
|
+
...(state.timestamp.start && {
|
|
42
|
+
greaterThanOrEqual: new TZDateMini(startOfDay(state.timestamp.start), localeInfo.timezone).toISOString(),
|
|
36
43
|
}),
|
|
37
|
-
...(timestamp.end && {
|
|
38
|
-
lesserThanOrEqual: new TZDateMini(endOfDay(timestamp.end), localeInfo.timezone).toISOString(),
|
|
44
|
+
...(state.timestamp.end && {
|
|
45
|
+
lesserThanOrEqual: new TZDateMini(endOfDay(state.timestamp.end), localeInfo.timezone).toISOString(),
|
|
39
46
|
}),
|
|
40
47
|
},
|
|
41
48
|
}),
|
|
42
49
|
},
|
|
43
50
|
});
|
|
44
|
-
return (_jsxs(_Fragment, { children: [_jsx(TableFilters, {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
withdrawalStatus,
|
|
51
|
+
return (_jsxs(_Fragment, { children: [_jsx(TableFilters, { value: {
|
|
52
|
+
timestamp: state.timestamp,
|
|
53
|
+
withdrawalType: state.type,
|
|
54
|
+
withdrawalStatus: state.status,
|
|
49
55
|
}, onChange: (value) => {
|
|
56
|
+
setState({
|
|
57
|
+
type: value.withdrawalType,
|
|
58
|
+
status: value.withdrawalStatus,
|
|
59
|
+
timestamp: value.timestamp,
|
|
60
|
+
});
|
|
50
61
|
firstPage();
|
|
51
|
-
|
|
52
|
-
|
|
62
|
+
}, enabledFilters: {
|
|
63
|
+
withdrawalType: true,
|
|
64
|
+
withdrawalStatus: true,
|
|
53
65
|
} }), rows.length <= 0 && (_jsx(Empty, { icon: loading ? SpinnerIcon : File02Icon, title: loading ? 'Just a moment' : 'No data', message: loading
|
|
54
66
|
? 'Fetching latest withdrawal records...'
|
|
55
67
|
: 'No data is currently available.', className: "mt-5xl" })), rows.length >= 1 && (_jsxs("div", { className: twMerge('mt-xl', 'border-y', 'border-border-secondary', 'bleed', 'lg:not-bleed', 'lg:mt-3xl', 'lg:w-full', 'lg:rounded-xl', 'lg:border-x'), children: [_jsx("div", { className: "border-border-secondary scrollbar-thumb:bg-bg-quaternary scrollbar-track:bg-transparent scrollbar:h-2 scrollbar-thumb:rounded-full overflow-hidden overflow-x-auto rounded-none border-b lg:rounded-t-xl", children: _jsxs(Table.Root, { className: "border-0", children: [_jsx(Table.Header, { children: _jsxs(Table.Row, { children: [_jsx(Table.Heading, { children: "Withdrawal No." }), _jsx(Table.Heading, { children: "Reference" }), _jsx(Table.Heading, { children: "Withdrawal Method" }), _jsx(Table.Heading, { children: "Mobile Number" }), _jsx(Table.Heading, { children: "Withdrawal Amount" }), _jsx(Table.Heading, { children: "Net Amount" }), _jsx(Table.Heading, { children: "Transaction Fee" }), _jsx(Table.Heading, { children: "Bank Name" }), _jsx(Table.Heading, { children: "Withdrawal Time" }), _jsx(Table.Heading, { children: "Status" })] }) }), _jsx(Table.Body, { children: rows.map((data) => (_jsxs(Table.Row, { children: [_jsx(Table.Cell, { className: "!py-1", children: data.withdrawalNumber }), _jsx(Table.Cell, { className: "!py-1", children: data.reference }), _jsx(Table.Cell, { className: "!py-1", children: capitalize(data.type, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const FILE_FRAGMENT = "\n fragment FileFragment on File {\n id\n url\n status\n }\n";
|
|
2
2
|
export declare const FILE = "\n \n fragment FileFragment on File {\n id\n url\n status\n }\n\n\n query File($id: ObjectId!) {\n node(id: $id) {\n ... on File {\n ...FileFragment\n }\n }\n }\n";
|
|
3
3
|
export declare const UPLOAD_PRIVATE_IMAGE_FILE = "\n mutation UploadPrivateImageFile($input: UploadFileInput!) {\n uploadPrivateImageFile(input: $input) {\n ... on FileFormatNotSupportedError {\n name: __typename\n message\n }\n ... on FileNameTooLongError {\n name: __typename\n message\n }\n ... on FileSizeTooBigError {\n name: __typename\n message\n }\n }\n }\n";
|
|
4
|
-
export declare const WALLET = "\n query Wallet {\n wallet {\n balance\n }\n
|
|
4
|
+
export declare const WALLET = "\n query Wallet {\n wallet {\n balance\n }\n }\n";
|
|
5
5
|
export declare const POINTS_WALLET = "\n query PointsWallet {\n pointsWallet {\n id\n points\n account\n dateTimeCreated\n }\n }\n";
|
|
6
6
|
export declare const REDEEM_POINTS_TO_CASH = "\n mutation RedeemPointsToCash($input: RedeemPointsToCashInput!) {\n redeemPointsToCash(input: $input) {\n ... on InsufficientPointsError {\n name: __typename\n message\n }\n ... on PointsNotDivisibleBy100Error {\n name: __typename\n message\n }\n }\n }\n";
|
|
7
7
|
export declare const POINTS_WALLET_TRANSACTIONS = "\n query PointsWalletTransactions(\n $first: Int\n $after: Cursor\n $filter: MemberPointsWalletTransactionFilterInput\n ) {\n member {\n pointsWalletTransactions(first: $first, after: $after, filter: $filter) {\n edges {\n cursor\n node {\n ... on PointsWalletTransaction {\n id\n type\n amount\n balance\n dateTimeCreated\n }\n }\n }\n totalCount\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n }\n }\n";
|
|
@@ -49,12 +49,12 @@ export declare const CASHBACKS = "\n \n \n fragment FileFragment on File {\n
|
|
|
49
49
|
export declare const CASHBACK = "\n \n \n fragment FileFragment on File {\n id\n url\n status\n }\n\n\n fragment CashbackFragment on Cashback {\n id\n name\n banner {\n ...FileFragment\n }\n minimumCashback\n maximumMonthlyCashback\n status\n description\n activationStartDateTime\n activationEndDateTime\n turnoverContributionPercentagePerGameProvider\n dateTimeCreated\n dateTimeLastUpdated\n }\n\n\n query Cashback($id: ObjectId!) {\n node(id: $id) {\n ... on Cashback {\n ...CashbackFragment\n }\n }\n }\n";
|
|
50
50
|
export declare const BONUS_FRAGMENT = "\n \n \n fragment FileFragment on File {\n id\n url\n status\n }\n\n\n fragment PromoFragment on Promo {\n id\n type\n name\n banner {\n ...FileFragment\n }\n status\n description\n maximumBonusAmount\n minimumBonusAmount\n maximumDepositAmount\n minimumDepositAmount\n activationStartDateTime\n turnoverRequirementContributionPercentagePerGameProvider\n activationEndDateTime\n dateTimeCreated\n dateTimeLastUpdated\n }\n\n\n fragment BonusFragment on Bonus {\n id\n promo {\n ...PromoFragment\n }\n deposit {\n type\n amount\n netAmount\n fee\n status\n reference\n dateTimeCreated\n dateTimeLastUpdated\n }\n amount\n balance\n turnoverRequirement\n currentTurnoverRequirementContribution\n currentTurnoverRequirementContributionPercentage\n turnoverRequirementContributionPercentagePerGameProvider\n enabledGameProviders\n expiration\n dateTimeCreated\n dateTimeLastUpdated\n }\n";
|
|
51
51
|
export declare const BONUSES = "\n \n \n \n fragment FileFragment on File {\n id\n url\n status\n }\n\n\n fragment PromoFragment on Promo {\n id\n type\n name\n banner {\n ...FileFragment\n }\n status\n description\n maximumBonusAmount\n minimumBonusAmount\n maximumDepositAmount\n minimumDepositAmount\n activationStartDateTime\n turnoverRequirementContributionPercentagePerGameProvider\n activationEndDateTime\n dateTimeCreated\n dateTimeLastUpdated\n }\n\n\n fragment BonusFragment on Bonus {\n id\n promo {\n ...PromoFragment\n }\n deposit {\n type\n amount\n netAmount\n fee\n status\n reference\n dateTimeCreated\n dateTimeLastUpdated\n }\n amount\n balance\n turnoverRequirement\n currentTurnoverRequirementContribution\n currentTurnoverRequirementContributionPercentage\n turnoverRequirementContributionPercentagePerGameProvider\n enabledGameProviders\n expiration\n dateTimeCreated\n dateTimeLastUpdated\n }\n\n\n query Bonuses {\n bonuses {\n ...BonusFragment\n }\n }\n";
|
|
52
|
-
export declare const
|
|
52
|
+
export declare const BONUS_IDS = "\n query BonusIds {\n bonuses {\n id\n }\n }\n";
|
|
53
|
+
export declare const BONUS_BALANCES = "\n query BonusesBalance {\n bonuses {\n balance\n }\n }\n";
|
|
53
54
|
export declare const BONUS = "\n \n \n \n fragment FileFragment on File {\n id\n url\n status\n }\n\n\n fragment PromoFragment on Promo {\n id\n type\n name\n banner {\n ...FileFragment\n }\n status\n description\n maximumBonusAmount\n minimumBonusAmount\n maximumDepositAmount\n minimumDepositAmount\n activationStartDateTime\n turnoverRequirementContributionPercentagePerGameProvider\n activationEndDateTime\n dateTimeCreated\n dateTimeLastUpdated\n }\n\n\n fragment BonusFragment on Bonus {\n id\n promo {\n ...PromoFragment\n }\n deposit {\n type\n amount\n netAmount\n fee\n status\n reference\n dateTimeCreated\n dateTimeLastUpdated\n }\n amount\n balance\n turnoverRequirement\n currentTurnoverRequirementContribution\n currentTurnoverRequirementContributionPercentage\n turnoverRequirementContributionPercentagePerGameProvider\n enabledGameProviders\n expiration\n dateTimeCreated\n dateTimeLastUpdated\n }\n\n\n query Bonus($id: ObjectId!) {\n node(id: $id) {\n ... on Bonus {\n ...BonusFragment\n }\n }\n }\n";
|
|
54
|
-
export declare const CURRENT_BONUS = "\n \n \n \n fragment FileFragment on File {\n id\n url\n status\n }\n\n\n fragment PromoFragment on Promo {\n id\n type\n name\n banner {\n ...FileFragment\n }\n status\n description\n maximumBonusAmount\n minimumBonusAmount\n maximumDepositAmount\n minimumDepositAmount\n activationStartDateTime\n turnoverRequirementContributionPercentagePerGameProvider\n activationEndDateTime\n dateTimeCreated\n dateTimeLastUpdated\n }\n\n\n fragment BonusFragment on Bonus {\n id\n promo {\n ...PromoFragment\n }\n deposit {\n type\n amount\n netAmount\n fee\n status\n reference\n dateTimeCreated\n dateTimeLastUpdated\n }\n amount\n balance\n turnoverRequirement\n currentTurnoverRequirementContribution\n currentTurnoverRequirementContributionPercentage\n turnoverRequirementContributionPercentagePerGameProvider\n enabledGameProviders\n expiration\n dateTimeCreated\n dateTimeLastUpdated\n }\n\n\n query CurrentBonus {\n currentBonus: bonus {\n ...BonusFragment\n }\n }\n";
|
|
55
55
|
export declare const CASHBACK_BONUS_FRAGMENT = "\n \n \n fragment FileFragment on File {\n id\n url\n status\n }\n\n\n fragment CashbackFragment on Cashback {\n id\n name\n banner {\n ...FileFragment\n }\n minimumCashback\n maximumMonthlyCashback\n status\n description\n activationStartDateTime\n activationEndDateTime\n turnoverContributionPercentagePerGameProvider\n dateTimeCreated\n dateTimeLastUpdated\n }\n\n\n fragment CashbackBonusFragment on CashbackBonus {\n id\n balance\n total\n cashback {\n ...CashbackFragment\n }\n dateTimeCreated\n dateTimeLastUpdated\n }\n";
|
|
56
56
|
export declare const CASHBACK_BONUSES = "\n \n \n \n fragment FileFragment on File {\n id\n url\n status\n }\n\n\n fragment CashbackFragment on Cashback {\n id\n name\n banner {\n ...FileFragment\n }\n minimumCashback\n maximumMonthlyCashback\n status\n description\n activationStartDateTime\n activationEndDateTime\n turnoverContributionPercentagePerGameProvider\n dateTimeCreated\n dateTimeLastUpdated\n }\n\n\n fragment CashbackBonusFragment on CashbackBonus {\n id\n balance\n total\n cashback {\n ...CashbackFragment\n }\n dateTimeCreated\n dateTimeLastUpdated\n }\n\n\n query CashbackBonuses {\n cashbackBonuses {\n ...CashbackBonusFragment\n }\n }\n";
|
|
57
|
-
export declare const
|
|
57
|
+
export declare const CASHBACK_BONUS_IDS = "\n query CashbackBonusIds {\n cashbackBonuses {\n id\n }\n }\n";
|
|
58
58
|
export declare const CASHBACK_BONUS = "\n \n \n \n fragment FileFragment on File {\n id\n url\n status\n }\n\n\n fragment CashbackFragment on Cashback {\n id\n name\n banner {\n ...FileFragment\n }\n minimumCashback\n maximumMonthlyCashback\n status\n description\n activationStartDateTime\n activationEndDateTime\n turnoverContributionPercentagePerGameProvider\n dateTimeCreated\n dateTimeLastUpdated\n }\n\n\n fragment CashbackBonusFragment on CashbackBonus {\n id\n balance\n total\n cashback {\n ...CashbackFragment\n }\n dateTimeCreated\n dateTimeLastUpdated\n }\n\n\n query CashbackBonus($id: ObjectId!) {\n node(id: $id) {\n ... on CashbackBonus {\n ...CashbackBonusFragment\n }\n }\n }\n";
|
|
59
59
|
export declare const CLAIM_CASHBACK_BONUS = "\n mutation ClaimCashbackBonus($input: ClaimCashbackBonusInput!) {\n claimCashbackBonus(input: $input) {\n ... on CashbackBonusDoesNotExistError {\n name: __typename\n message\n }\n }\n }\n";
|
|
60
60
|
export declare const MEMBER = "\n query Member {\n member {\n dateTimeLastActive\n }\n }\n";
|
|
@@ -105,7 +105,7 @@ export declare const DAILY_CHECKIN_FRAGMENT = "\n \n fragment QuestProgramFrag
|
|
|
105
105
|
export declare const WAGERING_FRAGMENT = "\n fragment WageringQuestFragment on WageringQuest {\n bonus\n id\n name\n type\n description\n program {\n ...QuestProgramFragment\n }\n\n status\n progressPercentage\n turnover\n targetTurnover\n endDateTime\n dateTimeCreated\n }\n";
|
|
106
106
|
export declare const ONBOARDING_QUEST_FRAGMENT = "\n fragment OnboardingQuestFragment on OnboardingQuest {\n id\n name\n description\n program {\n ...QuestProgramFragment\n }\n\n status\n type\n progressPercentage\n bonus\n endDateTime\n dateTimeCreated\n firstDepositCompleted\n accountVerificationCompleted\n }\n";
|
|
107
107
|
export declare const AVAILABLE_QUESTS = "\n \n fragment WageringQuestFragment on WageringQuest {\n bonus\n id\n name\n type\n description\n program {\n ...QuestProgramFragment\n }\n\n status\n progressPercentage\n turnover\n targetTurnover\n endDateTime\n dateTimeCreated\n }\n\n \n \n fragment QuestProgramFragment on QuestProgram {\n status\n type\n name\n description\n }\n\n fragment DailyCheckinQuestFragment on DailyCheckInQuest {\n id\n name\n description\n type\n program {\n ...QuestProgramFragment\n }\n\n status\n progressPercentage\n turnover\n endDateTime\n dateTimeCreated\n lastCheckInDate\n startDateTime\n checkInStreak\n\n thirdDayBonusAmount\n seventhDayBonusAmount\n sixthDayBonusAmount\n }\n\n \n fragment OnboardingQuestFragment on OnboardingQuest {\n id\n name\n description\n program {\n ...QuestProgramFragment\n }\n\n status\n type\n progressPercentage\n bonus\n endDateTime\n dateTimeCreated\n firstDepositCompleted\n accountVerificationCompleted\n }\n\n\n query AvailableQuests {\n availableQuests {\n ... on Quest {\n ... on WageringQuest {\n ...WageringQuestFragment\n }\n ... on DailyCheckInQuest {\n ...DailyCheckinQuestFragment\n }\n ... on OnboardingQuest {\n ...OnboardingQuestFragment\n }\n }\n }\n }\n";
|
|
108
|
-
export declare const
|
|
108
|
+
export declare const AVAILABLE_QUEST_IDS = "\n query AvailableQuestIds {\n availableQuests {\n ... on Node {\n id\n }\n }\n }\n";
|
|
109
109
|
export declare const CHECK_IN_DAILY_QUEST = "\n mutation checkInDailyCheckInQuest($input: CheckInDailyCheckInQuestInput!) {\n checkInDailyCheckInQuest(input: $input)\n }\n";
|
|
110
110
|
export declare const TOP_WINS = "\n query TopWins($first: Int) {\n topWins(first: $first) {\n id\n game {\n id\n name\n type\n provider\n }\n member {\n id\n name\n }\n multiplier\n payout\n }\n }\n";
|
|
111
111
|
export declare const JACKPOTS = "\n query Jackpots(\n $first: Int\n $after: Cursor\n $sort: JackpotSortInput\n $filter: JackpotFilterInput\n ) {\n jackpots(first: $first, after: $after, sort: $sort, filter: $filter) {\n totalCount\n pageInfo {\n hasNextPage\n endCursor\n }\n edges {\n node {\n ... on Jackpot {\n id\n name\n description\n pool\n status\n minimumJackpotPoolDrawingLimit\n maximumJackpotPoolLimit\n drawing\n minimumMultiplier\n minimumBet\n jackpotPayoutPercentage\n jackpotTurnoverContributionPercentagePerGameProvider\n totalPayout\n }\n }\n }\n }\n }\n";
|
package/dist/services/queries.js
CHANGED
|
@@ -39,9 +39,6 @@ export const WALLET = /* GraphQL */ `
|
|
|
39
39
|
wallet {
|
|
40
40
|
balance
|
|
41
41
|
}
|
|
42
|
-
bonus {
|
|
43
|
-
balance
|
|
44
|
-
}
|
|
45
42
|
}
|
|
46
43
|
`;
|
|
47
44
|
export const POINTS_WALLET = /* GraphQL */ `
|
|
@@ -1217,13 +1214,20 @@ export const BONUSES = /* GraphQL */ `
|
|
|
1217
1214
|
}
|
|
1218
1215
|
}
|
|
1219
1216
|
`;
|
|
1220
|
-
export const
|
|
1221
|
-
query
|
|
1217
|
+
export const BONUS_IDS = /* GraphQL */ `
|
|
1218
|
+
query BonusIds {
|
|
1222
1219
|
bonuses {
|
|
1223
1220
|
id
|
|
1224
1221
|
}
|
|
1225
1222
|
}
|
|
1226
1223
|
`;
|
|
1224
|
+
export const BONUS_BALANCES = /* GraphQL */ `
|
|
1225
|
+
query BonusesBalance {
|
|
1226
|
+
bonuses {
|
|
1227
|
+
balance
|
|
1228
|
+
}
|
|
1229
|
+
}
|
|
1230
|
+
`;
|
|
1227
1231
|
export const BONUS = /* GraphQL */ `
|
|
1228
1232
|
${BONUS_FRAGMENT}
|
|
1229
1233
|
|
|
@@ -1235,15 +1239,6 @@ export const BONUS = /* GraphQL */ `
|
|
|
1235
1239
|
}
|
|
1236
1240
|
}
|
|
1237
1241
|
`;
|
|
1238
|
-
export const CURRENT_BONUS = /* GraphQL */ `
|
|
1239
|
-
${BONUS_FRAGMENT}
|
|
1240
|
-
|
|
1241
|
-
query CurrentBonus {
|
|
1242
|
-
currentBonus: bonus {
|
|
1243
|
-
...BonusFragment
|
|
1244
|
-
}
|
|
1245
|
-
}
|
|
1246
|
-
`;
|
|
1247
1242
|
export const CASHBACK_BONUS_FRAGMENT = /* GraphQL */ `
|
|
1248
1243
|
${CASHBACK_FRAGMENT}
|
|
1249
1244
|
|
|
@@ -1267,8 +1262,8 @@ export const CASHBACK_BONUSES = /* GraphQL */ `
|
|
|
1267
1262
|
}
|
|
1268
1263
|
}
|
|
1269
1264
|
`;
|
|
1270
|
-
export const
|
|
1271
|
-
query
|
|
1265
|
+
export const CASHBACK_BONUS_IDS = /* GraphQL */ `
|
|
1266
|
+
query CashbackBonusIds {
|
|
1272
1267
|
cashbackBonuses {
|
|
1273
1268
|
id
|
|
1274
1269
|
}
|
|
@@ -2140,8 +2135,8 @@ export const AVAILABLE_QUESTS = /* GraphQL */ `
|
|
|
2140
2135
|
}
|
|
2141
2136
|
}
|
|
2142
2137
|
`;
|
|
2143
|
-
export const
|
|
2144
|
-
query
|
|
2138
|
+
export const AVAILABLE_QUEST_IDS = /* GraphQL */ `
|
|
2139
|
+
query AvailableQuestIds {
|
|
2145
2140
|
availableQuests {
|
|
2146
2141
|
... on Node {
|
|
2147
2142
|
id
|
package/dist/services/trigger.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cache } from 'react';
|
|
2
2
|
import { TRIGGER_GRAPHQL_ENDPOINT } from '../constants/index.js';
|
|
3
3
|
import { graphqlRequest } from './graphqlRequest.js';
|
|
4
|
-
import { AVAILABLE_QUESTS,
|
|
4
|
+
import { AVAILABLE_QUESTS, AVAILABLE_QUEST_IDS, CHECK_IN_DAILY_QUEST, CLAIM_REWARD, MARK_ALL_MESSAGES_AS_READ, MARK_MESSAGE_AS_READ, MESSAGES, REGISTER_FCM_DEVICE, UNREAD_MESSAGES_COUNT, UNREGISTER_FCM_DEVICE, } from './queries.js';
|
|
5
5
|
export const getMessages = cache(async (input, options) => {
|
|
6
6
|
const res = await graphqlRequest(TRIGGER_GRAPHQL_ENDPOINT, MESSAGES, input, options);
|
|
7
7
|
return res.messages;
|
|
@@ -53,7 +53,7 @@ export const getAvailableQuests = cache(async (options) => {
|
|
|
53
53
|
return res.availableQuests;
|
|
54
54
|
});
|
|
55
55
|
export const getAvailableQuestsCount = cache(async (options) => {
|
|
56
|
-
const res = await graphqlRequest(TRIGGER_GRAPHQL_ENDPOINT,
|
|
56
|
+
const res = await graphqlRequest(TRIGGER_GRAPHQL_ENDPOINT, AVAILABLE_QUEST_IDS, undefined, options);
|
|
57
57
|
return res.availableQuests.length ?? 0;
|
|
58
58
|
});
|
|
59
59
|
export const checkInDailyCheckInQuest = async (id, options) => {
|
|
@@ -37,7 +37,7 @@ export interface CashbackBonusesQuery {
|
|
|
37
37
|
cashbackBonuses?: CashbackBonus[] | null;
|
|
38
38
|
}
|
|
39
39
|
export declare const getCashbackBonuses: (options?: GraphQLRequestOptions) => Promise<CashbackBonus[]>;
|
|
40
|
-
export interface
|
|
40
|
+
export interface CashbackBonusIdsQuery {
|
|
41
41
|
cashbackBonuses?: {
|
|
42
42
|
id: string;
|
|
43
43
|
}[] | null;
|
|
@@ -63,10 +63,6 @@ export interface BonusQueryVariables {
|
|
|
63
63
|
id: string;
|
|
64
64
|
}
|
|
65
65
|
export declare const getBonus: (id: string, options?: GraphQLRequestOptions) => Promise<Bonus | null>;
|
|
66
|
-
export interface CurrentBonusQuery {
|
|
67
|
-
currentBonus?: Bonus | null;
|
|
68
|
-
}
|
|
69
|
-
export declare const getCurrentBonus: (options?: GraphQLRequestOptions) => Promise<Bonus | null>;
|
|
70
66
|
export interface CashbackBonusQuery {
|
|
71
67
|
node?: CashbackBonus | null;
|
|
72
68
|
}
|
|
@@ -82,6 +78,11 @@ export interface WalletQuery {
|
|
|
82
78
|
} | null;
|
|
83
79
|
};
|
|
84
80
|
}
|
|
81
|
+
export interface BonusBalancesQuery {
|
|
82
|
+
bonuses?: {
|
|
83
|
+
balance: string;
|
|
84
|
+
}[];
|
|
85
|
+
}
|
|
85
86
|
export declare const getWallet: (options?: GraphQLRequestOptions) => Promise<Wallet | null>;
|
|
86
87
|
export interface DepositQuery {
|
|
87
88
|
node?: Deposit | null;
|
|
@@ -410,7 +411,7 @@ export interface BonusesQuery {
|
|
|
410
411
|
bonuses?: Bonus[] | null;
|
|
411
412
|
}
|
|
412
413
|
export declare const getBonuses: (options?: GraphQLRequestOptions) => Promise<Bonus[]>;
|
|
413
|
-
export interface
|
|
414
|
+
export interface BonusIdsQuery {
|
|
414
415
|
bonuses?: {
|
|
415
416
|
id: string;
|
|
416
417
|
}[] | null;
|