Supplement - Upsert number supplement
API Url
Used for creating or updating single number supplement registration, including project related registration. For time supplements, please use /rest/General/employees/{emp_id}/time-registrations-wizard.
http://localhost:16010/ProMarkREST/rest/Supplement/employees/{emp_id}/num-registrations-wizard
Permissions: user
Path parameters
| Field | Type | Description |
|---|---|---|
| id | Number | Employee ID. |
Query parameters
| Field | Type | Description |
|---|---|---|
dateoptional | Date | Date when to create supplement registration. If not sent, first step in the wizard will be to enter registration period (question type 0). |
transSeqoptional | String | Supplement transaction number to be changed. Use it if you want to change an existing supplement registration via the wizard. |
Parameter
| Field | Type | Description |
|---|---|---|
| request | Object | Main object containing the request data. |
| data | Object | Object containg data to be uploaded. |
| complete | Boolean | true = All questions are answered, so save! |
| questions | Object[] | Collection with questions and answers used in the wizard. This is basically a carrier (in-out) collection between client-server. |
| answer | String | This is the answer to the question and needs to be filled by the client. For dates, it's the ISO-8601 string. For date intervals, it's ISO-8601 dates separated by '/'. |
autoSelectoptional | Boolean | true = If there is a single selectable answer (value), it is autoselected by the server. The client can choose to show the answer already selected, or hide the question entirely. Do not change by the client! |
| callBackOnChange | Boolean | true = After value is changed, do a callback to the server with the entire collection. This is because subsequent values depend on the question answer. Not to be changed on the client! |
clientDataoptional | String | Store here custon client data. DO NOT change on the server! |
| dataType | Number | Data type of the question (0: Text, 1: Integer, 2: Decimal, 3: Boolean: 4: Date. 5: Time of day, 6: Date and time, 7: Time duration, 8: Time interval, 9: Date interval, 10: Date and time interval). Not to be changed on the client! 0-10 |
formatoptional | String | Unit format. |
| inputType | Number | Suggestion with controll type to display on the client (0: Standard input, depends on 'dataType', 1: Fill-in, 2: Drop-down, 3: Combo-box, 4: Text area, 5: Radio-set, 6: Check-box, 7: Selection list, 8: Calendar, 9: Calendar drop-down, 10: External lookup URI). Not to be changed on the client! 0-10 |
| isMandatory | Boolean | true = It is mandatory to enter an answer (select a value) on the question. Not to be changed on the client! |
| isNew | Boolean | true = It's a new question that needs to be presented. Not to be changed on the client! |
| label | String | Label to display on the question. Not to be changed on the client! |
lookupURIoptional | String | If collection of 'values' is not sent with the request, then use this URI to bind to remote data. Tipically this is used for large amounts of data, where server paging and server filtering is enabled. Be aware, data schema might be different, depending on external lookup resource. Do not change by the client! |
maxValueoptional | Number | Allowed maximum answer value, as decimal. Client can test on this. |
minValueoptional | Number | Allowed minimum answer value, as decimal. Client can test on this. |
numDecimalsoptional | Number | Decimal precision for answers having 'unit' = 2 (days) or 3 (pieces) and 'dataType' = 2 (Decimal). |
| order | Number | Order of question. Sort by this value. Not to be changed on the client! |
| readOnly | Boolean | true = User cannot change the answer, which is typically already supplied as default value. |
serverDataoptional | String | Store here custom server data. Do NOT change on the client! |
| type | Number | Type of question (0: Registration period, 1: Project, 2: Activity, 3: Split dates, 4: Piecework, 5: Time type, 6: Extra Info, 10: Supplement, 11: Supplement value, 12: Supplement note). Not all questions are part of the wizard and depends on setup and selected values. Not to be changed on the client! 0-12 |
typeIDoptional | String | Question type identifier value. Related to 'type', can be used for external lookups of possible values the user can select from. |
unitoptional | Number | Supplements are related to accounts. This is the account unit (1: Hours, 2: Days, 3: Pieces). 1-3 |
unitStroptional | String | Unit description. |
| valueChanged | Boolean | The client needs to always set this to 'true' when the question answer is selected or changed! The server will always reset it to 'false'. |
valuesoptional | Object[] | Collection of possible selectable values. It's used when user needs to select among a list of values, tipically for 'inputType' = 2, 3 and 7. Do not change by the client! |
| description | String | The Description that should be displayed in the list for selection. |
| displayId | String | The text to be displayed for selected items. It might be different than 'internalId'. |
| internalId | String | This is the answer value that needs to be filled into 'answer' and sent to the server. Not to be displayed. |
| sorNo | Number | Order of values to select from. |
Request example:
{"request": {"data": {"complete": false,"questions": [{"order": 1,"type": 10,"label": "Supplement","isMandatory": true,"inputType": 2,"dataType": 0,"isNew": false,"callBackOnChange": true,"answer": "SUPPL1","valueChanged": false},{"order": 2,"type": 11,"label": "Days","isMandatory": true,"inputType": 0,"dataType": 1,"isNew": true,"callBackOnChange": false,"answer": "2","valueChanged": true}]}}}
Success 200
| Field | Type | Description |
|---|---|---|
| response | Object | Main object containing the response data. |
| data | Object | Object containing the requested data. |
| complete | Boolean | true = All questions are answered, so save! |
| questions | Object[] | Collection with questions and answers used in the wizard. This is basically a carrier (in-out) collection between client-server. |
| answer | String | This is the answer to the question and needs to be filled by the client. For dates, it's the ISO-8601 string. For date intervals, it's ISO-8601 dates separated by '/'. |
autoSelectoptional | Boolean | true = If there is a single selectable answer (value), it is autoselected by the server. The client can choose to show the answer already selected, or hide the question entirely. Do not change by the client! |
| callBackOnChange | Boolean | true = After value is changed, do a callback to the server with the entire collection. This is because subsequent values depend on the question answer. Not to be changed on the client! |
clientDataoptional | String | Store here custon client data. DO NOT change on the server! |
| dataType | Number | Data type of the question (0: Text, 1: Integer, 2: Decimal, 3: Boolean: 4: Date. 5: Time of day, 6: Date and time, 7: Time duration, 8: Time interval, 9: Date interval, 10: Date and time interval). Not to be changed on the client! 0-10 |
formatoptional | String | Unit fromat. |
| inputType | Number | Suggestion with controll type to display on the client (0: Standard input, depends on 'dataType', 1: Fill-in, 2: Drop-down, 3: Combo-box, 4: Text area, 5: Radio-set, 6: Check-box, 7: Selection list, 8: Calendar, 9: Calendar drop-down, 10: External lookup URI). Not to be changed on the client! 0-10 |
| isMandatory | Boolean | true = It is mandatory to enter an answer (select a value) on the question. Not to be changed on the client! |
| isNew | Boolean | true = It's a new question that needs to be presented. Not to be changed on the client! |
| label | String | Label to display on the question. Not to be changed on the client! |
lookupURIoptional | String | If collection of 'values' is not sent with the request, then use this URI to bind to remote data. Tipically this is used for large amounts of data, where server paging and server filtering is enabled. Be aware, data schema might be different, depending on external lookup resource. Do not change by the client! |
maxValueoptional | Number | Allowed maximum answer value, as decimal. Client can test on this. |
minValueoptional | Number | Allowed minimum answer value, as decimal. Client can test on this. |
numDecimalsoptional | Number | Decimal precision for answers having 'unit' = 2 (days) or 3 (pieces) and 'dataType' = 2 (Decimal). |
| order | Number | Order of question. Sort by this value. Not to be changed on the client! |
| readOnly | Boolean | true = User cannot change the answer, which is typically already supplied as default value. |
serverDataoptional | String | Store here custom server data. Do NOT change on the client! |
| type | Number | Type of question (0: Registration period, 1: Project, 2: Activity, 3: Split dates, 4: Piecework, 5: Time type, 6: Extra Info, 10: Supplement, 11: Supplement value, 12: Supplement note). Not all questions are part of the wizard and depends on setup and selected values. Not to be changed on the client! 0-12 |
typeIDoptional | String | Question type identifier value. Related to 'type', can be used for external lookups of possible values the user can select from. |
unitoptional | Number | Supplements are related to accounts. This is the account unit (1: Hours, 2: Days, 3: Pieces). 1-3 |
unitStroptional | String | Unit description. |
| valueChanged | Boolean | The client needs to always set this to 'true' when the question answer is selected or changed! The server will always reset it to 'false'. |
valuesoptional | Object[] | Collection of possible selectable values. It's used when user needs to select among a list of values, tipically for 'inputType' = 2, 3 and 7. Do not change by the client! |
| description | String | The Description that should be displayed in the list for selection. |
| displayId | String | The text to be displayed for selected items. It might be different than 'internalId'. |
| internalId | String | This is the answer value that needs to be filled into 'answer' and sent to the server. Not to be displayed. |
| sortNo | Number | Order of values to select from. |
messageoptional | Object | Object containing response messages. |
| code | Number | Message code. |
| text | String | Message text. |
| type | String | Type of message. "warning""info" |
Response example:
{"request": {"data": {"complete": false,"questions": [{"order": 1,"type": 10,"label": "Supplement","isMandatory": true,"inputType": 2,"dataType": 0,"isNew": false,"callBackOnChange": true,"answer": "Suppl#1","valueChanged": false,"values": [{"sortNo": 1,"internalID": "Suppl#1","displayID": "Suppl1","description": "Days supplement"}]},{"order": 2,"type": 11,"label": "Days","isMandatory": true,"inputType": 0,"dataType": 2,"numDecimals": 2,"minValue": 0.00,"maxValue": 5.00,"isNew": true,"callBackOnChange": false,"answer": 3,"valueChanged": false},{"order": 3,"type": 1,"label": "Project","isMandatory": true,"inputType": 10,"dataType": 0,"isNew": true,"callBackOnChange": true,"lookupURI": "/rest/ProJect/projects?mostRecent=true&fields=id,description,ref1"}]}}}
Error 4xx
| Field | Type | Description |
|---|---|---|
| response | Object | Main object containing the response data. |
| data | Object | Object containing the requested data (empty). |
| errorCode | Number | Error code. |
| errorMessage | String | Error description. |