Clément Oudelet
c68241e884
PMPR-44 : fix missing newline
Check Deno code / Check Deno code (pull_request) Successful in 6s
Tests / Unit tests (pull_request) Successful in 12s
Tests / Integration tests (pull_request) Successful in 1m13s
2026-04-26 23:33:45 +02:00
Clément Oudelet
383bebb3e7
PMPR-44 : fix formatting
Check Deno code / Check Deno code (pull_request) Failing after 6s
Tests / Unit tests (pull_request) Successful in 12s
Tests / Integration tests (pull_request) Successful in 1m13s
2026-04-26 23:28:50 +02:00
Clément Oudelet
a1c15185d6
PMPR-44 : POST /notes/import-xlsx - importer des notes via Excel
Check Deno code / Check Deno code (pull_request) Failing after 6s
Tests / Unit tests (pull_request) Successful in 14s
Tests / Integration tests (pull_request) Successful in 1m14s
2026-04-26 20:47:41 +02:00
djalim
714486f43c
chore: formated tests
Check Deno code / Check Deno code (pull_request) Successful in 5s
Tests / Unit tests (pull_request) Successful in 12s
Tests / Integration tests (pull_request) Successful in 1m9s
Check Deno code / Check Deno code (push) Successful in 6s
Tests / Unit tests (push) Successful in 12s
Tests / Integration tests (push) Successful in 1m13s
2026-04-26 19:07:15 +02:00
djalim
b0930b8da2
fix: correct handler bugs exposed by test suite
...
Check Deno code / Check Deno code (pull_request) Failing after 6s
Tests / Unit tests (pull_request) Successful in 13s
Tests / Integration tests (pull_request) Successful in 1m17s
- ajustements [numEtud]/[idUE]: fix .where() missing and() — PUT/DELETE
were applying only numEtud condition, modifying all rows for a student
- modules/users/enseignements POST: add try/catch, return 500 on invalid JSON
- modules/[idModule] PUT: add try/catch + type check on nom (string required)
- modules POST: add .trim() check to reject whitespace-only id/nom
- users POST: add .trim() check to reject whitespace-only id/nom/prenom
- ues POST: add .trim() check to reject whitespace-only nom
- notes POST: add type check (typeof number) and bounds check (0 ≤ note ≤ 20)
- ue-modules POST: add coeff >= 0 validation
Update robustness tests to reflect fixed behavior (remove [BUG] labels,
replace assertRejects with status code assertions).
2026-04-26 19:01:53 +02:00
djalim
2f4d8db1bf
test: add full test coverage for notes, ues, ue-modules, ajustements, enseignements, users
...
Check Deno code / Check Deno code (pull_request) Failing after 6s
Tests / Unit tests (pull_request) Successful in 13s
Tests / Integration tests (pull_request) Failing after 1m14s
- Unit tests (mock DB + API) for all missing endpoints
- Integration tests (Drizzle direct) for all missing entities
- E2E tests (handler + real DB) for all missing endpoints
- Robustness tests: invalid inputs, SQL injection, type errors, business rule violations
- Seed helpers: seedNotes, seedUeModules, seedEnseignements, seedAjustements
- Add test:coverage and test:coverage:html tasks to deno.json
Tests expose known handler bugs (marked [BUG] in test names):
- ajustements PUT/DELETE: .where() without and() modifies all rows for student
- Missing try/catch in modules, users, enseignements handlers
- Whitespace accepted as valid string values
- No type or business rule validation (note bounds, coeff >= 0)
2026-04-26 18:25:00 +02:00
djalim
a3b55d0a1b
fix: remove unused body variable in permissions e2e test
Check Deno code / Check Deno code (pull_request) Successful in 6s
Tests / Unit tests (pull_request) Successful in 11s
Tests / Integration tests (pull_request) Successful in 1m19s
Check Deno code / Check Deno code (push) Successful in 6s
Tests / Unit tests (push) Successful in 11s
Tests / Integration tests (push) Successful in 1m7s
2026-04-26 13:34:43 +00:00
djalim
86080b8042
test(permissions): add unit and e2e tests for GET /permissions ( #115 )
...
Handler is static (no DB), tests verify the 9 known permissions are returned
with correct id/nom shapes.
2026-04-26 13:34:43 +00:00
djalim
e3a7e20993
fix: remove unused assertExists import
Check Deno code / Check Deno code (pull_request) Successful in 5s
Tests / Unit tests (pull_request) Successful in 12s
Tests / Integration tests (pull_request) Successful in 1m1s
Check Deno code / Check Deno code (push) Successful in 5s
Tests / Unit tests (push) Successful in 11s
Tests / Integration tests (push) Successful in 1m10s
2026-04-26 13:34:27 +00:00
djalim
c5d02a2890
style: fix deno fmt and lint
2026-04-26 13:34:27 +00:00
djalim
c86d20ca81
test(modules): add unit, integration and e2e tests for /modules ( #113 )
...
- unit: fixture shapes, mock API (GET/POST/PUT/DELETE + 409), mock DB CRUD
- integration: list, create, get, duplicate rejection, update, delete
- e2e: handler calls with mock context + real DB, covers 400/403/404/409
2026-04-26 13:34:27 +00:00
djalim
f038e4020b
style: fix deno fmt and lint
Check Deno code / Check Deno code (pull_request) Successful in 6s
Tests / Unit tests (pull_request) Successful in 11s
Tests / Integration tests (pull_request) Successful in 59s
Check Deno code / Check Deno code (push) Successful in 6s
Tests / Unit tests (push) Successful in 11s
Tests / Integration tests (push) Successful in 1m2s
2026-04-26 13:34:09 +00:00
djalim
e75098083a
test(roles): add unit, integration and e2e tests for /roles ( #112 )
...
- unit: fixture shapes, mock API (GET/POST/PUT/DELETE), mock DB CRUD
- integration: list, create, assign permissions, update, reset perms, delete
- e2e: handler calls with mock context + real DB, covers 400/404 cases
2026-04-26 13:34:09 +00:00
djalim
e3eefd945c
chore: remove .github workflows (act only uses .gitea)
Check Deno code / Check Deno code (pull_request) Successful in 5s
Tests / Unit tests (pull_request) Successful in 12s
Tests / Integration tests (pull_request) Successful in 1m3s
Check Deno code / Check Deno code (push) Successful in 5s
Tests / Unit tests (push) Successful in 12s
Tests / Integration tests (push) Successful in 1m3s
2026-04-26 13:08:03 +00:00
djalim
d25c353018
fix: remove unused assertExists import
2026-04-26 13:08:03 +00:00
djalim
b3eb1b60a5
style: fix deno fmt and lint
2026-04-26 13:08:03 +00:00
djalim
222c3237f0
test(promotions): add unit, integration and e2e tests for /promotions ( #110 )
...
- unit: fixture shapes, mock API (GET/POST/PUT/DELETE), mock DB CRUD
- integration: real DB list, create, get, update, delete, not-found cases
- e2e: handler calls with mock context + real DB, covers 400/403/404 cases
2026-04-26 13:08:03 +00:00
djalim
e2f5bf7b95
ci: remove Run tests step from lint workflow
Check Deno code / Check Deno code (push) Successful in 6s
Tests / Unit tests (push) Successful in 12s
Tests / Integration tests (push) Successful in 57s
Check Deno code / Check Deno code (pull_request) Successful in 6s
Tests / Unit tests (pull_request) Successful in 12s
Tests / Integration tests (pull_request) Successful in 1m3s
2026-04-26 14:30:40 +02:00
djalim
cd5c524ff0
style: fix deno fmt on students tests and drizzle.config
Check Deno code / Check Deno code (pull_request) Failing after 8s
Tests / Unit tests (pull_request) Successful in 11s
Tests / Integration tests (pull_request) Successful in 58s
2026-04-26 14:18:09 +02:00
djalim
e5c6c389ea
test(students): add unit, integration and e2e tests for /students ( #109 )
...
Check Deno code / Check Deno code (pull_request) Failing after 5s
Tests / Unit tests (pull_request) Successful in 12s
Tests / Integration tests (pull_request) Successful in 58s
- 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 >
2026-04-26 14:00:38 +02:00
djalim
daa7f4951f
fix(ci): fix postgres TCP setup and truncateAll superuser error
...
Check Deno code / Check Deno code (push) Failing after 5s
Tests / Unit tests (push) Successful in 11s
Tests / Integration tests (push) Successful in 55s
- 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 >
2026-04-26 11:30:33 +00:00
djalim
a95818e3bf
fix(ci): use connection URL with ssl:false in drizzle config
2026-04-26 11:30:33 +00:00
djalim
26eedcc4f2
debug(ci): add connection diagnostics before migrate
2026-04-26 11:30:33 +00:00
djalim
ce4782580d
fix(ci): remove unsupported --verbose from drizzle-kit migrate
2026-04-26 11:30:33 +00:00
djalim
91248370da
fix(ci): add GRANT on public schema and verbose migrate output
2026-04-26 11:30:33 +00:00
djalim
6b8b5e6aa3
fix(ci): start postgres with pg_ctlcluster instead of systemctl
2026-04-26 11:30:33 +00:00
djalim
d1c3b93755
fix(ci): install postgres via apt-get instead of docker
2026-04-26 11:30:33 +00:00
djalim
f42df29f06
fix(ci): use docker run instead of services for postgres
2026-04-26 11:30:33 +00:00
djalim
c8b808f509
fix(ci): use bash /dev/tcp for postgres readiness check
2026-04-26 11:30:33 +00:00
djalim
fdfdd74894
fix(ci): replace pg_isready with nc for postgres readiness check
2026-04-26 11:30:33 +00:00
djalim
60dde4675c
fix(ci): use deno install for unit tests, add postgres readiness check
2026-04-26 11:30:33 +00:00
djalim
fef9457795
fix(ci): install npm deps before running unit tests
2026-04-26 11:30:33 +00:00
djalim
6db04045f4
fix(lint): add version to drizzle-orm imports and prefix unused NOT_FOUND
2026-04-26 11:30:33 +00:00
djalim
cdd9c0bf06
chore(test): set up integration test framework with postgres
...
- 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
2026-04-26 11:30:33 +00:00
djalim
980efcfbc3
ci: add Deno code check job and enable lint on develop
Check Deno code / Check Deno code (pull_request) Failing after 9s
Check Deno code / Check Deno code (push) Failing after 6s
2026-04-23 14:29:08 +02:00
anys
66183c2ad8
feat(api): implement UE-Module coefficient update and deletion endpoint
...
- 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
2026-04-23 14:01:40 +02:00
anys
9976b9e2b4
feat(api): implement UE-Module association get endpoint
...
- GET /ue-modules/{idModule}/{idUE}/{idPromo}: recover the detail of an
ue-module association by its composite key
- requires employee role
2026-04-23 11:57:30 +00:00
Clément Oudelet
457b008ba3
PMPR-46/47 : PUT et DELETE /notes/{numEtud}/{idModule}
2026-04-23 11:56:20 +00:00
anys
22750ba07e
feat(api): implement ajustement delete endpoint
...
- DELETE /ajustements/{numEtud}/{idUE}: remove ajustement from DB
- Requires employee role
- Returns 204 on success
2026-04-23 13:55:24 +02:00
anys
49876339bf
feat(api): implement ajustement update endpoint
...
- PUT /ajustements/{numEtud}/{idUE}: update ajustement valeur
- Requires employee role
2026-04-23 11:48:31 +00:00
Clément Oudelet
eeb087ea76
PMPR-36 : DELETE /ues/{idUE} - supprimer une UE
2026-04-23 13:44:43 +02:00
Clément Oudelet
7ad70c4525
GET /notes/{numEtud}/{idModule} - récupérer le détail d'une note pour un étudiant dans un module
2026-04-23 13:11:48 +02:00
Clément Oudelet
79669d60cf
PMPR-38 : POST /ue-modules - associer un module à une UE
2026-04-22 20:40:28 +02:00
anys
d3f1f433e1
feat(api): implement single ajustement retrieval endpoint
...
- GET /ajustements/{numEtud}/{idUE}: get ajustement by student numEtud
and UE id
- Requires employee role
2026-04-22 17:24:39 +00:00
anys
022994e5a7
feat(api): implement ajustements list and create endpoints
...
- GET /ajustements: list all ajustements with optional numEtud/idUE
filters
- POST /ajustements: create new ajustement for student in UE
- Both require employee role
2026-04-22 17:24:07 +00:00
Clément Oudelet
33d023986c
PMPR-34 : GET /ues/{idUE} - récupérer une UE par son id
2026-04-22 17:20:20 +00:00
Clément Oudelet
bbc9ea58e2
PMPR-37 : GET /ue-modules - liste les associations UE-Module
2026-04-22 17:15:54 +00:00
Clément Oudelet
96b7edf77f
PMPR-43 : POST /notes - créer une note
2026-04-22 17:14:45 +00:00
anys
a19a1e6c13
test(api): remove enseignements unit tests
...
Unit tests removed as they only used mocks without real value.
2026-04-22 17:13:14 +00:00
anys
2739a01ab5
fix(api): align enseignements route with Fresh file routing
...
- Replace flat file `[idProf]_[idModule]_[idPromo].ts`
with nested structure `[idProf]/[idModule]/[idPromo].ts`
- Ensures URL matches `/enseignements/{idProf}/{idModule}/{idPromo}`
2026-04-22 17:13:14 +00:00