Add Convert to Estimate feature for invoices

New backend endpoint POST /invoices/{id}/convert-to-estimate that
creates a draft estimate from an invoice, copying items, taxes,
custom fields, and financial data. Frontend wired with dropdown
action, store method, and API service call.
This commit is contained in:
Darko Gjorgjijoski
2026-04-06 22:57:03 +02:00
parent c328d1cd10
commit 9ca998e64a
6 changed files with 107 additions and 0 deletions

View File

@@ -103,6 +103,11 @@ export const invoiceService = {
return data
},
async convertToEstimate(id: number): Promise<ApiResponse<Record<string, unknown>>> {
const { data } = await client.post(`${API.INVOICES}/${id}/convert-to-estimate`)
return data
},
async changeStatus(payload: InvoiceStatusPayload): Promise<ApiResponse<Invoice>> {
const { data } = await client.post(`${API.INVOICES}/${payload.id}/status`, payload)
return data