Setting up web services with ChatGPT’s aid
Consider the following simple example of a user story that allows an external inventory system to update stock levels.
User Story – integrate Salesforce with an external inventory system:
- Goal: As a backend developer, I want to create a web service in Salesforce so that the external inventory management system can update Salesforce whenever an item’s stock level changes.
- Acceptance criteria:
- Given the external inventory management system has an update to the stock level of an item
- When the external system sends a POST request with the updated stock level and item ID
- Then the Salesforce web service should update the corresponding record in the Product object with the new stock level
- Given the external system sends an invalid Item ID or stock level
- When the Salesforce web service receives the request
Then the web service should respond with a proper error message and HTTP status code indicating the issue...