AmericaSCORESBayArea / salesforce-data-api

This project is based on Mulesoft Dataweave and Salesforce to provide secure, reliable, API access for all the Scores apps and projects. It is hosted on Anypoint and acts as the transactional hub, in concert with the authentication API
3 stars 1 forks source link

Fix/208 Delete Enrollment/s Not Found #245

Closed TharunKumarReddyPolu closed 4 months ago

TharunKumarReddyPolu commented 4 months ago

Description:

Fixed the Issue DEL /enrollments - 'Enrollment/s Not Found' is missing with implementing a choice in the .xml flow as follows:

  1. Success flow: If post delete payload's successful flag is true, then return status code as 200 OK
  2. Error flow: If post delete payload's size with filter(no. of items with item.successful is false) and without filter are same, then return status code as 404 Not Found
  3. Partial Success flow: Else Case of above, then return status code as 206 Partial Content

Test Example:

DELETE {{base_url}}/enrollments

Payload 1:

[
  {
      "EnrollmentId": "a0mU8000000hMzlIAE"
  }
]

Payload 2:

[
  {
      "EnrollmentId": "a0mU8000000hMy9IAE"
  }
]

Payload 3:

[
    {
        "EnrollmentId": "a0mU8000000hN1NIAU"
    },
    {
        "EnrollmentId": "a0mU8000000hMzlIAE"
    }
]

Screenshots of Tests:

Payload 1:

image

Payload 2:

image

Payload 3:

image