- unit: fixture shapes, mock API (GET/POST/PUT/DELETE), mock DB operations
- integration: real DB CRUD via testDb (list, filter, create, get, update, delete)
- e2e: handler calls directly with mock FreshContext + real DB
covers auth (employee vs non-employee), 400/403/404 cases
- adds test:e2e deno task and CI step
- adds tests/helpers/handler.ts with makeEmployeeContext, makeContextWithAffiliation,
makeGetRequest, makeJsonRequest utilities
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Use apt-get install + configure listen_addresses + md5 auth in pg_hba
so psql can connect via 127.0.0.1 (not just Unix socket)
- Use pg_ctlcluster restart after config changes + wait for pg_isready
- Replace session_replication_role (requires superuser) with a single
TRUNCATE ... CASCADE which handles FK deps without elevated privileges
- All 3 integration tests now pass in CI (act + Gitea Actions)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Generate Drizzle migrations (databases/migrations/)
- Add databases/schema.kit.ts for drizzle-kit (Node-compatible imports)
- Update drizzle.config.ts to use schema.kit.ts
- Add deno tasks: test:unit, test:integration, migrate
- Add tests/helpers/db_integration.ts: testDb, truncateAll, seed helpers
- Add .gitea/workflows/test.yml: CI with postgres service container
- Update lint.yml: run test:unit only (no DB needed)
- Update deploy.yml: add check-code job, gate deploy on it
- PUT /ue-modules/{idModule}/{idUE}/{idPromo}: update coeff for
UE-Module-Promo association
- DELETE /ue-modules/{idModule}/{idUE}/{idPromo}: remove UE-Module-Promo
association
- requires employee role
- GET /ajustements: list all ajustements with optional numEtud/idUE
filters
- POST /ajustements: create new ajustement for student in UE
- Both require employee role
Add CRUD API for enseignements (prof-module-promo associations):
- POST /enseignements: Create with validation (201/409)
- GET /enseignements/{idProf}/{idModule}/{idPromo}: Read by composite
key (200/404)
- DELETE /enseignements/{idProf}/{idModule}/{idPromo}: Delete by
composite key (204/404)
Access control: Employee-only (403 Forbidden)
Tests: 7 unit tests added
Note: RBAC implementation pending (current access control is temporary)
- GET /promotions/{idPromo} returns promotion or 404
- PUT /promotions/{idPromo} updates year or 404
- DELETE /promotions/{idPromo} deletes promotion or 404
- Only employees allowed, otherwise 403