Recorded hours ============== Current version: 1.0.0 Create ------ .. http:post:: /api2/personeel/42/uren Record new hours **Example request**: .. sourcecode:: http POST /api2/personeel/42/uren HTTP/1.1 Host: demo.recras.nl Accept: application/json { "begin": "2021-02-20T09:00:00+01:00", // (start) "dienst_id": 182, // (shift_id) "eind": "2021-02-20T16:55:00+01:00", // (end) "noot": "Shorter break because I had to leave early", // (note) "pauze_minuten": 25, // (break_minutes) "personeel_id": 42 // (staff_id) } **Example response**: .. sourcecode:: http HTTP/1.1 201 Created Content-Type: application/json Location: /api2/personeel/42/uren/179 { "begin": "2021-02-20T09:00:00+01:00", // (start) "dienst_id": 182, // (shift_id) "eind": "2021-02-20T16:55:00+01:00", // (end) "id": 179, "noot": "Shorter break because I had to leave early", // (note) "pauze_minuten": 25, // (break_minutes) "personeel_id": 42 // (staff_id) } :json datetime begin: An ISO8601 datetime representing the start (`begin`) of the registration :json int dienst_id: the id of the shift (`dienst`) this registration is for :json datetime eind: An ISO8601 datetime representing the end (`eind`) of the registration :json string noot: *Optional* An optional note (`noot`) :json int pauze_minuten: the number of minutes the staff member was on break (`pauze_minuten` means break_minutes) :json int personeel_id: the id of the staff member (`personeel_id` means staff_id) :resheader Location: The location of the new registration :statuscode 201: Registration recorded :statuscode 406: Error in the input (`Fout in de invoer`) :statuscode 403: User does not have the correct permission(s) Read ---- .. http:get:: /api2/personeel/42/uren Get the recorded hours of a certain staff member **Example request**: .. sourcecode:: http GET /api2/personeel/42/uren HTTP/1.1 Host: demo.recras.nl Accept: application/json **Example response**: .. sourcecode:: http HTTP/1.1 200 OK Content-Type: application/json [ { "Dienst": { // (Shift) "id": 182, "boeking_id": null, // (booking_id) "locatie_id": null, // (location_id) "product_id": null, "kwalificatie_id": null, // (qualification_id) "begin": "2021-02-20T09:00:00+01:00", // (start) "eind": "2021-02-20T17:00:00+01:00", // (end) "status": "bevestigd", // (status: "confirmed") "opmerking": "", // (remark) "noot": "", // (note) "personeel_id": 42 // (staff_id) }, "Personeel": { // (Staff) "id": 42, "displaynaam": "Tim the Enchanter", // (display_name) "naam": "", // (name) "bedrijf_id": 1 // (company_id) }, "begin": "2021-02-20T09:00:00+01:00", // (start) "dienst_id": 182, // (shift_id) "eind": "2021-02-20T16:55:00+01:00", // (end) "id": 179, "noot": "Shorter break because I had to leave early", // (note) "pauze_minuten": 25, // (break_minutes) "personeel_id": 42 // (staff_id) } ] :statuscode 200: no error .. http:get:: /api2/personeel/42/uren/(int:id) A specific hour registration **Example request**: .. sourcecode:: http GET /api2/personeel/42/uren/179 HTTP/1.1 Host: demo.recras.nl Accept: application/json **Example response**: .. sourcecode:: http HTTP/1.1 200 OK Content-Type: application/json { "Personeel": { // (Staff) "id": 42, "displaynaam": "Tim the Enchanter", // (display_name) "naam": "", // (name) "bedrijf_id": 1 // (company_id) }, "begin": "2021-02-20T09:00:00+01:00", // (start) "dienst_id": 182, // (shift_id) "eind": "2021-02-20T16:55:00+01:00", // (end) "id": 179, "noot": "Shorter break because I had to leave early", // (note) "pauze_minuten": 25, // (break_minutes) "personeel_id": 42 // (staff_id) } :statuscode 200: OK :statuscode 404: No recorded hour with this ``id`` Update ------ .. http:put:: /api2/producten/(int:id) **Example request**: .. sourcecode:: http PUT /api2/personeel/42/uren/179 HTTP/1.1 Host: demo.recras.nl Accept: application/json { "begin": "2021-02-20T09:00:00+01:00", // (start) "dienst_id": 182, // (shift_id) "eind": "2021-02-20T16:50:00+01:00", // (end) "id": 179, "noot": "It was even earlier that I left", // (note) "pauze_minuten": 25, // (break_minutes) "personeel_id": 42 // (staff_id) } **Example response**: .. sourcecode:: http HTTP/1.1 200 OK Content-Type: application/json { "begin": "2021-02-20T09:00:00+01:00", // (start) "dienst_id": 182, // (shift_id) "eind": "2021-02-20T16:50:00+01:00", // (end) "id": 179, "noot": "It was even earlier that I left", // (note) "pauze_minuten": 25, // (break_minutes) "personeel_id": 42 // (staff_id) } :json int id: ID of the registration, cannot be changed :statuscode 200: Registration altered :statuscode 406: Error in the input :statuscode 403: User does not have the correct permission(s) Delete ------ .. http:delete:: /api2/personeel/(int:id)/uren/(int:id) **Example request**: .. sourcecode:: http DELETE /api2/personeel/42/uren/179 HTTP/1.1 Host: demo.recras.nl **Example response**: .. sourcecode:: http HTTP/1.1 200 OK :statuscode 200: Registration deleted :statuscode 403: User does not have the permission ``editPersoneelsplanning`` (editStaffRoster)