Now Create Files Schema, Controller and Routed For Process, Full, Half, Finish
Now Create Files Schema, Controller and Routed For Process, Full, Half, Finish
1. Isme jo hai el lot number generate hoga low number hmesha jo current
month hai uske 3 charracter then after it s in serires of 1,2,3 make sure lot
number is unique to make sure it entry in db
2. Entry wali files main jo party name “ http://localhost:4000/api/entries" is api
ki entry main jitne party name aae hai vhii show honge or in party k andar jo
quality hai vo show hongi
3. Isem ye hoga jaise ki quality select ki to is quality k andr jitne challan no. hai
vo sare show ho jaenge
4.
now create files schema ,controller and routed for process , full, half , finish
Party APIs
Create Party
- Method: POST
- URL: http://localhost:3000/api/party
- Request Body:
json
{
"name": "Party Name",
"location": "Location",
"date": "YYYY-MM-DD"
}
- Description: Create a new party by providing its name, location, and date.
Get All Parties
- Method: GET
- URL: http://localhost:3000/api/party
- Description: Retrieve details of all parties available in the system.
Get Party by ID
- Method: GET
- URL: http://localhost:3000/api/party/:partyId
- Description: Replace :partyId with the ID of the party you want to retrieve
details for.
Update Party
- Method: PUT
- URL: http://localhost:3000/api/party/:partyId
- Request Body:
json
{
"name": "New Party Name",
"location": "New Location",
"date": "New Date"
}
- Description: Replace :partyId with the ID of the party you want to update,
and provide the updated details in the request body.
Delete Party
- Method: DELETE
- URL: http://localhost:3000/api/party/:partyId
- Description: Replace :partyId with the ID of the party you want to delete.
Quality APIs
- Description: Replace :partyId with the ID of the party, and :qualityId with
the ID of the quality you want to update. Provide the new quality name in the
request body.
1. Create Entry
Method: POST
URL: http://localhost:5000/api/entries
Headers:
- Content-Type: application/json
Method: GET
URL: http://localhost:5000/api/entries
Headers: None
3. Get Entry By ID
Method: GET
URL: http://localhost:5000/api/entries/:id
Headers: None
4. Update Entry
Method: PUT
URL: http://localhost:5000/api/entries/:id
5. Delete Entry
Method: DELETE
URL: http://localhost:5000/api/entries/:id
Headers: None
Method: GET
URL: http://localhost:5000/api/entries/challan/:challanNumber
Headers: None
1. Create Entry:
- Open Postman.
- Select POST method.
- Enter the URL http://localhost:5000/api/entries.
- Go to the Headers tab and add Content-Type: application/json.
- Go to the Body tab, select raw, and enter the JSON payload provided
above.
- Click Send.
4. Update Entry:
- Select PUT method.
- Enter the URL http://localhost:5000/api/entries/:id (replace :id with a valid
entry ID).
- Go to the Headers tab and add Content-Type: application/json.
- Go to the Body tab, select raw, and enter the JSON payload provided
above.
- Click Send.
5. Delete Entry:
- Select DELETE method.
- Enter the URL http://localhost:5000/api/entries/:id (replace :id with a valid
entry ID).
- Click Send.
6. Get Qualities by Challan Number:
- Select GET method.
- Enter the URL http://localhost:5000/api/entries/challan/:challanNumber
(replace :challanNumber with a valid challan number).
- Click Send.
Grey Work