chicken-sloths / bangazon-api-sprint1

API for a mock Amazon + Etsy platform providing developers access to the company's employee & product data
0 stars 0 forks source link

/payment-options endpoints #108

Closed kenziebottoms closed 6 years ago

kenziebottoms commented 6 years ago

Description

Adds the following endpoints:

Related Ticket(s)

fixes #108, fixes #3

Steps to Test Solution

  1. npm run db:generate
  2. comment out non-payment option routes
  3. http://localhost:8080/api/v1/payment-options should give you payment options with ids 0-9
  4. http://localhost:8080/api/v1/payment-options/3 should give you an "invoice" payment option
  5. POST http://localhost:8080/api/v1/payment-options:
    {"type":"blood sacrifice","account_number":"1234","customer_id":3}
  6. should return 25 and http://localhost:8080/api/v1/payment-options/25 should now give you the blood sacrifice payment option
  7. PUT http://localhost:8080/api/v1/payment-options/3:
    {"type":"blood sacrifice","account_number":"1234","customer_id":3}
  8. should return 3 and http://localhost:8080/api/v1/payment-options/3 should now give you the blood sacrifice payment option
  9. PUT http://localhost:8080/api/v1/payment-options/31:
    {"type":"blood sacrifice","account_number":"1234","customer_id":3}
  10. should return 31 and http://localhost:8080/api/v1/payment-options/31 should now give you the blood sacrifice payment option
  11. DELETE http://localhost:8080/api/v1/payment-options/31 should return 31 and http://localhost:8080/api/v1/payment-options/31 should now give you a "Payment option not found" error
  12. DELETE http://localhost:8080/api/v1/payment-options/31 should now return a "Payment option not found" error
jordan-castelloe commented 6 years ago

testing!