Optimize client details with opaque tokens
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m20s

This commit is contained in:
Cauê Faleiros
2026-06-22 11:00:42 -03:00
parent 3c74fa7210
commit 0874238fc6
12 changed files with 548 additions and 43 deletions

View File

@@ -65,6 +65,7 @@ export interface DashboardAnalytics {
export interface ClientAnalyticsItem {
customerKey: string;
clientToken: string;
name: string;
phone: string;
quantityPurchased: number;
@@ -75,6 +76,7 @@ export interface ClientAnalyticsItem {
export interface RfmClient {
customerKey: string;
clientToken: string;
name: string;
phone: string;
monetary: number;
@@ -112,6 +114,34 @@ export interface RfmAnalytics {
};
}
export interface GroupedClientOrder {
date: string;
orderId: string;
orderTotal: number;
items: OrderData[];
}
export interface ClientDetailsAnalytics {
range: {
start: string | null;
end: string | null;
};
clientToken: string;
chartData: Array<{
date: string;
value: number;
}>;
groupedOrders: GroupedClientOrder[];
allTimeOrderCount: number;
clientName: string;
clientPhone: string;
hasClient: boolean;
periodAverageTicket: number;
periodOrderCount: number;
periodSpent: number;
periodItems: number;
}
export type CampaignStatus = 'pending' | 'processing' | 'sent' | 'failed' | 'skipped';
export interface CampaignQueueItem {