Stocks inputs

Endpoints

Create / update stock inputs

/companies/{companycode}/establishments/{establishmentcode}/stock-inputs

Parameters

Type Name Description Schema Associated rules

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

Rules

R1

companyCode and establishmentCode must be the same in path and body.

R2

at should be before the call.

There should be only one final quantity for these companyCode, establishmentCode, moNb and at.

R3

MO with moNb as external MO number should exist for companyCode and establishmentCode.

This MO should be started, suspended or finished (it can’t be in awaiting state).

If the MO state is "awaiting", it is impossible to set final quantities.

R4

The quantity can’t be equals to 0.

R5

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

R6

To update a final quantity : companyCode, establishmentCode, moNb, unitCode and at which already exist can be sent with the new quantity.

Delete stock inputs

/companies/{companycode}/establishments/{establishmentcode}/stock-inputs

Parameters

Type Name Description Schema Associated rules

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

Rules

R7

There should be one undeleted final quantity with these companyCode, establishmentCOde, moNb and at.

The final quantity is deleted (logical deletion).

Data structure

QuantityFinal (Create / Update)

Name Description Value Associated rules

companyCode
required

Company code

string

R1

establishmentCode
required

Establishment code

string

R1

at
required

The date of the quantity

string

R2

moNb
required

The manufacturing order number

string

R3

quantity
required

Stock inputs quantity

R4 R5

QuantityFinal (Delete)

Name Description Value Associated rules

companyCode
required

Company code

string

R1

establishmentCode
required

Establishment code

string

R1

at
required

The date of the quantity

string

R2

moNb
required

The manufacturing order number

string

R3

Quantity

Quantity data structure.

Name Description Value Associated rules

value
required

Quantity

BigDecimal

R4

unitCode
required

Quantity unit code

string

R5