Losses

Endpoints

Create / update losses

/companies/{companycode}/establishments/{establishmentcode}/losses

Parameters

Type Name Description Schema

Path

companyCode
required

Current context company code

string

Path

establishmentCode
required

Current context establishment code

string

Body

body
required

Responses

HTTP Code Description Schema

201

Successfully created

No Content

400

Functionnal error

No Content

500

Internal server error

No Content

Consumes

  • application/json

Produces

  • application/json

Delete losses

/companies/{companycode}/establishments/{establishmentcode}/losses

Parameters

Type Name Description Schema

Path

companyCode
required

Current context company code

string

Path

establishmentCode
required

Current context establishment code

string

Body

body
required

Responses

HTTP Code Description Schema

201

Successfully created

No Content

400

Functionnal error

No Content

500

Internal server error

No Content

Consumes

  • application/json

Produces

  • application/json

Data structure

ScrapQuantity (Create / update losses)

Name Description Value Associated rules

companyCode
required

Company code

string

establishmentCode
required

Establishment code

string

moNb
required

The manufacturing order number

string

R1

at
required

The date of the scrap quantity

string

R2

quantity
required

Losses quantity

R3

lossReasonCode
required

Loss reason code

string

R5

comment
optional

Comment

string

R6

ScrapQuantity (Delete)

Name Description Value Associated rules

companyCode
required

Company code

string

establishmentCode
required

Establishment code

string

moNb
required

The manufacturing order number

string

R7

at
required

The date of the scrap quantity

string

R7

Quantity

Quantity data structure.

Name Description Value

value
required

Quantity

BigDecimal

unitCode
required

Quantity unit code

string

Rules

R1

moNb should refer to a resource that exists for these companyCode and establishmentCode.

If MO already exists and is awaiting, scrap quantity cannot be added.

R2

at should be on mo period.

R3

quantity should be different than 0.

If a scrap quantity exists for companyCode, establishmentCode, moNb and at, this scrap quantity will be updated.

If scrapReason is to remove from done; quantity cannot be greater than good quantities.

R4

unitCode should exist and should be lineCode cadency unit or there should be a conversion between unitCode and lineCode cadency unit.

R5

lossReasonCode should refer to the production line.

R6

comment should be lowest than 1024 caracters.

R7

Scrap quantity should refer to a resource that exists for these companyCode, establishmentCode, moNb and at.