add campaign observability page
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 43s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 43s
This commit is contained in:
71
src/types.ts
71
src/types.ts
@@ -23,3 +23,74 @@ export interface DateRange {
|
||||
start: Date;
|
||||
end: Date;
|
||||
}
|
||||
|
||||
export type CampaignStatus = 'pending' | 'processing' | 'sent' | 'failed' | 'skipped';
|
||||
|
||||
export interface CampaignQueueItem {
|
||||
id: number;
|
||||
base_product_name: string;
|
||||
produto_id: string;
|
||||
nome: string;
|
||||
saldo: number;
|
||||
delta_estoque: number;
|
||||
status: CampaignStatus;
|
||||
attempts: number;
|
||||
last_error?: string | null;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
sent_at?: string | null;
|
||||
}
|
||||
|
||||
export interface CampaignGroup {
|
||||
key: string;
|
||||
baseProductName: string;
|
||||
status: CampaignStatus;
|
||||
totalDelta: number;
|
||||
rowCount: number;
|
||||
attempts: number;
|
||||
lastError?: string | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
sentAt?: string | null;
|
||||
items: CampaignQueueItem[];
|
||||
}
|
||||
|
||||
export interface CampaignQueueSummary {
|
||||
threshold: number;
|
||||
maxAttempts: number;
|
||||
groups: CampaignGroup[];
|
||||
rows: CampaignQueueItem[];
|
||||
}
|
||||
|
||||
export interface CampaignProductPreview {
|
||||
baseProduct: string;
|
||||
total_delta: number;
|
||||
sizes: Array<{
|
||||
id: string;
|
||||
nome: string;
|
||||
delta: number;
|
||||
saldo: number;
|
||||
}>;
|
||||
}
|
||||
|
||||
export interface CampaignPreview {
|
||||
threshold: number;
|
||||
readyProducts: CampaignProductPreview[];
|
||||
belowThresholdProducts: CampaignProductPreview[];
|
||||
productsText: string;
|
||||
customerCount: number;
|
||||
customersPreview: Array<{
|
||||
nome: string;
|
||||
fone: string;
|
||||
total_gasto?: string;
|
||||
total_comprado?: string;
|
||||
}>;
|
||||
}
|
||||
|
||||
export interface CampaignProcessSummary {
|
||||
claimed: number;
|
||||
sentGroups: number;
|
||||
skippedGroups: number;
|
||||
failedGroups: number;
|
||||
pendingBelowThresholdGroups: number;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user