This repository has been archived on 2025-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
BreCal/misc/BreCalApi.yaml

1979 lines
59 KiB
YAML

openapi: 3.0.0
x-stoplight:
id: mwv4y8vcnopwr
info:
version: 1.6.0
title: Bremen calling API
description: 'Administer DEBRE ship calls, times and notifications'
termsOfService: 'https://www.bsmd.de/'
contact:
name: Bremen calling API
url: 'https://www.textbausteine.net'
email: info@textbausteine.net
license:
name: Use at your own risk
url: 'https://www.bsmd.de/license'
servers:
- url: 'https://brecaltest.bsmd-emswe.eu'
description: Test server hosted on vcup
tags:
- name: user
- name: shipcall
- name: times
- name: static
- name: ship
paths:
/login:
post:
description: Perform login
summary: Returns a JWT session token and user data if successful
tags:
- user
operationId: login
requestBody:
description: Login credentials
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/credentials'
example:
username: alfred
password: '123456'
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/login_result'
example:
id: 42
participant_id: 5
first_name: John
last_name: Doe
user_name: johndoe
user_phone: '1234567890'
user_email: no@where.com
exp: 1630000000
token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
'400':
$ref: '#/components/responses/400'
'403':
$ref: '#/components/responses/403'
'500':
$ref: '#/components/responses/500'
'503':
$ref: '#/components/responses/503'
/user:
put:
description: Update user information
summary: 'Update user details (first/last name, phone, password)'
tags:
- user
operationId: userUpdate
requestBody:
description: User details
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/user_details'
example:
id: 42
first_name: John
last_name: Doe
user_phone: '1234567890'
user_email: no@where.de
responses:
'200':
$ref: '#/components/responses/200'
'400':
$ref: '#/components/responses/400'
'401':
$ref: '#/components/responses/401'
'500':
$ref: '#/components/responses/500'
'503':
$ref: '#/components/responses/503'
/shipcalls:
get:
description: Get current ship calls
summary: Gets a list of ship calls
tags:
- shipcall
operationId: shipcallsGet
parameters:
- name: past_days
in: query
required: false
description: 'number of days in the past to include in the result. *Example: 7*.'
schema:
type: integer
example: 7
responses:
'200':
description: ship call list
content:
application/json:
schema:
$ref: '#/components/schemas/shipcalls'
example:
- id: 6
ship_id: 8
type: arrival
eta: '2023-08-21T08:23:35Z'
voyage: Voyage 123
etd: '2023-08-21T08:23:35Z'
arrival_berth_id: 3
departure_berth_id: 4
tug_required: true
pilot_required: true
flags: 1
pier_side: false
bunkering: false
replenishing_terminal: false
replenishing_lock: false
draft: 10.5
tidal_window_from: '2023-08-21T08:23:35Z'
tidal_window_to: '2023-08-21T08:23:35Z'
rain_sensitive_cargo: false
recommended_tugs: 2
anchored: false
moored_lock: false
canceled: false
evaluation: yellow
evaluation_message: Time window too short
time_ref_point: 1
participants:
- participant_id: 5
type: 4
- participant_id: 6
type: 8
created: '2023-08-21T08:23:35Z'
modified: '2023-08-21T08:23:35Z'
- id: 7
ship_id: 8
type: departure
eta: '2023-08-21T08:23:35Z'
voyage: Voyage 123
etd: '2023-08-21T08:23:35Z'
arrival_berth_id: 3
departure_berth_id: 4
tug_required: true
pilot_required: true
flags: 1
pier_side: false
bunkering: false
replenishing_terminal: false
replenishing_lock: false
draft: 10.5
tidal_window_from: '2023-08-21T08:23:35Z'
tidal_window_to: '2023-08-21T08:23:35Z'
rain_sensitive_cargo: false
recommended_tugs: 2
anchored: false
moored_lock: false
canceled: false
evaluation: yellow
evaluation_message: Time window too short
time_ref_point: 1
participants:
- participant_id: 5
type: 4
- participant_id: 6
type: 8
created: '2023-08-21T08:23:35Z'
modified: '2023-08-21T08:23:35Z'
'400':
$ref: '#/components/responses/400'
'401':
$ref: '#/components/responses/401'
'500':
$ref: '#/components/responses/500'
'503':
$ref: '#/components/responses/503'
post:
summary: Create a new ship call
description: A new shipcall is created without times at this point. This is ususally done by the BSMD or a participant with that particular role.
tags:
- shipcall
operationId: shipcallCreate
requestBody:
description: Creates a new ship call. **Do not** provide id parameter.
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/shipcall'
example:
id: 6
ship_id: 8
type: arrival
eta: '2023-08-21T08:23:35Z'
voyage: Voyage 123
etd: '2023-08-21T08:23:35Z'
arrival_berth_id: 3
departure_berth_id: 4
tug_required: true
pilot_required: true
flags: 1
pier_side: false
bunkering: false
replenishing_terminal: false
replenishing_lock: false
draft: 10.5
tidal_window_from: '2023-08-21T08:23:35Z'
tidal_window_to: '2023-08-21T08:23:35Z'
rain_sensitive_cargo: false
recommended_tugs: 2
anchored: false
moored_lock: false
canceled: false
evaluation: yellow
evaluation_message: Time window too short
time_ref_point: 1
participants:
- participant_id: 5
type: 4
- participant_id: 6
type: 8
responses:
'201':
$ref: '#/components/responses/201'
'400':
$ref: '#/components/responses/400'
'401':
$ref: '#/components/responses/401'
'500':
$ref: '#/components/responses/500'
'503':
$ref: '#/components/responses/503'
put:
summary: Updates a ship call
description: Updates a shipcall. Usually done if the participant assignments change.
tags:
- shipcall
operationId: shipcallUpdate
requestBody:
description: Creates a new ship call. The id parameter is **required**.
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/shipcall'
example:
ship_id: 8
type: arrival
eta: '2023-08-21T08:23:35Z'
voyage: Voyage 123
etd: '2023-08-21T08:23:35Z'
arrival_berth_id: 3
departure_berth_id: 4
tug_required: true
pilot_required: true
flags: 1
pier_side: false
bunkering: false
replenishing_terminal: false
replenishing_lock: false
draft: 10.5
tidal_window_from: '2023-08-21T08:23:35Z'
tidal_window_to: '2023-08-21T08:23:35Z'
rain_sensitive_cargo: false
recommended_tugs: 2
anchored: false
moored_lock: false
canceled: false
evaluation: yellow
evaluation_message: Time window too short
time_ref_point: 1
participants:
- participant_id: 5
type: 4
- participant_id: 6
type: 8
responses:
'200':
$ref: '#/components/responses/200'
'400':
$ref: '#/components/responses/400'
'401':
$ref: '#/components/responses/401'
'500':
$ref: '#/components/responses/500'
'503':
$ref: '#/components/responses/503'
/ships:
get:
summary: gets a list of ships
description: Gets a list of ships including logically deleted ships to be used with shipcalls
tags:
- ship
operationId: shipsGet
responses:
'200':
description: list of ships
content:
application/json:
schema:
$ref: '#/components/schemas/ship_list'
example:
- id: 2
name: MS Bremen
imo: 1234567
type: 1
length: 200
width: 30
draft: 10
created: '2023-08-21T08:23:35Z'
modified: '2023-08-21T08:23:35Z'
- id: 3
name: MS Helgoland
imo: 7654321
type: 1
length: 150
width: 12
draft: 5
created: '2023-08-21T08:23:35Z'
modified: '2023-08-21T08:23:35Z'
'400':
$ref: '#/components/responses/400'
'401':
$ref: '#/components/responses/401'
'500':
$ref: '#/components/responses/500'
'503':
$ref: '#/components/responses/503'
post:
summary: create a new ship entry
description: adds a new non-existing ship to the database. The ships IMO number is the unique identifier.
tags:
- ship
operationId: shipsCreate
requestBody:
description: Ship details. **Do not** provide id parameter.
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ship'
example:
name: MS Bremen
imo: 1234567
type: 1
length: 200
width: 30
draft: 10
responses:
'201':
$ref: '#/components/responses/201'
'400':
$ref: '#/components/responses/400'
'401':
$ref: '#/components/responses/401'
'500':
$ref: '#/components/responses/500'
'503':
$ref: '#/components/responses/503'
put:
summary: Update a ship entry
description: Updating a ship entry. Please do not modify the IMO number. In that case please add a new entry.
tags:
- ship
operationId: shipUpdate
requestBody:
description: Updated ship entry. The id parameter is **required**.
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ship'
example:
id: 2
imo: 1234567
name: Ship name
type: 1
created: '2023-08-21T08:23:35Z'
modified: '2023-08-21T08:23:35Z'
responses:
'200':
$ref: '#/components/responses/200'
'400':
$ref: '#/components/responses/400'
'401':
$ref: '#/components/responses/401'
'500':
$ref: '#/components/responses/500'
'503':
$ref: '#/components/responses/503'
delete:
summary: Delete a ship (logically).
description: 'A ship can only be logically deleted, since it is possible to have been used in previous shipcalls. On logical delete, the ship can no longer be selected in a new ship call.'
tags:
- ship
operationId: shipDelete
parameters:
- name: id
description: '**Id of ship**. *Example: 42*. Id of ship to be deleted.'
in: query
required: true
schema:
type: integer
example: 42
responses:
'200':
$ref: '#/components/responses/200'
'400':
$ref: '#/components/responses/400'
'401':
$ref: '#/components/responses/401'
'500':
$ref: '#/components/responses/500'
'503':
$ref: '#/components/responses/503'
/participants:
get:
summary: gets one or all participants
description: 'If no parameter is given, all participants are returned. The list can be used to display participant information in the context of ship calls.'
tags:
- static
operationId: participantsGet
parameters:
- name: user_id
in: query
required: false
description: '**Id of user**. *Example: 2*. User id returned by verify call.'
schema:
type: integer
example: 2
responses:
'200':
description: one or all participants as list
content:
application/json:
schema:
$ref: '#/components/schemas/participant_list'
example:
- id: 5
name: BSMD
type: 1
created: '2023-08-21T08:23:35Z'
- id: 6
name: Terminal 1
type: 2
created: '2023-08-21T08:23:35Z'
'400':
$ref: '#/components/responses/400'
'401':
$ref: '#/components/responses/401'
'404':
$ref: '#/components/responses/404'
'500':
$ref: '#/components/responses/500'
'503':
$ref: '#/components/responses/503'
/times:
get:
summary: Gets list of times
description: Get all times assigned to a shipcall. These might not be complete.
tags:
- times
operationId: timesGet
parameters:
- name: shipcall_id
in: query
description: '**Id**. *Example: 42*. Id of referenced ship call.'
schema:
type: integer
example: 42
example: 42
responses:
'200':
description: list of recorded times
content:
application/json:
schema:
$ref: '#/components/schemas/times_list'
example:
- id: 2
eta_berth: '2023-08-21T08:23:35Z'
eta_berth_fixed: true
etd_berth: '2023-08-21T08:23:35Z'
etd_berth_fixed: true
lock_time: '2023-08-21T08:23:35Z'
lock_time_fixed: true
zone_entry: '2023-08-21T08:23:35Z'
zone_entry_fixed: true
operations_start: '2023-08-21T08:23:35Z'
operations_end: '2023-08-21T08:23:35Z'
remarks: Please be aware of the strong current
shipcall_id: 23
participant_id: 34
berth_id: 1
berth_info: 200m length
pier_side: true
participant_type: 4
ata: '2023-08-21T08:23:35Z'
atd: '2023-08-21T08:23:35Z'
eta_interval_end: '2023-08-21T08:23:35Z'
etd_interval_end: '2023-08-21T08:23:35Z'
created: '2023-08-21T08:23:35Z'
modified: '2023-08-21T08:23:35Z'
'400':
$ref: '#/components/responses/400'
'401':
$ref: '#/components/responses/401'
'500':
$ref: '#/components/responses/500'
'503':
$ref: '#/components/responses/503'
post:
summary: Create a new times entry for a ship call
description: The times entry for a shipcall is created with reference to a participant. For each participant type there should be only one times data record.
tags:
- times
operationId: timesCreate
requestBody:
description: Times entry that will be added to the ship call. **Do not** provide id parameter.
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/times'
example:
eta_berth: '2023-08-21T08:23:35Z'
eta_berth_fixed: true
etd_berth: '2023-08-21T08:23:35Z'
etd_berth_fixed: true
lock_time: '2023-08-21T08:23:35Z'
lock_time_fixed: true
zone_entry: '2023-08-21T08:23:35Z'
zone_entry_fixed: true
operations_start: '2023-08-21T08:23:35Z'
operations_end: '2023-08-21T08:23:35Z'
remarks: Please be aware of the strong current
shipcall_id: 23
participant_id: 34
berth_id: 1
berth_info: 200m length
pier_side: true
participant_type: 4
ata: '2023-08-21T08:23:35Z'
atd: '2023-08-21T08:23:35Z'
eta_interval_end: '2023-08-21T08:23:35Z'
etd_interval_end: '2023-08-21T08:23:35Z'
responses:
'201':
$ref: '#/components/responses/201'
'400':
$ref: '#/components/responses/400'
'401':
$ref: '#/components/responses/401'
'500':
$ref: '#/components/responses/500'
'503':
$ref: '#/components/responses/503'
put:
summary: Update a times entry for a ship call
description: Updating a times entry for a ship for a particular participant. The times entries are required for a shipcall to pass the validation rules.
tags:
- times
operationId: timesUpdate
requestBody:
description: Times entry that will be added to the ship call. The id parameter is **required**.
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/times'
example:
id: 2
eta_berth: '2023-08-21T08:23:35Z'
eta_berth_fixed: true
etd_berth: '2023-08-21T08:23:35Z'
etd_berth_fixed: true
lock_time: '2023-08-21T08:23:35Z'
lock_time_fixed: true
zone_entry: '2023-08-21T08:23:35Z'
zone_entry_fixed: true
operations_start: '2023-08-21T08:23:35Z'
operations_end: '2023-08-21T08:23:35Z'
remarks: Please be aware of the strong current
shipcall_id: 23
participant_id: 34
berth_id: 1
berth_info: 200m length
pier_side: true
participant_type: 4
ata: '2023-08-21T08:23:35Z'
atd: '2023-08-21T08:23:35Z'
eta_interval_end: '2023-08-21T08:23:35Z'
etd_interval_end: '2023-08-21T08:23:35Z'
created: '2023-08-21T08:23:35Z'
modified: '2023-08-21T08:23:35Z'
responses:
'200':
$ref: '#/components/responses/200'
'400':
$ref: '#/components/responses/400'
'401':
$ref: '#/components/responses/401'
'500':
$ref: '#/components/responses/500'
'503':
$ref: '#/components/responses/503'
delete:
summary: Delete a times entry for a ship call.
description: A times entry is typically deleted if the agent for example changes or removes the participant assignment for a particular role.
tags:
- times
operationId: timesDelete
parameters:
- name: id
description: '**Id of times**. *Example: 42*. Id of times entry to be deleted.'
in: query
required: true
schema:
$ref: '#/components/schemas/timesId'
responses:
'200':
$ref: '#/components/responses/200'
'400':
$ref: '#/components/responses/400'
'401':
$ref: '#/components/responses/401'
'500':
$ref: '#/components/responses/500'
'503':
$ref: '#/components/responses/503'
/notifications:
get:
summary: Gets a list of notifications pursuant to a specified participant and ship call
description: List of notifications (tbd)
tags:
- static
operationId: notificationsGet
parameters:
- name: shipcall_id
in: query
required: true
description: '**Id of ship call**. *Example: 52*. Id given in ship call list'
schema:
$ref: '#/components/schemas/shipcallId'
responses:
'200':
description: notification list
content:
application/json:
schema:
$ref: '#/components/schemas/notification_list'
example:
- id: 2
shipcall_id: 52
participant_id: 5
message: Please be aware of the strong current
created: '2023-08-21T08:23:35Z'
- id: 3
shipcall_id: 52
participant_id: 6
message: Please be aware of the strong current
created: '2023-08-21T08:23:35Z'
'400':
$ref: '#/components/responses/400'
'401':
$ref: '#/components/responses/401'
'500':
$ref: '#/components/responses/500'
'503':
$ref: '#/components/responses/503'
/berths:
get:
description: 'Returns a list of berths, including berths that are (logically) deleted'
summary: Gets a list of all berths registered
tags:
- static
operationId: berthsGet
responses:
'200':
description: list of berths
content:
application/json:
schema:
$ref: '#/components/schemas/berth_list'
example:
- id: 3
name: Pier 1
owner_id: 5
port_id: 3
- id: 4
name: Pier 2
owner_id: 5
port_id: 3
'400':
$ref: '#/components/responses/400'
'401':
$ref: '#/components/responses/401'
'500':
$ref: '#/components/responses/500'
'503':
$ref: '#/components/responses/503'
/history:
get:
description: This endpoint returns a list of changes made to the specific shipcall
summary: History data
tags:
- static
operationId: historyGet
parameters:
- name: shipcall_id
in: query
required: true
description: '**Id of ship call**. *Example: 3*. Id given in ship call list'
schema:
$ref: '#/components/schemas/shipcallId'
responses:
'200':
description: list of history entries
content:
application/json:
schema:
$ref: '#/components/schemas/history_list'
example:
- id: 2
shipcall_id: 3
participant_id: 5
operation: insert
type: shipcall
created: '2023-08-21T08:23:35Z'
- id: 3
shipcall_id: 3
participant_id: 6
operation: update
type: shipcall
created: '2023-08-21T08:23:35Z'
'400':
$ref: '#/components/responses/400'
'401':
$ref: '#/components/responses/401'
'500':
$ref: '#/components/responses/500'
'503':
$ref: '#/components/responses/503'
/ports:
get:
summary: Your GET endpoint
description: Returns a list of ports
tags:
- static
operationId: get-ports
responses:
'200':
description: list of ports
content:
application/json:
schema:
$ref: '#/components/schemas/port_list'
example:
- id: 3
name: Bremen
country: Germany
- id: 4
name: Hamburg
country: Germany
'401':
$ref: '#/components/responses/401'
'403':
$ref: '#/components/responses/403'
'500':
$ref: '#/components/responses/500'
'503':
$ref: '#/components/responses/503'
components:
schemas:
credentials:
description: Login credentials for the user
type: object
properties:
username:
type: string
example: alfred
password:
type: string
format: password
example: '123456'
required:
- username
- password
example:
username: alfred
password: '123456'
timesId:
description: The unique identifier for a times entry
type: integer
example: 2
shipcallId:
description: The unique identifier of a ship call
type: integer
example: 6
participant_assignment:
description: Participant assigned to a shipcall with a given role (type)
type: object
required:
- participant_id
- type
properties:
participant_id:
type: integer
example: 5
type:
description: 'Possible role values: 1: BSMD 2: TERMINAL, 4: PILOT, 8: AGENCY, 16: MOORING, 32: PORT_ADMINISTRATION, 64: TUG. A participant may appear multiple times with different roles.'
type: integer
example: 4
example:
participant_id: 5
type: 4
shipcall:
type: object
description: Ship call data
example:
id: 6
ship_id: 8
port_id: 1
type: arrival
eta: '2023-08-21T08:23:35Z'
voyage: Voyage 123
etd: '2023-08-21T08:23:35Z'
arrival_berth_id: 3
departure_berth_id: 4
tug_required: true
pilot_required: true
flags: 1
pier_side: false
bunkering: false
replenishing_terminal: false
replenishing_lock: false
draft: 10.5
tidal_window_from: '2023-08-21T08:23:35Z'
tidal_window_to: '2023-08-21T08:23:35Z'
rain_sensitive_cargo: false
recommended_tugs: 2
anchored: false
moored_lock: false
canceled: false
evaluation: yellow
evaluation_message: Time window too short
time_ref_point: 1
participants:
- participant_id: 5
type: 4
- participant_id: 6
type: 8
created: '2023-08-21T08:23:35Z'
modified: '2023-08-21T08:23:35Z'
properties:
id:
type: integer
example: 6
ship_id:
type: integer
example: 8
port_id:
type: integer
example: 3
type:
$ref: '#/components/schemas/ShipcallType'
eta:
type: string
format: date-time
example: '2023-08-21T08:23:35Z'
nullable: true
voyage:
type: string
maxLength: 16
example: Voyage 123
nullable: true
etd:
type: string
format: date-time
example: '2023-08-21T08:23:35Z'
nullable: true
arrival_berth_id:
type: integer
example: 3
nullable: true
departure_berth_id:
type: integer
example: 4
nullable: true
tug_required:
type: boolean
example: true
nullable: true
pilot_required:
type: boolean
example: true
nullable: true
flags:
type: integer
example: 1
nullable: true
pier_side:
type: boolean
example: false
nullable: true
bunkering:
type: boolean
example: false
nullable: true
replenishing_terminal:
type: boolean
example: false
nullable: true
replenishing_lock:
type: boolean
example: false
nullable: true
draft:
type: number
format: double
example: 10.5
nullable: true
tidal_window_from:
type: string
format: date-time
example: '2023-08-21T08:23:35Z'
nullable: true
tidal_window_to:
type: string
format: date-time
example: '2023-08-21T08:23:35Z'
nullable: true
rain_sensitive_cargo:
type: boolean
example: false
nullable: true
recommended_tugs:
type: integer
example: 2
nullable: true
anchored:
type: boolean
example: false
nullable: true
moored_lock:
type: boolean
example: false
nullable: true
canceled:
type: boolean
example: false
nullable: true
evaluation:
$ref: '#/components/schemas/EvaluationType'
evaluation_message:
maxLength: 512
type: string
example: Time window too short
nullable: true
readOnly: true
time_ref_point:
type: integer
description: Physical reference point for all times given in shipcall and depending times entries
example: 1
nullable: true
participants:
type: array
example:
- participant_id: 5
type: 4
- participant_id: 6
type: 8
items:
$ref: '#/components/schemas/participant_assignment'
created:
type: string
format: date-time
description: Readonly field set by the database when shipcall was created
example: '2023-08-21T08:23:35Z'
modified:
type: string
format: date-time
description: Readonly field set by the database when shipcall was last modified
example: '2023-08-21T08:23:35Z'
nullable: true
required:
- ship_id
- type
shipcalls:
description: List of ship calls
type: array
items:
$ref: '#/components/schemas/shipcall'
example:
- id: 6
ship_id: 8
port_id: 1
type: arrival
eta: '2023-08-21T08:23:35Z'
voyage: Voyage 123
etd: '2023-08-21T08:23:35Z'
arrival_berth_id: 3
departure_berth_id: 4
tug_required: true
pilot_required: true
flags: 1
pier_side: false
bunkering: false
replenishing_terminal: false
replenishing_lock: false
draft: 10.5
tidal_window_from: '2023-08-21T08:23:35Z'
tidal_window_to: '2023-08-21T08:23:35Z'
rain_sensitive_cargo: false
recommended_tugs: 2
anchored: false
moored_lock: false
canceled: false
evaluation: yellow
evaluation_message: Time window too short
time_ref_point: 1
participants:
- participant_id: 5
type: 4
- participant_id: 6
type: 8
created: '2023-08-21T08:23:35Z'
modified: '2023-08-21T08:23:35Z'
- id: 7
ship_id: 8
port_id: 1
type: departure
eta: '2023-08-21T08:23:35Z'
voyage: Voyage 123
etd: '2023-08-21T08:23:35Z'
arrival_berth_id: 3
departure_berth_id: 4
tug_required: true
pilot_required: true
flags: 1
pier_side: false
bunkering: false
replenishing_terminal: false
replenishing_lock: false
draft: 10.5
tidal_window_from: '2023-08-21T08:23:35Z'
tidal_window_to: '2023-08-21T08:23:35Z'
rain_sensitive_cargo: false
recommended_tugs: 2
anchored: false
moored_lock: false
canceled: false
evaluation: red
evaluation_message: Disagreement on time windows
time_ref_point: 1
participants:
- participant_id: 5
type: 4
- participant_id: 6
type: 8
created: '2023-08-21T08:23:35Z'
modified: '2023-08-21T08:23:35Z'
times:
type: object
description: 'the id parameter needs to be missing on POST and to be present on PUT (Update) calls, otherwise a 400 response will be generated'
properties:
id:
type: integer
example: 2
eta_berth:
type: string
format: date-time
nullable: true
description: Arrival time at berth
example: '2023-08-21T08:23:35Z'
eta_berth_fixed:
type: boolean
nullable: true
description: 'If true, the eta is fixed and cannot be changed'
example: true
etd_berth:
type: string
format: date-time
nullable: true
description: departure time from berth
example: '2023-08-21T08:23:35Z'
etd_berth_fixed:
type: boolean
nullable: true
description: 'If true, the etd is fixed and cannot be changed'
example: true
lock_time:
type: string
format: date-time
nullable: true
description: arrival time at lock
example: '2023-08-21T08:23:35Z'
lock_time_fixed:
type: boolean
nullable: true
description: 'If true, the lock time is fixed and cannot be changed'
example: true
zone_entry:
type: string
format: date-time
nullable: true
description: Expected time of entry into the zone
example: '2023-08-21T08:23:35Z'
zone_entry_fixed:
type: boolean
nullable: true
description: 'If true, the zone entry time is fixed and cannot be changed'
example: true
operations_start:
type: string
format: date-time
nullable: true
description: Start time for terminal operations
example: '2023-08-21T08:23:35Z'
operations_end:
type: string
format: date-time
nullable: true
description: End time for terminal operations
example: '2023-08-21T08:23:35Z'
remarks:
type: string
maxLength: 512
nullable: true
description: Additional remarks
example: Please be aware of the strong current
shipcall_id:
type: integer
description: Reference to a shipcall id
example: 23
participant_id:
type: integer
description: Reference to a participant id
example: 34
berth_id:
type: integer
nullable: true
description: Reference to a berth id
example: 1
berth_info:
type: string
nullable: true
maxLength: 512
description: Additional info text for berth
example: 200m length
pier_side:
description: 'true if ship is rotated, false otherwise'
type: boolean
nullable: true
example: true
participant_type:
type: integer
example: 4
ata:
type: string
format: date-time
nullable: true
description: ata can be set by mooring if actual times are different from planned
example: '2023-08-21T08:23:35Z'
atd:
type: string
format: date-time
nullable: true
description: atd can be set by mooring if actual times are different from planned
example: '2023-08-21T08:23:35Z'
eta_interval_end:
type: string
format: date-time
nullable: true
description: Optional end of the interval for the times eta entry
example: '2023-08-21T08:23:35Z'
etd_interval_end:
type: string
format: date-time
nullable: true
description: Optional end of the interval for the times etd entry
example: '2023-08-21T08:23:35Z'
created:
type: string
format: date-time
description: Readonly field set by the database when times record was created
example: '2023-08-21T08:23:35Z'
modified:
type: string
format: date-time
nullable: true
description: Readonly field set by the database when times record was last modified
example: '2023-08-21T08:23:35Z'
required:
- shipcall_id
- participant_id
example:
id: 2
eta_berth: '2023-08-21T08:23:35Z'
eta_berth_fixed: true
etd_berth: '2023-08-21T08:23:35Z'
etd_berth_fixed: true
lock_time: '2023-08-21T08:23:35Z'
lock_time_fixed: true
zone_entry: '2023-08-21T08:23:35Z'
zone_entry_fixed: true
operations_start: '2023-08-21T08:23:35Z'
operations_end: '2023-08-21T08:23:35Z'
remarks: Please be aware of the strong current
shipcall_id: 23
participant_id: 34
berth_id: 1
berth_info: 200m length
pier_side: true
participant_type: 4
ata: '2023-08-21T08:23:35Z'
atd: '2023-08-21T08:23:35Z'
eta_interval_end: '2023-08-21T08:23:35Z'
etd_interval_end: '2023-08-21T08:23:35Z'
created: '2023-08-21T08:23:35Z'
modified: '2023-08-21T08:23:35Z'
times_list:
description: List of times entries
type: array
items:
$ref: '#/components/schemas/times'
example:
- id: 2
eta_berth: '2023-08-21T08:23:35Z'
eta_berth_fixed: true
etd_berth: '2023-08-21T08:23:35Z'
etd_berth_fixed: true
lock_time: '2023-08-21T08:23:35Z'
lock_time_fixed: true
zone_entry: '2023-08-21T08:23:35Z'
zone_entry_fixed: true
operations_start: '2023-08-21T08:23:35Z'
operations_end: '2023-08-21T08:23:35Z'
remarks: Please be aware of the strong current
shipcall_id: 23
participant_id: 34
berth_id: 1
berth_info: 200m length
pier_side: true
participant_type: 4
ata: '2023-08-21T08:23:35Z'
atd: '2023-08-21T08:23:35Z'
eta_interval_end: '2023-08-21T08:23:35Z'
etd_interval_end: '2023-08-21T08:23:35Z'
created: '2023-08-21T08:23:35Z'
modified: '2023-08-21T08:23:35Z'
- id: 3
eta_berth: '2023-08-21T08:23:35Z'
eta_berth_fixed: true
etd_berth: '2023-08-21T08:23:35Z'
etd_berth_fixed: true
lock_time: '2023-08-21T08:23:35Z'
lock_time_fixed: true
zone_entry: '2023-08-21T08:23:35Z'
zone_entry_fixed: true
operations_start: '2023-08-21T08:23:35Z'
operations_end: '2023-08-21T08:23:35Z'
remarks: Please be aware of the strong current
shipcall_id: 23
participant_id: 34
berth_id: 1
berth_info: 200m length
pier_side: true
participant_type: 4
ata: '2023-08-21T08:23:35Z'
atd: '2023-08-21T08:23:35Z'
eta_interval_end: '2023-08-21T08:23:35Z'
etd_interval_end: '2023-08-21T08:23:35Z'
created: '2023-08-21T08:23:35Z'
modified: '2023-08-21T08:23:35Z'
berth:
type: object
description: Ship berth used for a ship call
properties:
id:
type: integer
example: 3
name:
type: string
maxLength: 128
example: Pier 1
owner_id:
type: integer
nullable: true
description: Optional reference to a participant (terminal)
example: 5
authority_id:
type: integer
nullable: true
description: Optional reference to a participant (port authority)
example: 6
lock:
type: boolean
nullable: true
description: If true lock must be passed
example: true
port_id:
type: integer
nullable: false
description: Required reference to a port
example: 1
created:
description: Readonly field set by the database when berth was created
type: string
format: date-time
example: '2023-08-21T08:23:35Z'
modified:
description: Readonly field set by the database when berth was last modified
type: string
format: date-time
nullable: true
example: '2023-08-21T08:23:35Z'
deleted:
description: marks the berth as logically deleted
type: boolean
default: false
example: false
example:
id: 3
name: Pier 1
owner_id: 5
authority_id: 6
lock: true
port_id: 1
created: '2023-08-21T08:23:35Z'
modified: '2023-08-21T08:23:35Z'
deleted: false
berth_list:
type: array
description: List of berths
items:
$ref: '#/components/schemas/berth'
example:
- id: 3
name: Pier 1
owner_id: 5
authority_id: 6
lock: true
port_id: 1
created: '2023-08-21T08:23:35Z'
modified: '2023-08-21T08:23:35Z'
deleted: false
- id: 4
name: Pier 2
owner_id: 5
authority_id: 6
lock: true
port_id: 1
created: '2023-08-21T08:23:35Z'
modified: '2023-08-21T08:23:35Z'
deleted: false
ship:
type: object
description: a ship
properties:
id:
type: integer
example: 8
name:
type: string
maxLength: 64
example: MS Bremen
imo:
type: integer
nullable: true
example: 1234567
callsign:
type: string
maxLength: 8
nullable: true
example: DBRE
participant_id:
type: integer
nullable: true
description: Optional reference to participant (tug role)
example: 9
length:
type: number
format: double
nullable: true
example: 200
width:
type: number
format: double
nullable: true
example: 30
is_tug:
type: boolean
default: false
example: false
bollard_pull:
type: integer
nullable: true
example: 100
eni:
type: integer
nullable: true
description: BSMD internal use
example: 1234567
created:
type: string
format: date-time
description: Readonly field set by the database when ship was created
example: '2023-08-21T08:23:35Z'
modified:
type: string
format: date-time
nullable: true
description: Readonly field set by the database when ship was last modified
example: '2023-08-21T08:23:35Z'
deleted:
type: boolean
default: false
description: marks the ship as logically deleted
example: false
example:
id: 8
name: MS Bremen
imo: 1234567
callsign: DBRE
participant_id: 9
length: 200
width: 30
is_tug: false
bollard_pull: 100
eni: 1234567
created: '2023-08-21T08:23:35Z'
modified: '2023-08-21T08:23:35Z'
deleted: false
ship_list:
type: array
description: List of ships
items:
$ref: '#/components/schemas/ship'
example:
- id: 8
name: MS Bremen
imo: 1234567
callsign: DBRE
participant_id: 9
length: 200
width: 30
is_tug: false
bollard_pull: 100
eni: 1234567
created: '2023-08-21T08:23:35Z'
modified: '2023-08-21T08:23:35Z'
deleted: false
- id: 9
name: MS Alfred
imo: 1234568
callsign: DBRF
participant_id: 9
length: 200
width: 30
is_tug: false
bollard_pull: 100
eni: 1234567
created: '2023-08-21T08:23:35Z'
modified: '2023-08-21T08:23:35Z'
deleted: false
history:
type: object
description: Single history entry with references
properties:
id:
type: integer
example: 3
participant_id:
type: integer
example: 5
shipcall_id:
type: integer
example: 42
timestamp:
type: string
format: date-time
example: '2023-08-21T08:23:35Z'
eta:
type: string
format: date-time
example: '2023-08-21T08:23:35Z'
operation:
$ref: '#/components/schemas/OperationType'
type:
$ref: '#/components/schemas/ObjectType'
example:
id: 3
participant_id: 5
shipcall_id: 42
timestamp: '2023-08-21T08:23:35Z'
eta: '2023-08-21T08:23:35Z'
operation: update
type: shipcall
history_list:
type: array
description: List of history items
items:
$ref: '#/components/schemas/history'
x-stoplight:
id: 93b5ff080c12a
example:
- id: 3
participant_id: 5
shipcall_id: 42
timestamp: '2023-08-21T08:23:35Z'
eta: '2023-08-21T08:23:35Z'
operation: insert
type: shipcall
- id: 4
participant_id: 5
shipcall_id: 42
timestamp: '2023-08-21T08:23:35Z'
eta: '2023-08-21T08:23:35Z'
operation: update
type: shipcall
notification:
type: object
description: a notification created by the engine if a times entry violates a rule
properties:
id:
type: integer
example: 42
shipcall_id:
type: integer
example: 5
notification_type:
$ref: '#/components/schemas/NotificationType'
message:
type: string
example: Entry XY violates rule Z
created:
type: string
format: date-time
description: Readonly field set by the database when notification was created
example: '2023-08-21T08:23:35Z'
modified:
type: string
format: date-time
nullable: true
description: Readonly field set by the database when notification was last modified
example: '2023-08-21T08:23:35Z'
example:
id: 42
shipcall_id: 5
notification_type: email
message: Entry XY violates rule Z
created: '2023-08-21T08:23:35Z'
modified: '2023-08-21T08:23:35Z'
notification_list:
type: array
description: List of notifications
items:
$ref: '#/components/schemas/notification'
example:
- id: 42
shipcall_id: 5
notification_type: email
message: Entry XY violates rule Z
created: '2023-08-21T08:23:35Z'
modified: '2023-08-21T08:23:35Z'
- id: 43
shipcall_id: 7
notification_type: email
message: Entry AB violates rule C
created: '2023-08-21T08:23:35Z'
modified: '2023-08-21T08:23:35Z'
participant:
type: object
description: A organisational entity that participates in Bremen Calling
example:
id: 42
name: BSMD
street: Hermann-Hollerith-Str. 7
postal code: '28359'
city: Bremen
type: 10
flags: 0
created: '2023-08-21T08:23:35Z'
modified: '2023-08-21T08:23:35Z'
deleted: false
properties:
id:
type: integer
example: 42
name:
type: string
maxLength: 128
example: BSMD
street:
type: string
maxLength: 128
example: Hermann-Hollerith-Str. 7
postal code:
type: string
maxLength: 5
example: '28359'
city:
type: string
maxLength: 64
example: Bremen
type:
type: integer
description: a logical combination (bitflag) of possible values. This cannot be encoded in a Enumeration type with discrete values in OpenAPI version < 3.1.
example: 10
flags:
description: Bit-encoded flag array for internal use
type: integer
example: 0
nullable: true
ports:
type: array
x-stoplight:
id: cj29rdqeg15b3
items:
x-stoplight:
id: is7kj0fmlc1nz
type: integer
minimum: 1
example: 1
example:
- 1
- 2
created:
type: string
format: date-time
description: Readonly field set by the database when participant was created
example: '2023-08-21T08:23:35Z'
modified:
type: string
format: date-time
description: Readonly field set by the database when participant was last modified
example: '2023-08-21T08:23:35Z'
nullable: true
deleted:
description: marks the participant as logically deleted
type: boolean
default: false
example: false
participant_list:
description: List of participants
type: array
items:
$ref: '#/components/schemas/participant'
example:
- id: 42
name: BSMD
street: Hermann-Hollerith-Str. 7
postal code: '28359'
city: Bremen
type: 10
flags: 0
created: '2023-08-21T08:23:35Z'
modified: '2023-08-21T08:23:35Z'
deleted: false
login_result:
type: object
description: result structure of a successful login attempt
properties:
id:
type: integer
example: 42
participant_id:
type: integer
example: 5
first_name:
type: string
example: John
last_name:
type: string
example: Doe
user_name:
type: string
example: johndoe
user_phone:
type: string
example: '1234567890'
user_email:
type: string
example: no@where.com
exp:
type: number
format: float
example: 1630000000
token:
type: string
example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
example:
id: 42
participant_id: 5
first_name: John
last_name: Doe
user_name: johndoe
user_phone: '1234567890'
user_email: no@where.com
exp: 1630000000
token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
user_details:
type: object
description: fields that a user may change
properties:
id:
type: integer
example: 42
old_password:
type: string
nullable: true
maxLength: 128
example: oldpassword
new_password:
type: string
nullable: true
maxLength: 128
example: newpassword
first_name:
type: string
nullable: true
maxLength: 45
example: John
last_name:
type: string
nullable: true
maxLength: 45
example: Doe
user_phone:
maxLength: 128
type: string
nullable: true
example: '1234567890'
user_email:
maxLength: 128
type: string
nullable: true
example: no@where.com
example:
id: 42
old_password: oldpassword
new_password: newpassword
first_name: John
last_name: Doe
user_phone: '1234567890'
user_email: no@where.com
Id:
type: object
description: A unique identifier for an entity
properties:
id:
type: integer
example: 42
example:
id: 42
Error:
type: object
description: Structure returned when invalid data (bad request) is created.
properties:
error_field:
description: Input field that caused the error or general error message
type: string
example: eta
error_description:
description: Detailed description if error_field was an input field
type: string
example: eta must be in the future
required:
- error_field
example:
error_field: eta
error_description: eta must be in the future
ShipcallType:
type: string
enum:
- undefined
- arrival
- departure
- shifting
x-internal: false
description: Type of ship call
example: arrival
NotificationType:
type: string
description: Type of notification
enum:
- undefined
- email
- push
example: email
EvaluationType:
description: Evaluation of the ship call
readOnly: true
nullable: true
type: string
enum:
- undefined
- green
- yellow
- red
example: green
OperationType:
type: string
description: Type of operation that was performed
enum:
- undefined
- insert
- update
- delete
example: insert
ObjectType:
type: string
description: Type of object that was changed
enum:
- times
- shipcall
example: times
port:
title: port
x-stoplight:
id: j17v63cxewkz6
type: object
description: Record of port data
properties:
id:
type: integer
example: 2
minimum: 1
name:
type: string
x-stoplight:
id: zfcomg2kr5e9g
example: Hamburg
locode:
type: string
x-stoplight:
id: lbrnbreql8ah1
maxLength: 5
minLength: 5
example: DEHAM
created:
description: Readonly field set by the database when port was created
type: string
format: date-time
example: '2023-08-21T08:23:35Z'
modified:
description: Readonly field set by the database when port was last modified
type: string
format: date-time
nullable: true
example: '2023-08-21T08:23:35Z'
deleted:
description: marks the port as logically deleted
type: boolean
default: false
example: false
example:
id: 2
name: Hamburg
locode: DEHAM
port_list:
title: port_list
description: List of ports
x-stoplight:
id: it0cu6ivurgii
type: array
items:
$ref: '#/components/schemas/port'
example:
- id: 2
name: Hamburg
locode: DEHAM
- id: 3
name: Bremen
locode: DEBRE
securitySchemes:
ApiKey:
description: API key needed to access the API
type: apiKey
in: header
name: Authorization
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/Id'
example:
id: 42
'201':
description: Created
content:
application/json:
schema:
$ref: '#/components/schemas/Id'
example:
id: 42
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error_field: eta
error_description: eta must be in the future
'401':
description: Not authorized
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error_field: user_id
error_description: User not authorized to perform this action
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error_field: user_id
error_description: User not authorized to perform this action
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error_field: shipcall_id
error_description: Ship call not found
'500':
description: Unexpected error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error_field: service
error_description: Internal server error
'503':
description: Service unavailable
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error_field: service
error_description: Service is currently unavailable
security:
- ApiKey: []
externalDocs:
url: 'http://textbausteine.net/'
description: Extra documentation and conditions for Bremen Calling
x-internal: true