Open blau2 opened 3 years ago
As a system administrator, I want to create a record of when inventory was purchased so that I can accurately track stock levels and manage spoilage.
POST /admin/products_purchased
[ { 'product_id': Int, 'quantity': Int, 'date_purchased': DateTime, 'purchase_price_cents': Int, 'tax': Float, 'date_expiry': DateTime, 'location_purchased': String? }, { ... } ]
200 OK
400 Bad Request
422 Unprocessable Entity
401 Unauthorized
403 Forbidden
products_purchased
Product
User Story
As a system administrator, I want to create a record of when inventory was purchased so that I can accurately track stock levels and manage spoilage.
Acceptance Criteria
POST /admin/products_purchased
200 OK
when products successfully added400 Bad Request
when body contains malformed JSON422 Unprocessable Entity
when input validation fails401 Unauthorized
when request is missing auth header403 Forbidden
when provided admin auth token is unauthorized (@dzlau to provide details)products_purchased
tableProduct
upon successful insertionAdditional Considerations