feat(F-177): completed feature
This commit is contained in:
@@ -93,6 +93,15 @@ export const productsApi = {
|
||||
|
||||
// ── Orders ────────────────────────────────────────────────────────────────────
|
||||
|
||||
export interface StaleOrderNotification {
|
||||
id: string;
|
||||
state: 'PENDING' | 'SHIPPED';
|
||||
totalCents: number;
|
||||
customerEmail: string | null;
|
||||
stateChangedAt: string;
|
||||
ageHours: number;
|
||||
}
|
||||
|
||||
export const ordersApi = {
|
||||
list: (params?: { limit?: number; offset?: number; status?: string; q?: string }) => {
|
||||
const sp = new URLSearchParams();
|
||||
@@ -128,6 +137,10 @@ export const ordersApi = {
|
||||
),
|
||||
history: (id: string) =>
|
||||
api.get<{ items: import('@/types').OrderHistoryEvent[] }>(`/api/orders/${id}/history`),
|
||||
staleNotifications: (hours = 24, limit = 20) =>
|
||||
api.get<{ total: number; thresholdHours: number; items: StaleOrderNotification[] }>(
|
||||
`/api/orders/notifications/stale?hours=${hours}&limit=${limit}`,
|
||||
),
|
||||
};
|
||||
|
||||
// ── Customers ─────────────────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user