Summary
The Sequelize model defines legacy billing linkage columns (teJobId, teWorkerId, teBillTypeId, teInvoiceJobId), but other layers are out of sync.
Current drift
| Layer |
Status |
setup/TimeEntry.sql |
Only teCustId FK; no job/worker/billtype columns |
app/config/db.config.js |
No TimeEntry ↔ Job/Worker/BillingType/InvoiceJob associations |
timeentrycontroller.js |
Create/update whitelist excludes those fields |
| CSV export |
Omits those columns |
Risk
Fresh installs from baseline SQL may diverge from migrated DBs; API clients cannot read/write billing linkage; model and physical schema can drift.
Acceptance criteria
Pick one direction and finish it end-to-end:
- Full restore: migration + baseline SQL + zod schemas + controller whitelist + associations + OpenAPI + CSV + integration tests
- Intentional sever: remove columns from model (or mark deprecated), document the break, migration to drop unused columns if present in prod
Source
Code review backlog (2026-06-23)
Summary
The Sequelize model defines legacy billing linkage columns (
teJobId,teWorkerId,teBillTypeId,teInvoiceJobId), but other layers are out of sync.Current drift
setup/TimeEntry.sqlteCustIdFK; no job/worker/billtype columnsapp/config/db.config.jstimeentrycontroller.jsRisk
Fresh installs from baseline SQL may diverge from migrated DBs; API clients cannot read/write billing linkage; model and physical schema can drift.
Acceptance criteria
Pick one direction and finish it end-to-end:
Source
Code review backlog (2026-06-23)