Add refusals tab to the order dashboard

Orders whose Nova Poshta status is a refusal (102/103/105/108) now show
only under «Отказы», whether or not they have a receipt. GET /orders takes
tab=no_receipt|has_receipt|refused instead of has_receipt. NP statuses are
also polled for orders that already have a receipt, until NP reports a
final status.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-24 21:25:59 +03:00
co-authored by Claude Opus 5.5
parent 56ac0fc370
commit f88b5cccc0
9 changed files with 116 additions and 33 deletions
+3 -3
View File
@@ -1,8 +1,8 @@
import { apiFetch } from '@/api/client'
import type { Order, OrderUpdate } from '@/features/orders/types'
import type { Order, OrderTab, OrderUpdate } from '@/features/orders/types'
export function getOrders(hasReceipt: boolean): Promise<Order[]> {
return apiFetch<Order[]>(`/orders?has_receipt=${hasReceipt}`)
export function getOrders(tab: OrderTab): Promise<Order[]> {
return apiFetch<Order[]>(`/orders?tab=${tab}`)
}
export function deleteOrder(orderId: string): Promise<void> {