This is a small rest api application.
{
"title" : "Shift Title"
}
{
"id" : "2",
"title" : "Shift Title"
}
{
"id" : "2"
}
{
"name" : "Worker 01",
"email" : "[email protected]",
"age" : "20",
"designation" : "Packer"
}
{
"id" : "3",
"name" : "Worker 03",
"email" : "[email protected]",
"age" : "20",
"designation" : "Packer"
}
{
"id" : "20"
}
We first check by workerId exist in workershift data if not exist then we will insert other wise we throw error msg to client that worker already exist in that day for a shift
{
"workerId" : "1",
"shiftId" : "1",
"date" : "2021-05-09"
}
{
"workerId" : "1",
"date" : "2021-05-09"
}
There are three tables.
- worker
- Worker table is for workers, fields are(id,name,email,age,designation)
- shift
- Shift tables is for shift, fields are(id,title)
- workershift
- workershift is childtable to store the worker's shift record. Fields are (id,workerid,shiftid,date )