ifixkart-admin/services/api/billingFinanceService.ts
adithiyan b5837073e7 feat: add warranties, refunds, notification templates, user POS analytics, credit & delivery services
New pages:
- app/(admin)/warranties/ — full warranty management with claims
- app/(admin)/refunds/ — refund management
- app/(admin)/notification-templates/ — email/SMS template editor
- app/(admin)/user-pos-analytics/ — per-user POS analytics

New components:
- components/quotations/ — quotation components
- components/ui/PartNumbersModal.tsx — part numbers selection

New services:
- creditService.ts, deliverySettingsService.ts
- notificationTemplateService.ts, roleNotificationSettingsService.ts

Updated:
- Sidebar navigation, dashboard, orders, POS sessions, products
- Bulk quotations, CRM leads/quotations, notifications gateway
- settings, service invoices, quotes, technician, users pages
- adminService, billingFinanceService, catalogService, client
- inventoryPosService, notificationGatewayService, openwaService, userService
- Removed pos-sync page (merged into POS sessions)
2026-10-13 22:05:55 +05:30

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',
});
}
};