Update scheduled transfer

Description for PUT /api/scheduledTransfer

Objective:

To verify the correct functionality of the PUT /api/scheduledTransfer API method for updating an existing scheduled transfer in the banking system.

API Endpoint:

PUT /api/scheduledTransfer

Method:

PUT

Description:

This API method updates the details of an existing scheduled transfer based on the provided transfer ID. It allows modifications to various attributes of the scheduled transfer such as the amount, transfer date, or description.

Expected Responses:

  • Success (HTTP 200 OK):

    • Description: The scheduled transfer has been successfully updated.
    • Response Body:
      {
        "status": "success",
        "message": "Scheduled transfer updated successfully."
      }
      
  • Client Error (HTTP 400 Bad Request):

    • Description: The request is malformed or missing required parameters, or contains invalid data.
    • Response Body:
      {
        "status": "error",
        "message": "Invalid request. Please check the input data."
      }
      
  • Client Error (HTTP 401 Unauthorized):

    • Description: The request is missing or has an invalid authorization token.
    • Response Body:
      {
        "status": "error",
        "message": "Authorization required or invalid token."
      }
      
  • Client Error (HTTP 403 Forbidden):

    • Description: The user does not have permission to update the scheduled transfer.
    • Response Body:
      {
        "status": "error",
        "message": "User does not have permission to update this transfer."
      }
      
  • Client Error (HTTP 404 Not Found):

    • Description: The specified transferId does not match any existing scheduled transfers.
    • Response Body:
      {
        "status": "error",
        "message": "Scheduled transfer not found."
      }
      
  • Client Error (HTTP 422 Unprocessable Entity):

    • Description: The request contains valid syntax but is semantically incorrect (e.g., insufficient funds after updating amount).
    • Response Body:
      {
        "status": "error",
        "message": "Unable to process update. Please check the provided details."
      }
      
  • Server Error (HTTP 500 Internal Server Error):

    • Description: An unexpected error occurred on the server while processing the request.
    • Response Body:
      {
        "status": "error",
        "message": "An internal error occurred. Please try again later."
      }
      

Test Cases:

  1. Valid Update Request:

    • Description: Test updating an existing scheduled transfer with valid parameters.
    • Expected Result: The transfer is updated successfully, and a 200 OK status is returned with a success message.
  2. Invalid Transfer ID:

    • Description: Test update with a non-existent or invalid transferId.
    • Expected Result: Receives a 404 Not Found status with an error message indicating the transfer does not exist.
  3. Missing Authorization Token:

    • Description: Test update without providing an authorization token.
    • Expected Result: Receives a 401 Unauthorized status with an error message about missing or invalid authorization.
  4. Permission Denied:

    • Description: Test update with valid details but without sufficient permissions for the specified transfer.
    • Expected Result: Receives a 403 Forbidden status with an error message about permission.
  5. Invalid or Incomplete Data:

    • Description: Test update with invalid data or incomplete fields (e.g., invalid amount or improperly formatted transferDate).
    • Expected Result: Receives a 400 Bad Request status with an error message about the invalid input data.
  6. Insufficient Funds After Update:

    • Description: Test update with an amount that exceeds the available balance in the source account after modification.
    • Expected Result: Receives a 422 Unprocessable Entity status with a message about insufficient funds.
  7. Server Error Simulation:

    • Description: Simulate a server-side issue to test error handling for internal errors.
    • Expected Result: Receives a 500 Internal Server Error status with a generic error message.

Notes:

  • Ensure that the transferId used in tests corresponds to a valid scheduled transfer in the test environment.
  • Verify that the authorization token has the correct privileges to update the transfer.
  • Check for proper validation of all fields, including date formats and numerical values.

This test description provides a thorough approach to validating the functionality and reliability of the PUT /api/scheduledTransfer endpoint.

Language
Credentials
Bearer
JWT
Click Try It! to start a request and see the response here!