Implemented an API to suspend a Contact #66
Collaborator
- Authentication & Authorization:
- Retrieves the current tenant ID and the logged-in employee to ensure the operation is tenant-scoped and auditable.
- Validation:
- Checks that the provided contact ID is not empty.
- Attempts to find the contact within the tenant using the provided ID.
- Soft Deletion:
- If the contact exists, it sets IsActive = false, effectively performing a soft delete (preserving data for potential recovery or auditing).
- Saves the change to the database.
- Logging and Response:
- Logs the successful deletion with the employee's ID.
- Returns a 200 OK response with an empty object and a success message.
- If the contact is not found, it logs a warning and returns a 404 Not Found.
- If the ID is invalid or empty, it logs that and returns a 400 Bad Request.
- **Authentication & Authorization**:
- Retrieves the current tenant ID and the logged-in employee to ensure the operation is tenant-scoped and auditable.
- **Validation**:
- Checks that the provided contact ID is not empty.
- Attempts to find the contact within the tenant using the provided ID.
- **Soft Deletion**:
- If the contact exists, it sets IsActive = false, effectively performing a soft delete (preserving data for potential recovery or auditing).
- Saves the change to the database.
- **Logging and Response**:
- Logs the successful deletion with the employee's ID.
- Returns a 200 OK response with an empty object and a success message.
- If the contact is not found, it logs a warning and returns a 404 Not Found.
- If the ID is invalid or empty, it logs that and returns a 400 Bad Request.
ashutosh.nehete
added 1 commit 2025-05-21 12:11:51 +00:00
ashutosh.nehete
added 1 commit 2025-05-21 13:05:11 +00:00
Merge pull request 'Implemented an API to suspend a Contact' (#66) from Ashutosh_Task#263_Delete_Contact into Feature_Directory
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "Ashutosh_Task#263_Delete_Contact"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?