POST api/company/:companyId/trucks/:vin/reports with:
Make sure logged in user has access to truck
Verify all data matches up
Persist responses
{
vin: "12345678",
responses: [
{
questionId: 123,
response: false,
comments: "this is an explanation of my response"
}, {...}
]
}
Expected responses:
201: success - report persisted successfully
400: failure - request (question, user, truck, etc) invalid
401: unauthorized - user is not allowed to submit report for this truck
Response payload on successful submission:
{
success: true,
reportId: 123 // ID of newly created report
}
POST api/company/:companyId/trucks/:vin/reports
with:Expected responses:
201
: success - report persisted successfully400
: failure - request (question, user, truck, etc) invalid401
: unauthorized - user is not allowed to submit report for this truckResponse payload on successful submission: