feat(convert): show convert requests under hesab ketab

Admins review pending cathode-to-wire requests in the shared table, and on mobile they see cards.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-11-01 13:13:09 +03:30
co-authored by Cursor
parent dfc6f8dc64
commit 3df3164e0b
9 changed files with 470 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
import useAxios from '@core/utils/useAxios'
export interface CopperConvertRequestRow {
id: number
status: 'pending' | 'approved' | 'rejected' | string
source: string
customer_name: string
customer_mobile: string
asset_unit: string
consumed_amount: number
leftover_amount: number
source_unit_price: number
wire15_rings: number
wire15_unit_price: number
wire25_rings: number
wire25_unit_price: number
created_at?: string
}
export const getCopperConvertRequests = () =>
useAxios.get<CopperConvertRequestRow[]>('/admin/copper-convert-request')
export const approveCopperConvertRequest = (id: number) =>
useAxios.post(`/admin/copper-convert-request/${id}/approve`)
export const rejectCopperConvertRequest = (id: number) =>
useAxios.post(`/admin/copper-convert-request/${id}/reject`)