Containers Admin

Project made for admin the containers logistics in a port enviroment.

API Reference

Containers

Create new container record

  POST /api/containers
Body Type Description
container_id string Required. Container Number: (Ex. 'TEST1234567')
client string Required. Client identifier
type enum Required. '20' or '40'
status enum Required. 'FULL' or 'EMPTY'
category enum Required. 'IMPORT' or 'EXPORT'
Response
Status Return Description
201 object Return the container created
400 message Container not valid
400 message Container already created

Get container record

  GET /api/containers/:container_id
Params Type Description
container_id string Required. Container Number: (Ex. 'TEST1234567')
Response
Status Return Description
200 object Return the container record
400 message Container number not valid
400 message Container not found

Get container records

  GET /api/containers/
Query Type Description
client string Client identifier to filter containers by client
type enum '20' or '40'
status enum 'FULL' or 'EMPTY' to filter containers by status
category enum 'IMPORT' or 'EXPORT' to filter containers by categoty
Response
Status Return Description
200 object Return the containers records. (see bellow)
response object
    {
        itemsList: [Container]!
    }

Update container record

  PUT /api/containers/:container_id
Params Type Description
container_id string Required. Container Number: (Ex. 'TEST1234567')
Body Type Description
client string Client identifier
type enum '20' or '40'
status enum 'FULL' or 'EMPTY'
category enum 'IMPORT' or 'EXPORT'
Response
Status Return Description
200 object Return the container record
400 message Update not valid
400 message Container not found

Delete container record

  DELETE /api/containers/:container_id
Params Type Description
container_id string Required. Container Number: (Ex. 'TEST1234567')
Response
Status Return Description
204 Container record deleted
400 message Container not found

Operations

Post new operation

  POST /api/operations
Body Type Description
type enum Required. Operation type: see below possible operations
procedure enum Required. 'START' or 'END'
container_id string Required. Container Number: (Ex. 'TEST1234567')
date string Required. Date string: 'YYYY-MM-DDTHH:mm:ss'

Possible operations: ['BOARDING', 'LANDING', 'GATE_IN', 'GATE_OUT', 'STACK_POSITIONING', 'WEIGHING', 'SCANNER']

Response
Status Return Description
201 id Return the operation id
400 message Operation not valid

Get operation record

  GET /api/operations/:operation_id
Params Type Description
operation_id string Required. Operation id
Response
Status Return Description
200 object Return the operation record
400 message Container not found

Get operatios records

  GET /api/operations/
Paramns Type Description
type string Operation to filter operations
container_id string Container Number to filter operations by container
client string Client identifier to filter containers by client
Response
Status Return Description
200 object Return the operations records. (see bellow)
response object
    {
        itemsList: [Operation]!
    }

Update operation record

  PUT /api/operations/:operation_id
Params Type Description
operation_id string Required. Operation id
Body Type Description
type enum Operation: see below possible operations
procedure enum 'START' or 'END'
container_id string Container Number: (Ex. 'TEST1234567')
date string Date string: 'YYYY-MM-DDTHH:mm:ss'
Response
Status Return Description
200 object Return the operation record
400 message Update not valid
400 message Container not found

Delete operation record

  DELETE /api/operations/:operation_id
Params Type Description
operation_id string Required. Operation id
Response
Status Return Description
204 Operation record deleted
400 message Operation not found

Tech Stack

Client: React, MaterializeCSS

Server: REST with: Node, Express

License

ISC License

Copyright (c) 2021, Jeremias Leao

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.