Use recent data for purchase hour pattern
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m29s

This commit is contained in:
Cauê Faleiros
2026-07-01 13:17:05 -03:00
parent 57fd48ccc5
commit 27d2980b32
5 changed files with 82 additions and 21 deletions

View File

@@ -301,6 +301,8 @@ export const fetchClientAnalytics = async (dateRange: DateRange, filters?: Parti
};
const emptyClientPurchasePattern = (): ClientPurchasePatternAnalytics => ({
weekdayRangeLabel: 'Todo período',
hourRangeLabel: 'Últimos 60 dias',
purchaseWeekdays: ['Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sab'].map(label => ({ label, value: 0 })),
purchaseHours: Array.from({ length: 24 }, (_, hour) => ({
label: `${String(hour).padStart(2, '0')}h`,