update add new kind N

This commit is contained in:
wayanrivan
2025-04-25 11:34:21 +07:00
parent 97996a99dc
commit daae143823
5 changed files with 12 additions and 6 deletions

View File

@ -252,14 +252,14 @@ const DashboardHomePage = () => {
<Card <Card
title="Registered Users" title="Registered Users"
total={responseStatisticCard?.data.total_registered ?? 0} total={responseStatisticCard?.data.total_registered ?? 0}
growth={responseStatisticCard?.data.registered_last_week.percent ?? 0} growth={parseFloat((responseStatisticCard?.data?.registered_last_week.percent ?? 0).toFixed(2)) ?? 0}
surplus={responseStatisticCard?.data.registered_last_week.surplus ?? false} surplus={responseStatisticCard?.data.registered_last_week.surplus ?? false}
icon="test" icon="test"
/> />
<Card <Card
title="Unregistered Users" title="Unregistered Users"
total={responseStatisticCard?.data.total_unregistered ?? 0} total={responseStatisticCard?.data.total_unregistered ?? 0}
growth={responseStatisticCard?.data.unregistered_last_week.percent ?? 0} growth={parseFloat((responseStatisticCard?.data?.unregistered_last_week.percent ?? 0).toFixed(2)) ?? 0}
surplus={responseStatisticCard?.data.unregistered_last_week.surplus ?? false} surplus={responseStatisticCard?.data.unregistered_last_week.surplus ?? false}
icon="test" icon="test"
@ -267,28 +267,28 @@ const DashboardHomePage = () => {
<Card <Card
title="Total Cash-in" title="Total Cash-in"
total={responseStatisticCard?.data.total_cash_in ?? 0} total={responseStatisticCard?.data.total_cash_in ?? 0}
growth={responseStatisticCard?.data.cash_in_last_week.percent ?? 0} growth={parseFloat((responseStatisticCard?.data?.cash_in_last_week.percent ?? 0).toFixed(2))?? 0}
surplus={responseStatisticCard?.data.cash_in_last_week.surplus ?? false} surplus={responseStatisticCard?.data.cash_in_last_week.surplus ?? false}
icon="test" icon="test"
/> />
<Card <Card
title="Total Cash-out" title="Total Cash-out"
total={responseStatisticCard?.data.total_cash_out ?? 0} total={responseStatisticCard?.data.total_cash_out ?? 0}
growth={responseStatisticCard?.data.cash_out_last_week.percent ?? 0} growth={parseFloat((responseStatisticCard?.data?.cash_out_last_week.percent ?? 0).toFixed(2)) ?? 0}
surplus={responseStatisticCard?.data.cash_out_last_week.surplus ?? false} surplus={responseStatisticCard?.data.cash_out_last_week.surplus ?? false}
icon="test" icon="test"
/> />
<Card <Card
title="Active Event" title="Active Event"
total={responseStatisticCard?.data.total_event ?? 0} total={responseStatisticCard?.data.total_event ?? 0}
growth={responseStatisticCard?.data.event_last_week.percent ?? 0} growth={parseFloat((responseStatisticCard?.data?.event_last_week.percent ?? 0).toFixed(2)) ?? 0}
surplus={responseStatisticCard?.data.event_last_week.surplus ?? false} surplus={responseStatisticCard?.data.event_last_week.surplus ?? false}
icon="test" icon="test"
/> />
<Card <Card
title="Total Billing" title="Total Billing"
total={responseStatisticCard?.data.total_billing ?? 0} total={responseStatisticCard?.data.total_billing ?? 0}
growth={responseStatisticCard?.data.billing_last_week.percent ?? 0} growth={parseFloat((responseStatisticCard?.data?.billing_last_week.percent ?? 0).toFixed(2)) ?? 0}
surplus={responseStatisticCard?.data.billing_last_week.surplus ?? false} surplus={responseStatisticCard?.data.billing_last_week.surplus ?? false}
icon='test' icon='test'
/> />

View File

@ -42,6 +42,7 @@ const TransactionPieChart = ({ startdate, enddate }: Props) => {
{ name: 'Topup', value: parseFloat((responseTransactionValue?.data?.U ?? 0).toFixed(2)), color: '#9f7aea' }, { name: 'Topup', value: parseFloat((responseTransactionValue?.data?.U ?? 0).toFixed(2)), color: '#9f7aea' },
{ name: 'Purchase', value: parseFloat((responseTransactionValue?.data?.P ?? 0).toFixed(2)), color: '#baf7c5' }, { name: 'Purchase', value: parseFloat((responseTransactionValue?.data?.P ?? 0).toFixed(2)), color: '#baf7c5' },
{ name: 'Withdraw', value: parseFloat((responseTransactionValue?.data?.W ?? 0).toFixed(2)), color: '#f56565' }, { name: 'Withdraw', value: parseFloat((responseTransactionValue?.data?.W ?? 0).toFixed(2)), color: '#f56565' },
{ name: 'Top Up Partner', value: parseFloat((responseTransactionValue?.data?.N ?? 0).toFixed(2)), color: '#f7fa52' },
]; ];
return ( return (

View File

@ -61,6 +61,9 @@ const TransactionValue = ({ startdate, enddate }: Props) => {
case "R": case "R":
type = "Return"; type = "Return";
break; break;
case "N":
type = "Top Up Partner";
break;
default: default:
type = "Unknown"; type = "Unknown";
break; break;

View File

@ -144,6 +144,7 @@ const ListToolbar = () => {
<SelectItem value="W">WITHDRAW</SelectItem> <SelectItem value="W">WITHDRAW</SelectItem>
<SelectItem value="U">TOP UP</SelectItem> <SelectItem value="U">TOP UP</SelectItem>
<SelectItem value="R">RETURN</SelectItem> <SelectItem value="R">RETURN</SelectItem>
<SelectItem value='N'>TOP UP PARTNER</SelectItem>
</SelectContent> </SelectContent>
</Select> </Select>

View File

@ -70,6 +70,7 @@ const TransactionProvider = ({ children }: { children: React.ReactNode }) => {
case 'W': return 'WITHDRAW'; case 'W': return 'WITHDRAW';
case 'U': return 'TOP UP'; case 'U': return 'TOP UP';
case 'R': return 'RETURN'; case 'R': return 'RETURN';
case 'N': return 'TOP UP PARTNER';
default: return '_'; default: return '_';
} }
}, },