97 lines
1.9 KiB
TypeScript
97 lines
1.9 KiB
TypeScript
export interface OrderData {
|
|
Nome_Cliente: string;
|
|
Data_Pedido: string;
|
|
Valor_Pedido: number;
|
|
ID_Produto: string;
|
|
Descricao_Produto: string;
|
|
Quantidade: number;
|
|
Valor_Unitario: number;
|
|
Recebido_Em?: string;
|
|
ID_Pedido?: string;
|
|
Fone_Cliente?: string;
|
|
}
|
|
|
|
export interface StockData {
|
|
produto_id: string;
|
|
nome: string;
|
|
saldo: number;
|
|
delta_estoque: number;
|
|
updated_at?: string;
|
|
}
|
|
|
|
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;
|
|
}
|