8.9 KiB
Employee Bundle Deep Dive
Ubiquitous Language
- Employee / Salarie / Employe: central person lifecycle record.
Path:src/Uriae/EmployeeBundle/Entity/Employee.php - TypeEmployee: profile category driving workflows/filters.
Paths:src/Uriae/EmployeeBundle/Entity/Employee.php,src/Uriae/EmployeeBundle/Repository/EmployeeRepository.php - Employee state (
Postulant,En contrat,Sorti): lifecycle projection from contracts/sortie.
Paths:src/Uriae/EmployeeBundle/Entity/Employee.php,src/Uriae/EmployeeBundle/Model/EmployeeStateUpdater.php - Contrat: contract period + métier + site + ASP bridge.
Path:src/Uriae/EmployeeBundle/Entity/Contrat.php - ParcoursInsertion: insertion timeline + sortie segments.
Path:src/Uriae/EmployeeBundle/Entity/ParcoursInsertion.php - SituationSortie: exit segment with dates/type.
Path:src/Uriae/UnionBundle/Entity/SituationSortie.php - FirstHome: intake/prescriber/resource/mutuelle context.
Path:src/Uriae/EmployeeBundle/Entity/FirstHome.php - AdministrativeInformation: civil/admin identity block (NIR/NTT, nationality, birth info).
Path:src/Uriae/EmployeeBundle/Entity/AdministrativeInformation.php - PersonnalDetail: address/contact block.
Path:src/Uriae/EmployeeBundle/Entity/PersonnalDetail.php - HiringStatus: eligibility and social condition matrix (RSA, AAH, RQTH, etc.).
Path:src/Uriae/EmployeeBundle/Entity/HiringStatus.php
Domain Core
-
De facto root:
Employee- Owns/coordinates personal, admin, intake, insertion, contracts, jobs, medical visits, receipts, competencies.
- Path:
src/Uriae/EmployeeBundle/Entity/Employee.php
-
Contract lifecycle cluster
Contrat+ ASP contract dossier + sortie semantics.- Paths:
src/Uriae/EmployeeBundle/Entity/Contrat.phpsrc/Uriae/AspBundle/Entity/FicheContratAsp.phpsrc/Uriae/UnionBundle/Entity/SituationSortie.php
-
Insertion timeline cluster
ParcoursInsertionwith associated sortie segments.- Path:
src/Uriae/EmployeeBundle/Entity/ParcoursInsertion.php
-
Profile/intake clusters
PersonnalDetail,AdministrativeInformation,HiringStatus,FirstHome.- Paths:
src/Uriae/EmployeeBundle/Entity/PersonnalDetail.phpsrc/Uriae/EmployeeBundle/Entity/AdministrativeInformation.phpsrc/Uriae/EmployeeBundle/Entity/HiringStatus.phpsrc/Uriae/EmployeeBundle/Entity/FirstHome.php
Invariants / Concistency
-
src/Uriae/EmployeeBundle/Entity/Employee.php- State constrained to known values.
civilitydrives derived sex.- Sortie considered complete only when both date + type are present.
- Contract timeline helpers (first/last/previous/initial logic).
-
src/Uriae/EmployeeBundle/Model/EmployeeStateUpdater.php- Recomputes state from contracts/sortie chronology.
-
src/Uriae/EmployeeBundle/Entity/Contrat.php- Contract date ordering constraints.
- ROME validity constraints.
- ASP-specific duration-in-months rounding behavior.
-
src/Uriae/EmployeeBundle/Form/Validator/DateEffectiveContratValidator.php- Prevents new/update contract when previous relevant contract has no effective end date.
-
src/Uriae/EmployeeBundle/Form/Validator/CodeRomeValidator.php- Rejects expired ROME codes at contract start.
- Adds date-threshold behavior around 2022 policy.
-
src/Uriae/EmployeeBundle/Entity/ParcoursInsertion.php- Agreement number format constraints.
- First/last sortie determination rules by entry dates.
-
src/Uriae/UnionBundle/Entity/SituationSortie.php- Sortie type/date consistency (both required together).
-
src/Uriae/EmployeeBundle/Model/SituationSortieUpdater.php- Rebuilds contract-sortie mapping.
- Removes empty sorties.
- Creates sortie for orphan contracts.
- Triggers state refresh.
-
src/Uriae/EmployeeBundle/Entity/AdministrativeInformation.php- Birth date required and validated.
- NIR/NTT consistency via validators.
-
src/Uriae/EmployeeBundle/Form/Validator/SocialSecurityNumberValidator.php- NIR shape + civility constraints.
- NTT fallback requirement when NIR absent in specific cases.
-
src/Uriae/EmployeeBundle/Form/Validator/TemporaryTechnicalNumberValidator.php- NIR/NTT mutual exclusivity.
-
src/Uriae/EmployeeBundle/Entity/HiringStatus.php- Coherence between social flags (RSA/ayant-droit, sans-ressources, AAH-handicap linkage).
- Young-in-difficulty age window logic based on DOB + first contract.
-
src/Uriae/EmployeeBundle/Entity/PersonnalDetail.php- At least one phone required.
- Phone/address/town/zip consistency checks.
-
src/Uriae/EmployeeBundle/Entity/FirstHome.php- PE inscription-dependent fields required conditionally.
- PE identifier formatting.
- Conventionneur-only partner constraint.
Cross-context Dependencies
-
Employee -> Suivi
- Paths:
src/Uriae/EmployeeBundle/Entity/Employee.phpsrc/Uriae/SuiviBundle/Entity/Accompagnement.phpsrc/Uriae/SuiviBundle/Entity/Evaluation.phpsrc/Uriae/SuiviBundle/Entity/Problematique.phpsrc/Uriae/SuiviBundle/Entity/Potentiel.php
- DDD direction idea: Suivi consumes Employee identity/reference, not full object graph.
- Paths:
-
Employee -> ASP
- Paths:
src/Uriae/EmployeeBundle/Entity/Contrat.phpsrc/Uriae/AspBundle/Entity/FicheContratAsp.phpsrc/Uriae/AspBundle/Manager/AspFicheContratManager.php
- DDD direction idea: ASP as downstream integration context reacting to contract events.
- Paths:
-
Employee -> Union
- Paths:
src/Uriae/EmployeeBundle/Entity/ParcoursInsertion.phpsrc/Uriae/UnionBundle/Entity/SituationSortie.php
- DDD direction idea: shared kernel or ACL around sortie taxonomy.
- Paths:
-
Employee <-> Structure
- Paths:
src/Uriae/EmployeeBundle/Entity/Employee.phpsrc/Uriae/StructureBundle/Entity/Structure.php
- DDD direction idea: explicit IDs/reference objects instead of deep bidirectional graph.
- Paths:
DDD Slicing
-
Aggregates (candidate)
EmployeeProfile(identity + personal/admin + hiring status).EmploymentLifecycle(contracts + state projection + timeline fields).InsertionJourney(parcours + sortie segments).IntakeContext(first home/resources/mutuelle data).EmployeeCompetency(employee-competence assignment).
-
Domain services (candidate)
EmployeeStatePolicy(fromEmployeeStateUpdater).SituationSortieRebuilder(fromSituationSortieUpdater).ContractTimelineCalculator(first/last contract rules).HiringStatusPolicy(coherence rules currently scattered in entity callbacks/validators).
-
Repository interfaces (domain-facing)
EmployeeRepository(aggregate retrieval only).ContractRepository(active/last/chronology views).InsertionJourneyRepository.- Separate read-model queries for reporting/export/bilan.
-
Domain events (candidate)
ContractAdded,ContractUpdated,ContractRemoved.EmployeeStateChanged.SituationSortieRecomputed.AspSubmissionAcknowledged(integration side).
-
Value objects (candidate)
EmployeeState,EmployeeTypeSlug.ContractPeriod.SocialSecurityNumber,TemporaryTechnicalNumber.AgreementNumber,PoleEmploiId.PhoneNumber,PostalAddress,ZipCode.
src/Uriae/EmployeeBundle/Entity/Employee.php
Reading Order (Employee domain deep dive)
src/Uriae/EmployeeBundle/Entity/Employee.phpsrc/Uriae/EmployeeBundle/Entity/Contrat.phpsrc/Uriae/EmployeeBundle/Entity/ParcoursInsertion.phpsrc/Uriae/UnionBundle/Entity/SituationSortie.phpsrc/Uriae/EmployeeBundle/Model/SituationSortieUpdater.phpsrc/Uriae/EmployeeBundle/Model/EmployeeStateUpdater.phpsrc/Uriae/EmployeeBundle/EventSubscriber/ContratChangeSubscriber.phpsrc/Uriae/EmployeeBundle/Entity/AdministrativeInformation.phpsrc/Uriae/EmployeeBundle/Entity/HiringStatus.phpsrc/Uriae/EmployeeBundle/Entity/PersonnalDetail.phpsrc/Uriae/EmployeeBundle/Entity/FirstHome.phpsrc/Uriae/EmployeeBundle/Entity/Pmsmp.phpsrc/Uriae/EmployeeBundle/Form/Validator/DateEffectiveContratValidator.phpsrc/Uriae/EmployeeBundle/Form/Validator/CodeRomeValidator.phpsrc/Uriae/EmployeeBundle/Form/Validator/SocialSecurityNumberValidator.phpsrc/Uriae/EmployeeBundle/Form/Validator/TemporaryTechnicalNumberValidator.phpsrc/Uriae/EmployeeBundle/Repository/EmployeeRepository.phpsrc/Uriae/EmployeeBundle/Repository/ContratRepository.phpsrc/Uriae/EmployeeBundle/Controller/ContratsController.phpsrc/Uriae/EmployeeBundle/Controller/InsertionController.phpsrc/Uriae/AspBundle/Entity/FicheContratAsp.phpsrc/Uriae/AspBundle/Manager/AspFicheContratManager.phpsrc/Uriae/SuiviBundle/Entity/Accompagnement.phpsrc/Uriae/SuiviBundle/Entity/Evaluation.phpsrc/Uriae/StructureBundle/Entity/Structure.php