{"swagger":"2.0","info":{"title":"1 Plus Security API","description":"API for the 1 Plus Security App","version":"1.0.0"},"host":"localhost:3000","schemes":["http","https"],"basePath":"/api","securityDefinitions":{"basicAuth":{"type":"basic"},"bearer":{"type":"apiKey","in":"header","name":"Authorization"}},"consumes":["application/json"],"produces":["application/json"],"paths":{"/employees":{"get":{"summary":"Get a list of all employees","security":[{"basicAuth":[]}],"responses":{"200":{"description":"An array of employees","schema":{"type":"array","items":{"$ref":"#/definitions/Employee"}}},"401":{"description":"Authentication failed","schema":{"$ref":"#/definitions/Error"}}}}},"/employees/verify":{"post":{"summary":"Verify an employee","security":[{"basicAuth":[]}],"parameters":[{"in":"body","name":"body","required":true,"schema":{"type":"object","properties":{"employeeId":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"}},"required":["employeeId"]}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/Employee"}},"401":{"description":"Login failed","schema":{"$ref":"#/definitions/Error"}}}}},"/employees/id-ranges":{"get":{"summary":"Get a list of unregistered employee ID ranges","security":[{"basicAuth":[]}],"responses":{"200":{"description":"An array of employee ID ranges","schema":{"type":"array","items":{"$ref":"#/definitions/EmployeeIdRange"}}},"401":{"description":"Authentication failed","schema":{"$ref":"#/definitions/Error"}}}}},"/venues":{"get":{"summary":"Get a list of Venues between start and end date","security":[{"basicAuth":[]}],"responses":{"200":{"description":"An array of venues.","schema":{"type":"array","items":{"$ref":"#/definitions/Venue"}}},"401":{"description":"Authentication failed","schema":{"$ref":"#/definitions/Error"}}}}},"/shifts/start":{"post":{"summary":"Start a new shift","security":[{"basicAuth":[]}],"parameters":[{"in":"body","name":"body","schema":{"type":"object","properties":{"employeeId":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"venueId":{"type":"string"},"timestamp":{"type":"string","description":"Start time in ISO-8601 format"},"location":{"$ref":"#/definitions/Location"}},"required":["employeeId","venueId"]}}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"shiftId":{"type":"string"},"shiftDuration":{"type":"number","description":"The duration of the shift in minutes"},"accessToken":{"type":"string"},"accessTokenExpiry":{"type":"string"}}}},"401":{"description":"Authentication failed","schema":{"$ref":"#/definitions/Error"}}}}},"/shifts/end":{"post":{"summary":"End a shift","security":[{"bearer":[]}],"parameters":[{"in":"body","name":"body","schema":{"$ref":"#/definitions/ShiftEndRecord"}}],"responses":{"200":{"description":"OK"},"401":{"description":"Authentication failed","schema":{"$ref":"#/definitions/Error"}}}}},"/shifts/notifications":{"post":{"summary":"Record a safety notification.","security":[{"bearer":[]}],"parameters":[{"in":"body","name":"body","schema":{"type":"object","required":["acknowledged"],"properties":{"timestamp":{"type":"string","description":"The notification time in ISO-8601 format\n"},"location":{"$ref":"#/definitions/Location"},"acknowledged":{"type":"boolean","description":"Indicates whether the employee acknowleged the notification.\n"}}}}],"responses":{"200":{"description":"OK"},"401":{"description":"Authentication failed","schema":{"$ref":"#/definitions/Error"}}}}},"/shifts/notification":{"post":{"summary":"Record a safety notification.","security":[{"bearer":[]}],"parameters":[{"in":"body","name":"body","schema":{"type":"object","required":["acknowledged"],"properties":{"timestamp":{"type":"string","description":"The notification time in ISO-8601 format\n"},"location":{"$ref":"#/definitions/Location"},"acknowledged":{"type":"boolean","description":"Indicates whether the employee acknowleged the notification.\n"}}}}],"responses":{"200":{"description":"OK"},"401":{"description":"Authentication failed","schema":{"$ref":"#/definitions/Error"}}}}},"/shifts/locations":{"post":{"summary":"Record an employee location.","security":[{"bearer":[]}],"parameters":[{"in":"body","name":"body","schema":{"type":"object","required":["location"],"properties":{"timestamp":{"type":"string","description":"The time the location was recorded in ISO-8601 format\n"},"location":{"$ref":"#/definitions/Location"}}}}],"responses":{"200":{"description":"OK"},"401":{"description":"Authentication failed","schema":{"$ref":"#/definitions/Error"}}}}},"/shifts/equipment/start":{"get":{"summary":"Retrieve the equipment list recorded at start of a shift.","security":[{"bearer":[]}],"responses":{"200":{"description":"Return the recorded equipment list.","schema":{"type":"object","properties":{"equipmentListAnswers":{"type":"array","items":{"$ref":"#/definitions/EquipmentListAnswer"}}},"required":["equipmentListAnswers"]}},"401":{"description":"Authentication failed","schema":{"$ref":"#/definitions/Error"}}}},"post":{"summary":"Update the equipment list recorded at start of a shift.","security":[{"bearer":[]}],"parameters":[{"in":"body","name":"body","schema":{"type":"object","properties":{"equipmentListAnswers":{"type":"array","items":{"$ref":"#/definitions/EquipmentListAnswer"}}},"required":["equipmentListAnswers"]}}],"responses":{"200":{"description":"OK"},"401":{"description":"Authentication failed","schema":{"$ref":"#/definitions/Error"}}}}},"/incidents/types":{"get":{"summary":"Get a list of valid incident types","security":[{"basicAuth":[]}],"responses":{"200":{"description":"Return a list of incident types","schema":{"type":"array","items":{"$ref":"#/definitions/IncidentType"}}},"401":{"description":"Authentication failed","schema":{"$ref":"#/definitions/Error"}}}}}},"definitions":{"Employee":{"type":"object","properties":{"employeeId":{"type":"string"},"dateOfBirth":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"shiftId":{"type":"string"},"shiftDuration":{"type":"number","description":"The duration of the shift in minutes"},"timeStarted":{"description":"The current shift start-time if a shift is in progress.\n","type":"string","format":"date-time"},"accessToken":{"type":"string"},"accessTokenExpiry":{"type":"string","format":"date-time"},"suggestedVenueId":{"type":"string"}}},"EmployeeIdRange":{"type":"object","properties":{"id":{"type":"string","description":"A unique ID for this ID range"},"name":{"type":"string","description":"The name of this ID range for display in the UI"},"min":{"type":"number","description":"The lowest ID within this range"},"max":{"type":"number","description":"The highest ID within this range"},"dob":{"type":"string","description":"The date of birth that should be used with this ID range"}},"required":["id","name","min","max"]},"Venue":{"type":"object","properties":{"id":{"description":"An ID that uniquely identifies the venue.","type":"string"},"name":{"description":"The name of the venue.","type":"string"},"eircode":{"description":"The eircode of the venue.","type":"string"},"ssai":{"description":"Link to PDF","type":"string"},"loneWorker":{"description":"A flag to indiacte that venue may have only a single employee\n","type":"boolean"}}},"Location":{"type":"object","properties":{"latitude":{"type":"number"},"longitude":{"type":"number"}}},"ShiftEndRecord":{"type":"object","required":["feedback","rating","equipmentListAnswers"],"properties":{"timestamp":{"description":"End time in ISO-8601 format","type":"string","format":"date-time"},"location":{"$ref":"#/definitions/Location"},"feedback":{"description":"Additional user feedback","type":"string"},"rating":{"description":"Rating between 0 and 5","type":"string"},"equipmentListAnswers":{"description":"The end-of-shift equipment list answers.","type":"array","items":{"$ref":"#/definitions/EquipmentListAnswer"}},"siteInstructionsChecked":{"type":"boolean"},"deviceCharged":{"type":"boolean"},"incidents":{"type":"array","items":{"$ref":"#/definitions/Incident"}}}},"Incident":{"type":"object","properties":{"id":{"description":"ID that uniquelty identifies this incident","type":"string"},"typeId":{"description":"ID of the incident type that occurred","type":"string"},"timestamp":{"description":"Date and time the incident occurred in ISO-8601 format","type":"string","format":"date-time"},"shortDescription":{"type":"string"},"longDescription":{"type":"string"}}},"IncidentType":{"type":"object","properties":{"id":{"description":"ID of incident type","type":"string"},"name":{"description":"name of incident type","type":"string"}}},"EquipmentListAnswer":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["bib","radio","camera","scanner","wristband"]},"text":{"type":"string"}}},"Error":{"type":"object","properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"}}}}}