diff --git a/misc/BreCalApi.cs b/misc/BreCalApi.cs index 997cc50..e1c100f 100644 --- a/misc/BreCalApi.cs +++ b/misc/BreCalApi.cs @@ -1,7 +1,7 @@ //---------------------- // -// 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 // //---------------------- @@ -7441,10 +7441,11 @@ namespace BreCalClient.misc.Model /// canceled. /// evaluation. /// evaluationMessage. + /// Physical reference point for all times given in shipcall and depending times entries. /// participants. /// Readonly field set by the database. /// Readonly field set by the database. - 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 participants = default(List), 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 participants = default(List), DateTime created = default(DateTime), DateTime? modified = default(DateTime?)) { this.Id = id; this.ShipId = shipId; @@ -7471,6 +7472,7 @@ namespace BreCalClient.misc.Model this.Canceled = canceled; this.Evaluation = evaluation; this.EvaluationMessage = evaluationMessage; + this.TimeRefPoint = timeRefPoint; this.Participants = participants; this.Created = created; this.Modified = modified; @@ -7592,6 +7594,12 @@ namespace BreCalClient.misc.Model [DataMember(Name = "evaluation_message", EmitDefaultValue = true)] public string EvaluationMessage { get; set; } /// + /// Physical reference point for all times given in shipcall and depending times entries + /// + /// Physical reference point for all times given in shipcall and depending times entries + [DataMember(Name = "time_ref_point", EmitDefaultValue = true)] + public int? TimeRefPoint { get; set; } + /// /// Gets or Sets Participants /// [DataMember(Name = "participants", EmitDefaultValue = true)] @@ -7641,6 +7649,7 @@ namespace BreCalClient.misc.Model sb.Append(" Canceled: ").Append(Canceled).Append("\n"); sb.Append(" Evaluation: ").Append(Evaluation).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(" Created: ").Append(Created).Append("\n"); sb.Append(" Modified: ").Append(Modified).Append("\n"); @@ -7760,9 +7769,11 @@ namespace BreCalClient.misc.Model /// Additional info text for berth. /// true if ship is rotated, false otherwise. /// participantType. + /// can be set by mooring if actual times are different from planned. + /// End of the interval for the times entry. /// Readonly field set by the database. /// Readonly field set by the database. - 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.ParticipantId = participantId; @@ -7782,6 +7793,8 @@ namespace BreCalClient.misc.Model this.BerthInfo = berthInfo; this.PierSide = pierSide; this.ParticipantType = participantType; + this.AtaAtd = ataAtd; + this.IntervalEnd = intervalEnd; this.Created = created; this.Modified = modified; } @@ -7891,6 +7904,18 @@ namespace BreCalClient.misc.Model [DataMember(Name = "participant_type", EmitDefaultValue = true)] public int ParticipantType { get; set; } /// + /// can be set by mooring if actual times are different from planned + /// + /// can be set by mooring if actual times are different from planned + [DataMember(Name = "ata_atd", EmitDefaultValue = true)] + public DateTime? AtaAtd { get; set; } + /// + /// End of the interval for the times entry + /// + /// End of the interval for the times entry + [DataMember(Name = "interval_end", EmitDefaultValue = true)] + public DateTime? IntervalEnd { get; set; } + /// /// Readonly field set by the database /// /// Readonly field set by the database @@ -7928,6 +7953,8 @@ namespace BreCalClient.misc.Model sb.Append(" BerthInfo: ").Append(BerthInfo).Append("\n"); sb.Append(" PierSide: ").Append(PierSide).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(" Modified: ").Append(Modified).Append("\n"); sb.Append("}\n"); diff --git a/src/BreCalClient/EditShipcallControl.xaml.cs b/src/BreCalClient/EditShipcallControl.xaml.cs index 78cbd97..7d60717 100644 --- a/src/BreCalClient/EditShipcallControl.xaml.cs +++ b/src/BreCalClient/EditShipcallControl.xaml.cs @@ -38,7 +38,7 @@ namespace BreCalClient set { this.buttonEditShips.Visibility = value ? Visibility.Visible : Visibility.Hidden; } } - public ShipApi ShipApi { get; set; } + public ShipApi? ShipApi { get; set; } #endregion diff --git a/src/BreCalClient/MainWindow.xaml.cs b/src/BreCalClient/MainWindow.xaml.cs index 28fbdc3..ffc3872 100644 --- a/src/BreCalClient/MainWindow.xaml.cs +++ b/src/BreCalClient/MainWindow.xaml.cs @@ -108,7 +108,7 @@ namespace BreCalClient }, onRetry: (resp, timespan, context) => { - this.RefreshToken(null); + this.RefreshToken(); Trace.WriteLine("token refreshed"); }); RetryConfiguration.AsyncRetryPolicy = retryPolicy; @@ -191,7 +191,7 @@ namespace BreCalClient } } - private bool RefreshToken(object? state) + private bool RefreshToken() { bool result = false; try @@ -417,7 +417,7 @@ namespace BreCalClient if (ex.Message.Contains("access", StringComparison.OrdinalIgnoreCase)) { - this.RefreshToken(null); + this.RefreshToken(); } } @@ -614,7 +614,7 @@ namespace BreCalClient Times? t = x.GetTimesForParticipantType(ParticipantType.AGENCY); switch (x.Shipcall?.Type) { - case (int)Extensions.TypeEnum.Incoming: + case ShipcallType.Arrival: { if ((t != null) && t.EtaBerth.HasValue) return t.EtaBerth.Value < sfm.EtaFrom; return x.Shipcall?.Eta < sfm.EtaFrom; @@ -636,7 +636,7 @@ namespace BreCalClient DateTime refValue = sfm.EtaTo.Value.AddMinutes(1439); // 23:59 switch (x.Shipcall?.Type) { - case (int)Extensions.TypeEnum.Incoming: + case ShipcallType.Arrival: { if ((t != null) && t.EtaBerth.HasValue) return t.EtaBerth.Value > refValue; return x.Shipcall?.Eta > refValue;