Add COD-in-transit summary and received tab to the dashboard
- GET /orders/summary: count and sum of cash-on-delivery for parcels not yet picked up (excludes received, refused, deleted/unknown TTNs, paid COD); shown as a card above the tabs. - New «Полученные» tab: orders with NP received codes (9, 10, 11, 106) move there automatically, regardless of receipt; 106 is now a final status. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,10 +1,14 @@
|
||||
import { apiFetch } from '@/api/client'
|
||||
import type { Order, OrderTab, OrderUpdate } from '@/features/orders/types'
|
||||
import type { Order, OrdersSummary, OrderTab, OrderUpdate } from '@/features/orders/types'
|
||||
|
||||
export function getOrders(tab: OrderTab): Promise<Order[]> {
|
||||
return apiFetch<Order[]>(`/orders?tab=${tab}`)
|
||||
}
|
||||
|
||||
export function getOrdersSummary(): Promise<OrdersSummary> {
|
||||
return apiFetch<OrdersSummary>('/orders/summary')
|
||||
}
|
||||
|
||||
export function deleteOrder(orderId: string): Promise<void> {
|
||||
return apiFetch<void>(`/orders/${orderId}`, { method: 'DELETE' })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user