Skip to main content
Skip table of contents

Batch updating

This function allows you to update a work order batch.

Input parameters

Parameter

Type

Description

Id MANDATORY FIELD

Integer

Batch id

externalReferenceId

String

External ID

shortDescription

String

Description

action MANDATORY FIELD

String

Action to do. Values allowed:

saveBatch = Updates batch

setInProgress= Changes status to “In progress”

completeBatch= Changes status to “Closed”

Output parameters

Parameter

Type

Description

id

Integer

Batch id

agentId

Integer

Agent id

agentName

String

Agent name

closedDate

Date

Closed date

dedicatedTime

Double

Dedicated time (hours)

externalLaboratoryId

Integer

Laboratory id

externalLaboratoryName

String

Laboratory name

externalReferenceId

String

External id

familyId

Integer

Family id

familyName

String

Family name

isExternalCalibration

Boolean

Indicates if it is an external calibration

openDate

Date

Open date

plannedClosedDate

Date

Planned closed date

plannedOpenDate

Date

Planned open date

serviceId

Integer

Service Id

serviceName

String

Service name

serviceType

String

Service Type. Values:

D = Allowances

I = On Site

LABEXT = External Calibration

MO = Labour Cost

NA = Does not apply

P = Permanent Lab.

S = Supplement

SUPPY = Supply

shortDescription

String

Description

statusId

String

Status id. Values:

OPEN = Open

PROGRESS = In progress

FINAL = Closed

registeredClosedDate

Date

Registered closed date

registeredOpenDate

Date

Registered open date

workOrderList

WorkOrder

Assigned work orders.

workOrderList

Assigned work orders:

Parameter

Type

Description

id

Integer

Work Order ID

agentName

String

Agent Name

customerId

Integer

Customer ID

customerName

String

Customer Name

externalOfferId

String

External offer code

externalOrderId

String

External order code

externalReferenceId

String

External ID

groupName

String

Group Name to do the Work Order

itemId

Integer

Item ID

itemTag

String

Item Name

observations

String

Description

offerCode

String

Offer Code

openDate

Date

Open Date. Automatically generated

serviceId

Integer

Service ID

serviceType

String

Service Type. Values:

I=In Situ

LABEXT = External Calibration

P =Permanent Lab.

NA= Does not apply

statusName

String

Status Name. In the creation, OPEN status is assigned automatically

typeId

String

Type of Work Order. Values:

ATP = ATP

CALIBRATION = Calibration

CONTROL = Control between calibrations

MAINTENANCE = Maintenance

METROLOGICAL = Metrological Requirements

REPAIR = Repair

REVIEW = Review

Error codes

Code

Description

1000

Generic error

17000

Unknown batch

17001

Missing mandatory fields

17002

Action not valid

17003

The batch does not have any work orders assigned to it. You cannot go to PROGRESS status without assigned work orders.

17004

Action not allowed

Examples

Call (POST Method)

JSON
https://server:8443/calibry-rest-api/rest/cif/batch/{id_Lote}/?action=saveBatch

https://server:8443/calibry-rest-api/rest/cif/batch/137/?action=saveBatch

https://server:8443/calibry-rest-api/rest/cif/batch/137/?action=setInProgressBatch

https://server:8443/calibry-rest-api/rest/cif/batch/137/?action=completeBatch


Headers:
    Authorization
    Content-Type = application/json

Body:
{
    "id":"137",
    "shortDescription":"Batch description XYZ"
}

Responses

OK:

JSON
{
    "id": 137,
    "statusId": "OPEN",
    "familyId": null,
    "familyName": null,
    "serviceId": null,
    "serviceName": null,
    "openDate": 1572354081957,
    "closedDate": null,
    "agentId": 385,
    "agentName": "user123",
    "plannedOpenDate": "1572397200000",
    "plannedClosedDate": "1572483600000",
    "registeredOpenDate": null,
    "registeredClosedDate": null,
    "dedicatedTime": "18.0",
    "shortDescription": "Batch description XYZ",
    "serviceType": "P",
    "isExternalCalibration": "false",
    "externalLaboratoryId": 133,
    "externalLaboratoryName": "Laboratory 003",
    "externalReferenceId": "ext_123456",
    "workOrderList":[{
    "id":"1311",
					"typeId":"CALIBRATION",
					"statusName":"OPEN",
					"openDate":"1572355073579",
					"agentName":"usuario123",
					"customerId":"3919",
					"customerName":"Customer123",
					"observations":"",
					"offerCode":"",
					"externalReferenceId":"",
					"serviceId":"",
					"serviceType":"P",
					"itemTag":"Item-001"
					}]
}

Error:

JSON
{"code":"17002"}
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.