stable

Clone or download

Read-only

refactor: Domain should proceed RoleAssignment updates

part of request #29215 - Clean baseline plugin ⬡ Currently, ServiceSavePermissionController has too much responsibilities. It extracts the user groups ids from the request's body while it should be done by a dedicated adapter. This refactoring introduces a RoleAssignmentFromRequestExtractor which takes care of the extraction of the ids and returns a RoleAssignmentsToUpdate. It also introduces a domain object called RoleAssignmentsSaver whose role is to orchestrate the RoleAssignment Project History update when given a ProjectIdentifier and a RoleAssignmentsToUpdate. This is the final step of the refactoring aiming to clean the hexagon on the RoleAssignments side. Now the ServiceSavePermissionsController only handles the request, asks the Domain to save the permissions, and returns a Response. The domain commands the server-side adapters to save what's needed, and voilà. Change-Id: If9e40d3e3fcf69be42393c8bdea7ce4e058b43fc

Modified Files

Name
A plugins/baseline/include/Adapter/Administration/RoleAssignmentFromRequestExtractor.php +80 −0 Go to diff View file
A plugins/baseline/include/Domain/RoleAssignmentsSaver.php +77 −0 Go to diff View file
A plugins/baseline/include/Domain/RoleAssignmentsToUpdate.php +34 −0 Go to diff View file
M plugins/baseline/include/ServiceSavePermissionsController.php +10 −61 Go to diff View file
M plugins/baseline/include/baselinePlugin.php +8 −6 Go to diff View file
A plugins/baseline/tests/unit/Adapter/Administration/RoleAssignmentFromRequestExtractorTest.php +39 −0 Go to diff View file
A plugins/baseline/tests/unit/Domain/RoleAssignmentsSaverTest.php +123 −0 Go to diff View file
M plugins/baseline/tests/unit/ServiceSavePermissionsControllerTest.php +14 −10 Go to diff View file
A plugins/baseline/tests/unit/Stub/RoleAssignmentsToUpdateStub.php +54 −0 Go to diff View file