- Backend: FastAPI app with all models, services, schemas, routes - Admin Panel: Next.js dashboard with all modules (CRM, POS, repairs, warranties, billing, notifications, etc.) - Ecommerce: storefront (submodule) + product catalog - AI Agents: .agents/ skill library for Antigravity IDE - Docs: architecture, billing, notification gateway markdown - Submodules: Backend/OpenWA, Ecommerce/File 2/storefront
41 lines
1.1 KiB
TypeScript
41 lines
1.1 KiB
TypeScript
import { apiFetch } from './client';
|
|
|
|
export interface BulkQuotation {
|
|
quote_id: string;
|
|
tenant_id?: string;
|
|
quote_number: string;
|
|
customer_id?: string;
|
|
customer_name?: string;
|
|
customer_phone?: string;
|
|
customer_email?: string;
|
|
company_name?: string;
|
|
gst_number?: string;
|
|
status: string; // DRAFT, SENT, APPROVED, REJECTED, CONVERTED_TO_INVOICE
|
|
subtotal: number;
|
|
discount_amount?: number;
|
|
tax_amount: number;
|
|
grand_total: number;
|
|
notes?: string;
|
|
items?: any[];
|
|
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',
|
|
});
|
|
}
|
|
};
|