Commit Graph

146 Commits

Author SHA1 Message Date
anys 84ec75ac3c 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 13:03:23 +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
anys f3c1f10999 feat(api): implement enseignements CRUD endpoints
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)
2026-04-22 17:13:14 +00:00
djalim 92182b952f feat(modules): add CRUD endpoints for module resource
Implement GET, PUT, DELETE for /modules/{idModule} with 404 handling.
2026-04-22 14:47:08 +02:00
djalim cf3c7c0693 feat(admin/api): add modules endpoint with GET and POST handlers 2026-04-22 14:46:00 +02:00
djalim 5229453169 chore(drizzle.config.ts): import process for env variable support 2026-04-22 14:40:19 +02:00
djalim 6c18189d9f chore(deps): update drizzle-orm to 0.45.2 and pg to 8.20.0 2026-04-22 14:40:19 +02:00
djalim 2c1fd7e5ad feat(promotions): add CRUD endpoints for promotion by id
- 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
2026-04-22 14:40:19 +02:00
Clément Oudelet 2f15efe21e PMPR-33 : POST /ues - créer une UE 2026-04-22 14:28:03 +02:00
Clément Oudelet b2847a4a7d PMPR-42 : GET /notes - récupère les notes 2026-04-22 12:20:59 +00:00
djalim 3f0c8d079f feat(students): add promotions API for employees 2026-04-22 14:13:59 +02:00
djalim 4eaea48ebd feat(students): add CRUD endpoints for student by numEtud 2026-04-22 14:11:29 +02:00
djalim f959cf0d3a feat(students): add CSV import endpoint for student data 2026-04-22 14:10:18 +02:00
djalim 0d45bd4c1c refactor(students): simplify API, remove unused imports and helpers
refactor(students): add query param filtering, enforce employee role for POST
refactor(students): return created student in POST response
2026-04-22 14:06:01 +02:00
djalim b5f134d016 feat(roles): add CRUD endpoints for role by id 2026-04-22 13:45:59 +02:00
djalim 9a3f49ecfe feat(admin/api): add roles endpoint with GET and POST 2026-04-22 13:44:30 +02:00
djalim 5a86f69093 feat: add CRUD endpoints for users by id 2026-04-22 13:42:29 +02:00
djalim 03b58e7b0a feat(admin/api/users): add GET and POST endpoints for users 2026-04-22 13:41:33 +02:00
djalim 9168ca53da feat(admin): scaffold admin module and add GET /permissions endpoint
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 13:30:19 +02:00
djalim b8d359a507 feat(database): add roles, permissions, users, modules, and related tables
Add tables for role-based access control and academic entities.
Includes modules, UEs, notes, and adjustments.
Update students and mobility tables to reference new primary keys.
This enables richer data modeling for the application.
2026-04-22 13:17:08 +02:00
Clément Oudelet 32ffbb7cda PMPR-32 : GET /ues - liste toutes les UEs 2026-04-22 12:50:46 +02:00
djalim ce5acacca6 refactor(api_mock.ts): remove async from mockFetch to match signature 2026-04-21 10:14:25 +00:00
djalim 4211df32a8 style: format api mock return type and test imports/JSON body 2026-04-21 10:14:25 +00:00
djalim 50afe2ae66 test: add mock DB helper for unit tests
test: add tests for fixtures, mock fetch, mock db, and happy-dom

- Add comprehensive fixture shape tests.
- Expand mockFetch to support methods, status codes, and body tracking.
- Introduce getFetchCalls to inspect intercepted requests.
- Add mockDb helper for in-memory DB operations.
- Reorganize tests for clarity and coverage.
- Ensure happy-dom setup/cleanup works correctly.
2026-04-21 10:14:25 +00:00
djalim 17c5b33a5b refactor(test): improve fetch mock and update fixture types
Add support for HTTP methods, status codes, body and headers in the fetch
mock. Track calls and expose getFetchCalls for assertions. Update fixture
interfaces to use string IDs, add ImportResult and ApiError types, and
provide standard error constants. Adjust fixture data to match new types.
2026-04-21 10:14:25 +00:00
djalim 01fd6e9984 test: add e2e, integration, and unit tests for fixtures and mockFetch 2026-04-21 10:14:25 +00:00
djalim 332286c085 test: add API mock, fixtures, and DOM helpers for tests 2026-04-21 10:14:25 +00:00
djalim 612c41c099 ci: add test job to lint workflow and update deno.json
Add test script to deno.json
Add @std/assert, @std/testing, happy-dom dependencies
2026-04-21 10:14:25 +00:00
djalim 0f7282ba87 chore(compose.yml): update Docker Compose for production deployment
Add postgres service with environment variable for password.
Change app image to registry and adjust ports.
Update volume mount to production path.
Add deploy constraints for manager nodes.
2026-04-03 10:50:53 +02:00
djalim 9636242b42 refactor(mobility): switch to Drizzle ORM and remove raw SQLite usage
- replace Database with db instance
- use schema imports for tables
- use db.select, db.insert, onConflictDoUpdate
- remove manual connection handling and console logs
- improve type safety and maintainability

refactor(students): migrate to Drizzle ORM and async queries

Replace raw sqlite queries with Drizzle ORM. Remove the connect helper and use the
shared db instance and schema definitions. Convert getItself, getAll and
addStudents to async functions, use eq and lt helpers, and simplify promotion
handling. This improves type safety, maintainability, and allows non‑blocking
database access.
2026-04-03 10:43:29 +02:00
djalim 4949bdce5d chore(drizzle): add config for drizzle-kit migrations 2026-04-03 10:41:52 +02:00
djalim 33b8c178f2 feat(db): add PostgreSQL connection and schema definitions 2026-04-03 10:41:11 +02:00
djalim 4a2a0a3681 chore: add dependencies for dotenv, drizzle-orm, pg and dev deps
Set up environment config and database ORM
2026-04-03 10:33:38 +02:00
djalim 5932b8c2cd docs(env): add postgres env variables 2026-04-03 10:30:48 +02:00
djalim e111d5be28 Merge pull request '🐛 (Dockerfile): remove stray 'flag' argument from deno cache command' (#6) from feature/deploy into main
Build and push image / Build Docker image (push) Successful in 20s
Reviewed-on: https://git.polytech.djalim.fr/admin/PolyMPR/pulls/6
2026-01-13 08:08:24 +00:00
djalim c70d4a5f11 🐛 (Dockerfile): remove stray 'flag' argument from deno cache command
Check Deno code / Check Deno code (pull_request) Successful in 14s
2026-01-13 09:07:01 +01:00
djalim ad5c271b05 Merge pull request 'feature/deploy : Added deploy ci tu automaticaly push image to registry' (#5) from feature/deploy into main
Build and push image / Build Docker image (push) Failing after 1m35s
Reviewed-on: https://git.polytech.djalim.fr/admin/PolyMPR/pulls/5
2026-01-13 07:47:18 +00:00
djalim 19a588ac25 🚀 ci: add Docker build and push workflow, remove old Deno check workflow
Check Deno code / Check Deno code (pull_request) Successful in 16s
2026-01-13 08:45:23 +01:00
djalim ad524978df 🔧 (ci.yml): renamed Deno lint workflow for pull requests 2026-01-09 12:57:51 +01:00
djalim 2ce78547b7 Merge pull request '🔧 chore(ci): removed old github workflow folder' (#4) from fix/action into main
Reviewed-on: https://git.polytech.djalim.fr/admin/PolyMPR/pulls/4
2026-01-09 11:52:25 +00:00
djalim 81a3fc0e03 🔧 chore(ci): removed old github workflow folder
Check Deno code / Check Deno code (pull_request) Successful in 13s
2026-01-09 12:50:46 +01:00
djalim 2615961bf1 Merge pull request '🔧 ci: add Deno lint and format check workflow' (#1) from feature/actions into main
Reviewed-on: https://git.polytech.djalim.fr/admin/PolyMPR/pulls/1
2026-01-09 11:48:18 +00:00
djalim fb967e3af3 Merge pull request '🔧 chore: add env.template and load .env instead of .env.development.local' (#2) from feature/dotenv into main
Reviewed-on: https://git.polytech.djalim.fr/admin/PolyMPR/pulls/2
2026-01-09 11:48:05 +00:00