Closed odidev closed 1 year ago
Hi @odidev.
You must specify the date of the workshop-planning on the URL. The JSON in the request should eb something like this:
{
"jobId": "ec7432f4-f2a0-4534-8a7a-1b6a4b649dfb",
"startTime": "2023-07-21T13:00:00",
"endTime": "2023-07-21T14:00:00",
"customerInfo": {
"item1": "06d54189ecf549f983c6078cd9d300ae",
"item2": "John Doe",
"item3": "1234567890"
},
"vehicleInfo": {
"item1": "81-XX-32",
"item2": "Ford",
"item3": "Fiesta"
},
"description": "General Maintenance",
"messageId": "f1734ba1-82bb-46e8-bd77-8f46f6b3a741",
"messageType": "PlanMaintenanceJob"
}
Obsiously, the Customer Id (item1
in the customerInfo
tuple) and Vehicle Id (item1
in the vehicleInfo
tuple) must correspond to an existing customer and vehicle.
This is the Curl command that I used to do a successful request using the Swagger UI:
curl -X 'POST' \
'http://localhost:49659/api/WorkshopPlanning/2023-07-21/jobs' \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '{
"jobId": "ec7432f4-f2a0-4534-8a7a-1b6a4b649dfb",
"startTime": "2023-07-21T13:00:00",
"endTime": "2023-07-21T14:00:00",
"customerInfo": {
"item1": "06d54189ecf549f983c6078cd9d300ae",
"item2": "John Doe",
"item3": "1234567890"
},
"vehicleInfo": {
"item1": "81-XX-32",
"item2": "Ford",
"item3": "Fiesta"
},
"description": "General Maintenance",
"messageId": "f1734ba1-82bb-46e8-bd77-8f46f6b3a741",
"messageType": "PlanMaintenanceJob"
}'
I hope this helps.
Thanks for the quick response @EdwinVW. It helped and now I am able to POST workshop data as well.
Also, if it's not too much to ask for can you also suggest how to clear the customer/vehicle data from webapp portal which gets stored there when we register any new customer/vehicle.
Hi @odidev.
In the repo there's a SQL script to remove all the data. Editing or deleting data through the UI is not implemented (and will not be implemented). It would not add anything to the sample.
Hi @EdwinVW,
It is giving Error 500 while trying to POST data to workshop management service through swagger UI. I have used the below sample data to POST where I have already registered customer with ID IDs760480 and vehicle with License Number 703-64-800.
If available, May I get exact format of some sample data available already to POST to workshop management service.
Thanks.