33 lines
929 B
TypeScript
33 lines
929 B
TypeScript
import { apiFetch } from './client';
|
|
|
|
export interface BulkQuotation {
|
|
quotation_id: string;
|
|
tenant_id: string;
|
|
quote_number: string;
|
|
customer_id: string;
|
|
status: string; // DRAFT, SENT, APPROVED, REJECTED, CONVERTED_TO_INVOICE
|
|
subtotal: number;
|
|
tax_amount: number;
|
|
final_amount: number;
|
|
created_at: string;
|
|
}
|
|
|
|
export const billingFinanceService = {
|
|
getQuotations: async (status?: string) => {
|
|
const query = status ? `?status=${encodeURIComponent(status)}` : '';
|
|
return apiFetch<BulkQuotation[]>(`/api/v1/billing-finance/quotations${query}`);
|
|
},
|
|
|
|
createQuotation: async (data: any) => {
|
|
return apiFetch<BulkQuotation>('/api/v1/billing-finance/quotations', {
|
|
method: 'POST',
|
|
body: JSON.stringify(data),
|
|
});
|
|
},
|
|
|
|
convertToInvoice: async (quoteId: string) => {
|
|
return apiFetch(`/api/v1/billing-finance/quotations/${quoteId}/convert`, {
|
|
method: 'POST',
|
|
});
|
|
}
|
|
};
|