fixed a lot of small problems in yaml file, returned to OpenApi 3.0 format
This commit is contained in:
parent
5459d99098
commit
bd81f01d76
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
||||
openapi: 3.1.0
|
||||
openapi: 3.0.0
|
||||
x-stoplight:
|
||||
id: iucm9tq7jgu7j
|
||||
info:
|
||||
@ -13,7 +13,6 @@ info:
|
||||
license:
|
||||
name: Use at your own risk
|
||||
url: 'https://www.bsmd.de/license'
|
||||
summary: Bremen calling
|
||||
servers:
|
||||
- url: 'https://brecaldevel.bsmd-emswe.eu'
|
||||
description: Development server hosted on vcup
|
||||
@ -395,10 +394,6 @@ components:
|
||||
type: integer
|
||||
shipcall:
|
||||
type: object
|
||||
required:
|
||||
- id
|
||||
- ship_id
|
||||
- type
|
||||
properties:
|
||||
id:
|
||||
$ref: '#/components/schemas/shipcallId'
|
||||
@ -485,10 +480,16 @@ components:
|
||||
created:
|
||||
type: string
|
||||
format: date-time
|
||||
description: Readonly field set by the database
|
||||
modified:
|
||||
type: string
|
||||
format: date-time
|
||||
nullable: true
|
||||
description: Readonly field set by the database
|
||||
required:
|
||||
- id
|
||||
- ship_id
|
||||
- type
|
||||
shipcalls:
|
||||
type: array
|
||||
items:
|
||||
@ -496,9 +497,6 @@ components:
|
||||
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'
|
||||
required:
|
||||
- shipcall_id
|
||||
- participant_id
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
@ -509,6 +507,7 @@ components:
|
||||
eta_berth_fixed:
|
||||
type: boolean
|
||||
nullable: true
|
||||
description: currently unused
|
||||
etd_berth:
|
||||
type: string
|
||||
format: date-time
|
||||
@ -516,6 +515,7 @@ components:
|
||||
etd_berth_fixed:
|
||||
type: boolean
|
||||
nullable: true
|
||||
description: currently unused
|
||||
lock_time:
|
||||
type: string
|
||||
format: date-time
|
||||
@ -523,6 +523,7 @@ components:
|
||||
lock_time_fixed:
|
||||
type: boolean
|
||||
nullable: true
|
||||
description: currently unused
|
||||
zone_entry:
|
||||
type: string
|
||||
format: date-time
|
||||
@ -530,25 +531,31 @@ components:
|
||||
zone_entry_fixed:
|
||||
type: boolean
|
||||
nullable: true
|
||||
description: currently unused
|
||||
operations_start:
|
||||
type: string
|
||||
format: date-time
|
||||
nullable: true
|
||||
description: Start time for terminal operations
|
||||
operations_end:
|
||||
type: string
|
||||
format: date-time
|
||||
nullable: true
|
||||
description: End time for terminal operations
|
||||
remarks:
|
||||
type: string
|
||||
maxLength: 512
|
||||
nullable: true
|
||||
shipcall_id:
|
||||
type: integer
|
||||
description: Reference to a shipcall id
|
||||
participant_id:
|
||||
type: integer
|
||||
description: Reference to a participant id
|
||||
berth_id:
|
||||
type: integer
|
||||
nullable: true
|
||||
description: Reference to a berth id
|
||||
berth_info:
|
||||
type: string
|
||||
nullable: true
|
||||
@ -556,14 +563,19 @@ components:
|
||||
type: boolean
|
||||
nullable: true
|
||||
participant_type:
|
||||
$ref: '#/components/schemas/ParticipantType2'
|
||||
type: integer
|
||||
created:
|
||||
type: string
|
||||
format: date-time
|
||||
description: Readonly field set by the database
|
||||
modified:
|
||||
type: string
|
||||
format: date-time
|
||||
nullable: true
|
||||
description: Readonly field set by the database
|
||||
required:
|
||||
- shipcall_id
|
||||
- participant_id
|
||||
times_list:
|
||||
type: array
|
||||
items:
|
||||
@ -670,10 +682,12 @@ components:
|
||||
created:
|
||||
type: string
|
||||
format: date-time
|
||||
description: Readonly field set by the database
|
||||
modified:
|
||||
type: string
|
||||
format: date-time
|
||||
nullable: true
|
||||
description: Readonly field set by the database
|
||||
participant:
|
||||
type: object
|
||||
description: A organisational entity that participates in Bremen Calling
|
||||
@ -694,17 +708,19 @@ components:
|
||||
maxLength: 64
|
||||
type:
|
||||
type: integer
|
||||
description: a logical combinat
|
||||
description: a logical combination (bitflag) of possible values. This cannot be encoded in a Enumeration type with discrete values in OpenAPI version < 3.1. The values are 1=
|
||||
flags:
|
||||
type: integer
|
||||
nullable: true
|
||||
created:
|
||||
type: string
|
||||
format: date-time
|
||||
description: Readonly field set by the database
|
||||
modified:
|
||||
type: string
|
||||
format: date-time
|
||||
nullable: true
|
||||
description: Readonly field set by the database
|
||||
deleted:
|
||||
type: boolean
|
||||
default: false
|
||||
@ -788,52 +804,6 @@ components:
|
||||
- undefined
|
||||
- email
|
||||
- push
|
||||
ParticipantType:
|
||||
type: integer
|
||||
enum:
|
||||
- 1
|
||||
- 2
|
||||
- 4
|
||||
- 8
|
||||
- 16
|
||||
- 32
|
||||
- 64
|
||||
x-enumDescriptions:
|
||||
'1': bsmd
|
||||
'2': terminal
|
||||
'4': pilot
|
||||
'8': agency
|
||||
'16': mooring
|
||||
'32': port_authority
|
||||
'64': tug
|
||||
ParticipantType2:
|
||||
title: ParticipantType2
|
||||
x-stoplight:
|
||||
id: whw0m8x8dq6cg
|
||||
type: integer
|
||||
oneOf:
|
||||
- const: 1
|
||||
title: bsmd
|
||||
description: Bremen Schiffsmeldedienst
|
||||
- const: 2
|
||||
title: terminal
|
||||
description: Terminal
|
||||
- const: 4
|
||||
title: pilot
|
||||
description: Pilot
|
||||
- const: 8
|
||||
title: agency
|
||||
description: Agency
|
||||
- const: 16
|
||||
title: mooring
|
||||
description: Mooring
|
||||
- const: 32
|
||||
title: port_authority
|
||||
description: Port Authority
|
||||
- const: 64
|
||||
title: tug
|
||||
description: Tug
|
||||
description: Enumeration that can take particular values
|
||||
securitySchemes:
|
||||
ApiKey:
|
||||
type: apiKey
|
||||
|
||||
@ -13,6 +13,30 @@ namespace BreCalClient
|
||||
|
||||
#region Enum
|
||||
|
||||
/// <summary>
|
||||
/// Copied from models clunky I know
|
||||
/// </summary>
|
||||
[Flags]
|
||||
public enum ParticipantType
|
||||
{
|
||||
[Description("not assigned")]
|
||||
NONE = 0,
|
||||
[Description("BSMD")]
|
||||
BSMD = 1,
|
||||
[Description("Terminal")]
|
||||
TERMINAL = 2,
|
||||
[Description("Lotsen")]
|
||||
PILOT = 4,
|
||||
[Description("Agentur")]
|
||||
AGENCY = 8,
|
||||
[Description("Festmacher")]
|
||||
MOORING = 16,
|
||||
[Description("Hafenamt")]
|
||||
PORT_ADMINISTRATION = 32,
|
||||
[Description("Schlepper")]
|
||||
TUG = 64,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Custom participant flags
|
||||
/// </summary>
|
||||
|
||||
@ -209,13 +209,13 @@ namespace BreCalClient
|
||||
// this.labelShipName.Content = this.ShipcallControlModel?.Ship?.Name;
|
||||
switch (this.ShipcallControlModel?.Shipcall?.Type)
|
||||
{
|
||||
case 1: // incoming
|
||||
case ShipcallType.Arrival: // incoming
|
||||
this.imageShipcallType.Source = new BitmapImage(new Uri("pack://application:,,,/BreCalDevelClient;component/Resources/arrow_down_red.png"));
|
||||
break;
|
||||
case 2: // outgoing
|
||||
case ShipcallType.Departure: // outgoing
|
||||
this.imageShipcallType.Source = new BitmapImage(new Uri("pack://application:,,,/BreCalDevelClient;component/Resources/arrow_up_blue.png"));
|
||||
break;
|
||||
case 3: // shifting
|
||||
case ShipcallType.Shifting: // shifting
|
||||
this.imageShipcallType.Source = new BitmapImage(new Uri("pack://application:,,,/BreCalDevelClient;component/Resources/arrow_right_green.png"));
|
||||
break;
|
||||
default:
|
||||
@ -274,11 +274,11 @@ namespace BreCalClient
|
||||
|
||||
this.textBlockBerth.Text = this.ShipcallControlModel?.Berth;
|
||||
this.textBlockCallsign.Text = this.ShipcallControlModel?.Ship?.Callsign;
|
||||
if (this.ShipcallControlModel?.Shipcall?.Type == 1)
|
||||
if (this.ShipcallControlModel?.Shipcall?.Type == ShipcallType.Arrival)
|
||||
{
|
||||
this.textBlockETA.Text = this.ShipcallControlModel?.Shipcall?.Eta?.ToString("dd.MM. HH:mm");
|
||||
}
|
||||
if ((this.ShipcallControlModel?.Shipcall?.Type == 2) || (this.ShipcallControlModel?.Shipcall?.Type == 3))
|
||||
if ((this.ShipcallControlModel?.Shipcall?.Type == ShipcallType.Departure) || (this.ShipcallControlModel?.Shipcall?.Type == ShipcallType.Shifting))
|
||||
{
|
||||
this.labelETA.Text = "ETD";
|
||||
this.textBlockETA.Text = this.ShipcallControlModel?.Shipcall?.Etd?.ToString("dd.MM. HH:mm");
|
||||
@ -290,7 +290,7 @@ namespace BreCalClient
|
||||
// rename labels if this is not an incoming
|
||||
// must be here because there may not be a times record for each participant (yet)
|
||||
|
||||
if (this.ShipcallControlModel?.Shipcall?.Type != 1)
|
||||
if (this.ShipcallControlModel?.Shipcall?.Type != ShipcallType.Arrival)
|
||||
{
|
||||
this.labelETAETDAgent.Content = "ETD";
|
||||
this.labelETAETDMooring.Content = "ETD";
|
||||
@ -310,7 +310,7 @@ namespace BreCalClient
|
||||
this.labelAgencyETAETDValue.Content = agencyTimes.EtaBerth.HasValue ? agencyTimes.EtaBerth.Value.ToString("dd.MM.yyyy HH:mm") : "- / -";
|
||||
this.textBlockAgencyRemarks.Text = agencyTimes.Remarks;
|
||||
this.textBlockAgencyBerthRemarks.Text = agencyTimes.BerthInfo;
|
||||
if (this.ShipcallControlModel?.Shipcall?.Type != 1)
|
||||
if (this.ShipcallControlModel?.Shipcall?.Type != ShipcallType.Arrival)
|
||||
{
|
||||
this.labelAgencyETAETDValue.Content = agencyTimes.EtdBerth.HasValue ? agencyTimes.EtdBerth.Value.ToString("dd.MM.yyyy HH:mm") : "- / -";
|
||||
}
|
||||
@ -330,7 +330,7 @@ namespace BreCalClient
|
||||
|
||||
this.labelMooringETAETDValue.Content = mooringTimes.EtaBerth.HasValue ? mooringTimes.EtaBerth.Value.ToString("dd.MM.yyyy HH:mm") : "- / -";
|
||||
this.textBlockMooringRemarks.Text = mooringTimes.Remarks;
|
||||
if (this.ShipcallControlModel?.Shipcall?.Type != 1)
|
||||
if (this.ShipcallControlModel?.Shipcall?.Type != ShipcallType.Arrival)
|
||||
{
|
||||
this.labelMooringETAETDValue.Content = mooringTimes.EtdBerth.HasValue ? mooringTimes.EtdBerth.Value.ToString("dd.MM.yyyy HH:mm") : "- / -";
|
||||
}
|
||||
@ -346,7 +346,7 @@ namespace BreCalClient
|
||||
{
|
||||
this.labelPortAuthorityETAETDValue.Content = portAuthorityTimes.EtaBerth.HasValue ? portAuthorityTimes.EtaBerth.Value.ToString("dd.MM.yyyy HH:mm") : "- / -";
|
||||
this.textBlockPortAuthorityRemarks.Text = portAuthorityTimes.Remarks;
|
||||
if (this.ShipcallControlModel?.Shipcall?.Type != 1)
|
||||
if (this.ShipcallControlModel?.Shipcall?.Type != ShipcallType.Arrival)
|
||||
{
|
||||
this.labelPortAuthorityETAETDValue.Content = portAuthorityTimes.EtdBerth.HasValue ? portAuthorityTimes.EtdBerth.Value.ToString("dd.MM.yyyy HH:mm") : "- / -";
|
||||
}
|
||||
@ -362,7 +362,7 @@ namespace BreCalClient
|
||||
{
|
||||
this.labelPilotETAETDValue.Content = pilotTimes.EtaBerth.HasValue ? pilotTimes.EtaBerth.Value.ToString("dd.MM.yyyy HH:mm") : "- / -";
|
||||
this.textBlockPilotRemarks.Text = pilotTimes.Remarks;
|
||||
if (this.ShipcallControlModel?.Shipcall?.Type != 1)
|
||||
if (this.ShipcallControlModel?.Shipcall?.Type != ShipcallType.Arrival)
|
||||
{
|
||||
this.labelPilotETAETDValue.Content = pilotTimes.EtdBerth.HasValue ? pilotTimes.EtdBerth.Value.ToString("dd.MM.yyyy HH:mm") : "- / -";
|
||||
}
|
||||
@ -378,7 +378,7 @@ namespace BreCalClient
|
||||
{
|
||||
this.labelTugETAETDValue.Content = tugTimes.EtaBerth.HasValue ? tugTimes.EtaBerth.Value.ToString("dd.MM.yyyy HH:mm") : "- / -";
|
||||
this.textBlockTugRemarks.Text = tugTimes.Remarks;
|
||||
if (this.ShipcallControlModel?.Shipcall?.Type != 1)
|
||||
if (this.ShipcallControlModel?.Shipcall?.Type != ShipcallType.Arrival)
|
||||
{
|
||||
this.labelTugETAETDValue.Content = tugTimes.EtdBerth.HasValue ? tugTimes.EtdBerth.Value.ToString("dd.MM.yyyy HH:mm") : "- / -";
|
||||
}
|
||||
@ -395,7 +395,7 @@ namespace BreCalClient
|
||||
this.labelTerminalBerth.Content = this.ShipcallControlModel?.GetBerthText(terminalTimes);
|
||||
this.labelOperationsStart.Content = terminalTimes.OperationsStart.HasValue ? terminalTimes.OperationsStart.Value.ToString("dd.MM.yyyy HH:mm") : "- / -";
|
||||
this.textBlockTerminalRemarks.Text = terminalTimes.Remarks;
|
||||
if (this.ShipcallControlModel?.Shipcall?.Type != 1)
|
||||
if (this.ShipcallControlModel?.Shipcall?.Type != ShipcallType.Arrival)
|
||||
{
|
||||
this.labelOperationsStart.Content = terminalTimes.OperationsEnd.HasValue ? terminalTimes.OperationsEnd.Value.ToString("dd.MM.yyyy HH:mm") : "- / -";
|
||||
}
|
||||
|
||||
@ -48,7 +48,7 @@ namespace BreCalClient
|
||||
|
||||
public string? Berth { get; set; }
|
||||
|
||||
internal Dictionary<ParticipantType, ParticipantAssignment> AssignedParticipants { get; } = new();
|
||||
internal Dictionary<Extensions.ParticipantType, ParticipantAssignment> AssignedParticipants { get; } = new();
|
||||
|
||||
public List<Times> Times { get; set; } = new();
|
||||
|
||||
@ -56,7 +56,7 @@ namespace BreCalClient
|
||||
{
|
||||
get
|
||||
{
|
||||
Times? agencyTimes = this.GetTimesForParticipantType(ParticipantType.AGENCY);
|
||||
Times? agencyTimes = this.GetTimesForParticipantType(Extensions.ParticipantType.AGENCY);
|
||||
if((agencyTimes != null) && (agencyTimes.EtaBerth != null))
|
||||
return agencyTimes.EtaBerth;
|
||||
return Shipcall?.Eta;
|
||||
@ -96,8 +96,7 @@ namespace BreCalClient
|
||||
get
|
||||
{
|
||||
if (this.Shipcall == null) return "";
|
||||
Extensions.TypeEnum callType = (Extensions.TypeEnum) this.Shipcall.Type;
|
||||
return string.Format("{0} {1}", callType, this.Ship?.Name);
|
||||
return string.Format("{0} {1}", this.Shipcall.Type, this.Ship?.Name);
|
||||
}
|
||||
}
|
||||
|
||||
@ -112,12 +111,12 @@ namespace BreCalClient
|
||||
{
|
||||
foreach (ParticipantAssignment participantAssignment in Shipcall.Participants)
|
||||
{
|
||||
AssignedParticipants[(ParticipantType)participantAssignment.Type] = participantAssignment;
|
||||
AssignedParticipants[(Extensions.ParticipantType)participantAssignment.Type] = participantAssignment;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal Times? GetTimesForParticipantType(ParticipantType type)
|
||||
internal Times? GetTimesForParticipantType(Extensions.ParticipantType type)
|
||||
{
|
||||
|
||||
if (AssignedParticipants.ContainsKey(type)) {
|
||||
@ -127,14 +126,14 @@ namespace BreCalClient
|
||||
if ((times.ParticipantId == participantId) && (times.ParticipantType == (int) type))
|
||||
return times;
|
||||
}
|
||||
if(type == ParticipantType.AGENCY)
|
||||
if(type == Extensions.ParticipantType.AGENCY)
|
||||
{
|
||||
// if I am BSMD and no agency entry was found this means we are editing the agency entry
|
||||
if(App.Participant.Type == (int) ParticipantType.BSMD)
|
||||
if(App.Participant.Type == (int) Extensions.ParticipantType.BSMD)
|
||||
{
|
||||
foreach(Times times in this.Times)
|
||||
{
|
||||
if ((times.ParticipantId == App.Participant.Id) && (times.ParticipantType == (int) ParticipantType.AGENCY))
|
||||
if ((times.ParticipantId == App.Participant.Id) && (times.ParticipantType == (int) Extensions.ParticipantType.AGENCY))
|
||||
return times;
|
||||
}
|
||||
}
|
||||
@ -166,7 +165,7 @@ namespace BreCalClient
|
||||
berthText = berth?.Name;
|
||||
}
|
||||
|
||||
if ((berthText == null) && (times.ParticipantType != ParticipantType.TERMINAL))
|
||||
if ((berthText == null) && (times.ParticipantType != (int) Extensions.ParticipantType.TERMINAL))
|
||||
{
|
||||
if (this.Shipcall?.Type == ShipcallType.Arrival)
|
||||
{
|
||||
@ -191,7 +190,7 @@ namespace BreCalClient
|
||||
/// <param name="_api">API reference to PUT eidted times</param>
|
||||
internal async void UpdateTimesAssignments(DefaultApi _api)
|
||||
{
|
||||
foreach (ParticipantType participantType in this.AssignedParticipants.Keys)
|
||||
foreach (Extensions.ParticipantType participantType in this.AssignedParticipants.Keys)
|
||||
{
|
||||
Times? times = this.GetTimesForParticipantType(participantType);
|
||||
if(times == null) continue;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user