Move vehicle utilization filtering to database query #15
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context:
vehicles.service.tsgetUtilization()fetches all events then filters for past events in application code. This should be done at the database level.File:
backend/src/vehicles/vehicles.service.ts(lines 116-143)Suggested fix:
where: { endTime: { lt: new Date() } }to the Prisma queryEffort: Small
Moved vehicle utilization event filtering to the Prisma query with .