This PR introduces a new endpoint that allows updating the status of a service join request. The endpoint also handles assigning permissions to users when the request is approved.
Endpoint:
POST /update-service-join-request-status/
Changes:
Service Join Request Status Update:
Accepts a request to update the status of a service join request (pending, approved, rejected).
Handles validation of the input payload using service_join_request_update_schema.
If the service join request is not found, returns a 404 response.
Add user to service:
When the status is set to approved, it adds the user to a service and sets the permission
This is applied by dao_add_user_to_service
Send approved email
If the user request is approved, an email is sent to the user
This is handled by send_service_join_request_decision_email
Cancel Pending requests for the same service by the same user
Pending service join requests are cancelled for a user when one of their requests is approved, ensuring the system reflects the most up-to-date request.
The cancellation is service-specific, meaning only requests for the same service as the approved request will be canceled. Any requests the user has for other services remain unaffected
Summary
This PR introduces a new endpoint that allows updating the status of a service join request. The endpoint also handles assigning permissions to users when the request is approved.
Endpoint:
POST /update-service-join-request-status/
Changes:
Service Join Request Status Update:
Add user to service:
Send approved email
Cancel Pending requests for the same service by the same user
Ticket
Update the request status when request to join service approved/rejected