Skip to content

ahaomar/restapiwork

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API REST EXAMPLE

This is a small rest api application.

MAIN SECTIONS (Shifts, Employee(Workers),Employee Shifts,)

Shift

Fetch ALL Records

Fetch Single Record

Create Shift

	{
	    "title" : "Shift Title"
	}

Update Shift

	{
	    "id"	: "2",
	    "title" : "Shift Title"
	}

Delete Shift

	{
	    "id"	: "2"
	}

Worker

Fetch ALL Records

Fetch Single Record

Create Worker

	{
	    "name" : "Worker 01",
	    "email" : "[email protected]",
	    "age" : "20",
	    "designation" : "Packer"
	}

Update Worker

	{
	    "id"   : "3",
	    "name" : "Worker 03",
	    "email" : "[email protected]",
	    "age" : "20",
	    "designation" : "Packer"
	}

Delete Shift

	{
	    "id"	: "20"
	}

Worker Shift

Fetch ALL Records

Fetch Single Record

Create Worker Shift

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"
	}

Delete Shift

	{
	    "workerId" : "1",
	    "date"	: "2021-05-09"
	}

DB Explanation

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 )

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages