3.9 KiB
3.9 KiB
SIRH
Mandatory Rules
- Any functional change MUST update
doc/in the same intervention - At the end of every feature addition or functional modification, update this CLAUDE.md to reflect new patterns, rules, or conventions introduced
Commands
make start— start Docker stackmake test— run backend tests (PHPUnit)make dev-nuxt— dev frontendcd frontend && npm run build— build frontendphp bin/console cache:clear && php bin/console cache:warmup— clear cache after deploy
Stack
- Backend: Symfony + API Platform + Doctrine ORM
- Frontend: Nuxt 4 + Vue 3 + TypeScript + Tailwind CSS
Project Structure
src/— Symfony domain, API resources, state providers/processors, servicesfrontend/— Nuxt app (pages, components, composables, services)migrations/— Doctrine migrations (always include workingdown())doc/— functional rules and business documentation
Functional Rules
- Reference:
doc/functional-rules.md(mandatory reading before any business logic change) - Complementary:
doc/leave-rollover.md,doc/rtt-rollover.md
Domain Model
- Contracts:
trackingMode(TIME=hours, PRESENCE=half-days),weeklyHours - Contract types: FORFAIT, THIRTY_FIVE_HOURS, THIRTY_NINE_HOURS, INTERIM, CUSTOM
- Contract nature (per period): CDI, CDD, INTERIM
- Employee contract history:
employee_contract_periods, resolved byEmployeeContractResolver - Absences: stored per day (auto-split), AM/PM/full day, clear corresponding hour slots
- Absences with
countAsWorkedHours=true: credit minutes (TIME) or nothing (PRESENCE) - Driver periods (
isDriver=trueonEmployeeContractPeriod): separate screen/driver-hours, usesdayHoursMinutes/nightHoursMinutes+ meal/overnight flags onWorkHour
Validation Rules
isValid(RH): locks line for everyone (admin can only untoggle validation)isSiteValid(site manager): locks for non-admin, admin can still edit- Any real modification resets both
isSiteValid=falseandisValid=false - No-op saves preserve existing validations
Overtime Rules
- Contracts <= 35h: +25% from 35h to 43h, +50% beyond
- Contracts >= 39h: +25% from 39h to 43h, +50% beyond
- INTERIM: no overtime bonuses, no recovery time
- Driver contracts: no overtime calculation
Frais (MileageAllowance)
- Onglet "Frais" (anciennement "Frais Kms") sur la fiche employé
- Validation: mois obligatoire + au moins
kilometers > 0ouamount > 0 - Les deux champs km et montant sont optionnels individuellement mais au moins un requis
Frontend Patterns
Table styling (standard across all pages)
- Header:
grid border border-black bg-tertiary-500 px-6 py-3 text-[20px] font-semibold text-black rounded-t-md sticky top-0 z-10 - Body wrapper:
border-x border-b border-primary-500 rounded-b-md - Rows:
grid items-center gap-4 border-b border-primary-500 px-6 py-3 text-md font-bold text-primary-500 last:border-b-0 cursor-pointer hover:bg-tertiary-500 - Page wrapper for scroll:
h-full flex flex-col overflow-hidden, table container:min-h-0 overflow-auto rounded-md bg-white
Drawer buttons (AppDrawer)
- Edit mode:
grid grid-cols-2 gap-3→ Supprimer (red, left) + Modifier (primary, right) - Create mode: centered
+ Ajouterbutton, w-[200px] - Exception: Users drawer has NO delete button
- All "Ajouter" buttons across the app use "+" prefix
API Platform (backend)
- Custom operations use Processor (write) / Provider (read)
- File uploads:
deserialize: falseon Post, access file via RequestStack - Upload dir:
%kernel.project_dir%/var/uploads
Backend Conventions
- Prefer explicit DTOs over associative arrays
- Business rules in backend (providers/processors/services), frontend is display/interaction only
- Keep backend PHP DTOs aligned with frontend TS DTOs (
frontend/services/dto/*) - Update unit tests when constructor/service signatures change
Language
- UI is in French
- User communicates in French
- Code (variables, comments) in English