{"swagger":"2.0","info":{"description":"Backend API routes descriptions","version":"1.0.0","title":"7odor Backend API","contact":{"email":"abdullaho.gira@gmail.com"},"license":{"name":"Apache 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0.html"}},"tags":[{"name":"admins","description":"Secured Admin-only calls"},{"name":"owner","description":"Operations available to regular user"},{"name":"employee","description":"Operations that can be done on employees"},{"name":"department","description":"Operations that can be done on departments"}],"paths":{"/owner/signup":{"post":{"tags":["owner"],"summary":"Adds a new owner to the system","operationId":"userSignup","consumes":["application/json"],"produces":["application/json"],"parameters":[{"in":"body","name":"body","description":"User information that need to be added to the system","required":true,"schema":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string","format":"email"}}}}],"responses":{"200":{"description":"User has been successfuly registered"},"406":{"description":"Bad input parameter"}}}},"/owner/login":{"post":{"tags":["owner"],"summary":"Logs the user in","consumes":["application/json"],"produces":["application/json"],"parameters":[{"in":"body","name":"body","description":"Email and password for the user who wants to log in.","required":true,"schema":{"type":"object","properties":{"email":{"type":"string","format":"email"},"password":{"type":"string","format":"password"}}}}],"responses":{"200":{"description":"Returns the access token for the logged in user","schema":{"type":"object","properties":{"access-token":{"type":"string"}}}},"405":{"description":"Email or password was incorrect"}}}},"/ower/request-reset-password":{"post":{"tags":["owner"],"summary":"Forget your password handler","description":"Sends an email to the user with a link to reset the password, this link is alive for only 30 minutes and can only be used once.","consumes":["application/json"],"produces":["application/json"],"parameters":[{"in":"body","name":"body","description":"Email that need to reset it's password","required":true,"schema":{"type":"object","properties":{"email":{"type":"string","format":"email"}}}}],"responses":{"200":{"description":"Email was successfully send"},"405":{"description":"Email doesn't exist"}}}},"/ower/reset-password":{"post":{"tags":["owner"],"summary":"Changes the user password","description":"Accepts the user's new password after they have received the rest token.","consumes":["application/json"],"produces":["application/json"],"parameters":[{"in":"body","name":"body","description":"The new password, and the token that was sent to the email","required":true,"schema":{"type":"object","properties":{"password":{"type":"string","format":"password"},"token":{"type":"string"}}}}],"responses":{"200":{"description":"Password was successfully reset"},"405":{"description":"Invalid token"},"406":{"description":"Invalid password"}}}},"/ower/secret-key":{"get":{"tags":["owner"],"summary":"Get desktop secret key","produces":["application/json"],"responses":{"200":{"description":"Returns the secret key","schema":{"type":"object","properties":{"secret-key":{"type":"string"}}}},"401":{"description":"Unauthorized access"}}}},"/employee/active-today":{"get":{"tags":["employee"],"summary":"Get Real-time access of todays' attendance","produces":["application/json"],"responses":{"200":{"description":"Returns a list of all employees who have attended today","schema":{"type":"object","properties":{"secret-key":{"type":"string"}}}},"401":{"description":"Unauthorized access"}}}},"/employee":{"get":{"tags":["employee"],"summary":"Get all employees from all branches","produces":["application/json"],"responses":{"200":{"description":"Array representing all users from all branches","schema":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"branch":{"type":"string"},"role":{"type":"string","enum":["Manager","Employee"]}}}}},"401":{"description":"Unauthorized access"}}}},"/employee/{employeeId}":{"get":{"tags":["employee"],"summary":"Get all employees from all branches","produces":["application/json"],"parameters":[{"name":"employeeId","in":"path","description":"The id of employee to get his data","required":true,"type":"string"}],"responses":{"200":{"description":"Object representing employee information","schema":{"$ref":"#/definitions/Employee"}},"401":{"description":"Unauthorized access"}}},"post":{"tags":["employee"],"summary":"Update employee info","produces":["application/json"],"consumes":["application/json"],"parameters":[{"name":"employeeId","in":"path","description":"The id of employee to update his data","required":true,"type":"string"},{"in":"body","name":"body","description":"Employee information to update","required":true,"schema":{"type":"object","properties":{"salary":{"type":"number"},"estimateSalaryFromDay":{"type":"string","format":"date"},"workTime":{"type":"object","properties":{"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"}}}}}}],"responses":{"200":{"description":"Updated employee information successfully"},"406":{"description":"Invalid body property"},"401":{"description":"Unauthorized access"}}}},"/employee/{employeeId}/progress/current-month":{"get":{"tags":["employee"],"summary":"Get current month info","produces":["application/json"],"parameters":[{"name":"employeeId","in":"path","description":"The id of employee to get his data","required":true,"type":"string"}],"responses":{"200":{"description":"Object including the summary for the employee attendance hours and an array represeting detailed attendance information","schema":{"type":"object","properties":{"estimated-salary":{"type":"number"},"total-attended-time":{"type":"string"},"total-abscence-time":{"type":"string"},"overtime-hours":{"type":"string"},"days":{"type":"array","items":{"$ref":"#/definitions/Day"}}}}},"401":{"description":"Unauthorized access"}}}},"/employee/{employeeId}/progress/prev-month":{"get":{"tags":["employee"],"summary":"Get previous month info","produces":["application/json"],"parameters":[{"name":"employeeId","in":"path","description":"The id of employee to get his data","required":true,"type":"string"}],"responses":{"200":{"description":"Object including the summary for the employee attendance hours and salary, and an array represeting detailed attendance information","schema":{"type":"object","properties":{"estimated-salary":{"type":"number"},"total-attended-time":{"type":"string"},"total-abscence-time":{"type":"string"},"overtime-hours":{"type":"string"},"days":{"type":"array","items":{"$ref":"#/definitions/Day"}}}}},"401":{"description":"Unauthorized access"}}}},"/employee/{employeeId}/progress/all-months":{"get":{"tags":["employee"],"summary":"Get the overall attendance information of all month","produces":["application/json"],"parameters":[{"name":"employeeId","in":"path","description":"The id of employee to get his data","required":true,"type":"string"}],"responses":{"200":{"description":"Array represeting overall attendance information","schema":{"type":"object","properties":{"days":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"total-attended-time":{"type":"string","format":"date-time"},"total-abscence-time":{"type":"string","format":"date-time"}}}}}}},"401":{"description":"Unauthorized access"}}}},"/department":{"get":{"tags":["department"],"produces":["application/json"],"responses":{"200":{"description":"Array of the branches of the logged in user","schema":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"manager":{"type":"string","default":"-"}}}}},"401":{"description":"Unauthorized access"}}}},"/app/employees":{"post":{"tags":["desktop"],"summary":"Downloads new employees from other branches.","produces":["application/json"],"responses":{"200":{"description":"Array of new connections","schema":{"type":"array","items":{"type":"string","format":"mac-address"}}}}}},"/app/appinfo":{"post":{"tags":["desktop"],"summary":"Updates the app info","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"body","name":"body","description":"Department information","required":true,"schema":{"type":"object","properties":{"department_uuid":{"type":"string"},"department_name":{"type":"string"},"apps_token":{"type":"string"}}}}],"responses":{"200":{"description":"Uploaded successfully"},"405":{"description":"Invalid application token"}}}},"/app/userinfo":{"post":{"tags":["desktop"],"summary":"Uploads a new connection to the server","description":"Uploads new connection to be shared with other departments","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"body","name":"body","description":"New connection info","required":true,"schema":{"type":"object","properties":{"department_uuid":{"type":"string"},"apps_token":{"type":"string"},"mac_address":{"type":"string"},"user_name":{"type":"string"}}}}],"responses":{"200":{"description":"Uploaded successfully"},"405":{"description":"Invalid application token"}}}},"/app/add":{"post":{"tags":["desktop"],"summary":"Uploads day data for all connected users","description":"Uploads the attendance information for all the users of a department","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"body","name":"body","description":"Day info","required":true,"schema":{"type":"object","properties":{"department_uuid":{"type":"string"},"apps_token":{"type":"string"},"mac_address":{"type":"string"},"date":{"type":"string","format":"date"},"checkin":{"type":"string","format":"date-time"},"checkout":{"type":"string","format":"date-time"}}}}],"responses":{"200":{"description":"Uploaded successfully"},"405":{"description":"Invalid application token"}}}}},"definitions":{"Employee":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"role":{"type":"string","default":"employee"},"salary":{"type":"number"},"estimateSalaryFromDay":{"type":"string","format":"date"},"workTime":{"type":"object","properties":{"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"}}}}},"Day":{"type":"object","properties":{"id":{"type":"number"},"branch":{"type":"string"},"date":{"type":"string","format":"date"},"entered":{"type":"string","format":"date-time"},"left":{"type":"string","format":"date-time"},"attendance-duration":{"type":"string","format":"date-time"},"abscence-duration":{"type":"string","format":"date-time"}}}},"host":"virtserver.swaggerhub.com","schemes":["https"],"basePath":"/abdullahgira/7odorBackendAPI/1.0.0"}