- 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
39 lines
1.1 KiB
TypeScript
39 lines
1.1 KiB
TypeScript
import { apiFetch } from './client';
|
|
|
|
export interface RepairTicket {
|
|
ticket_id: string;
|
|
tenant_id: string;
|
|
ticket_number: string;
|
|
customer_id: string;
|
|
customer_name: string;
|
|
customer_phone: string;
|
|
imei_serial: string;
|
|
brand_name: string;
|
|
model_name: string;
|
|
problem_description: string;
|
|
status: string; // INTAKE, DIAGNOSING, REPAIRING, COMPLETED, DELIVERED
|
|
priority: string;
|
|
assigned_technician_id?: string;
|
|
sla_due_at?: string;
|
|
created_at: string;
|
|
}
|
|
|
|
export const repairService = {
|
|
getTickets: async (status?: string) => {
|
|
const query = status ? `?status=${encodeURIComponent(status)}` : '';
|
|
return apiFetch<RepairTicket[]>(`/api/v1/repair/tickets${query}`);
|
|
},
|
|
|
|
createTicket: async (data: Partial<RepairTicket>) => {
|
|
return apiFetch<RepairTicket>('/api/v1/repair/tickets', {
|
|
method: 'POST',
|
|
body: JSON.stringify(data),
|
|
});
|
|
},
|
|
|
|
assignTechnician: async (ticketId: string, technicianId: string) => {
|
|
return apiFetch(`/api/v1/repair/tickets/${ticketId}/assign?technician_id=${technicianId}`, {
|
|
method: 'POST',
|
|
});
|
|
}
|
|
};
|