7.8. Approve delete block request Name Approve delete block request Purpose Allow Approver to validate a block delete request Linked user stories 3.36. Editor - Delete a block 4.48. Approver - Approve deleted block request 4.53. Organisation Approver - Approve deleted block request for organisation APIs used PUT /blocks//approve PUT /blocks//reject PUT or PATCH /blocks/ Scope This process only handles the validation of an already created block deletion request Roles System, Approver / Global Approver Input - id of the block that is marked for deletion - optionally the information to amend Output - confirmation that the update request has been approved/rejected Detailed Process description Main Process Step Description Actor(s) Input(s) Output(s) Decision points 1 The System sends out notifications to the Global approvers and organisation approvers, indicating that an approval a pending. System - Outside trigger (e.g. Editor sent a delete request) - notification to the Global and organisation Approvers 2 The Approver verifies if the block can be deleted Approver - Block deletion request - yes / no If the site can be deleted: Go to step 3 Else: Go to secondary process S.1 3 The System verifies if the site has other blocks than the one being deleted System - Block to be deleted - yes / no If the site has more blocks: Go to step 4 Else: Go to E.1 4 The System marks the block with the flag “is_deleted = true” and adds the information on the date of validation and the user that validated the request System - block with flag “marked_for_deletion = true” - block with flag “is_deleted = true” - approver set to the user that triggered the approval - approval date set to the current date 4 The System sets all the objects linked to the block with the flag “is_deleted = true” (units, equipments). System - block - all linked objects marked with the flag “is_deleted = true” 5 The System creates validated update requests with the flag “is_deleted = true” for each active physical link that are connected to at least one unit of the block. System - block - new validated physical links with the flag “is_deleted = true” for each active physical link that links at least one unit of the deleted block 6 The Approver gets a confirmation that the approval has been applied Approver - confirmation of the validation Secondary Processes S.1. Delete block request rejected Step Description Actor(s) Input(s) Output(s) Decision points 1 The System removes the mark_for_deletion tag from the block entry System - block marked for deletion - block with the flag “mark_for_deletion = false” 2 The Approver gets a confirmation that the deletion rejection has been applied Approver - deletion request rejection confirmation Error Processes E.1. Last block can’t be deleted Step Description Actor(s) Input(s) Output(s) Decision points 1 The Approver gets an error indicating that the last block of a site cannot be deleted System - Error: last block can’t be deleted Exceptions [400 Bad Request] Invalid input: If mandatory fields are missing or invalid, the system returns an error message. If some addresses do not exist in the system, this is also considered as a bad request. [404 Not Found] Block not found Error returned by the system if the block is not found. [409 Conflict] Block not marked for deletion Error returned by the system if the block being validated is not marked for deletion. [500 Internal Server Error] System Error If the system fails to save changes due to an internal error, it displays an appropriate message and logs the error for further investigation.