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.

PUT
http://localhost:16010/ProMarkREST/rest/Supplement/employees/{emp_id}/num-registrations-wizard

Permissions: user

Path parameters

FieldTypeDescription
idNumber

Employee ID.

Query parameters

FieldTypeDescription
dateoptionalDate

Date when to create supplement registration. If not sent, first step in the wizard will be to enter registration period (question type 0).

transSeqoptionalString

Supplement transaction number to be changed. Use it if you want to change an existing supplement registration via the wizard.

Parameter

FieldTypeDescription
requestObject

Main object containing the request data.

  dataObject

Object containg data to be uploaded.

    completeBoolean

true = All questions are answered, so save!

    questionsObject[]

Collection with questions and answers used in the wizard. This is basically a carrier (in-out) collection between client-server.

      answerString

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 '/'.

      autoSelectoptionalBoolean

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!

      callBackOnChangeBoolean

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!

      clientDataoptionalString

Store here custon client data. DO NOT change on the server!

      dataTypeNumber

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!

Size range: 0-10
      formatoptionalString

Unit format.

      inputTypeNumber

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!

Size range: 0-10
      isMandatoryBoolean

true = It is mandatory to enter an answer (select a value) on the question. Not to be changed on the client!

      isNewBoolean

true = It's a new question that needs to be presented. Not to be changed on the client!

      labelString

Label to display on the question. Not to be changed on the client!

      lookupURIoptionalString

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!

      maxValueoptionalNumber

Allowed maximum answer value, as decimal. Client can test on this.

      minValueoptionalNumber

Allowed minimum answer value, as decimal. Client can test on this.

      numDecimalsoptionalNumber

Decimal precision for answers having 'unit' = 2 (days) or 3 (pieces) and 'dataType' = 2 (Decimal).

      orderNumber

Order of question. Sort by this value. Not to be changed on the client!

      readOnlyBoolean

true = User cannot change the answer, which is typically already supplied as default value.

      serverDataoptionalString

Store here custom server data. Do NOT change on the client!

      typeNumber

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!

Size range: 0-12
      typeIDoptionalString

Question type identifier value. Related to 'type', can be used for external lookups of possible values the user can select from.

      unitoptionalNumber

Supplements are related to accounts. This is the account unit (1: Hours, 2: Days, 3: Pieces).

Size range: 1-3
      unitStroptionalString

Unit description.

      valueChangedBoolean

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'.

      valuesoptionalObject[]

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!

        descriptionString

The Description that should be displayed in the list for selection.

        displayIdString

The text to be displayed for selected items. It might be different than 'internalId'.

        internalIdString

This is the answer value that needs to be filled into 'answer' and sent to the server. Not to be displayed.

        sorNoNumber

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

FieldTypeDescription
responseObject

Main object containing the response data.

  dataObject

Object containing the requested data.

    completeBoolean

true = All questions are answered, so save!

    questionsObject[]

Collection with questions and answers used in the wizard. This is basically a carrier (in-out) collection between client-server.

      answerString

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 '/'.

      autoSelectoptionalBoolean

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!

      callBackOnChangeBoolean

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!

      clientDataoptionalString

Store here custon client data. DO NOT change on the server!

      dataTypeNumber

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!

Size range: 0-10
      formatoptionalString

Unit fromat.

      inputTypeNumber

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!

Size range: 0-10
      isMandatoryBoolean

true = It is mandatory to enter an answer (select a value) on the question. Not to be changed on the client!

      isNewBoolean

true = It's a new question that needs to be presented. Not to be changed on the client!

      labelString

Label to display on the question. Not to be changed on the client!

      lookupURIoptionalString

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!

      maxValueoptionalNumber

Allowed maximum answer value, as decimal. Client can test on this.

      minValueoptionalNumber

Allowed minimum answer value, as decimal. Client can test on this.

      numDecimalsoptionalNumber

Decimal precision for answers having 'unit' = 2 (days) or 3 (pieces) and 'dataType' = 2 (Decimal).

      orderNumber

Order of question. Sort by this value. Not to be changed on the client!

      readOnlyBoolean

true = User cannot change the answer, which is typically already supplied as default value.

      serverDataoptionalString

Store here custom server data. Do NOT change on the client!

      typeNumber

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!

Size range: 0-12
      typeIDoptionalString

Question type identifier value. Related to 'type', can be used for external lookups of possible values the user can select from.

      unitoptionalNumber

Supplements are related to accounts. This is the account unit (1: Hours, 2: Days, 3: Pieces).

Size range: 1-3
      unitStroptionalString

Unit description.

      valueChangedBoolean

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'.

      valuesoptionalObject[]

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!

        descriptionString

The Description that should be displayed in the list for selection.

        displayIdString

The text to be displayed for selected items. It might be different than 'internalId'.

        internalIdString

This is the answer value that needs to be filled into 'answer' and sent to the server. Not to be displayed.

        sortNoNumber

Order of values to select from.

  messageoptionalObject

Object containing response messages.

    codeNumber

Message code.

    textString

Message text.

    typeString

Type of message.

Allowed values:"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

FieldTypeDescription
responseObject

Main object containing the response data.

  dataObject

Object containing the requested data (empty).

  errorCodeNumber

Error code.

  errorMessageString

Error description.