From bd81f01d76dbfeced8ba713f6470618faa4cf08f Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Mon, 18 Dec 2023 18:10:58 +0100 Subject: [PATCH] fixed a lot of small problems in yaml file, returned to OpenApi 3.0 format --- misc/BreCalApi.cs | 819 ++++++++++++----------- misc/BreCalApi.yaml | 84 +-- src/BreCalClient/Extensions.cs | 30 +- src/BreCalClient/ShipcallControl.xaml.cs | 24 +- src/BreCalClient/ShipcallControlModel.cs | 21 +- 5 files changed, 488 insertions(+), 490 deletions(-) diff --git a/misc/BreCalApi.cs b/misc/BreCalApi.cs index d153dad..a99de65 100644 --- a/misc/BreCalApi.cs +++ b/misc/BreCalApi.cs @@ -1,7 +1,7 @@ //---------------------- // -// Generated REST API Client Code Generator v1.9.1.0 on 15.12.2023 15:53:58 +// Generated REST API Client Code Generator v1.9.1.0 on 18.12.2023 18:02:05 // Using the tool OpenAPI Generator v7.1.0 // //---------------------- @@ -4087,7 +4087,7 @@ namespace BreCalClient.misc.Client /// /// Gets or sets the base path for API access. /// - public virtual string BasePath + public virtual string BasePath { get { return _basePath; } set { _basePath = value; } @@ -5383,7 +5383,7 @@ namespace BreCalClient.misc.Model /// created. /// modified. /// deleted (default to false). - public Berth(int id = default(int), string name = default(string), int ownerId = default(int), int authorityId = default(int), bool varLock = default(bool), DateTime created = default(DateTime), DateTime modified = default(DateTime), bool deleted = false) + public Berth(int id = default(int), string name = default(string), int? ownerId = default(int?), int? authorityId = default(int?), bool? varLock = default(bool?), DateTime created = default(DateTime), DateTime? modified = default(DateTime?), bool deleted = false) { this.Id = id; this.Name = name; @@ -5408,17 +5408,17 @@ namespace BreCalClient.misc.Model /// Gets or Sets OwnerId /// [DataMember(Name = "owner_id", EmitDefaultValue = true)] - public int OwnerId { get; set; } + public int? OwnerId { get; set; } /// /// Gets or Sets AuthorityId /// [DataMember(Name = "authority_id", EmitDefaultValue = true)] - public int AuthorityId { get; set; } + public int? AuthorityId { get; set; } /// /// Gets or Sets VarLock /// [DataMember(Name = "lock", EmitDefaultValue = true)] - public bool VarLock { get; set; } + public bool? VarLock { get; set; } /// /// Gets or Sets Created /// @@ -5428,7 +5428,7 @@ namespace BreCalClient.misc.Model /// Gets or Sets Modified /// [DataMember(Name = "modified", EmitDefaultValue = true)] - public DateTime Modified { get; set; } + public DateTime? Modified { get; set; } /// /// Gets or Sets Deleted /// @@ -5481,38 +5481,41 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Id == input.Id || this.Id.Equals(input.Id) - ) && + ) && ( this.Name == input.Name || (this.Name != null && this.Name.Equals(input.Name)) - ) && + ) && ( this.OwnerId == input.OwnerId || - this.OwnerId.Equals(input.OwnerId) - ) && + (this.OwnerId != null && + this.OwnerId.Equals(input.OwnerId)) + ) && ( this.AuthorityId == input.AuthorityId || - this.AuthorityId.Equals(input.AuthorityId) - ) && + (this.AuthorityId != null && + this.AuthorityId.Equals(input.AuthorityId)) + ) && ( this.VarLock == input.VarLock || - this.VarLock.Equals(input.VarLock) - ) && + (this.VarLock != null && + this.VarLock.Equals(input.VarLock)) + ) && ( this.Created == input.Created || (this.Created != null && this.Created.Equals(input.Created)) - ) && + ) && ( this.Modified == input.Modified || (this.Modified != null && this.Modified.Equals(input.Modified)) - ) && + ) && ( this.Deleted == input.Deleted || this.Deleted.Equals(input.Deleted) @@ -5532,9 +5535,18 @@ namespace BreCalClient.misc.Model { hashCode = (hashCode * 59) + this.Name.GetHashCode(); } - hashCode = (hashCode * 59) + this.OwnerId.GetHashCode(); - hashCode = (hashCode * 59) + this.AuthorityId.GetHashCode(); - hashCode = (hashCode * 59) + this.VarLock.GetHashCode(); + if (this.OwnerId != null) + { + hashCode = (hashCode * 59) + this.OwnerId.GetHashCode(); + } + if (this.AuthorityId != null) + { + hashCode = (hashCode * 59) + this.AuthorityId.GetHashCode(); + } + if (this.VarLock != null) + { + hashCode = (hashCode * 59) + this.VarLock.GetHashCode(); + } if (this.Created != null) { hashCode = (hashCode * 59) + this.Created.GetHashCode(); @@ -5657,12 +5669,12 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Username == input.Username || (this.Username != null && this.Username.Equals(input.Username)) - ) && + ) && ( this.Password == input.Password || (this.Password != null && @@ -5782,7 +5794,7 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Message == input.Message || (this.Message != null && @@ -5887,7 +5899,7 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.VarId == input.VarId || this.VarId.Equals(input.VarId) @@ -6052,44 +6064,44 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Id == input.Id || this.Id.Equals(input.Id) - ) && + ) && ( this.ParticipantId == input.ParticipantId || this.ParticipantId.Equals(input.ParticipantId) - ) && + ) && ( this.FirstName == input.FirstName || (this.FirstName != null && this.FirstName.Equals(input.FirstName)) - ) && + ) && ( this.LastName == input.LastName || (this.LastName != null && this.LastName.Equals(input.LastName)) - ) && + ) && ( this.UserName == input.UserName || (this.UserName != null && this.UserName.Equals(input.UserName)) - ) && + ) && ( this.UserPhone == input.UserPhone || (this.UserPhone != null && this.UserPhone.Equals(input.UserPhone)) - ) && + ) && ( this.UserEmail == input.UserEmail || (this.UserEmail != null && this.UserEmail.Equals(input.UserEmail)) - ) && + ) && ( this.Exp == input.Exp || this.Exp.Equals(input.Exp) - ) && + ) && ( this.Token == input.Token || (this.Token != null && @@ -6178,9 +6190,9 @@ namespace BreCalClient.misc.Model /// notificationType. /// timestamp. /// acknowledged. - /// created. - /// modified. - public Notification(int id = default(int), int timesId = default(int), int participantId = default(int), NotificationType? notificationType = default(NotificationType?), DateTime timestamp = default(DateTime), bool acknowledged = default(bool), DateTime created = default(DateTime), DateTime modified = default(DateTime)) + /// Readonly field set by the database. + /// Readonly field set by the database. + public Notification(int id = default(int), int timesId = default(int), int participantId = default(int), NotificationType? notificationType = default(NotificationType?), DateTime timestamp = default(DateTime), bool acknowledged = default(bool), DateTime created = default(DateTime), DateTime? modified = default(DateTime?)) { this.Id = id; this.TimesId = timesId; @@ -6217,15 +6229,17 @@ namespace BreCalClient.misc.Model [DataMember(Name = "acknowledged", EmitDefaultValue = true)] public bool Acknowledged { get; set; } /// - /// Gets or Sets Created + /// Readonly field set by the database /// + /// Readonly field set by the database [DataMember(Name = "created", EmitDefaultValue = true)] public DateTime Created { get; set; } /// - /// Gets or Sets Modified + /// Readonly field set by the database /// + /// Readonly field set by the database [DataMember(Name = "modified", EmitDefaultValue = true)] - public DateTime Modified { get; set; } + public DateTime? Modified { get; set; } /// /// Returns the string presentation of the object /// @@ -6273,37 +6287,37 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Id == input.Id || this.Id.Equals(input.Id) - ) && + ) && ( this.TimesId == input.TimesId || this.TimesId.Equals(input.TimesId) - ) && + ) && ( this.ParticipantId == input.ParticipantId || this.ParticipantId.Equals(input.ParticipantId) - ) && + ) && ( this.NotificationType == input.NotificationType || this.NotificationType.Equals(input.NotificationType) - ) && + ) && ( this.Timestamp == input.Timestamp || (this.Timestamp != null && this.Timestamp.Equals(input.Timestamp)) - ) && + ) && ( this.Acknowledged == input.Acknowledged || this.Acknowledged.Equals(input.Acknowledged) - ) && + ) && ( this.Created == input.Created || (this.Created != null && this.Created.Equals(input.Created)) - ) && + ) && ( this.Modified == input.Modified || (this.Modified != null && @@ -6411,12 +6425,12 @@ namespace BreCalClient.misc.Model /// street. /// postalCode. /// city. - /// a logical combinat. + /// 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. - /// created. - /// modified. + /// Readonly field set by the database. + /// Readonly field set by the database. /// deleted (default to false). - public Participant(int id = default(int), string name = default(string), string street = default(string), string postalCode = default(string), string city = default(string), int type = default(int), int flags = default(int), DateTime created = default(DateTime), DateTime modified = default(DateTime), bool deleted = false) + public Participant(int id = default(int), string name = default(string), string street = default(string), string postalCode = default(string), string city = default(string), int type = default(int), int? flags = default(int?), DateTime created = default(DateTime), DateTime? modified = default(DateTime?), bool deleted = false) { this.Id = id; this.Name = name; @@ -6455,26 +6469,28 @@ namespace BreCalClient.misc.Model [DataMember(Name = "city", EmitDefaultValue = true)] public string City { get; set; } /// - /// a logical combinat + /// 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= /// - /// a logical combinat + /// 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= [DataMember(Name = "type", EmitDefaultValue = true)] public int Type { get; set; } /// /// Gets or Sets Flags /// [DataMember(Name = "flags", EmitDefaultValue = true)] - public int Flags { get; set; } + public int? Flags { get; set; } /// - /// Gets or Sets Created + /// Readonly field set by the database /// + /// Readonly field set by the database [DataMember(Name = "created", EmitDefaultValue = true)] public DateTime Created { get; set; } /// - /// Gets or Sets Modified + /// Readonly field set by the database /// + /// Readonly field set by the database [DataMember(Name = "modified", EmitDefaultValue = true)] - public DateTime Modified { get; set; } + public DateTime? Modified { get; set; } /// /// Gets or Sets Deleted /// @@ -6529,49 +6545,50 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Id == input.Id || this.Id.Equals(input.Id) - ) && + ) && ( this.Name == input.Name || (this.Name != null && this.Name.Equals(input.Name)) - ) && + ) && ( this.Street == input.Street || (this.Street != null && this.Street.Equals(input.Street)) - ) && + ) && ( this.PostalCode == input.PostalCode || (this.PostalCode != null && this.PostalCode.Equals(input.PostalCode)) - ) && + ) && ( this.City == input.City || (this.City != null && this.City.Equals(input.City)) - ) && + ) && ( this.Type == input.Type || this.Type.Equals(input.Type) - ) && + ) && ( this.Flags == input.Flags || - this.Flags.Equals(input.Flags) - ) && + (this.Flags != null && + this.Flags.Equals(input.Flags)) + ) && ( this.Created == input.Created || (this.Created != null && this.Created.Equals(input.Created)) - ) && + ) && ( this.Modified == input.Modified || (this.Modified != null && this.Modified.Equals(input.Modified)) - ) && + ) && ( this.Deleted == input.Deleted || this.Deleted.Equals(input.Deleted) @@ -6604,7 +6621,10 @@ namespace BreCalClient.misc.Model hashCode = (hashCode * 59) + this.City.GetHashCode(); } hashCode = (hashCode * 59) + this.Type.GetHashCode(); - hashCode = (hashCode * 59) + this.Flags.GetHashCode(); + if (this.Flags != null) + { + hashCode = (hashCode * 59) + this.Flags.GetHashCode(); + } if (this.Created != null) { hashCode = (hashCode * 59) + this.Created.GetHashCode(); @@ -6732,11 +6752,11 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.ParticipantId == input.ParticipantId || this.ParticipantId.Equals(input.ParticipantId) - ) && + ) && ( this.Type == input.Type || this.Type.Equals(input.Type) @@ -6768,142 +6788,6 @@ namespace BreCalClient.misc.Model } } -/* - * Bremen calling API - * - * Administer DEBRE ship calls, times and notifications - * - * The version of the OpenAPI document: 1.1.0 - * Contact: info@textbausteine.net - * Generated by: https://github.com/openapitools/openapi-generator.git - */ -namespace BreCalClient.misc.Model -{ - /// - /// Defines ParticipantType - /// - public enum ParticipantType - { - /// - /// Enum NUMBER_1 for value: 1 - /// - NUMBER_1 = 1, - /// - /// Enum NUMBER_2 for value: 2 - /// - NUMBER_2 = 2, - /// - /// Enum NUMBER_4 for value: 4 - /// - NUMBER_4 = 4, - /// - /// Enum NUMBER_8 for value: 8 - /// - NUMBER_8 = 8, - /// - /// Enum NUMBER_16 for value: 16 - /// - NUMBER_16 = 16, - /// - /// Enum NUMBER_32 for value: 32 - /// - NUMBER_32 = 32, - /// - /// Enum NUMBER_64 for value: 64 - /// - NUMBER_64 = 64 - } -} - -/* - * Bremen calling API - * - * Administer DEBRE ship calls, times and notifications - * - * The version of the OpenAPI document: 1.1.0 - * Contact: info@textbausteine.net - * Generated by: https://github.com/openapitools/openapi-generator.git - */ -namespace BreCalClient.misc.Model -{ - /// - /// Enumeration that can take particular values - /// - [DataContract(Name = "ParticipantType2")] - public partial class ParticipantType2 : IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - public ParticipantType2() - { - } - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - StringBuilder sb = new StringBuilder(); - sb.Append("class ParticipantType2 {\n"); - sb.Append("}\n"); - return sb.ToString(); - } - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as ParticipantType2); - } - /// - /// Returns true if ParticipantType2 instances are equal - /// - /// Instance of ParticipantType2 to be compared - /// Boolean - public bool Equals(ParticipantType2 input) - { - if (input == null) - { - return false; - } - return false; - } - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - return hashCode; - } - } - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - yield break; - } - } -} - /* * Bremen calling API * @@ -6937,7 +6821,7 @@ namespace BreCalClient.misc.Model /// created. /// modified. /// deleted (default to false). - public Ship(int id = default(int), string name = default(string), int imo = default(int), string callsign = default(string), int participantId = default(int), float length = default(float), float width = default(float), bool isTug = false, int bollardPull = default(int), int eni = default(int), DateTime created = default(DateTime), DateTime modified = default(DateTime), bool deleted = false) + public Ship(int id = default(int), string name = default(string), int? imo = default(int?), string callsign = default(string), int? participantId = default(int?), float? length = default(float?), float? width = default(float?), bool isTug = false, int? bollardPull = default(int?), int? eni = default(int?), DateTime created = default(DateTime), DateTime? modified = default(DateTime?), bool deleted = false) { this.Id = id; this.Name = name; @@ -6967,7 +6851,7 @@ namespace BreCalClient.misc.Model /// Gets or Sets Imo /// [DataMember(Name = "imo", EmitDefaultValue = true)] - public int Imo { get; set; } + public int? Imo { get; set; } /// /// Gets or Sets Callsign /// @@ -6977,17 +6861,17 @@ namespace BreCalClient.misc.Model /// Gets or Sets ParticipantId /// [DataMember(Name = "participant_id", EmitDefaultValue = true)] - public int ParticipantId { get; set; } + public int? ParticipantId { get; set; } /// /// Gets or Sets Length /// [DataMember(Name = "length", EmitDefaultValue = true)] - public float Length { get; set; } + public float? Length { get; set; } /// /// Gets or Sets Width /// [DataMember(Name = "width", EmitDefaultValue = true)] - public float Width { get; set; } + public float? Width { get; set; } /// /// Gets or Sets IsTug /// @@ -6997,12 +6881,12 @@ namespace BreCalClient.misc.Model /// Gets or Sets BollardPull /// [DataMember(Name = "bollard_pull", EmitDefaultValue = true)] - public int BollardPull { get; set; } + public int? BollardPull { get; set; } /// /// Gets or Sets Eni /// [DataMember(Name = "eni", EmitDefaultValue = true)] - public int Eni { get; set; } + public int? Eni { get; set; } /// /// Gets or Sets Created /// @@ -7012,7 +6896,7 @@ namespace BreCalClient.misc.Model /// Gets or Sets Modified /// [DataMember(Name = "modified", EmitDefaultValue = true)] - public DateTime Modified { get; set; } + public DateTime? Modified { get; set; } /// /// Gets or Sets Deleted /// @@ -7070,59 +6954,65 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Id == input.Id || this.Id.Equals(input.Id) - ) && + ) && ( this.Name == input.Name || (this.Name != null && this.Name.Equals(input.Name)) - ) && + ) && ( this.Imo == input.Imo || - this.Imo.Equals(input.Imo) - ) && + (this.Imo != null && + this.Imo.Equals(input.Imo)) + ) && ( this.Callsign == input.Callsign || (this.Callsign != null && this.Callsign.Equals(input.Callsign)) - ) && + ) && ( this.ParticipantId == input.ParticipantId || - this.ParticipantId.Equals(input.ParticipantId) - ) && + (this.ParticipantId != null && + this.ParticipantId.Equals(input.ParticipantId)) + ) && ( this.Length == input.Length || - this.Length.Equals(input.Length) - ) && + (this.Length != null && + this.Length.Equals(input.Length)) + ) && ( this.Width == input.Width || - this.Width.Equals(input.Width) - ) && + (this.Width != null && + this.Width.Equals(input.Width)) + ) && ( this.IsTug == input.IsTug || this.IsTug.Equals(input.IsTug) - ) && + ) && ( this.BollardPull == input.BollardPull || - this.BollardPull.Equals(input.BollardPull) - ) && + (this.BollardPull != null && + this.BollardPull.Equals(input.BollardPull)) + ) && ( this.Eni == input.Eni || - this.Eni.Equals(input.Eni) - ) && + (this.Eni != null && + this.Eni.Equals(input.Eni)) + ) && ( this.Created == input.Created || (this.Created != null && this.Created.Equals(input.Created)) - ) && + ) && ( this.Modified == input.Modified || (this.Modified != null && this.Modified.Equals(input.Modified)) - ) && + ) && ( this.Deleted == input.Deleted || this.Deleted.Equals(input.Deleted) @@ -7142,17 +7032,35 @@ namespace BreCalClient.misc.Model { hashCode = (hashCode * 59) + this.Name.GetHashCode(); } - hashCode = (hashCode * 59) + this.Imo.GetHashCode(); + if (this.Imo != null) + { + hashCode = (hashCode * 59) + this.Imo.GetHashCode(); + } if (this.Callsign != null) { hashCode = (hashCode * 59) + this.Callsign.GetHashCode(); } - hashCode = (hashCode * 59) + this.ParticipantId.GetHashCode(); - hashCode = (hashCode * 59) + this.Length.GetHashCode(); - hashCode = (hashCode * 59) + this.Width.GetHashCode(); + if (this.ParticipantId != null) + { + hashCode = (hashCode * 59) + this.ParticipantId.GetHashCode(); + } + if (this.Length != null) + { + hashCode = (hashCode * 59) + this.Length.GetHashCode(); + } + if (this.Width != null) + { + hashCode = (hashCode * 59) + this.Width.GetHashCode(); + } hashCode = (hashCode * 59) + this.IsTug.GetHashCode(); - hashCode = (hashCode * 59) + this.BollardPull.GetHashCode(); - hashCode = (hashCode * 59) + this.Eni.GetHashCode(); + if (this.BollardPull != null) + { + hashCode = (hashCode * 59) + this.BollardPull.GetHashCode(); + } + if (this.Eni != null) + { + hashCode = (hashCode * 59) + this.Eni.GetHashCode(); + } if (this.Created != null) { hashCode = (hashCode * 59) + this.Created.GetHashCode(); @@ -7243,9 +7151,9 @@ namespace BreCalClient.misc.Model /// evaluation. /// evaluationMessage. /// participants. - /// created. - /// modified. - 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), float draft = default(float), 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), int evaluation = default(int), string evaluationMessage = default(string), List participants = default(List), DateTime created = default(DateTime), DateTime modified = default(DateTime)) + /// 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?), float? draft = default(float?), 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?), int? evaluation = default(int?), string evaluationMessage = default(string), List participants = default(List), DateTime created = default(DateTime), DateTime? modified = default(DateTime?)) { this.Id = id; this.ShipId = shipId; @@ -7291,7 +7199,7 @@ namespace BreCalClient.misc.Model /// Gets or Sets Eta /// [DataMember(Name = "eta", EmitDefaultValue = true)] - public DateTime Eta { get; set; } + public DateTime? Eta { get; set; } /// /// Gets or Sets Voyage /// @@ -7301,97 +7209,97 @@ namespace BreCalClient.misc.Model /// Gets or Sets Etd /// [DataMember(Name = "etd", EmitDefaultValue = true)] - public DateTime Etd { get; set; } + public DateTime? Etd { get; set; } /// /// Gets or Sets ArrivalBerthId /// [DataMember(Name = "arrival_berth_id", EmitDefaultValue = true)] - public int ArrivalBerthId { get; set; } + public int? ArrivalBerthId { get; set; } /// /// Gets or Sets DepartureBerthId /// [DataMember(Name = "departure_berth_id", EmitDefaultValue = true)] - public int DepartureBerthId { get; set; } + public int? DepartureBerthId { get; set; } /// /// Gets or Sets TugRequired /// [DataMember(Name = "tug_required", EmitDefaultValue = true)] - public bool TugRequired { get; set; } + public bool? TugRequired { get; set; } /// /// Gets or Sets PilotRequired /// [DataMember(Name = "pilot_required", EmitDefaultValue = true)] - public bool PilotRequired { get; set; } + public bool? PilotRequired { get; set; } /// /// Gets or Sets Flags /// [DataMember(Name = "flags", EmitDefaultValue = true)] - public int Flags { get; set; } + public int? Flags { get; set; } /// /// Gets or Sets PierSide /// [DataMember(Name = "pier_side", EmitDefaultValue = true)] - public bool PierSide { get; set; } + public bool? PierSide { get; set; } /// /// Gets or Sets Bunkering /// [DataMember(Name = "bunkering", EmitDefaultValue = true)] - public bool Bunkering { get; set; } + public bool? Bunkering { get; set; } /// /// Gets or Sets ReplenishingTerminal /// [DataMember(Name = "replenishing_terminal", EmitDefaultValue = true)] - public bool ReplenishingTerminal { get; set; } + public bool? ReplenishingTerminal { get; set; } /// /// Gets or Sets ReplenishingLock /// [DataMember(Name = "replenishing_lock", EmitDefaultValue = true)] - public bool ReplenishingLock { get; set; } + public bool? ReplenishingLock { get; set; } /// /// Gets or Sets Draft /// [DataMember(Name = "draft", EmitDefaultValue = true)] - public float Draft { get; set; } + public float? Draft { get; set; } /// /// Gets or Sets TidalWindowFrom /// [DataMember(Name = "tidal_window_from", EmitDefaultValue = true)] - public DateTime TidalWindowFrom { get; set; } + public DateTime? TidalWindowFrom { get; set; } /// /// Gets or Sets TidalWindowTo /// [DataMember(Name = "tidal_window_to", EmitDefaultValue = true)] - public DateTime TidalWindowTo { get; set; } + public DateTime? TidalWindowTo { get; set; } /// /// Gets or Sets RainSensitiveCargo /// [DataMember(Name = "rain_sensitive_cargo", EmitDefaultValue = true)] - public bool RainSensitiveCargo { get; set; } + public bool? RainSensitiveCargo { get; set; } /// /// Gets or Sets RecommendedTugs /// [DataMember(Name = "recommended_tugs", EmitDefaultValue = true)] - public int RecommendedTugs { get; set; } + public int? RecommendedTugs { get; set; } /// /// Gets or Sets Anchored /// [DataMember(Name = "anchored", EmitDefaultValue = true)] - public bool Anchored { get; set; } + public bool? Anchored { get; set; } /// /// Gets or Sets MooredLock /// [DataMember(Name = "moored_lock", EmitDefaultValue = true)] - public bool MooredLock { get; set; } + public bool? MooredLock { get; set; } /// /// Gets or Sets Canceled /// [DataMember(Name = "canceled", EmitDefaultValue = true)] - public bool Canceled { get; set; } + public bool? Canceled { get; set; } /// /// Gets or Sets Evaluation /// [DataMember(Name = "evaluation", EmitDefaultValue = true)] - public int Evaluation { get; set; } + public int? Evaluation { get; set; } /// /// Gets or Sets EvaluationMessage /// @@ -7403,15 +7311,17 @@ namespace BreCalClient.misc.Model [DataMember(Name = "participants", EmitDefaultValue = true)] public List Participants { get; set; } /// - /// Gets or Sets Created + /// Readonly field set by the database /// + /// Readonly field set by the database [DataMember(Name = "created", EmitDefaultValue = true)] public DateTime Created { get; set; } /// - /// Gets or Sets Modified + /// Readonly field set by the database /// + /// Readonly field set by the database [DataMember(Name = "modified", EmitDefaultValue = true)] - public DateTime Modified { get; set; } + public DateTime? Modified { get; set; } /// /// Returns the string presentation of the object /// @@ -7479,124 +7389,140 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Id == input.Id || this.Id.Equals(input.Id) - ) && + ) && ( this.ShipId == input.ShipId || this.ShipId.Equals(input.ShipId) - ) && + ) && ( this.Type == input.Type || this.Type.Equals(input.Type) - ) && + ) && ( this.Eta == input.Eta || (this.Eta != null && this.Eta.Equals(input.Eta)) - ) && + ) && ( this.Voyage == input.Voyage || (this.Voyage != null && this.Voyage.Equals(input.Voyage)) - ) && + ) && ( this.Etd == input.Etd || (this.Etd != null && this.Etd.Equals(input.Etd)) - ) && + ) && ( this.ArrivalBerthId == input.ArrivalBerthId || - this.ArrivalBerthId.Equals(input.ArrivalBerthId) - ) && + (this.ArrivalBerthId != null && + this.ArrivalBerthId.Equals(input.ArrivalBerthId)) + ) && ( this.DepartureBerthId == input.DepartureBerthId || - this.DepartureBerthId.Equals(input.DepartureBerthId) - ) && + (this.DepartureBerthId != null && + this.DepartureBerthId.Equals(input.DepartureBerthId)) + ) && ( this.TugRequired == input.TugRequired || - this.TugRequired.Equals(input.TugRequired) - ) && + (this.TugRequired != null && + this.TugRequired.Equals(input.TugRequired)) + ) && ( this.PilotRequired == input.PilotRequired || - this.PilotRequired.Equals(input.PilotRequired) - ) && + (this.PilotRequired != null && + this.PilotRequired.Equals(input.PilotRequired)) + ) && ( this.Flags == input.Flags || - this.Flags.Equals(input.Flags) - ) && + (this.Flags != null && + this.Flags.Equals(input.Flags)) + ) && ( this.PierSide == input.PierSide || - this.PierSide.Equals(input.PierSide) - ) && + (this.PierSide != null && + this.PierSide.Equals(input.PierSide)) + ) && ( this.Bunkering == input.Bunkering || - this.Bunkering.Equals(input.Bunkering) - ) && + (this.Bunkering != null && + this.Bunkering.Equals(input.Bunkering)) + ) && ( this.ReplenishingTerminal == input.ReplenishingTerminal || - this.ReplenishingTerminal.Equals(input.ReplenishingTerminal) - ) && + (this.ReplenishingTerminal != null && + this.ReplenishingTerminal.Equals(input.ReplenishingTerminal)) + ) && ( this.ReplenishingLock == input.ReplenishingLock || - this.ReplenishingLock.Equals(input.ReplenishingLock) - ) && + (this.ReplenishingLock != null && + this.ReplenishingLock.Equals(input.ReplenishingLock)) + ) && ( this.Draft == input.Draft || - this.Draft.Equals(input.Draft) - ) && + (this.Draft != null && + this.Draft.Equals(input.Draft)) + ) && ( this.TidalWindowFrom == input.TidalWindowFrom || (this.TidalWindowFrom != null && this.TidalWindowFrom.Equals(input.TidalWindowFrom)) - ) && + ) && ( this.TidalWindowTo == input.TidalWindowTo || (this.TidalWindowTo != null && this.TidalWindowTo.Equals(input.TidalWindowTo)) - ) && + ) && ( this.RainSensitiveCargo == input.RainSensitiveCargo || - this.RainSensitiveCargo.Equals(input.RainSensitiveCargo) - ) && + (this.RainSensitiveCargo != null && + this.RainSensitiveCargo.Equals(input.RainSensitiveCargo)) + ) && ( this.RecommendedTugs == input.RecommendedTugs || - this.RecommendedTugs.Equals(input.RecommendedTugs) - ) && + (this.RecommendedTugs != null && + this.RecommendedTugs.Equals(input.RecommendedTugs)) + ) && ( this.Anchored == input.Anchored || - this.Anchored.Equals(input.Anchored) - ) && + (this.Anchored != null && + this.Anchored.Equals(input.Anchored)) + ) && ( this.MooredLock == input.MooredLock || - this.MooredLock.Equals(input.MooredLock) - ) && + (this.MooredLock != null && + this.MooredLock.Equals(input.MooredLock)) + ) && ( this.Canceled == input.Canceled || - this.Canceled.Equals(input.Canceled) - ) && + (this.Canceled != null && + this.Canceled.Equals(input.Canceled)) + ) && ( this.Evaluation == input.Evaluation || - this.Evaluation.Equals(input.Evaluation) - ) && + (this.Evaluation != null && + this.Evaluation.Equals(input.Evaluation)) + ) && ( this.EvaluationMessage == input.EvaluationMessage || (this.EvaluationMessage != null && this.EvaluationMessage.Equals(input.EvaluationMessage)) - ) && + ) && ( this.Participants == input.Participants || this.Participants != null && input.Participants != null && this.Participants.SequenceEqual(input.Participants) - ) && + ) && ( this.Created == input.Created || (this.Created != null && this.Created.Equals(input.Created)) - ) && + ) && ( this.Modified == input.Modified || (this.Modified != null && @@ -7627,16 +7553,46 @@ namespace BreCalClient.misc.Model { hashCode = (hashCode * 59) + this.Etd.GetHashCode(); } - hashCode = (hashCode * 59) + this.ArrivalBerthId.GetHashCode(); - hashCode = (hashCode * 59) + this.DepartureBerthId.GetHashCode(); - hashCode = (hashCode * 59) + this.TugRequired.GetHashCode(); - hashCode = (hashCode * 59) + this.PilotRequired.GetHashCode(); - hashCode = (hashCode * 59) + this.Flags.GetHashCode(); - hashCode = (hashCode * 59) + this.PierSide.GetHashCode(); - hashCode = (hashCode * 59) + this.Bunkering.GetHashCode(); - hashCode = (hashCode * 59) + this.ReplenishingTerminal.GetHashCode(); - hashCode = (hashCode * 59) + this.ReplenishingLock.GetHashCode(); - hashCode = (hashCode * 59) + this.Draft.GetHashCode(); + if (this.ArrivalBerthId != null) + { + hashCode = (hashCode * 59) + this.ArrivalBerthId.GetHashCode(); + } + if (this.DepartureBerthId != null) + { + hashCode = (hashCode * 59) + this.DepartureBerthId.GetHashCode(); + } + if (this.TugRequired != null) + { + hashCode = (hashCode * 59) + this.TugRequired.GetHashCode(); + } + if (this.PilotRequired != null) + { + hashCode = (hashCode * 59) + this.PilotRequired.GetHashCode(); + } + if (this.Flags != null) + { + hashCode = (hashCode * 59) + this.Flags.GetHashCode(); + } + if (this.PierSide != null) + { + hashCode = (hashCode * 59) + this.PierSide.GetHashCode(); + } + if (this.Bunkering != null) + { + hashCode = (hashCode * 59) + this.Bunkering.GetHashCode(); + } + if (this.ReplenishingTerminal != null) + { + hashCode = (hashCode * 59) + this.ReplenishingTerminal.GetHashCode(); + } + if (this.ReplenishingLock != null) + { + hashCode = (hashCode * 59) + this.ReplenishingLock.GetHashCode(); + } + if (this.Draft != null) + { + hashCode = (hashCode * 59) + this.Draft.GetHashCode(); + } if (this.TidalWindowFrom != null) { hashCode = (hashCode * 59) + this.TidalWindowFrom.GetHashCode(); @@ -7645,12 +7601,30 @@ namespace BreCalClient.misc.Model { hashCode = (hashCode * 59) + this.TidalWindowTo.GetHashCode(); } - hashCode = (hashCode * 59) + this.RainSensitiveCargo.GetHashCode(); - hashCode = (hashCode * 59) + this.RecommendedTugs.GetHashCode(); - hashCode = (hashCode * 59) + this.Anchored.GetHashCode(); - hashCode = (hashCode * 59) + this.MooredLock.GetHashCode(); - hashCode = (hashCode * 59) + this.Canceled.GetHashCode(); - hashCode = (hashCode * 59) + this.Evaluation.GetHashCode(); + if (this.RainSensitiveCargo != null) + { + hashCode = (hashCode * 59) + this.RainSensitiveCargo.GetHashCode(); + } + if (this.RecommendedTugs != null) + { + hashCode = (hashCode * 59) + this.RecommendedTugs.GetHashCode(); + } + if (this.Anchored != null) + { + hashCode = (hashCode * 59) + this.Anchored.GetHashCode(); + } + if (this.MooredLock != null) + { + hashCode = (hashCode * 59) + this.MooredLock.GetHashCode(); + } + if (this.Canceled != null) + { + hashCode = (hashCode * 59) + this.Canceled.GetHashCode(); + } + if (this.Evaluation != null) + { + hashCode = (hashCode * 59) + this.Evaluation.GetHashCode(); + } if (this.EvaluationMessage != null) { hashCode = (hashCode * 59) + this.EvaluationMessage.GetHashCode(); @@ -7754,25 +7728,25 @@ namespace BreCalClient.misc.Model /// /// id. /// etaBerth. - /// etaBerthFixed. + /// currently unused. /// etdBerth. - /// etdBerthFixed. + /// currently unused. /// lockTime. - /// lockTimeFixed. + /// currently unused. /// zoneEntry. - /// zoneEntryFixed. - /// operationsStart. - /// operationsEnd. + /// currently unused. + /// Start time for terminal operations. + /// End time for terminal operations. /// remarks. - /// shipcallId (required). - /// participantId (required). - /// berthId. + /// Reference to a shipcall id (required). + /// Reference to a participant id (required). + /// Reference to a berth id. /// berthInfo. /// pierSide. /// participantType. - /// created. - /// modified. - 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), ParticipantType2 participantType = default(ParticipantType2), DateTime created = default(DateTime), DateTime modified = default(DateTime)) + /// 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?)) { this.ShipcallId = shipcallId; this.ParticipantId = participantId; @@ -7804,72 +7778,81 @@ namespace BreCalClient.misc.Model /// Gets or Sets EtaBerth /// [DataMember(Name = "eta_berth", EmitDefaultValue = true)] - public DateTime EtaBerth { get; set; } + public DateTime? EtaBerth { get; set; } /// - /// Gets or Sets EtaBerthFixed + /// currently unused /// + /// currently unused [DataMember(Name = "eta_berth_fixed", EmitDefaultValue = true)] - public bool EtaBerthFixed { get; set; } + public bool? EtaBerthFixed { get; set; } /// /// Gets or Sets EtdBerth /// [DataMember(Name = "etd_berth", EmitDefaultValue = true)] - public DateTime EtdBerth { get; set; } + public DateTime? EtdBerth { get; set; } /// - /// Gets or Sets EtdBerthFixed + /// currently unused /// + /// currently unused [DataMember(Name = "etd_berth_fixed", EmitDefaultValue = true)] - public bool EtdBerthFixed { get; set; } + public bool? EtdBerthFixed { get; set; } /// /// Gets or Sets LockTime /// [DataMember(Name = "lock_time", EmitDefaultValue = true)] - public DateTime LockTime { get; set; } + public DateTime? LockTime { get; set; } /// - /// Gets or Sets LockTimeFixed + /// currently unused /// + /// currently unused [DataMember(Name = "lock_time_fixed", EmitDefaultValue = true)] - public bool LockTimeFixed { get; set; } + public bool? LockTimeFixed { get; set; } /// /// Gets or Sets ZoneEntry /// [DataMember(Name = "zone_entry", EmitDefaultValue = true)] - public DateTime ZoneEntry { get; set; } + public DateTime? ZoneEntry { get; set; } /// - /// Gets or Sets ZoneEntryFixed + /// currently unused /// + /// currently unused [DataMember(Name = "zone_entry_fixed", EmitDefaultValue = true)] - public bool ZoneEntryFixed { get; set; } + public bool? ZoneEntryFixed { get; set; } /// - /// Gets or Sets OperationsStart + /// Start time for terminal operations /// + /// Start time for terminal operations [DataMember(Name = "operations_start", EmitDefaultValue = true)] - public DateTime OperationsStart { get; set; } + public DateTime? OperationsStart { get; set; } /// - /// Gets or Sets OperationsEnd + /// End time for terminal operations /// + /// End time for terminal operations [DataMember(Name = "operations_end", EmitDefaultValue = true)] - public DateTime OperationsEnd { get; set; } + public DateTime? OperationsEnd { get; set; } /// /// Gets or Sets Remarks /// [DataMember(Name = "remarks", EmitDefaultValue = true)] public string Remarks { get; set; } /// - /// Gets or Sets ShipcallId + /// Reference to a shipcall id /// + /// Reference to a shipcall id [DataMember(Name = "shipcall_id", IsRequired = true, EmitDefaultValue = true)] public int ShipcallId { get; set; } /// - /// Gets or Sets ParticipantId + /// Reference to a participant id /// + /// Reference to a participant id [DataMember(Name = "participant_id", IsRequired = true, EmitDefaultValue = true)] public int ParticipantId { get; set; } /// - /// Gets or Sets BerthId + /// Reference to a berth id /// + /// Reference to a berth id [DataMember(Name = "berth_id", EmitDefaultValue = true)] - public int BerthId { get; set; } + public int? BerthId { get; set; } /// /// Gets or Sets BerthInfo /// @@ -7879,22 +7862,24 @@ namespace BreCalClient.misc.Model /// Gets or Sets PierSide /// [DataMember(Name = "pier_side", EmitDefaultValue = true)] - public bool PierSide { get; set; } + public bool? PierSide { get; set; } /// /// Gets or Sets ParticipantType /// [DataMember(Name = "participant_type", EmitDefaultValue = true)] - public ParticipantType2 ParticipantType { get; set; } + public int ParticipantType { get; set; } /// - /// Gets or Sets Created + /// Readonly field set by the database /// + /// Readonly field set by the database [DataMember(Name = "created", EmitDefaultValue = true)] public DateTime Created { get; set; } /// - /// Gets or Sets Modified + /// Readonly field set by the database /// + /// Readonly field set by the database [DataMember(Name = "modified", EmitDefaultValue = true)] - public DateTime Modified { get; set; } + public DateTime? Modified { get; set; } /// /// Returns the string presentation of the object /// @@ -7954,93 +7939,98 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Id == input.Id || this.Id.Equals(input.Id) - ) && + ) && ( this.EtaBerth == input.EtaBerth || (this.EtaBerth != null && this.EtaBerth.Equals(input.EtaBerth)) - ) && + ) && ( this.EtaBerthFixed == input.EtaBerthFixed || - this.EtaBerthFixed.Equals(input.EtaBerthFixed) - ) && + (this.EtaBerthFixed != null && + this.EtaBerthFixed.Equals(input.EtaBerthFixed)) + ) && ( this.EtdBerth == input.EtdBerth || (this.EtdBerth != null && this.EtdBerth.Equals(input.EtdBerth)) - ) && + ) && ( this.EtdBerthFixed == input.EtdBerthFixed || - this.EtdBerthFixed.Equals(input.EtdBerthFixed) - ) && + (this.EtdBerthFixed != null && + this.EtdBerthFixed.Equals(input.EtdBerthFixed)) + ) && ( this.LockTime == input.LockTime || (this.LockTime != null && this.LockTime.Equals(input.LockTime)) - ) && + ) && ( this.LockTimeFixed == input.LockTimeFixed || - this.LockTimeFixed.Equals(input.LockTimeFixed) - ) && + (this.LockTimeFixed != null && + this.LockTimeFixed.Equals(input.LockTimeFixed)) + ) && ( this.ZoneEntry == input.ZoneEntry || (this.ZoneEntry != null && this.ZoneEntry.Equals(input.ZoneEntry)) - ) && + ) && ( this.ZoneEntryFixed == input.ZoneEntryFixed || - this.ZoneEntryFixed.Equals(input.ZoneEntryFixed) - ) && + (this.ZoneEntryFixed != null && + this.ZoneEntryFixed.Equals(input.ZoneEntryFixed)) + ) && ( this.OperationsStart == input.OperationsStart || (this.OperationsStart != null && this.OperationsStart.Equals(input.OperationsStart)) - ) && + ) && ( this.OperationsEnd == input.OperationsEnd || (this.OperationsEnd != null && this.OperationsEnd.Equals(input.OperationsEnd)) - ) && + ) && ( this.Remarks == input.Remarks || (this.Remarks != null && this.Remarks.Equals(input.Remarks)) - ) && + ) && ( this.ShipcallId == input.ShipcallId || this.ShipcallId.Equals(input.ShipcallId) - ) && + ) && ( this.ParticipantId == input.ParticipantId || this.ParticipantId.Equals(input.ParticipantId) - ) && + ) && ( this.BerthId == input.BerthId || - this.BerthId.Equals(input.BerthId) - ) && + (this.BerthId != null && + this.BerthId.Equals(input.BerthId)) + ) && ( this.BerthInfo == input.BerthInfo || (this.BerthInfo != null && this.BerthInfo.Equals(input.BerthInfo)) - ) && + ) && ( this.PierSide == input.PierSide || - this.PierSide.Equals(input.PierSide) - ) && + (this.PierSide != null && + this.PierSide.Equals(input.PierSide)) + ) && ( this.ParticipantType == input.ParticipantType || - (this.ParticipantType != null && - this.ParticipantType.Equals(input.ParticipantType)) - ) && + this.ParticipantType.Equals(input.ParticipantType) + ) && ( this.Created == input.Created || (this.Created != null && this.Created.Equals(input.Created)) - ) && + ) && ( this.Modified == input.Modified || (this.Modified != null && @@ -8061,22 +8051,34 @@ namespace BreCalClient.misc.Model { hashCode = (hashCode * 59) + this.EtaBerth.GetHashCode(); } - hashCode = (hashCode * 59) + this.EtaBerthFixed.GetHashCode(); + if (this.EtaBerthFixed != null) + { + hashCode = (hashCode * 59) + this.EtaBerthFixed.GetHashCode(); + } if (this.EtdBerth != null) { hashCode = (hashCode * 59) + this.EtdBerth.GetHashCode(); } - hashCode = (hashCode * 59) + this.EtdBerthFixed.GetHashCode(); + if (this.EtdBerthFixed != null) + { + hashCode = (hashCode * 59) + this.EtdBerthFixed.GetHashCode(); + } if (this.LockTime != null) { hashCode = (hashCode * 59) + this.LockTime.GetHashCode(); } - hashCode = (hashCode * 59) + this.LockTimeFixed.GetHashCode(); + if (this.LockTimeFixed != null) + { + hashCode = (hashCode * 59) + this.LockTimeFixed.GetHashCode(); + } if (this.ZoneEntry != null) { hashCode = (hashCode * 59) + this.ZoneEntry.GetHashCode(); } - hashCode = (hashCode * 59) + this.ZoneEntryFixed.GetHashCode(); + if (this.ZoneEntryFixed != null) + { + hashCode = (hashCode * 59) + this.ZoneEntryFixed.GetHashCode(); + } if (this.OperationsStart != null) { hashCode = (hashCode * 59) + this.OperationsStart.GetHashCode(); @@ -8091,16 +8093,19 @@ namespace BreCalClient.misc.Model } hashCode = (hashCode * 59) + this.ShipcallId.GetHashCode(); hashCode = (hashCode * 59) + this.ParticipantId.GetHashCode(); - hashCode = (hashCode * 59) + this.BerthId.GetHashCode(); + if (this.BerthId != null) + { + hashCode = (hashCode * 59) + this.BerthId.GetHashCode(); + } if (this.BerthInfo != null) { hashCode = (hashCode * 59) + this.BerthInfo.GetHashCode(); } - hashCode = (hashCode * 59) + this.PierSide.GetHashCode(); - if (this.ParticipantType != null) + if (this.PierSide != null) { - hashCode = (hashCode * 59) + this.ParticipantType.GetHashCode(); + hashCode = (hashCode * 59) + this.PierSide.GetHashCode(); } + hashCode = (hashCode * 59) + this.ParticipantType.GetHashCode(); if (this.Created != null) { hashCode = (hashCode * 59) + this.Created.GetHashCode(); @@ -8247,36 +8252,36 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Id == input.Id || this.Id.Equals(input.Id) - ) && + ) && ( this.OldPassword == input.OldPassword || (this.OldPassword != null && this.OldPassword.Equals(input.OldPassword)) - ) && + ) && ( this.NewPassword == input.NewPassword || (this.NewPassword != null && this.NewPassword.Equals(input.NewPassword)) - ) && + ) && ( this.FirstName == input.FirstName || (this.FirstName != null && this.FirstName.Equals(input.FirstName)) - ) && + ) && ( this.LastName == input.LastName || (this.LastName != null && this.LastName.Equals(input.LastName)) - ) && + ) && ( this.UserPhone == input.UserPhone || (this.UserPhone != null && this.UserPhone.Equals(input.UserPhone)) - ) && + ) && ( this.UserEmail == input.UserEmail || (this.UserEmail != null && diff --git a/misc/BreCalApi.yaml b/misc/BreCalApi.yaml index 5c3ad92..980963a 100644 --- a/misc/BreCalApi.yaml +++ b/misc/BreCalApi.yaml @@ -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 diff --git a/src/BreCalClient/Extensions.cs b/src/BreCalClient/Extensions.cs index 23611f1..e92bd4b 100644 --- a/src/BreCalClient/Extensions.cs +++ b/src/BreCalClient/Extensions.cs @@ -1,6 +1,6 @@ // Copyright (c) 2023 schick Informatik // Description: some helpers -// +// using BreCalClient.misc.Model; using System; @@ -11,7 +11,31 @@ namespace BreCalClient public static class Extensions { - #region Enum + #region Enum + + /// + /// Copied from models clunky I know + /// + [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, + } /// /// Custom participant flags @@ -42,7 +66,7 @@ namespace BreCalClient public static bool IsFlagSet(this Participant participant, ParticipantFlag flag) { return (participant.Flags & (uint)flag) != 0; - } + } public static string Truncate(this string value, int maxLength) { diff --git a/src/BreCalClient/ShipcallControl.xaml.cs b/src/BreCalClient/ShipcallControl.xaml.cs index 5fdc40b..c897c5d 100644 --- a/src/BreCalClient/ShipcallControl.xaml.cs +++ b/src/BreCalClient/ShipcallControl.xaml.cs @@ -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") : "- / -"; } diff --git a/src/BreCalClient/ShipcallControlModel.cs b/src/BreCalClient/ShipcallControlModel.cs index bc6df14..52f056c 100644 --- a/src/BreCalClient/ShipcallControlModel.cs +++ b/src/BreCalClient/ShipcallControlModel.cs @@ -48,7 +48,7 @@ namespace BreCalClient public string? Berth { get; set; } - internal Dictionary AssignedParticipants { get; } = new(); + internal Dictionary AssignedParticipants { get; } = new(); public List 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 /// API reference to PUT eidted times 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;