re-created API and fixed some small errors

This commit is contained in:
Daniel Schick 2024-03-28 08:04:33 +01:00
parent a5b16154c6
commit 166d886698
3 changed files with 36 additions and 9 deletions

View File

@ -1,7 +1,7 @@
//---------------------- //----------------------
// <auto-generated> // <auto-generated>
// Generated REST API Client Code Generator v1.9.8.0 on 27.03.2024 08:35:31 // Generated REST API Client Code Generator v1.9.8.0 on 28.03.2024 07:39:45
// Using the tool OpenAPI Generator v7.4.0 // Using the tool OpenAPI Generator v7.4.0
// </auto-generated> // </auto-generated>
//---------------------- //----------------------
@ -7441,10 +7441,11 @@ namespace BreCalClient.misc.Model
/// <param name="canceled">canceled.</param> /// <param name="canceled">canceled.</param>
/// <param name="evaluation">evaluation.</param> /// <param name="evaluation">evaluation.</param>
/// <param name="evaluationMessage">evaluationMessage.</param> /// <param name="evaluationMessage">evaluationMessage.</param>
/// <param name="timeRefPoint">Physical reference point for all times given in shipcall and depending times entries.</param>
/// <param name="participants">participants.</param> /// <param name="participants">participants.</param>
/// <param name="created">Readonly field set by the database.</param> /// <param name="created">Readonly field set by the database.</param>
/// <param name="modified">Readonly field set by the database.</param> /// <param name="modified">Readonly field set by the database.</param>
public Shipcall(int id = default(int), int shipId = default(int), ShipcallType type = default(ShipcallType), DateTime? eta = default(DateTime?), string voyage = default(string), DateTime? etd = default(DateTime?), int? arrivalBerthId = default(int?), int? departureBerthId = default(int?), bool? tugRequired = default(bool?), bool? pilotRequired = default(bool?), int? flags = default(int?), bool? pierSide = default(bool?), bool? bunkering = default(bool?), bool? replenishingTerminal = default(bool?), bool? replenishingLock = default(bool?), double? draft = default(double?), DateTime? tidalWindowFrom = default(DateTime?), DateTime? tidalWindowTo = default(DateTime?), bool? rainSensitiveCargo = default(bool?), int? recommendedTugs = default(int?), bool? anchored = default(bool?), bool? mooredLock = default(bool?), bool? canceled = default(bool?), EvaluationType? evaluation = default(EvaluationType?), string evaluationMessage = default(string), List<ParticipantAssignment> participants = default(List<ParticipantAssignment>), DateTime created = default(DateTime), DateTime? modified = default(DateTime?)) public Shipcall(int id = default(int), int shipId = default(int), ShipcallType type = default(ShipcallType), DateTime? eta = default(DateTime?), string voyage = default(string), DateTime? etd = default(DateTime?), int? arrivalBerthId = default(int?), int? departureBerthId = default(int?), bool? tugRequired = default(bool?), bool? pilotRequired = default(bool?), int? flags = default(int?), bool? pierSide = default(bool?), bool? bunkering = default(bool?), bool? replenishingTerminal = default(bool?), bool? replenishingLock = default(bool?), double? draft = default(double?), DateTime? tidalWindowFrom = default(DateTime?), DateTime? tidalWindowTo = default(DateTime?), bool? rainSensitiveCargo = default(bool?), int? recommendedTugs = default(int?), bool? anchored = default(bool?), bool? mooredLock = default(bool?), bool? canceled = default(bool?), EvaluationType? evaluation = default(EvaluationType?), string evaluationMessage = default(string), int? timeRefPoint = default(int?), List<ParticipantAssignment> participants = default(List<ParticipantAssignment>), DateTime created = default(DateTime), DateTime? modified = default(DateTime?))
{ {
this.Id = id; this.Id = id;
this.ShipId = shipId; this.ShipId = shipId;
@ -7471,6 +7472,7 @@ namespace BreCalClient.misc.Model
this.Canceled = canceled; this.Canceled = canceled;
this.Evaluation = evaluation; this.Evaluation = evaluation;
this.EvaluationMessage = evaluationMessage; this.EvaluationMessage = evaluationMessage;
this.TimeRefPoint = timeRefPoint;
this.Participants = participants; this.Participants = participants;
this.Created = created; this.Created = created;
this.Modified = modified; this.Modified = modified;
@ -7592,6 +7594,12 @@ namespace BreCalClient.misc.Model
[DataMember(Name = "evaluation_message", EmitDefaultValue = true)] [DataMember(Name = "evaluation_message", EmitDefaultValue = true)]
public string EvaluationMessage { get; set; } public string EvaluationMessage { get; set; }
/// <summary> /// <summary>
/// Physical reference point for all times given in shipcall and depending times entries
/// </summary>
/// <value>Physical reference point for all times given in shipcall and depending times entries</value>
[DataMember(Name = "time_ref_point", EmitDefaultValue = true)]
public int? TimeRefPoint { get; set; }
/// <summary>
/// Gets or Sets Participants /// Gets or Sets Participants
/// </summary> /// </summary>
[DataMember(Name = "participants", EmitDefaultValue = true)] [DataMember(Name = "participants", EmitDefaultValue = true)]
@ -7641,6 +7649,7 @@ namespace BreCalClient.misc.Model
sb.Append(" Canceled: ").Append(Canceled).Append("\n"); sb.Append(" Canceled: ").Append(Canceled).Append("\n");
sb.Append(" Evaluation: ").Append(Evaluation).Append("\n"); sb.Append(" Evaluation: ").Append(Evaluation).Append("\n");
sb.Append(" EvaluationMessage: ").Append(EvaluationMessage).Append("\n"); sb.Append(" EvaluationMessage: ").Append(EvaluationMessage).Append("\n");
sb.Append(" TimeRefPoint: ").Append(TimeRefPoint).Append("\n");
sb.Append(" Participants: ").Append(Participants).Append("\n"); sb.Append(" Participants: ").Append(Participants).Append("\n");
sb.Append(" Created: ").Append(Created).Append("\n"); sb.Append(" Created: ").Append(Created).Append("\n");
sb.Append(" Modified: ").Append(Modified).Append("\n"); sb.Append(" Modified: ").Append(Modified).Append("\n");
@ -7760,9 +7769,11 @@ namespace BreCalClient.misc.Model
/// <param name="berthInfo">Additional info text for berth.</param> /// <param name="berthInfo">Additional info text for berth.</param>
/// <param name="pierSide">true if ship is rotated, false otherwise.</param> /// <param name="pierSide">true if ship is rotated, false otherwise.</param>
/// <param name="participantType">participantType.</param> /// <param name="participantType">participantType.</param>
/// <param name="ataAtd">can be set by mooring if actual times are different from planned.</param>
/// <param name="intervalEnd">End of the interval for the times entry.</param>
/// <param name="created">Readonly field set by the database.</param> /// <param name="created">Readonly field set by the database.</param>
/// <param name="modified">Readonly field set by the database.</param> /// <param name="modified">Readonly field set by the database.</param>
public Times(int id = default(int), DateTime? etaBerth = default(DateTime?), bool? etaBerthFixed = default(bool?), DateTime? etdBerth = default(DateTime?), bool? etdBerthFixed = default(bool?), DateTime? lockTime = default(DateTime?), bool? lockTimeFixed = default(bool?), DateTime? zoneEntry = default(DateTime?), bool? zoneEntryFixed = default(bool?), DateTime? operationsStart = default(DateTime?), DateTime? operationsEnd = default(DateTime?), string remarks = default(string), int shipcallId = default(int), int participantId = default(int), int? berthId = default(int?), string berthInfo = default(string), bool? pierSide = default(bool?), int participantType = default(int), DateTime created = default(DateTime), DateTime? modified = default(DateTime?)) public Times(int id = default(int), DateTime? etaBerth = default(DateTime?), bool? etaBerthFixed = default(bool?), DateTime? etdBerth = default(DateTime?), bool? etdBerthFixed = default(bool?), DateTime? lockTime = default(DateTime?), bool? lockTimeFixed = default(bool?), DateTime? zoneEntry = default(DateTime?), bool? zoneEntryFixed = default(bool?), DateTime? operationsStart = default(DateTime?), DateTime? operationsEnd = default(DateTime?), string remarks = default(string), int shipcallId = default(int), int participantId = default(int), int? berthId = default(int?), string berthInfo = default(string), bool? pierSide = default(bool?), int participantType = default(int), DateTime? ataAtd = default(DateTime?), DateTime? intervalEnd = default(DateTime?), DateTime created = default(DateTime), DateTime? modified = default(DateTime?))
{ {
this.ShipcallId = shipcallId; this.ShipcallId = shipcallId;
this.ParticipantId = participantId; this.ParticipantId = participantId;
@ -7782,6 +7793,8 @@ namespace BreCalClient.misc.Model
this.BerthInfo = berthInfo; this.BerthInfo = berthInfo;
this.PierSide = pierSide; this.PierSide = pierSide;
this.ParticipantType = participantType; this.ParticipantType = participantType;
this.AtaAtd = ataAtd;
this.IntervalEnd = intervalEnd;
this.Created = created; this.Created = created;
this.Modified = modified; this.Modified = modified;
} }
@ -7891,6 +7904,18 @@ namespace BreCalClient.misc.Model
[DataMember(Name = "participant_type", EmitDefaultValue = true)] [DataMember(Name = "participant_type", EmitDefaultValue = true)]
public int ParticipantType { get; set; } public int ParticipantType { get; set; }
/// <summary> /// <summary>
/// can be set by mooring if actual times are different from planned
/// </summary>
/// <value>can be set by mooring if actual times are different from planned</value>
[DataMember(Name = "ata_atd", EmitDefaultValue = true)]
public DateTime? AtaAtd { get; set; }
/// <summary>
/// End of the interval for the times entry
/// </summary>
/// <value>End of the interval for the times entry</value>
[DataMember(Name = "interval_end", EmitDefaultValue = true)]
public DateTime? IntervalEnd { get; set; }
/// <summary>
/// Readonly field set by the database /// Readonly field set by the database
/// </summary> /// </summary>
/// <value>Readonly field set by the database</value> /// <value>Readonly field set by the database</value>
@ -7928,6 +7953,8 @@ namespace BreCalClient.misc.Model
sb.Append(" BerthInfo: ").Append(BerthInfo).Append("\n"); sb.Append(" BerthInfo: ").Append(BerthInfo).Append("\n");
sb.Append(" PierSide: ").Append(PierSide).Append("\n"); sb.Append(" PierSide: ").Append(PierSide).Append("\n");
sb.Append(" ParticipantType: ").Append(ParticipantType).Append("\n"); sb.Append(" ParticipantType: ").Append(ParticipantType).Append("\n");
sb.Append(" AtaAtd: ").Append(AtaAtd).Append("\n");
sb.Append(" IntervalEnd: ").Append(IntervalEnd).Append("\n");
sb.Append(" Created: ").Append(Created).Append("\n"); sb.Append(" Created: ").Append(Created).Append("\n");
sb.Append(" Modified: ").Append(Modified).Append("\n"); sb.Append(" Modified: ").Append(Modified).Append("\n");
sb.Append("}\n"); sb.Append("}\n");

View File

@ -38,7 +38,7 @@ namespace BreCalClient
set { this.buttonEditShips.Visibility = value ? Visibility.Visible : Visibility.Hidden; } set { this.buttonEditShips.Visibility = value ? Visibility.Visible : Visibility.Hidden; }
} }
public ShipApi ShipApi { get; set; } public ShipApi? ShipApi { get; set; }
#endregion #endregion

View File

@ -108,7 +108,7 @@ namespace BreCalClient
}, },
onRetry: (resp, timespan, context) => onRetry: (resp, timespan, context) =>
{ {
this.RefreshToken(null); this.RefreshToken();
Trace.WriteLine("token refreshed"); Trace.WriteLine("token refreshed");
}); });
RetryConfiguration.AsyncRetryPolicy = retryPolicy; RetryConfiguration.AsyncRetryPolicy = retryPolicy;
@ -191,7 +191,7 @@ namespace BreCalClient
} }
} }
private bool RefreshToken(object? state) private bool RefreshToken()
{ {
bool result = false; bool result = false;
try try
@ -417,7 +417,7 @@ namespace BreCalClient
if (ex.Message.Contains("access", StringComparison.OrdinalIgnoreCase)) if (ex.Message.Contains("access", StringComparison.OrdinalIgnoreCase))
{ {
this.RefreshToken(null); this.RefreshToken();
} }
} }
@ -614,7 +614,7 @@ namespace BreCalClient
Times? t = x.GetTimesForParticipantType(ParticipantType.AGENCY); Times? t = x.GetTimesForParticipantType(ParticipantType.AGENCY);
switch (x.Shipcall?.Type) switch (x.Shipcall?.Type)
{ {
case (int)Extensions.TypeEnum.Incoming: case ShipcallType.Arrival:
{ {
if ((t != null) && t.EtaBerth.HasValue) return t.EtaBerth.Value < sfm.EtaFrom; if ((t != null) && t.EtaBerth.HasValue) return t.EtaBerth.Value < sfm.EtaFrom;
return x.Shipcall?.Eta < sfm.EtaFrom; return x.Shipcall?.Eta < sfm.EtaFrom;
@ -636,7 +636,7 @@ namespace BreCalClient
DateTime refValue = sfm.EtaTo.Value.AddMinutes(1439); // 23:59 DateTime refValue = sfm.EtaTo.Value.AddMinutes(1439); // 23:59
switch (x.Shipcall?.Type) switch (x.Shipcall?.Type)
{ {
case (int)Extensions.TypeEnum.Incoming: case ShipcallType.Arrival:
{ {
if ((t != null) && t.EtaBerth.HasValue) return t.EtaBerth.Value > refValue; if ((t != null) && t.EtaBerth.HasValue) return t.EtaBerth.Value > refValue;
return x.Shipcall?.Eta > refValue; return x.Shipcall?.Eta > refValue;