Bug Details:
Extra-item purchases are non-atomic and can partially commit before returning an error
Test Case 1:
Step 1: Submit a purchase payload containing one valid extra item and one invalid item id.
Step 2: Inspect stock and purchase records after the API responds.
Expected Output:
The order should succeed completely or fail completely; no stock or billing change should persist if the request fails.
Actual Output:
The API returned Item not found for the invalid item, but the earlier valid item had already been recorded and its stock was already decremented.
Bug Details:
Extra-item purchases are non-atomic and can partially commit before returning an error
Test Case 1:
Step 1: Submit a purchase payload containing one valid extra item and one invalid item id.
Step 2: Inspect stock and purchase records after the API responds.
Expected Output:
The order should succeed completely or fail completely; no stock or billing change should persist if the request fails.
Actual Output:
The API returned Item not found for the invalid item, but the earlier valid item had already been recorded and its stock was already decremented.