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", "dienst_id": 182, "eind": "2021-02-20T16:55:00+01:00", "noot": "Shorter break because I had to leave early", "pauze_minuten": 25, "personeel_id": 42 } **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", "dienst_id": 182, "eind": "2021-02-20T16:55:00+01:00", "id": 179, "noot": "Shorter break because I had to leave early", "pauze_minuten": 25, "personeel_id": 42 } :json datetime begin: An ISO8601 datetime representing the start of the registration :json int dienst_id: the id of the shift this registration is for :json datetime eind: An ISO8601 datetime representing the end of the registration :json string noot: *Optional* An optional note :json int pauze_minuten: the number of minutes the staff member was on break :json int personeel_id: the id of the staff member :resheader Location: The location of the new registration :statuscode 201: Registration recorded :statuscode 406: Error in the input :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 **Voorbeeld 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": { "id": 182, "boeking_id": null, "locatie_id": null, "product_id": null, "kwalificatie_id": null, "begin": "2021-02-20T09:00:00+01:00", "eind": "2021-02-20T17:00:00+01:00", "status": "bevestigd", "opmerking": "", "noot": "", "personeel_id": 42 }, "Personeel": { "id": 42, "displaynaam": "Tim the Enchanter", "naam": "", "bedrijf_id": 1 }, "begin": "2021-02-20T09:00:00+01:00", "dienst_id": 182, "eind": "2021-02-20T16:55:00+01:00", "id": 179, "noot": "Shorter break because I had to leave early", "pauze_minuten": 25, "personeel_id": 42 } ] :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": { "id": 42, "displaynaam": "Tim the Enchanter", "naam": "", "bedrijf_id": 1 }, "begin": "2021-02-20T09:00:00+01:00", "dienst_id": 182, "eind": "2021-02-20T16:55:00+01:00", "id": 179, "noot": "Shorter break because I had to leave early", "pauze_minuten": 25, "personeel_id": 42 } :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", "dienst_id": 182, "eind": "2021-02-20T16:50:00+01:00", "id": 179, "noot": "It was even earlier that I left", "pauze_minuten": 25, "personeel_id": 42 } **Voorbeeld response**: .. sourcecode:: http HTTP/1.1 200 OK Content-Type: application/json { "begin": "2021-02-20T09:00:00+01:00", "dienst_id": 182, "eind": "2021-02-20T16:50:00+01:00", "id": 179, "noot": "It was even earlier that I left", "pauze_minuten": 25, "personeel_id": 42 } :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 **Voorbeeld response**: .. sourcecode:: http HTTP/1.1 200 OK :statuscode 200: Registration deleted :statuscode 403: User does not have the permission ``editPersoneelsplanning``