|
Http Verb |
PATCH |
|---|---|
|
Url |
/integration/workforce/r1/work-shifts |
|
Permissions required |
Core Additional Parameters: Edit (fsm.core.additionalparameter.edit) Resource Configuration: View (fsm.core.resource.configuration.view) or Resource Configuration: Edit (fsm.core.resource.configuration.edit) |
|
Last Modified Version |
r1 |
|
Tech Tags |
|
|
Available Async |
No |
BPMN Diagram
Business Logic
This Integration API updates the required Work Shift.
The Private API Suite mandates the verification of OverITs’ software license and the required user permissions. Each call initiated by the Integration API will activate both validations. Only upon successful completion of these validations can the business processes commence.
STEP 1 - External System Validation
System takes Input fields and checks their existence in internal configuration.
API Verb: GET
Resource: External Systems
Input: externalSystemCode, active=true
Output: externalSystemId
If System can obtain the Output fields → continue to next step.
If System can’t obtain the Output fields → responds with error. Elaboration is stopped.
STEP 2 - Resource Validation
System takes Input fields and extract the Resource filtered by identificationNumber.
If System can obtain the Output fields → continue to next step.
If System can’t obtain the Output fields → responds with error. Elaboration is stopped.
Error Type:
-
Others - see link in Resource
STEP 3 - Work Shift Retrieval
System takes Input fields and extract the WorkShift filtered by resourceId, startTime and endTime.
(startTime and endTime are calculated from day in input → both are zoneDateTime with LocalDate extracted from day, but startTime has a LocalTime equals to 00:00, while endTime has a LocalTime equals to 23:59)
If System can obtain the Output fields → continue to next step.
If System can’t obtain the Output fields → responds with error. Elaboration is stopped.
STEP 4 - Work Shift Type Retrieval
System takes Input fields and extract the Work Shift typeId.
If System can obtain the Output fields → continue to next step.
If System can’t obtain the Output fields → responds with error. Elaboration is stopped.
STEP 5 - Clocking Type Retrieval
System takes Input fields and extract the clockingTypeId.
If System can obtain the Output fields → continue to next step.
If System can’t obtain the Output fields → responds with error. Elaboration is stopped.
STEP 6 - Transfer Time Type Retrieval
System takes Input fields and extract the transferTimeTypeId.
If System can obtain the Output fields → continue to next step.
If System can’t obtain the Output fields → responds with error. Elaboration is stopped.
STEP 7 - Availability Type Retrieval
System takes Input fields and extract the availabilityTypeId.
If System can obtain the Output fields → continue to next step.
If System can’t obtain the Output fields → responds with error. Elaboration is stopped.
STEP 8 - Work Shift Update
System takes Input fields and updates the existing record.
API Verb: PATCH
Resource: Work Shift Update
Input: workShiftId, startTime, endTime, breakStart, breakEnd, overtimeMinute, note, typeId, clockingTypeId, transferTimeTypeId, availabilityTypeId
Output: -
If Creation outcome is SUCCESS → elaboration is stopped. See Response payload fields.
If Creation outcome is ERROR → elaboration is stopped. See Response payload fields.
Error Type:
-
Others - see link in Resource
Path Parameters
Not present.
Query String Parameters
Start with a ? and includes parameters listed one after the another separated by &.
Filters
|
Field |
Description |
Mandatory |
Constraint |
|
|---|---|---|---|---|
|
1 |
externalSystemCode |
External system code |
Y |
Not Blank |
|
2 |
identificationNumber |
Resource identification number |
Y |
Not Blank |
|
3 |
day |
Work Shift day |
Y |
Not Null |
Header Parameters
Parameters included in the request headers. Generally, request headers are used to keep authorization parameters.
Default.
Request Body Parameters
Request body parameters are used when clients send data to the API. They are shipped in a JSON Object only in POST, PUT, or PATCH requests.
|
Field |
Description |
Mandatory |
Constraint |
|
|---|---|---|---|---|
|
1 |
typeCode |
Work Shift type code |
N |
Absent or Not Blank |
|
2 |
clockingTypeCode |
Work Shift Clocking Type Code |
N |
Absent or Null or Not Blank |
|
3 |
transferTimeTypeCode |
Work Shift Transfer Time Type Code |
N |
Absent or Null or Not Blank |
|
4 |
availabilityTypeCode |
Work Shift Availability Type Code |
N |
Absent or Null or Not Blank |
|
5 |
startTime |
Work Shift Start Time
|
N |
Absent or Not Null format HH:mm |
|
6 |
endTime |
Work Shift End Time
|
N |
Absent or Not Null format HH:mm |
|
7 |
breakStart |
Work Shift Break Start |
N |
format HH:mm |
|
8 |
breakEnd |
Work Shift Break End |
N |
format HH:mm |
|
9 |
overtimeMinute |
Work Shift Overtime Minute |
N |
|
|
10 |
note |
Note |
N |
|
The objects in input could have also the extension object that allows to add additional, customized data to this API. More info here How to use APIs: Custom data via Extension.
Request example
{baseUrl}/integration/workforce/r1/work-shifts?externalSystemCode=SAP&identificationNumber=MI0030&day=2024-04-17T00:00:00.000Z
{
"extension": {
"myFieldName": "myValue"
},
"typeCode": "string",
"clockingTypeCode": "string",
"transferTimeTypeCode": "string",
"availabilityTypeCode": "string",
"startTime": "HH:mm",
"endTime": "HH:mm",
"breakStart": "HH:mm",
"breakEnd": "HH:mm",
"overtimeMinute": 0,
"note": "string"
}
Response documentation
Response payload fields
Compliant with RFC Standard https://www.rfc-editor.org/rfc/rfc9457.html
Extension fields:
|
Field |
Description |
Note |
|---|---|---|
|
code |
Extension member of a Problem Details Object that contains the error code |
Only for ERROR |
Response example
Error example
{
"type": "about:blank",
"title": "Not Found",
"status": 404,
"detail": "External system string does not exist",
"instance": "/integration/workforce/r1/work-shifts",
"code": "IA001_001"
}