refactor: complete code efficiency pass (Issues #10, #14, #16)

Backend:
- Add Prisma soft-delete middleware for automatic deletedAt filtering (#10)
- Split 2758-line copilot.service.ts into focused sub-services (#14):
  - copilot-schedule.service.ts (schedule/event tools)
  - copilot-reports.service.ts (reporting/analytics tools)
  - copilot-fleet.service.ts (vehicle/driver tools)
  - copilot-vip.service.ts (VIP management tools)
  - copilot.service.ts now thin orchestrator
- Remove manual deletedAt: null from 50+ queries

Frontend:
- Create SortableHeader component for reusable table sorting (#16)
- Create useListPage hook for shared search/filter/sort state (#16)
- Update VipList, DriverList, EventList to use shared infrastructure

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-08 16:34:18 +01:00
parent f2b3f34a72
commit 3bc9cd0bca
23 changed files with 2975 additions and 2443 deletions

View File

@@ -375,9 +375,6 @@ Note: GPS tracking is only active during shift hours (${settings.shiftStartHour}
const devices = await this.prisma.gpsDevice.findMany({
where: {
isActive: true,
driver: {
deletedAt: null,
},
},
include: {
driver: {
@@ -743,7 +740,6 @@ Note: GPS tracking is only active during shift hours (${settings.shiftStartHour}
where: {
role: 'ADMINISTRATOR',
isApproved: true,
deletedAt: null,
},
});