You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: centralize code table management and enum generation
Refactors how database lookup code tables are cached, generated, and consumed. This eliminates manual code table arrays by dynamically building memory caches and types from Prisma metadata models ending in `_code`.
- Relocate and refactor code enum generation script to `src/db/codes/generate.ts`
- Implement dynamic cache manager in `src/db/codes/cache.ts` using a `Proxy` mapping
- Dynamically fetch active lookup tables in `services/code.ts` via Prisma DMMF models
- Update `peachSync.ts` to initialize caches prior to executing the synchronization loop
- Replace hardcoded constant validation arrays in endpoints and Joi schemas with live cache lookups
- Update unit tests and Jest deep mocks to support the central code cache system
Signed-off-by: qhanson55 <quinn.hanson@gov.bc.ca>
0 commit comments