As a product owner, I should be able to create payment types, so that the contractor can choose them as a reason while making payments.
Acceptance Criteria
GIVEN an product owner is creating a payment type in the desktop app
WHEN the app hits the /payment-types endpoint with a valid POST request, containing:
pay_type
THEN the app should receive a status 201AND in the response, the following information should be returned:
Summary
As a
product owner
, I should be able to create payment types, so that the contractor can choose them as a reason while making payments.Acceptance Criteria
GIVEN an
product owner
is creating a payment type in the desktop app WHEN the app hits the/payment-types
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
/payment-types
endpoint and ensure a 201 status code is returned.id
returned by the response in a subsequent GET request to/payment-types/:id
endpoint and ensure a 200 status code is returned.Scenario 2: POST request is incorrect
/payment-types
endpoint with an incorrect key name in the bodycode
parameter should contain an error pointing out failed validation.Scenario 3: POST request is forbidden
/payment-types
endpoint with acontractor
account token.code
parameter should contain an error pointing out failed access.