8.5 KiB
Structure Bundle Deep Dive
Ubiquitous Language
- Structure: tenant-like operational organization that owns users/employees/configuration.
Path:src/Uriae/StructureBundle/Entity/Structure.php - HeadOffice / Groupe: grouping of structures with admin ownership.
Path:src/Uriae/StructureBundle/Entity/HeadOffice.php - SiaeType: structure typology and ASP capabilities (
aspEnabled,aspFileEnabled,mesure,idAsp).
Path:src/Uriae/StructureBundle/Entity/SiaeType.php - FormeJuridique: legal form reference.
Path:src/Uriae/StructureBundle/Entity/FormeJuridique.php - Town / Department / Region: territorial reference model.
Path:src/Uriae/StructureBundle/Entity/Town.php - SiteTravail: work site linked to structure.
Path:src/Uriae/StructureBundle/Entity/SiteTravail.php - Sector: operational sector linked to structure.
Path:src/Uriae/StructureBundle/Entity/Sector.php - PersonneContact: structure contact person.
Path:src/Uriae/StructureBundle/Entity/PersonneContact.php - AnnexeFinanciere: yearly annex identifier for structure financing context.
Path:src/Uriae/StructureBundle/Entity/AnnexeFinanciere.php - ChiffreCle / Financement: yearly KPI and funding model.
Paths:src/Uriae/StructureBundle/Entity/ChiffreCle.php,src/Uriae/StructureBundle/Entity/Financement.php - Alerte: threshold rule per type with display/order metadata.
Path:src/Uriae/StructureBundle/Entity/Alerte.php - Diary / DiaryEvent / DiaryMailer: operational alert calendar and recipients.
Paths:src/Uriae/StructureBundle/Entity/Diary.php,src/Uriae/StructureBundle/Entity/DiaryEvent.php,src/Uriae/StructureBundle/Entity/DiaryMailer.php - Competence: structure-scoped competence catalog reused by employees.
Path:src/Uriae/StructureBundle/Entity/Competence.php - Fusion: merge workflow between structures with cross-context remapping.
Path:src/Uriae/StructureBundle/Controller/StructureController.php
Domain Core
-
Likely root today:
Structure- Central owner of users, employees, sectors, sites, alerts, diary, annexes, and financial records.
- Paths:
src/Uriae/StructureBundle/Entity/Structure.phpsrc/Uriae/StructureBundle/Repository/StructureRepository.php
-
Monitoring configuration cluster
Alerte,Diary,DiaryEvent,DiaryMailer.- Paths:
src/Uriae/StructureBundle/Entity/Alerte.phpsrc/Uriae/StructureBundle/Entity/Diary.phpsrc/Uriae/StructureBundle/Entity/DiaryEvent.phpsrc/Uriae/StructureBundle/Entity/DiaryMailer.php
-
Profile and topology cluster
- Identity/legal/contact + work organization (
SiteTravail,Sector). - Paths:
src/Uriae/StructureBundle/Entity/Structure.phpsrc/Uriae/StructureBundle/Entity/FormeJuridique.phpsrc/Uriae/StructureBundle/Entity/SiaeType.phpsrc/Uriae/StructureBundle/Entity/SiteTravail.phpsrc/Uriae/StructureBundle/Entity/Sector.php
- Identity/legal/contact + work organization (
-
Financial cluster
- Annex, key figures, financings.
- Paths:
src/Uriae/StructureBundle/Entity/AnnexeFinanciere.phpsrc/Uriae/StructureBundle/Entity/ChiffreCle.phpsrc/Uriae/StructureBundle/Entity/Financement.php
-
Boundary reality
- Structure aggregate currently directly traverses multiple contexts (Employee/User/Suivi/Union/Asp), especially in controller workflows.
Invariants / Concistency
-
src/Uriae/StructureBundle/Entity/Structure.php- Structure name uniqueness.
- Mandatory fields for information and characteristics contexts.
- SIRET length and structural validation coupling.
- Town cannot be sentinel invalid value.
- At least one activity sector required.
- Category activity constrained to a fixed set of values.
- Bidirectional consistency for collections (users, employees, sectors, sites, alerts, diary).
-
src/Uriae/StructureBundle/Form/Validator/SiretValidator.php- SIRET validated with Luhn checksum.
-
src/Uriae/StructureBundle/Form/Validator/AnnexeFinanciereValidator.php- Annex values must match allowed patterns.
-
src/Uriae/StructureBundle/Entity/Alerte.php- Alert type constrained to known constants and default behavior fields.
-
src/Uriae/StructureBundle/Entity/Diary.php- Default diary event initialization and base config defaults.
-
src/Uriae/StructureBundle/Controller/CompetenceController.php- Competence deletion blocked if linked to employee competences.
-
src/Uriae/StructureBundle/Controller/StructureController.php- Admin-only operations for create/delete/toggle SMS.
- On creation, default alert templates are provisioned.
- On delete, users are disabled or reassigned depending on group role.
-
src/Uriae/StructureBundle/Repository/StructureRepository.php- Soft-deleted structures excluded from normal retrieval paths.
Cross-context Dependencies
-
Structure <-> User
- Paths:
src/Uriae/StructureBundle/Entity/Structure.phpsrc/Uriae/UserBundle/Entity/User.phpsrc/Uriae/UserBundle/Security/SuccessHandler.php
- Paths:
-
Structure <-> Employee
- Paths:
src/Uriae/StructureBundle/Entity/Structure.phpsrc/Uriae/EmployeeBundle/Entity/Employee.phpsrc/Uriae/EmployeeBundle/Repository/EmployeeRepository.php
- Paths:
-
Structure <-> Suivi
- Paths:
src/Uriae/SuiviBundle/Entity/TypeAction.phpsrc/Uriae/SuiviBundle/Entity/CategorieSavoir.phpsrc/Uriae/StructureBundle/Model/EvaluationUpdater.phpsrc/Uriae/StructureBundle/Controller/ReferentielInsertionController.php
- Paths:
-
Structure <-> Union
- Paths:
src/Uriae/UnionBundle/Entity/Partenaire.phpsrc/Uriae/StructureBundle/Controller/StructureController.php
- Paths:
-
Structure <-> ASP
- Paths:
src/Uriae/StructureBundle/Entity/SiaeType.phpsrc/Uriae/AspBundle/Model/GeneratorFactory.phpsrc/Uriae/AspBundle/Manager/AbstractAspManager.phpsrc/Uriae/AspBundle/Entity/AbstractFichierAsp.php
- Paths:
DDD Slicing
-
Aggregates (candidate)
StructureProfile(identity/legal/contact/territory/SIAE/head-office).StructureWorkOrganization(sites/sectors/activity sectors).StructureMonitoringConfig(alerts/diary/events/recipients).StructureFinancialProfile(annexes/key figures/financing).
-
Value objects (candidate)
Siret,PhoneNumber,EmailAddress,PostalAddress.ActivityCategory.AlertThresholdsandAlertOperand.ApiTokenCiphertext.
-
Domain services (candidate)
StructureMergeService.StructureProvisioningService.StructureAlertPolicyService.StructureDiaryComputationService.
-
Repository interfaces (domain-facing)
StructureRepository.StructureMonitoringRepository.StructureFinancialRepository.StructureMergeReadModel.StructureReferenceDataRepository.
-
Domain events (candidate)
StructureCreated.StructureMerged.StructureSoftDeleted.StructureMonitoringConfigured.StructureSiaeTypeChanged.StructureUsersReassigned.
Reading Order
src/Uriae/StructureBundle/Entity/Structure.phpsrc/Uriae/StructureBundle/Repository/StructureRepository.phpsrc/Uriae/StructureBundle/Controller/StructureController.phpsrc/Uriae/StructureBundle/Entity/Alerte.phpsrc/Uriae/StructureBundle/Repository/AlerteRepository.phpsrc/Uriae/StructureBundle/Entity/Diary.phpsrc/Uriae/StructureBundle/Entity/DiaryEvent.phpsrc/Uriae/StructureBundle/Entity/DiaryMailer.phpsrc/Uriae/StructureBundle/Model/DiaryHandler.phpsrc/Uriae/StructureBundle/Controller/AlerteController.phpsrc/Uriae/StructureBundle/Entity/SiaeType.phpsrc/Uriae/StructureBundle/Entity/HeadOffice.phpsrc/Uriae/StructureBundle/Entity/SiteTravail.phpsrc/Uriae/StructureBundle/Entity/Sector.phpsrc/Uriae/StructureBundle/Entity/Competence.phpsrc/Uriae/StructureBundle/Form/Validator/AnnexeFinanciereValidator.phpsrc/Uriae/StructureBundle/Form/Validator/SiretValidator.phpsrc/Uriae/StructureBundle/Model/EvaluationUpdater.phpsrc/Uriae/EmployeeBundle/Entity/Employee.phpsrc/Uriae/EmployeeBundle/Entity/Contrat.phpsrc/Uriae/EmployeeBundle/Entity/Pmsmp.phpsrc/Uriae/EmployeeBundle/Repository/EmployeeRepository.phpsrc/Uriae/SuiviBundle/Entity/TypeAction.phpsrc/Uriae/SuiviBundle/Entity/CategorieSavoir.phpsrc/Uriae/AspBundle/Model/GeneratorFactory.phpsrc/Uriae/UserBundle/Entity/User.php