Extract shared Prisma include constants per entity #11
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: Identical Prisma
includeobjects (with the same nested relations) are duplicated 3-5 times per service file.Files affected:
backend/src/drivers/drivers.service.ts- same include infindAll,findOne,findByUserId(lines 23-29, 40-44, 58-64)backend/src/vehicles/vehicles.service.ts- same include repeated 3 times (lines 29-35, 57-63, 84-88)backend/src/events/events.service.ts- 9-line include pattern duplicated 5 times (lines 72-82, 91-100, 111-120, 210-220, 236-246)Suggested fix:
const EVENT_INCLUDE = { vip: true, driver: true, ... } as constat the top of each serviceEffort: Trivial
Extracted shared Prisma include constants in drivers, vehicles, and events services. Each service now defines the include pattern once at the top.