diff --git a/replit.md b/replit.md index 1403953..ba0d085 100644 --- a/replit.md +++ b/replit.md @@ -73,6 +73,26 @@ The database includes core tables for `users`, `guards`, `certifications`, `site - **Contract Management**: Sites now include contract fields: `contractReference` (codice contratto), `contractStartDate`, `contractEndDate` (date validità contratto in formato YYYY-MM-DD) - Sites now reference service types via `serviceTypeId` foreign key; `shiftType` is optional and can be derived from service type - **Multi-Location Support**: Added `location` field (enum: roccapiemonte, milano, roma) to `sites`, `guards`, and `vehicles` tables for complete multi-sede resource isolation +- **Customer Management (October 23, 2025)**: Added `customers` table with `sites.customerId` foreign key for customer-centric organization. Customers include: name, business name, VAT/fiscal code, address, city, province, ZIP, phone, email, PEC, contact person, notes, active status. + +**Recent Features (October 23, 2025)**: +- **Customer Management (Anagrafica Clienti)**: New `/customers` page with full CRUD operations: + - Comprehensive customer form: name, business name, VAT/fiscal code, address, contacts (phone/email/PEC), referent, notes + - Customer status toggle (active/inactive) + - Delete confirmation with cascade considerations + - Sidebar menu entry for admin/coordinator roles + - Backend: Full CRUD routes with validation +- **Reports per Cliente**: New customer-centric billing reports replacing site-based approach: + - Backend endpoint `/api/reports/customer-billing` aggregating by customer → sites → service types + - Separate counters based on service type: + * Presidio Fisso → Hours worked + * Pattuglia/Ronda → Number of passages (from `serviceType.patrolPassages`) + * Ispezione → Number of inspections counted + * Pronto Intervento → Number of interventions counted + - Frontend: "Report Clienti" tab with 5 KPI cards (customers, hours, passages, inspections, interventions) + - Hierarchical display: Customer header → Sites list → Service type details with conditional badges + - CSV export with 8 columns: Cliente, Sito, Tipologia Servizio, Ore, Turni, Passaggi, Ispezioni, Interventi + - Maintains existing "Report Guardie" and "Report Siti" tabs for compatibility **Recent Features (October 17-18, 2025)**: - **Multi-Sede Operational Planning**: Redesigned operational planning workflow with location-first approach: