As a contractor, I should be able to create payments, so that I can make purchases and maintain accounts #72
Labels
user story
A brief explanation of a functionality or an interaction with the system, from a user's perspective
Summary
As a
contractor
, I should be able to create payments, so that I can make purchases and maintain accounts.Acceptance Criteria
GIVEN an
contractor
is creating a payment in the desktop appWHEN the app hits the
/payments
endpoint with a valid POST request, containing:THEN the app should receive a status
201
AND in the response, the following information should be returned:
Sample Request/Sample Response
Resources
Dev Notes
{Some complementary notes if necessary}
Testing Notes
Scenario 1: POST request is successful
/payments
endpoint and ensure a 201 status code is returned.id
returned by the response in a subsequent GET request to/payments/:id
endpoint and ensure a 200 status code is returned.Scenario 2: POST request is incorrect
/payments
endpoint with thepay_type_id
containing a value not in the database.code
parameter should contain an error pointing out foreign key violation.Scenario 3: POST request fails foreign key constraint
Missing foreign key
/payments
endpoint with thepay_type_id
ormilestone_id
orproject_id
containing a value not in the database.code
parameter should contain an error pointing out foreign key violation.Referring to a milestone id of a different project i.e. failed constraint
/payments
endpoint with themilestone_id
containing a value such that the bodyproject_id
is not the same as that milestone'sproject_id
.code
parameter should contain an error pointing out foreign key violation.Scenario 3: POST request is forbidden
/payments
endpoint with ainspector
account token.code
parameter should contain an error pointing out failed access.The text was updated successfully, but these errors were encountered: