diff --git a/.gitignore b/.gitignore index d64518d..bbd7a3a 100644 --- a/.gitignore +++ b/.gitignore @@ -225,7 +225,7 @@ publish/ *.azurePubxml # Note: Comment the next line if you want to checkin your web deploy settings, # but database connection strings (with potential passwords) will be unencrypted -*.pubxml +# *.pubxml *.publishproj # Microsoft Azure Web App publish settings. Comment the next line if you want to diff --git a/misc/BreCalApi.cs b/misc/BreCalApi.cs index 7441519..3a006be 100644 --- a/misc/BreCalApi.cs +++ b/misc/BreCalApi.cs @@ -1,7 +1,7 @@ //---------------------- // -// Generated REST API Client Code Generator v1.7.17.0 on 11.08.2023 12:15:43 +// Generated REST API Client Code Generator v1.7.17.0 on 18.08.2023 15:15:15 // Using the tool OpenAPI Generator v6.6.0 // //---------------------- @@ -44,7 +44,7 @@ using System.Threading.Tasks; * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 0.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -280,6 +280,25 @@ namespace BreCalClient.misc.Api /// Index associated with the operation. /// ApiResponse of Object(void) ApiResponse TimesPutWithHttpInfo(Times times, int operationIndex = 0); + /// + /// Update user details (first/last name, phone, password) + /// + /// Thrown when fails to make API call + /// User details + /// Index associated with the operation. + /// + void UserPut(UserDetails userDetails, int operationIndex = 0); + /// + /// Update user details (first/last name, phone, password) + /// + /// + /// + /// + /// Thrown when fails to make API call + /// User details + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse UserPutWithHttpInfo(UserDetails userDetails, int operationIndex = 0); #endregion Synchronous Operations } /// @@ -572,6 +591,30 @@ namespace BreCalClient.misc.Api /// Cancellation Token to cancel the request. /// Task of ApiResponse System.Threading.Tasks.Task> TimesPutWithHttpInfoAsync(Times times, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Update user details (first/last name, phone, password) + /// + /// + /// + /// + /// Thrown when fails to make API call + /// User details + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task UserPutAsync(UserDetails userDetails, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Update user details (first/last name, phone, password) + /// + /// + /// + /// + /// Thrown when fails to make API call + /// User details + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> UserPutWithHttpInfoAsync(UserDetails userDetails, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); #endregion Asynchronous Operations } /// @@ -2143,6 +2186,134 @@ namespace BreCalClient.misc.Api } return localVarResponse; } + /// + /// Update user details (first/last name, phone, password) + /// + /// Thrown when fails to make API call + /// User details + /// Index associated with the operation. + /// + public void UserPut(UserDetails userDetails, int operationIndex = 0) + { + UserPutWithHttpInfo(userDetails); + } + /// + /// Update user details (first/last name, phone, password) + /// + /// Thrown when fails to make API call + /// User details + /// Index associated with the operation. + /// ApiResponse of Object(void) + public BreCalClient.misc.Client.ApiResponse UserPutWithHttpInfo(UserDetails userDetails, int operationIndex = 0) + { + // verify the required parameter 'userDetails' is set + if (userDetails == null) + { + throw new BreCalClient.misc.Client.ApiException(400, "Missing required parameter 'userDetails' when calling DefaultApi->UserPut"); + } + BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); + string[] _contentTypes = new string[] { + "application/json" + }; + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + var localVarAccept = BreCalClient.misc.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + localVarRequestOptions.Data = userDetails; + localVarRequestOptions.Operation = "DefaultApi.UserPut"; + localVarRequestOptions.OperationIndex = operationIndex; + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + // make the HTTP request + var localVarResponse = this.Client.Put("/user", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UserPut", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + return localVarResponse; + } + /// + /// Update user details (first/last name, phone, password) + /// + /// Thrown when fails to make API call + /// User details + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task UserPutAsync(UserDetails userDetails, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await UserPutWithHttpInfoAsync(userDetails, operationIndex, cancellationToken).ConfigureAwait(false); + } + /// + /// Update user details (first/last name, phone, password) + /// + /// Thrown when fails to make API call + /// User details + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> UserPutWithHttpInfoAsync(UserDetails userDetails, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'userDetails' is set + if (userDetails == null) + { + throw new BreCalClient.misc.Client.ApiException(400, "Missing required parameter 'userDetails' when calling DefaultApi->UserPut"); + } + BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); + string[] _contentTypes = new string[] { + "application/json" + }; + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + var localVarAccept = BreCalClient.misc.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + localVarRequestOptions.Data = userDetails; + localVarRequestOptions.Operation = "DefaultApi.UserPut"; + localVarRequestOptions.OperationIndex = operationIndex; + // authentication (ApiKey) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); + } + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PutAsync("/user", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UserPut", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + return localVarResponse; + } } } @@ -2151,7 +2322,7 @@ namespace BreCalClient.misc.Api * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 0.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -2886,7 +3057,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 0.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -2946,7 +3117,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 0.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -3086,7 +3257,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 0.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -3304,7 +3475,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 0.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -3744,7 +3915,7 @@ namespace BreCalClient.misc.Client string report = "C# SDK (BreCalClient.misc) Debug Report:\n"; report += " OS: " + System.Environment.OSVersion + "\n"; report += " .NET Framework Version: " + System.Environment.Version + "\n"; - report += " Version of the API: 1.0.0\n"; + report += " Version of the API: 0.3.0\n"; report += " SDK Package Version: 1.0.0\n"; return report; } @@ -3811,7 +3982,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 0.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -3831,7 +4002,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 0.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -3888,7 +4059,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 0.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -3921,7 +4092,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 0.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -3954,7 +4125,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 0.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -4045,7 +4216,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 0.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -4153,7 +4324,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 0.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -4237,7 +4408,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 0.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -4496,7 +4667,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 0.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -4524,7 +4695,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 0.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -4594,7 +4765,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 0.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -4621,7 +4792,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 0.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -4688,7 +4859,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 0.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -4704,13 +4875,21 @@ namespace BreCalClient.misc.Model /// Initializes a new instance of the class. /// /// id. - /// name1. - /// name2. - public Berth(int id = default(int), string name1 = default(string), string name2 = default(string)) + /// name. + /// participantId. + /// _lock. + /// created. + /// modified. + /// deleted (default to false). + public Berth(int id = default(int), string name = default(string), int? participantId = default(int?), bool? _lock = default(bool?), DateTime created = default(DateTime), DateTime? modified = default(DateTime?), bool deleted = false) { this.Id = id; - this.Name1 = name1; - this.Name2 = name2; + this.Name = name; + this.ParticipantId = participantId; + this.Lock = _lock; + this.Created = created; + this.Modified = modified; + this.Deleted = deleted; } /// /// Gets or Sets Id @@ -4718,15 +4897,35 @@ namespace BreCalClient.misc.Model [DataMember(Name = "id", EmitDefaultValue = true)] public int Id { get; set; } /// - /// Gets or Sets Name1 + /// Gets or Sets Name /// - [DataMember(Name = "name1", EmitDefaultValue = true)] - public string Name1 { get; set; } + [DataMember(Name = "name", EmitDefaultValue = true)] + public string Name { get; set; } /// - /// Gets or Sets Name2 + /// Gets or Sets ParticipantId /// - [DataMember(Name = "name2", EmitDefaultValue = true)] - public string Name2 { get; set; } + [DataMember(Name = "participant_id", EmitDefaultValue = true)] + public int? ParticipantId { get; set; } + /// + /// Gets or Sets Lock + /// + [DataMember(Name = "lock", EmitDefaultValue = true)] + public bool? Lock { get; set; } + /// + /// Gets or Sets Created + /// + [DataMember(Name = "created", EmitDefaultValue = true)] + public DateTime Created { get; set; } + /// + /// Gets or Sets Modified + /// + [DataMember(Name = "modified", EmitDefaultValue = true)] + public DateTime? Modified { get; set; } + /// + /// Gets or Sets Deleted + /// + [DataMember(Name = "deleted", EmitDefaultValue = true)] + public bool Deleted { get; set; } /// /// Returns the string presentation of the object /// @@ -4736,8 +4935,12 @@ namespace BreCalClient.misc.Model StringBuilder sb = new StringBuilder(); sb.Append("class Berth {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" Name1: ").Append(Name1).Append("\n"); - sb.Append(" Name2: ").Append(Name2).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" ParticipantId: ").Append(ParticipantId).Append("\n"); + sb.Append(" Lock: ").Append(Lock).Append("\n"); + sb.Append(" Created: ").Append(Created).Append("\n"); + sb.Append(" Modified: ").Append(Modified).Append("\n"); + sb.Append(" Deleted: ").Append(Deleted).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -4775,14 +4978,33 @@ namespace BreCalClient.misc.Model this.Id.Equals(input.Id) ) && ( - this.Name1 == input.Name1 || - (this.Name1 != null && - this.Name1.Equals(input.Name1)) + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) ) && ( - this.Name2 == input.Name2 || - (this.Name2 != null && - this.Name2.Equals(input.Name2)) + this.ParticipantId == input.ParticipantId || + (this.ParticipantId != null && + this.ParticipantId.Equals(input.ParticipantId)) + ) && + ( + this.Lock == input.Lock || + (this.Lock != null && + this.Lock.Equals(input.Lock)) + ) && + ( + 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) ); } /// @@ -4795,14 +5017,27 @@ namespace BreCalClient.misc.Model { int hashCode = 41; hashCode = (hashCode * 59) + this.Id.GetHashCode(); - if (this.Name1 != null) + if (this.Name != null) { - hashCode = (hashCode * 59) + this.Name1.GetHashCode(); + hashCode = (hashCode * 59) + this.Name.GetHashCode(); } - if (this.Name2 != null) + if (this.ParticipantId != null) { - hashCode = (hashCode * 59) + this.Name2.GetHashCode(); + hashCode = (hashCode * 59) + this.ParticipantId.GetHashCode(); } + if (this.Lock != null) + { + hashCode = (hashCode * 59) + this.Lock.GetHashCode(); + } + if (this.Created != null) + { + hashCode = (hashCode * 59) + this.Created.GetHashCode(); + } + if (this.Modified != null) + { + hashCode = (hashCode * 59) + this.Modified.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Deleted.GetHashCode(); return hashCode; } } @@ -4813,6 +5048,11 @@ namespace BreCalClient.misc.Model /// Validation Result IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { + // Name (string) maxLength + if (this.Name != null && this.Name.Length > 128) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Name, length must be less than 128.", new [] { "Name" }); + } yield break; } } @@ -4823,7 +5063,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 0.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -4845,7 +5085,7 @@ namespace BreCalClient.misc.Model /// /// username (required). /// password (required). - public Credentials(Object username = default(Object), Object password = default(Object)) + public Credentials(string username = default(string), string password = default(string)) { // to ensure "username" is required (not null) if (username == null) @@ -4864,12 +5104,12 @@ namespace BreCalClient.misc.Model /// Gets or Sets Username /// [DataMember(Name = "username", IsRequired = true, EmitDefaultValue = true)] - public Object Username { get; set; } + public string Username { get; set; } /// /// Gets or Sets Password /// [DataMember(Name = "password", IsRequired = true, EmitDefaultValue = true)] - public Object Password { get; set; } + public string Password { get; set; } /// /// Returns the string presentation of the object /// @@ -4960,7 +5200,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 0.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -5076,7 +5316,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 0.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -5288,7 +5528,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 0.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -5514,7 +5754,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 0.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -5537,7 +5777,8 @@ namespace BreCalClient.misc.Model /// type. /// created. /// modified. - 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), DateTime created = default(DateTime), DateTime? modified = default(DateTime?)) + /// 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), DateTime created = default(DateTime), DateTime? modified = default(DateTime?), bool deleted = false) { this.Id = id; this.Name = name; @@ -5547,6 +5788,7 @@ namespace BreCalClient.misc.Model this.Type = type; this.Created = created; this.Modified = modified; + this.Deleted = deleted; } /// /// Gets or Sets Id @@ -5589,6 +5831,11 @@ namespace BreCalClient.misc.Model [DataMember(Name = "modified", EmitDefaultValue = true)] public DateTime? Modified { get; set; } /// + /// Gets or Sets Deleted + /// + [DataMember(Name = "deleted", EmitDefaultValue = true)] + public bool Deleted { get; set; } + /// /// Returns the string presentation of the object /// /// String presentation of the object @@ -5604,6 +5851,7 @@ namespace BreCalClient.misc.Model sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" Created: ").Append(Created).Append("\n"); sb.Append(" Modified: ").Append(Modified).Append("\n"); + sb.Append(" Deleted: ").Append(Deleted).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -5673,6 +5921,10 @@ namespace BreCalClient.misc.Model this.Modified == input.Modified || (this.Modified != null && this.Modified.Equals(input.Modified)) + ) && + ( + this.Deleted == input.Deleted || + this.Deleted.Equals(input.Deleted) ); } /// @@ -5710,6 +5962,7 @@ namespace BreCalClient.misc.Model { hashCode = (hashCode * 59) + this.Modified.GetHashCode(); } + hashCode = (hashCode * 59) + this.Deleted.GetHashCode(); return hashCode; } } @@ -5720,6 +5973,26 @@ namespace BreCalClient.misc.Model /// Validation Result IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { + // Name (string) maxLength + if (this.Name != null && this.Name.Length > 128) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Name, length must be less than 128.", new [] { "Name" }); + } + // Street (string) maxLength + if (this.Street != null && this.Street.Length > 128) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Street, length must be less than 128.", new [] { "Street" }); + } + // PostalCode (string) maxLength + if (this.PostalCode != null && this.PostalCode.Length > 5) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PostalCode, length must be less than 5.", new [] { "PostalCode" }); + } + // City (string) maxLength + if (this.City != null && this.City.Length > 64) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for City, length must be less than 64.", new [] { "City" }); + } yield break; } } @@ -5730,7 +6003,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 0.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -5752,9 +6025,13 @@ namespace BreCalClient.misc.Model /// participantId. /// length. /// width. + /// isTug (default to false). + /// bollardPull. + /// eni. /// created. /// modified. - 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), DateTime created = default(DateTime), DateTime? modified = default(DateTime?)) + /// 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) { this.Id = id; this.Name = name; @@ -5763,8 +6040,12 @@ namespace BreCalClient.misc.Model this.ParticipantId = participantId; this.Length = length; this.Width = width; + this.IsTug = isTug; + this.BollardPull = bollardPull; + this.Eni = eni; this.Created = created; this.Modified = modified; + this.Deleted = deleted; } /// /// Gets or Sets Id @@ -5780,7 +6061,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 /// @@ -5790,17 +6071,32 @@ 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 + /// + [DataMember(Name = "is_tug", EmitDefaultValue = true)] + public bool IsTug { get; set; } + /// + /// Gets or Sets BollardPull + /// + [DataMember(Name = "bollard_pull", EmitDefaultValue = true)] + public int? BollardPull { get; set; } + /// + /// Gets or Sets Eni + /// + [DataMember(Name = "eni", EmitDefaultValue = true)] + public int? Eni { get; set; } /// /// Gets or Sets Created /// @@ -5812,6 +6108,11 @@ namespace BreCalClient.misc.Model [DataMember(Name = "modified", EmitDefaultValue = true)] public DateTime? Modified { get; set; } /// + /// Gets or Sets Deleted + /// + [DataMember(Name = "deleted", EmitDefaultValue = true)] + public bool Deleted { get; set; } + /// /// Returns the string presentation of the object /// /// String presentation of the object @@ -5826,8 +6127,12 @@ namespace BreCalClient.misc.Model sb.Append(" ParticipantId: ").Append(ParticipantId).Append("\n"); sb.Append(" Length: ").Append(Length).Append("\n"); sb.Append(" Width: ").Append(Width).Append("\n"); + sb.Append(" IsTug: ").Append(IsTug).Append("\n"); + sb.Append(" BollardPull: ").Append(BollardPull).Append("\n"); + sb.Append(" Eni: ").Append(Eni).Append("\n"); sb.Append(" Created: ").Append(Created).Append("\n"); sb.Append(" Modified: ").Append(Modified).Append("\n"); + sb.Append(" Deleted: ").Append(Deleted).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -5871,7 +6176,8 @@ namespace BreCalClient.misc.Model ) && ( this.Imo == input.Imo || - this.Imo.Equals(input.Imo) + (this.Imo != null && + this.Imo.Equals(input.Imo)) ) && ( this.Callsign == input.Callsign || @@ -5880,15 +6186,32 @@ namespace BreCalClient.misc.Model ) && ( 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 != null && + this.BollardPull.Equals(input.BollardPull)) + ) && + ( + this.Eni == input.Eni || + (this.Eni != null && + this.Eni.Equals(input.Eni)) ) && ( this.Created == input.Created || @@ -5899,6 +6222,10 @@ namespace BreCalClient.misc.Model this.Modified == input.Modified || (this.Modified != null && this.Modified.Equals(input.Modified)) + ) && + ( + this.Deleted == input.Deleted || + this.Deleted.Equals(input.Deleted) ); } /// @@ -5915,14 +6242,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(); + 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(); @@ -5931,6 +6279,7 @@ namespace BreCalClient.misc.Model { hashCode = (hashCode * 59) + this.Modified.GetHashCode(); } + hashCode = (hashCode * 59) + this.Deleted.GetHashCode(); return hashCode; } } @@ -5941,6 +6290,16 @@ namespace BreCalClient.misc.Model /// Validation Result IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { + // Name (string) maxLength + if (this.Name != null && this.Name.Length > 64) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Name, length must be less than 64.", new [] { "Name" }); + } + // Callsign (string) maxLength + if (this.Callsign != null && this.Callsign.Length > 8) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Callsign, length must be less than 8.", new [] { "Callsign" }); + } yield break; } } @@ -5951,7 +6310,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 0.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -6002,8 +6361,8 @@ namespace BreCalClient.misc.Model /// shipId (required). /// type (required). /// eta (required). - /// voyage (required). - /// etd (required). + /// voyage. + /// etd. /// arrivalBerthId. /// departureBerthId. /// tugReguired. @@ -6011,32 +6370,26 @@ namespace BreCalClient.misc.Model /// flags. /// pierSide. /// bunkering. - /// replenishing. + /// replenishingTerminal. + /// replenishingLock. /// draft. /// tidalWindowFrom. /// tidalWindowTo. /// rainSensitiveCargo. /// recommendedTugs. + /// anchored. + /// mooredLock. + /// canceled. /// participants. /// created. /// modified. - public Shipcall(int id = default(int), int shipId = default(int), TypeEnum type = default(TypeEnum), DateTime eta = default(DateTime), string voyage = default(string), DateTime? etd = default(DateTime?), int? arrivalBerthId = default(int?), int? departureBerthId = default(int?), bool? tugReguired = default(bool?), bool? pilotRequired = default(bool?), int? flags = default(int?), bool? pierSide = default(bool?), bool? bunkering = default(bool?), bool? replenishing = default(bool?), float? draft = default(float?), DateTime? tidalWindowFrom = default(DateTime?), DateTime? tidalWindowTo = default(DateTime?), bool? rainSensitiveCargo = default(bool?), int? recommendedTugs = default(int?), List participants = default(List), DateTime created = default(DateTime), DateTime? modified = default(DateTime?)) + public Shipcall(int id = default(int), int shipId = default(int), TypeEnum type = default(TypeEnum), DateTime eta = default(DateTime), string voyage = default(string), DateTime? etd = default(DateTime?), int? arrivalBerthId = default(int?), int? departureBerthId = default(int?), bool? tugReguired = 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?), List participants = default(List), DateTime created = default(DateTime), DateTime? modified = default(DateTime?)) { this.Id = id; this.ShipId = shipId; this.Type = type; this.Eta = eta; - // to ensure "voyage" is required (not null) - if (voyage == null) - { - throw new ArgumentNullException("voyage is a required property for Shipcall and cannot be null"); - } this.Voyage = voyage; - // to ensure "etd" is required (not null) - if (etd == null) - { - throw new ArgumentNullException("etd is a required property for Shipcall and cannot be null"); - } this.Etd = etd; this.ArrivalBerthId = arrivalBerthId; this.DepartureBerthId = departureBerthId; @@ -6045,12 +6398,16 @@ namespace BreCalClient.misc.Model this.Flags = flags; this.PierSide = pierSide; this.Bunkering = bunkering; - this.Replenishing = replenishing; + this.ReplenishingTerminal = replenishingTerminal; + this.ReplenishingLock = replenishingLock; this.Draft = draft; this.TidalWindowFrom = tidalWindowFrom; this.TidalWindowTo = tidalWindowTo; this.RainSensitiveCargo = rainSensitiveCargo; this.RecommendedTugs = recommendedTugs; + this.Anchored = anchored; + this.MooredLock = mooredLock; + this.Canceled = canceled; this.Participants = participants; this.Created = created; this.Modified = modified; @@ -6074,12 +6431,12 @@ namespace BreCalClient.misc.Model /// /// Gets or Sets Voyage /// - [DataMember(Name = "voyage", IsRequired = true, EmitDefaultValue = true)] + [DataMember(Name = "voyage", EmitDefaultValue = true)] public string Voyage { get; set; } /// /// Gets or Sets Etd /// - [DataMember(Name = "etd", IsRequired = true, EmitDefaultValue = true)] + [DataMember(Name = "etd", EmitDefaultValue = true)] public DateTime? Etd { get; set; } /// /// Gets or Sets ArrivalBerthId @@ -6117,10 +6474,15 @@ namespace BreCalClient.misc.Model [DataMember(Name = "bunkering", EmitDefaultValue = true)] public bool? Bunkering { get; set; } /// - /// Gets or Sets Replenishing + /// Gets or Sets ReplenishingTerminal /// - [DataMember(Name = "replenishing", EmitDefaultValue = true)] - public bool? Replenishing { get; set; } + [DataMember(Name = "replenishing_terminal", EmitDefaultValue = true)] + public bool? ReplenishingTerminal { get; set; } + /// + /// Gets or Sets ReplenishingLock + /// + [DataMember(Name = "replenishing_lock", EmitDefaultValue = true)] + public bool? ReplenishingLock { get; set; } /// /// Gets or Sets Draft /// @@ -6147,6 +6509,21 @@ namespace BreCalClient.misc.Model [DataMember(Name = "recommended_tugs", EmitDefaultValue = true)] public int? RecommendedTugs { get; set; } /// + /// Gets or Sets Anchored + /// + [DataMember(Name = "anchored", EmitDefaultValue = true)] + public bool? Anchored { get; set; } + /// + /// Gets or Sets MooredLock + /// + [DataMember(Name = "moored_lock", EmitDefaultValue = true)] + public bool? MooredLock { get; set; } + /// + /// Gets or Sets Canceled + /// + [DataMember(Name = "canceled", EmitDefaultValue = true)] + public bool? Canceled { get; set; } + /// /// Gets or Sets Participants /// [DataMember(Name = "participants", EmitDefaultValue = true)] @@ -6182,12 +6559,16 @@ namespace BreCalClient.misc.Model sb.Append(" Flags: ").Append(Flags).Append("\n"); sb.Append(" PierSide: ").Append(PierSide).Append("\n"); sb.Append(" Bunkering: ").Append(Bunkering).Append("\n"); - sb.Append(" Replenishing: ").Append(Replenishing).Append("\n"); + sb.Append(" ReplenishingTerminal: ").Append(ReplenishingTerminal).Append("\n"); + sb.Append(" ReplenishingLock: ").Append(ReplenishingLock).Append("\n"); sb.Append(" Draft: ").Append(Draft).Append("\n"); sb.Append(" TidalWindowFrom: ").Append(TidalWindowFrom).Append("\n"); sb.Append(" TidalWindowTo: ").Append(TidalWindowTo).Append("\n"); sb.Append(" RainSensitiveCargo: ").Append(RainSensitiveCargo).Append("\n"); sb.Append(" RecommendedTugs: ").Append(RecommendedTugs).Append("\n"); + sb.Append(" Anchored: ").Append(Anchored).Append("\n"); + sb.Append(" MooredLock: ").Append(MooredLock).Append("\n"); + sb.Append(" Canceled: ").Append(Canceled).Append("\n"); sb.Append(" Participants: ").Append(Participants).Append("\n"); sb.Append(" Created: ").Append(Created).Append("\n"); sb.Append(" Modified: ").Append(Modified).Append("\n"); @@ -6286,9 +6667,14 @@ namespace BreCalClient.misc.Model this.Bunkering.Equals(input.Bunkering)) ) && ( - this.Replenishing == input.Replenishing || - (this.Replenishing != null && - this.Replenishing.Equals(input.Replenishing)) + this.ReplenishingTerminal == input.ReplenishingTerminal || + (this.ReplenishingTerminal != null && + this.ReplenishingTerminal.Equals(input.ReplenishingTerminal)) + ) && + ( + this.ReplenishingLock == input.ReplenishingLock || + (this.ReplenishingLock != null && + this.ReplenishingLock.Equals(input.ReplenishingLock)) ) && ( this.Draft == input.Draft || @@ -6315,6 +6701,21 @@ namespace BreCalClient.misc.Model (this.RecommendedTugs != null && this.RecommendedTugs.Equals(input.RecommendedTugs)) ) && + ( + this.Anchored == input.Anchored || + (this.Anchored != null && + this.Anchored.Equals(input.Anchored)) + ) && + ( + this.MooredLock == input.MooredLock || + (this.MooredLock != null && + this.MooredLock.Equals(input.MooredLock)) + ) && + ( + this.Canceled == input.Canceled || + (this.Canceled != null && + this.Canceled.Equals(input.Canceled)) + ) && ( this.Participants == input.Participants || this.Participants != null && @@ -6384,9 +6785,13 @@ namespace BreCalClient.misc.Model { hashCode = (hashCode * 59) + this.Bunkering.GetHashCode(); } - if (this.Replenishing != null) + if (this.ReplenishingTerminal != null) { - hashCode = (hashCode * 59) + this.Replenishing.GetHashCode(); + hashCode = (hashCode * 59) + this.ReplenishingTerminal.GetHashCode(); + } + if (this.ReplenishingLock != null) + { + hashCode = (hashCode * 59) + this.ReplenishingLock.GetHashCode(); } if (this.Draft != null) { @@ -6408,6 +6813,18 @@ namespace BreCalClient.misc.Model { 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.Participants != null) { hashCode = (hashCode * 59) + this.Participants.GetHashCode(); @@ -6430,6 +6847,11 @@ namespace BreCalClient.misc.Model /// Validation Result IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { + // Voyage (string) maxLength + if (this.Voyage != null && this.Voyage.Length > 16) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Voyage, length must be less than 16.", new [] { "Voyage" }); + } yield break; } } @@ -6440,7 +6862,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 0.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -6461,25 +6883,37 @@ namespace BreCalClient.misc.Model /// Initializes a new instance of the class. /// /// id. - /// startPlanned. - /// endPlanned. - /// durationPlanned. - /// startActual. - /// endActual. + /// etaBerth. + /// etaBerthFixed. + /// etdBerth. + /// etdBerthFixed. + /// lockTime. + /// lockTimeFixed. + /// zoneEntry. + /// zoneEntryFixed. + /// operationsStart. + /// operationsEnd. + /// remarks. /// shipcallId (required). /// participantId (required). /// created. /// modified. - public Times(int id = default(int), DateTime startPlanned = default(DateTime), DateTime endPlanned = default(DateTime), int durationPlanned = default(int), DateTime startActual = default(DateTime), DateTime endActual = default(DateTime), int shipcallId = default(int), int participantId = 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), DateTime created = default(DateTime), DateTime? modified = default(DateTime?)) { this.ShipcallId = shipcallId; this.ParticipantId = participantId; this.Id = id; - this.StartPlanned = startPlanned; - this.EndPlanned = endPlanned; - this.DurationPlanned = durationPlanned; - this.StartActual = startActual; - this.EndActual = endActual; + this.EtaBerth = etaBerth; + this.EtaBerthFixed = etaBerthFixed; + this.EtdBerth = etdBerth; + this.EtdBerthFixed = etdBerthFixed; + this.LockTime = lockTime; + this.LockTimeFixed = lockTimeFixed; + this.ZoneEntry = zoneEntry; + this.ZoneEntryFixed = zoneEntryFixed; + this.OperationsStart = operationsStart; + this.OperationsEnd = operationsEnd; + this.Remarks = remarks; this.Created = created; this.Modified = modified; } @@ -6489,30 +6923,60 @@ namespace BreCalClient.misc.Model [DataMember(Name = "id", EmitDefaultValue = true)] public int Id { get; set; } /// - /// Gets or Sets StartPlanned + /// Gets or Sets EtaBerth /// - [DataMember(Name = "start_planned", EmitDefaultValue = true)] - public DateTime StartPlanned { get; set; } + [DataMember(Name = "eta_berth", EmitDefaultValue = true)] + public DateTime? EtaBerth { get; set; } /// - /// Gets or Sets EndPlanned + /// Gets or Sets EtaBerthFixed /// - [DataMember(Name = "end_planned", EmitDefaultValue = true)] - public DateTime EndPlanned { get; set; } + [DataMember(Name = "eta_berth_fixed", EmitDefaultValue = true)] + public bool? EtaBerthFixed { get; set; } /// - /// Gets or Sets DurationPlanned + /// Gets or Sets EtdBerth /// - [DataMember(Name = "duration_planned", EmitDefaultValue = true)] - public int DurationPlanned { get; set; } + [DataMember(Name = "etd_berth", EmitDefaultValue = true)] + public DateTime? EtdBerth { get; set; } /// - /// Gets or Sets StartActual + /// Gets or Sets EtdBerthFixed /// - [DataMember(Name = "start_actual", EmitDefaultValue = true)] - public DateTime StartActual { get; set; } + [DataMember(Name = "etd_berth_fixed", EmitDefaultValue = true)] + public bool? EtdBerthFixed { get; set; } /// - /// Gets or Sets EndActual + /// Gets or Sets LockTime /// - [DataMember(Name = "end_actual", EmitDefaultValue = true)] - public DateTime EndActual { get; set; } + [DataMember(Name = "lock_time", EmitDefaultValue = true)] + public DateTime? LockTime { get; set; } + /// + /// Gets or Sets LockTimeFixed + /// + [DataMember(Name = "lock_time_fixed", EmitDefaultValue = true)] + public bool? LockTimeFixed { get; set; } + /// + /// Gets or Sets ZoneEntry + /// + [DataMember(Name = "zone_entry", EmitDefaultValue = true)] + public DateTime? ZoneEntry { get; set; } + /// + /// Gets or Sets ZoneEntryFixed + /// + [DataMember(Name = "zone_entry_fixed", EmitDefaultValue = true)] + public bool? ZoneEntryFixed { get; set; } + /// + /// Gets or Sets OperationsStart + /// + [DataMember(Name = "operations_start", EmitDefaultValue = true)] + public DateTime? OperationsStart { get; set; } + /// + /// Gets or Sets OperationsEnd + /// + [DataMember(Name = "operations_end", EmitDefaultValue = true)] + public DateTime? OperationsEnd { get; set; } + /// + /// Gets or Sets Remarks + /// + [DataMember(Name = "remarks", EmitDefaultValue = true)] + public string Remarks { get; set; } /// /// Gets or Sets ShipcallId /// @@ -6542,11 +7006,17 @@ namespace BreCalClient.misc.Model StringBuilder sb = new StringBuilder(); sb.Append("class Times {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" StartPlanned: ").Append(StartPlanned).Append("\n"); - sb.Append(" EndPlanned: ").Append(EndPlanned).Append("\n"); - sb.Append(" DurationPlanned: ").Append(DurationPlanned).Append("\n"); - sb.Append(" StartActual: ").Append(StartActual).Append("\n"); - sb.Append(" EndActual: ").Append(EndActual).Append("\n"); + sb.Append(" EtaBerth: ").Append(EtaBerth).Append("\n"); + sb.Append(" EtaBerthFixed: ").Append(EtaBerthFixed).Append("\n"); + sb.Append(" EtdBerth: ").Append(EtdBerth).Append("\n"); + sb.Append(" EtdBerthFixed: ").Append(EtdBerthFixed).Append("\n"); + sb.Append(" LockTime: ").Append(LockTime).Append("\n"); + sb.Append(" LockTimeFixed: ").Append(LockTimeFixed).Append("\n"); + sb.Append(" ZoneEntry: ").Append(ZoneEntry).Append("\n"); + sb.Append(" ZoneEntryFixed: ").Append(ZoneEntryFixed).Append("\n"); + sb.Append(" OperationsStart: ").Append(OperationsStart).Append("\n"); + sb.Append(" OperationsEnd: ").Append(OperationsEnd).Append("\n"); + sb.Append(" Remarks: ").Append(Remarks).Append("\n"); sb.Append(" ShipcallId: ").Append(ShipcallId).Append("\n"); sb.Append(" ParticipantId: ").Append(ParticipantId).Append("\n"); sb.Append(" Created: ").Append(Created).Append("\n"); @@ -6588,28 +7058,59 @@ namespace BreCalClient.misc.Model this.Id.Equals(input.Id) ) && ( - this.StartPlanned == input.StartPlanned || - (this.StartPlanned != null && - this.StartPlanned.Equals(input.StartPlanned)) + this.EtaBerth == input.EtaBerth || + (this.EtaBerth != null && + this.EtaBerth.Equals(input.EtaBerth)) ) && ( - this.EndPlanned == input.EndPlanned || - (this.EndPlanned != null && - this.EndPlanned.Equals(input.EndPlanned)) + this.EtaBerthFixed == input.EtaBerthFixed || + (this.EtaBerthFixed != null && + this.EtaBerthFixed.Equals(input.EtaBerthFixed)) ) && ( - this.DurationPlanned == input.DurationPlanned || - this.DurationPlanned.Equals(input.DurationPlanned) + this.EtdBerth == input.EtdBerth || + (this.EtdBerth != null && + this.EtdBerth.Equals(input.EtdBerth)) ) && ( - this.StartActual == input.StartActual || - (this.StartActual != null && - this.StartActual.Equals(input.StartActual)) + this.EtdBerthFixed == input.EtdBerthFixed || + (this.EtdBerthFixed != null && + this.EtdBerthFixed.Equals(input.EtdBerthFixed)) ) && ( - this.EndActual == input.EndActual || - (this.EndActual != null && - this.EndActual.Equals(input.EndActual)) + this.LockTime == input.LockTime || + (this.LockTime != null && + this.LockTime.Equals(input.LockTime)) + ) && + ( + this.LockTimeFixed == 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 != 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 || @@ -6640,22 +7141,49 @@ namespace BreCalClient.misc.Model { int hashCode = 41; hashCode = (hashCode * 59) + this.Id.GetHashCode(); - if (this.StartPlanned != null) + if (this.EtaBerth != null) { - hashCode = (hashCode * 59) + this.StartPlanned.GetHashCode(); + hashCode = (hashCode * 59) + this.EtaBerth.GetHashCode(); } - if (this.EndPlanned != null) + if (this.EtaBerthFixed != null) { - hashCode = (hashCode * 59) + this.EndPlanned.GetHashCode(); + hashCode = (hashCode * 59) + this.EtaBerthFixed.GetHashCode(); } - hashCode = (hashCode * 59) + this.DurationPlanned.GetHashCode(); - if (this.StartActual != null) + if (this.EtdBerth != null) { - hashCode = (hashCode * 59) + this.StartActual.GetHashCode(); + hashCode = (hashCode * 59) + this.EtdBerth.GetHashCode(); } - if (this.EndActual != null) + if (this.EtdBerthFixed != null) { - hashCode = (hashCode * 59) + this.EndActual.GetHashCode(); + hashCode = (hashCode * 59) + this.EtdBerthFixed.GetHashCode(); + } + if (this.LockTime != null) + { + hashCode = (hashCode * 59) + this.LockTime.GetHashCode(); + } + if (this.LockTimeFixed != null) + { + hashCode = (hashCode * 59) + this.LockTimeFixed.GetHashCode(); + } + if (this.ZoneEntry != null) + { + hashCode = (hashCode * 59) + this.ZoneEntry.GetHashCode(); + } + if (this.ZoneEntryFixed != null) + { + hashCode = (hashCode * 59) + this.ZoneEntryFixed.GetHashCode(); + } + if (this.OperationsStart != null) + { + hashCode = (hashCode * 59) + this.OperationsStart.GetHashCode(); + } + if (this.OperationsEnd != null) + { + hashCode = (hashCode * 59) + this.OperationsEnd.GetHashCode(); + } + if (this.Remarks != null) + { + hashCode = (hashCode * 59) + this.Remarks.GetHashCode(); } hashCode = (hashCode * 59) + this.ShipcallId.GetHashCode(); hashCode = (hashCode * 59) + this.ParticipantId.GetHashCode(); @@ -6676,6 +7204,197 @@ namespace BreCalClient.misc.Model /// Validation context /// Validation Result IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Remarks (string) maxLength + if (this.Remarks != null && this.Remarks.Length > 512) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Remarks, length must be less than 512.", new [] { "Remarks" }); + } + yield break; + } + } +} + +/* + * Bremen calling API + * + * Administer DEBRE ship calls, times and notifications + * + * The version of the OpenAPI document: 0.3.0 + * Contact: info@textbausteine.net + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +namespace BreCalClient.misc.Model +{ + /// + /// fields that a user may change + /// + [DataContract(Name = "user_details")] + public partial class UserDetails : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// id. + /// oldPassword. + /// newPassword. + /// firstName. + /// lastName. + /// userPhone. + public UserDetails(int id = default(int), string oldPassword = default(string), string newPassword = default(string), string firstName = default(string), string lastName = default(string), string userPhone = default(string)) + { + this.Id = id; + this.OldPassword = oldPassword; + this.NewPassword = newPassword; + this.FirstName = firstName; + this.LastName = lastName; + this.UserPhone = userPhone; + } + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = true)] + public int Id { get; set; } + /// + /// Gets or Sets OldPassword + /// + [DataMember(Name = "old_password", EmitDefaultValue = true)] + public string OldPassword { get; set; } + /// + /// Gets or Sets NewPassword + /// + [DataMember(Name = "new_password", EmitDefaultValue = true)] + public string NewPassword { get; set; } + /// + /// Gets or Sets FirstName + /// + [DataMember(Name = "first_name", EmitDefaultValue = true)] + public string FirstName { get; set; } + /// + /// Gets or Sets LastName + /// + [DataMember(Name = "last_name", EmitDefaultValue = true)] + public string LastName { get; set; } + /// + /// Gets or Sets UserPhone + /// + [DataMember(Name = "user_phone", EmitDefaultValue = true)] + public string UserPhone { get; set; } + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class UserDetails {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" OldPassword: ").Append(OldPassword).Append("\n"); + sb.Append(" NewPassword: ").Append(NewPassword).Append("\n"); + sb.Append(" FirstName: ").Append(FirstName).Append("\n"); + sb.Append(" LastName: ").Append(LastName).Append("\n"); + sb.Append(" UserPhone: ").Append(UserPhone).Append("\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 UserDetails); + } + /// + /// Returns true if UserDetails instances are equal + /// + /// Instance of UserDetails to be compared + /// Boolean + public bool Equals(UserDetails input) + { + if (input == null) + { + return false; + } + 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)) + ); + } + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + if (this.OldPassword != null) + { + hashCode = (hashCode * 59) + this.OldPassword.GetHashCode(); + } + if (this.NewPassword != null) + { + hashCode = (hashCode * 59) + this.NewPassword.GetHashCode(); + } + if (this.FirstName != null) + { + hashCode = (hashCode * 59) + this.FirstName.GetHashCode(); + } + if (this.LastName != null) + { + hashCode = (hashCode * 59) + this.LastName.GetHashCode(); + } + if (this.UserPhone != null) + { + hashCode = (hashCode * 59) + this.UserPhone.GetHashCode(); + } + return hashCode; + } + } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/misc/BreCalApi.yaml b/misc/BreCalApi.yaml index 1a57832..0fa15ff 100644 --- a/misc/BreCalApi.yaml +++ b/misc/BreCalApi.yaml @@ -1,611 +1,732 @@ -openapi: '3.0.0' +openapi: "3.0.0" info: - version: '0.2.0' - title: 'Bremen calling API' - description: Administer DEBRE ship calls, times and notifications - termsOfService: "https://www.bsmd.de/" # url to terms page - contact: - name: "Bremen calling API" - url: "https://www.textbausteine.net" - email: "info@textbausteine.net" - license: - name: "Use at your own risk" - url: "https://www.bsmd.de/license" + version: "0.3.0" + title: "Bremen calling API" + description: Administer DEBRE ship calls, times and notifications + termsOfService: "https://www.bsmd.de/" # url to terms page + contact: + name: "Bremen calling API" + url: "https://www.textbausteine.net" + email: "info@textbausteine.net" + license: + name: "Use at your own risk" + url: "https://www.bsmd.de/license" servers: - # tutorial: https://idratherbewriting.com/learnapidoc/pubapis_openapi_step3_servers_object.html - - url : "https://brecal.bsmd-emswe.eu/" - description: "Test server hosted on vcup" + # tutorial: https://idratherbewriting.com/learnapidoc/pubapis_openapi_step3_servers_object.html + - url: "https://brecal.bsmd-emswe.eu/" + description: "Test server hosted on vcup" paths: - # tutorial: https://idratherbewriting.com/learnapidoc/pubapis_openapi_step4_paths_object.html - /login: - post: - summary: Returns a JWT session token and user data if successful - requestBody: - description: Login credentials - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/credentials' - responses: - 200: - description: Successful response - content: - application/json: - schema: - $ref: '#/components/schemas/login_result' - 400: - $ref: '#/components/responses/400' - 403: - $ref: '#/components/responses/403' - 500: - $ref: '#/components/responses/500' - 503: - $ref: '#/components/responses/503' + # tutorial: https://idratherbewriting.com/learnapidoc/pubapis_openapi_step4_paths_object.html + /login: + post: + summary: Returns a JWT session token and user data if successful + requestBody: + description: Login credentials + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/credentials" + responses: + 200: + description: Successful response + content: + application/json: + schema: + $ref: "#/components/schemas/login_result" + 400: + $ref: "#/components/responses/400" + 403: + $ref: "#/components/responses/403" + 500: + $ref: "#/components/responses/500" + 503: + $ref: "#/components/responses/503" - /shipcalls: - get: - summary: Gets a list of ship calls - #parameters: - # - name: participant_id - # in: query - # required: true - # description: "**Id of participant**. *Example: 2*. Id of participant entity requesting ship calls" - # schema: - # type: integer - responses: - 200: - description: ship call list - content: - application/json: - schema: - $ref: '#/components/schemas/shipcalls' - 400: - $ref: '#/components/responses/400' - 401: - $ref: '#/components/responses/401' - 500: - $ref: '#/components/responses/500' - 503: - $ref: '#/components/responses/503' - post: - summary: Create a new ship call - requestBody: - description: Creates a new ship call. **Do not** provide id parameter. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/shipcall' - responses: - 400: - $ref: '#/components/responses/400' - 401: - $ref: '#/components/responses/401' - 500: - $ref: '#/components/responses/500' - 503: - $ref: '#/components/responses/503' + /user: + put: + summary: Update user details (first/last name, phone, password) + requestBody: + description: User details + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/user_details" + responses: + 400: + $ref: "#/components/responses/400" + 401: + $ref: "#/components/responses/401" + 500: + $ref: "#/components/responses/500" + 503: + $ref: "#/components/responses/503" - put: - summary: Updates a ship call - requestBody: - description: Creates a new ship call. The id parameter is **required**. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/shipcall' - responses: - 400: - $ref: '#/components/responses/400' - 401: - $ref: '#/components/responses/401' - 500: - $ref: '#/components/responses/500' - 503: - $ref: '#/components/responses/503' + /shipcalls: + get: + summary: Gets a list of ship calls + #parameters: + # - name: participant_id + # in: query + # required: true + # description: "**Id of participant**. *Example: 2*. Id of participant entity requesting ship calls" + # schema: + # type: integer + responses: + 200: + description: ship call list + content: + application/json: + schema: + $ref: "#/components/schemas/shipcalls" + 400: + $ref: "#/components/responses/400" + 401: + $ref: "#/components/responses/401" + 500: + $ref: "#/components/responses/500" + 503: + $ref: "#/components/responses/503" + post: + summary: Create a new ship call + requestBody: + description: Creates a new ship call. **Do not** provide id parameter. + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/shipcall" + responses: + 400: + $ref: "#/components/responses/400" + 401: + $ref: "#/components/responses/401" + 500: + $ref: "#/components/responses/500" + 503: + $ref: "#/components/responses/503" - /ships: - get: - summary: gets a list of registered shipcalls - responses: - 200: - description: list of ships - content: - application/json: - schema: - $ref: '#/components/schemas/ship_list' - 400: - $ref: '#/components/responses/400' - 401: - $ref: '#/components/responses/401' - 500: - $ref: '#/components/responses/500' - 503: - $ref: '#/components/responses/503' + put: + summary: Updates a ship call + requestBody: + description: Creates a new ship call. The id parameter is **required**. + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/shipcall" + responses: + 400: + $ref: "#/components/responses/400" + 401: + $ref: "#/components/responses/401" + 500: + $ref: "#/components/responses/500" + 503: + $ref: "#/components/responses/503" - /participants: - get: - summary: gets a particular participant entry corresponding to user id - parameters: - - name: user_id - in: query - required: false - description: "**Id of user**. *Example: 2*. User id returned by verify call." - schema: - type: integer - responses: - 200: - description: ship call list - content: - application/json: - schema: - $ref: '#/components/schemas/participant_list' - 400: - $ref: '#/components/responses/400' - 404: - $ref: '#/components/responses/404' - 401: - $ref: '#/components/responses/401' - 500: - $ref: '#/components/responses/500' - 503: - $ref: '#/components/responses/503' + /ships: + get: + summary: gets a list of registered shipcalls + responses: + 200: + description: list of ships + content: + application/json: + schema: + $ref: "#/components/schemas/ship_list" + 400: + $ref: "#/components/responses/400" + 401: + $ref: "#/components/responses/401" + 500: + $ref: "#/components/responses/500" + 503: + $ref: "#/components/responses/503" - /times: - get: - summary: Get all recorded times for a a ship call - parameters: - - name: shipcall_id - in: query - description: "**Id**. *Example: 42*. Id of referenced ship call." - schema: - type: integer - responses: - 200: - description: list of recorded times - content: - application/json: - schema: - $ref: '#/components/schemas/times_list' - 400: - $ref: '#/components/responses/400' - 401: - $ref: '#/components/responses/401' - 500: - $ref: '#/components/responses/500' - 503: - $ref: '#/components/responses/503' + /participants: + get: + summary: gets a particular participant entry corresponding to user id + parameters: + - name: user_id + in: query + required: false + description: "**Id of user**. *Example: 2*. User id returned by verify call." + schema: + type: integer + responses: + 200: + description: ship call list + content: + application/json: + schema: + $ref: "#/components/schemas/participant_list" + 400: + $ref: "#/components/responses/400" + 404: + $ref: "#/components/responses/404" + 401: + $ref: "#/components/responses/401" + 500: + $ref: "#/components/responses/500" + 503: + $ref: "#/components/responses/503" - post: - summary: Create a new times entry for a ship call - requestBody: - description: Times entry that will be added to the ship call. **Do not** provide id parameter. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/times' - responses: - 400: - $ref: '#/components/responses/400' - 401: - $ref: '#/components/responses/401' - 500: - $ref: '#/components/responses/500' - 503: - $ref: '#/components/responses/503' + /times: + get: + summary: Get all recorded times for a a ship call + parameters: + - name: shipcall_id + in: query + description: "**Id**. *Example: 42*. Id of referenced ship call." + schema: + type: integer + responses: + 200: + description: list of recorded times + content: + application/json: + schema: + $ref: "#/components/schemas/times_list" + 400: + $ref: "#/components/responses/400" + 401: + $ref: "#/components/responses/401" + 500: + $ref: "#/components/responses/500" + 503: + $ref: "#/components/responses/503" - put: - summary: Update a times entry for a ship call - requestBody: - description: Times entry that will be added to the ship call. The id parameter is **required**. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/times' - responses: - 400: - $ref: '#/components/responses/400' - 401: - $ref: '#/components/responses/401' - 500: - $ref: '#/components/responses/500' - 503: - $ref: '#/components/responses/503' + post: + summary: Create a new times entry for a ship call + requestBody: + description: Times entry that will be added to the ship call. **Do not** provide id parameter. + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/times" + responses: + 400: + $ref: "#/components/responses/400" + 401: + $ref: "#/components/responses/401" + 500: + $ref: "#/components/responses/500" + 503: + $ref: "#/components/responses/503" - delete: - summary: Delete a times entry for a ship call. - parameters: - - name: id - in: query - required: true - schema: - $ref: '#/components/schemas/timesId' - responses: - 400: - $ref: '#/components/responses/400' - 401: - $ref: '#/components/responses/401' - 500: - $ref: '#/components/responses/500' - 503: - $ref: '#/components/responses/503' + put: + summary: Update a times entry for a ship call + requestBody: + description: Times entry that will be added to the ship call. The id parameter is **required**. + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/times" + responses: + 400: + $ref: "#/components/responses/400" + 401: + $ref: "#/components/responses/401" + 500: + $ref: "#/components/responses/500" + 503: + $ref: "#/components/responses/503" - /notifications: - get: - summary: Gets a list of notifications pursuant to a specified participant and ship call - parameters: - - name: participant_id - in: query - required: true - description: "**Id of participant**. *Example: 2*. Id returned through loading of participant" - schema: - type: integer - - name: shipcall_id - in: query - required: true - description: "**Id of ship call**. *Example: 52*. Id given in ship call list" - schema: - $ref: '#/components/schemas/shipcallId' - responses: - 200: - description: notification list - content: - application/json: - schema: - $ref: '#/components/schemas/notification' - 400: - $ref: '#/components/responses/400' - 401: - $ref: '#/components/responses/401' - 500: - $ref: '#/components/responses/500' - 503: - $ref: '#/components/responses/503' - /berths: - get: - summary: Gets a list of all berths registered - responses: - 200: - description: list of berths - content: - application/json: - schema: - $ref: '#/components/schemas/berth_list' - 400: - $ref: '#/components/responses/400' - 401: - $ref: '#/components/responses/401' - 500: - $ref: '#/components/responses/500' - 503: - $ref: '#/components/responses/503' + delete: + summary: Delete a times entry for a ship call. + parameters: + - name: id + in: query + required: true + schema: + $ref: "#/components/schemas/timesId" + responses: + 400: + $ref: "#/components/responses/400" + 401: + $ref: "#/components/responses/401" + 500: + $ref: "#/components/responses/500" + 503: + $ref: "#/components/responses/503" + + /notifications: + get: + summary: Gets a list of notifications pursuant to a specified participant and ship call + parameters: + - name: participant_id + in: query + required: true + description: "**Id of participant**. *Example: 2*. Id returned through loading of participant" + schema: + type: integer + - name: shipcall_id + in: query + required: true + description: "**Id of ship call**. *Example: 52*. Id given in ship call list" + schema: + $ref: "#/components/schemas/shipcallId" + responses: + 200: + description: notification list + content: + application/json: + schema: + $ref: "#/components/schemas/notification" + 400: + $ref: "#/components/responses/400" + 401: + $ref: "#/components/responses/401" + 500: + $ref: "#/components/responses/500" + 503: + $ref: "#/components/responses/503" + /berths: + get: + summary: Gets a list of all berths registered + responses: + 200: + description: list of berths + content: + application/json: + schema: + $ref: "#/components/schemas/berth_list" + 400: + $ref: "#/components/responses/400" + 401: + $ref: "#/components/responses/401" + 500: + $ref: "#/components/responses/500" + 503: + $ref: "#/components/responses/503" components: - schemas: - credentials: - type: object - required: - - username - - password - properties: - username: - format : string - password: - format : string - timesId: - description: The unique identifier for a times entry - type: integer - shipcallId: - description: The unique identifier of a ship call - type: integer - shipcall: - type: object - required: - - id - - ship_id - - type - - eta - - voyage - - etd - properties: - id: - $ref: '#/components/schemas/shipcallId' - ship_id: - type: integer - type: - type: string - enum: - - incoming - - outgoing - - shifting - eta: - type: string - format: date-time - voyage: - type: string - nullable: true - etd: - type: string - format: date-time - nullable: true - arrival_berth_id: - type: integer - nullable: true - departure_berth_id: - type: integer - nullable: true - tug_reguired: - type: boolean - nullable: true - pilot_required: - type: boolean - nullable: true - flags: - type: integer - nullable: true - pier_side: - type: boolean - nullable: true - bunkering: - type: boolean - nullable: true - replenishing: - type: boolean - nullable: true - draft: - type: number - format: float - nullable: true - tidal_window_from: - type: string - format: date-time - nullable: true - tidal_window_to: - type: string - format: date-time - nullable: true - rain_sensitive_cargo: - type: boolean - nullable: true - recommended_tugs: - type: integer - nullable: true - participants: - type: array - items: + schemas: + credentials: + type: object + required: + - username + - password + properties: + username: + type: string + password: + type: string + format: password + timesId: + description: The unique identifier for a times entry type: integer - example: [1, 5, 7] - created: - type: string - format: date-time - modified: - type: string - format: date-time - nullable: true + shipcallId: + description: The unique identifier of a ship call + type: integer + shipcall: + type: object + required: + - id + - ship_id + - type + - eta + properties: + id: + $ref: "#/components/schemas/shipcallId" + ship_id: + type: integer + type: + type: string + enum: + - incoming + - outgoing + - shifting + eta: + type: string + format: date-time + voyage: + type: string + maxLength: 16 + nullable: true + etd: + type: string + format: date-time + nullable: true + arrival_berth_id: + type: integer + nullable: true + departure_berth_id: + type: integer + nullable: true + tug_reguired: + type: boolean + nullable: true + pilot_required: + type: boolean + nullable: true + flags: + type: integer + nullable: true + pier_side: + type: boolean + nullable: true + bunkering: + type: boolean + nullable: true + replenishing_terminal: + type: boolean + nullable: true + replenishing_lock: + type: boolean + nullable: true + draft: + type: number + format: float + nullable: true + tidal_window_from: + type: string + format: date-time + nullable: true + tidal_window_to: + type: string + format: date-time + nullable: true + rain_sensitive_cargo: + type: boolean + nullable: true + recommended_tugs: + type: integer + nullable: true + anchored: + type: boolean + nullable: true + moored_lock: + type: boolean + nullable: true + canceled: + type: boolean + nullable: true + participants: + type: array + items: + type: integer + example: [1, 5, 7] + created: + type: string + format: date-time + modified: + type: string + format: date-time + nullable: true - shipcalls: - type: array - items: - $ref: '#/components/schemas/shipcall' + shipcalls: + type: array + items: + $ref: "#/components/schemas/shipcall" - 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 - start_planned: - type: string - format: date-time - end_planned: - type: string - format: date-time - duration_planned: - type: integer - start_actual: - type: string - format: date-time - end_actual: - type: string - format: date-time - shipcall_id: - type: integer - participant_id: - type: integer - created: - type: string - format: date-time - modified: - type: string - format: date-time - nullable: true + 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 + eta_berth: + type: string + format: date-time + nullable: true + eta_berth_fixed: + type: boolean + nullable: true + etd_berth: + type: string + format: date-time + nullable: true + etd_berth_fixed: + type: boolean + nullable: true + lock_time: + type: string + format: date-time + nullable: true + lock_time_fixed: + type: boolean + nullable: true + zone_entry: + type: string + format: date-time + nullable: true + zone_entry_fixed: + type: boolean + nullable: true + operations_start: + type: string + format: date-time + nullable: true + operations_end: + type: string + format: date-time + nullable: true + remarks: + type: string + maxLength: 512 + nullable: true + shipcall_id: + type: integer + participant_id: + type: integer + created: + type: string + format: date-time + modified: + type: string + format: date-time + nullable: true - times_list: - type: array - items: - $ref: '#/components/schemas/times' + times_list: + type: array + items: + $ref: "#/components/schemas/times" - berth: - type: object - description: Ship berth used for a ship call - properties: - id: - type: integer - name1: - type: string - name2: - type: string + berth: + type: object + description: Ship berth used for a ship call + properties: + id: + type: integer + name: + type: string + maxLength: 128 + participant_id: + type: integer + nullable: true + lock: + type: boolean + nullable: true + created: + type: string + format: date-time + modified: + type: string + format: date-time + nullable: true + deleted: + type: boolean + default: false - berth_list: - type: array - items: - $ref: '#/components/schemas/berth' + berth_list: + type: array + items: + $ref: "#/components/schemas/berth" - ship: - type: object - description: a ship - properties: - id: - type: integer - name: - type: string - imo: - type: integer - callsign: - type: string - participant_id: - type: integer - length: - type: number - format: float - width: - type: number - format: float - created: - type: string - format: date-time - modified: - type: string - format: date-time - nullable: true + ship: + type: object + description: a ship + properties: + id: + type: integer + name: + type: string + maxLength: 64 + imo: + type: integer + nullable: true + callsign: + type: string + maxLength: 8 + nullable: true + participant_id: + type: integer + nullable: true + length: + type: number + format: float + nullable: true + width: + type: number + format: float + nullable: true + is_tug: + type: boolean + default: false + bollard_pull: + type: integer + nullable: true + eni: + type: integer + nullable: true + created: + type: string + format: date-time + modified: + type: string + format: date-time + nullable: true + deleted: + type: boolean + default: false - ship_list: - type: array - items: - $ref: '#/components/schemas/ship' + ship_list: + type: array + items: + $ref: "#/components/schemas/ship" - notification: - type: object - description: a notification created by the engine if a times entry violates a rule - properties: - id: - type: integer - times_id: - type: integer - participant_id: - type: integer - notification_type: - type: string - enum: [undefined, email, push] - timestamp: - type: string - format: date-time - acknowledged: - type: boolean - created: - type: string - format: date-time - modified: - type: string - format: date-time - nullable: true + notification: + type: object + description: a notification created by the engine if a times entry violates a rule + properties: + id: + type: integer + times_id: + type: integer + participant_id: + type: integer + notification_type: + type: string + enum: [undefined, email, push] + timestamp: + type: string + format: date-time + acknowledged: + type: boolean + created: + type: string + format: date-time + modified: + type: string + format: date-time + nullable: true - notification_list: - type: array - items: - $ref: '#/components/schemas/notification' + notification_list: + type: array + items: + $ref: "#/components/schemas/notification" - participant: - type: object - description: A organisational entity that participates in Bremen Calling - properties: - id: - type: integer - name: - type: string - street: - type: string - postal code: - type: string - city: - type: string - type: - type: integer - created: - type: string - format: date-time - modified: - type: string - format: date-time - nullable: true + participant: + type: object + description: A organisational entity that participates in Bremen Calling + properties: + id: + type: integer + name: + type: string + maxLength: 128 + street: + type: string + maxLength: 128 + postal code: + type: string + maxLength: 5 + city: + type: string + maxLength: 64 + type: + type: integer + created: + type: string + format: date-time + modified: + type: string + format: date-time + nullable: true + deleted: + type: boolean + default: false - participant_list: - type: array - items: - $ref: '#/components/schemas/participant' + participant_list: + type: array + items: + $ref: "#/components/schemas/participant" - login_result: - type: object - description: result structure of a successful login attempt - properties: - id: - type: integer - participant_id: - type: integer - first_name: - type: string - last_name: - type: string - user_name: - type: string - user_phone: - type: string - exp: - type: number - format: float - token: - type: string + login_result: + type: object + description: result structure of a successful login attempt + properties: + id: + type: integer + participant_id: + type: integer + first_name: + type: string + last_name: + type: string + user_name: + type: string + user_phone: + type: string + exp: + type: number + format: float + token: + type: string - Error: - type: object - required: - - message - properties: - message: - description: A human readable error message - type: string + user_details: + type: object + description: fields that a user may change + properties: + id: + type: integer + old_password: + type: string + nullable: true + new_password: + type: string + nullable: true + first_name: + type: string + nullable: true + last_name: + type: string + nullable: true + user_phone: + type: string + nullable: true - securitySchemes: - ApiKey: - type: apiKey - in: header - name: Authorization - responses: - 400: - description: Invalid input - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - 401: - description: Not authorized - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - 500: - description: Unexpected error - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - 503: - description: Not available - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + Error: + type: object + required: + - message + properties: + message: + description: A human readable error message + type: string + + securitySchemes: + ApiKey: + type: apiKey + in: header + name: Authorization + responses: + 400: + description: Invalid input + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + 401: + description: Not authorized + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + 500: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + 503: + description: Not available + content: + application/json: + schema: + $ref: "#/components/schemas/Error" security: - - ApiKey: [] + - ApiKey: [] externalDocs: - url: http://textbausteine.net/ - description: Extra documentation and conditions for Bremen Calling + url: http://textbausteine.net/ + description: Extra documentation and conditions for Bremen Calling diff --git a/misc/create_schema.sql b/misc/create_schema.sql index 46c31d2..5fd7f9a 100644 --- a/misc/create_schema.sql +++ b/misc/create_schema.sql @@ -1,24 +1,232 @@ -CREATE DATABASE `bremen_calling` /*!40100 DEFAULT CHARACTER SET utf8mb4 */; +-- -------------------------------------------------------- +-- Host: 127.0.0.1 +-- Server Version: 8.0.34-0ubuntu0.22.04.1 - (Ubuntu) +-- Server Betriebssystem: Linux +-- HeidiSQL Version: 10.2.0.5599 +-- -------------------------------------------------------- -USE `bremen_calling` +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET NAMES utf8 */; +/*!50503 SET NAMES utf8mb4 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -CREATE TABLE `participant` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, +-- Exportiere Struktur von Tabelle bremen_calling.berth +CREATE TABLE IF NOT EXISTS `berth` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(128) DEFAULT NULL COMMENT 'Descriptive name', + `participant_id` int unsigned DEFAULT NULL COMMENT 'If berth belongs to a participant, reference it here', + `lock` bit(1) DEFAULT NULL COMMENT 'The lock must be used', + `created` datetime DEFAULT CURRENT_TIMESTAMP, + `modified` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, + `deleted` bit(1) DEFAULT b'0', + PRIMARY KEY (`id`), + KEY `FK_BERTH_PART` (`participant_id`), + CONSTRAINT `FK_BERTH_PART` FOREIGN KEY (`participant_id`) REFERENCES `participant` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='Berth of ship for a ship call'; + +-- Daten Export vom Benutzer nicht ausgewählt + +-- Exportiere Struktur von Tabelle bremen_calling.notification +CREATE TABLE IF NOT EXISTS `notification` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `times_id` int unsigned NOT NULL COMMENT 'times record that caused the notification', + `participant_id` int unsigned NOT NULL COMMENT 'participant ref', + `acknowledged` bit(1) DEFAULT b'0' COMMENT 'true if UI acknowledged', + `level` tinyint DEFAULT NULL COMMENT 'severity of the notification', + `type` tinyint DEFAULT NULL COMMENT 'Email/UI/Other', + `message` varchar(256) DEFAULT NULL COMMENT 'individual message', + `created` datetime DEFAULT CURRENT_TIMESTAMP, + `modified` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + KEY `FK_NOT_TIMES` (`times_id`), + KEY `FK_NOT_PART` (`participant_id`), + CONSTRAINT `FK_NOT_PART` FOREIGN KEY (`participant_id`) REFERENCES `participant` (`id`), + CONSTRAINT `FK_NOT_TIMES` FOREIGN KEY (`times_id`) REFERENCES `times` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='An entry corresponds to an alarm given by a violated rule during times update'; + +-- Daten Export vom Benutzer nicht ausgewählt + +-- Exportiere Struktur von Tabelle bremen_calling.participant +CREATE TABLE IF NOT EXISTS `participant` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, `name` varchar(128) DEFAULT NULL, `street` varchar(128) DEFAULT NULL, `postal_code` varchar(5) DEFAULT NULL, `city` varchar(64) DEFAULT NULL, - `type` int(10) DEFAULT NULL, - `flags` int(10) unsigned DEFAULT NULL, - `created` DATETIME NULL DEFAULT current_timestamp(), - `modified` DATETIME NULL DEFAULT NULL ON UPDATE current_timestamp(), + `type` int DEFAULT NULL, + `flags` int unsigned DEFAULT NULL, + `created` datetime DEFAULT CURRENT_TIMESTAMP, + `modified` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, + `deleted` bit(1) DEFAULT b'0', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='An organization taking part'; +) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='An organization taking part'; +-- Daten Export vom Benutzer nicht ausgewählt -CREATE TABLE `user` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `participant_id` int(11) UNSIGNED DEFAULT NULL, +-- Exportiere Struktur von Tabelle bremen_calling.role +CREATE TABLE IF NOT EXISTS `role` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(50) NOT NULL DEFAULT '0' COMMENT 'unique role name', + `description` varchar(255) DEFAULT '0' COMMENT 'role description', + `created` datetime DEFAULT CURRENT_TIMESTAMP, + `modified` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `name` (`name`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='logical group of securables for one or more user'; + +-- Daten Export vom Benutzer nicht ausgewählt + +-- Exportiere Struktur von Tabelle bremen_calling.role_securable_map +CREATE TABLE IF NOT EXISTS `role_securable_map` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `role_id` int unsigned NOT NULL, + `securable_id` int unsigned NOT NULL, + `created` datetime DEFAULT CURRENT_TIMESTAMP, + `modified` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + KEY `FK_ROLE_SECURABLE` (`role_id`), + KEY `FK_SECURABLE_ROLE` (`securable_id`), + CONSTRAINT `FK_ROLE_SECURABLE` FOREIGN KEY (`role_id`) REFERENCES `role` (`id`), + CONSTRAINT `FK_SECURABLE_ROLE` FOREIGN KEY (`securable_id`) REFERENCES `securable` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='Assigns securables to roles'; + +-- Daten Export vom Benutzer nicht ausgewählt + +-- Exportiere Struktur von Tabelle bremen_calling.securable +CREATE TABLE IF NOT EXISTS `securable` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(50) NOT NULL DEFAULT '', + `created` datetime DEFAULT CURRENT_TIMESTAMP, + `modified` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `name` (`name`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='Actual permission on a single(!) feature or operation'; + +-- Daten Export vom Benutzer nicht ausgewählt + +-- Exportiere Struktur von Tabelle bremen_calling.ship +CREATE TABLE IF NOT EXISTS `ship` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(64) DEFAULT NULL, + `imo` int DEFAULT NULL, + `callsign` varchar(8) DEFAULT NULL, + `participant_id` int unsigned DEFAULT NULL, + `length` float DEFAULT NULL, + `width` float DEFAULT NULL, + `is_tug` bit(1) DEFAULT b'0', + `bollard_pull` int DEFAULT NULL, + `eni` int DEFAULT NULL, + `created` datetime DEFAULT CURRENT_TIMESTAMP, + `modified` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, + `deleted` bit(1) DEFAULT b'0', + PRIMARY KEY (`id`), + KEY `FK_SHIP_PARTICIPANT` (`participant_id`), + CONSTRAINT `FK_SHIP_PARTICIPANT` FOREIGN KEY (`participant_id`) REFERENCES `participant` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- Daten Export vom Benutzer nicht ausgewählt + +-- Exportiere Struktur von Tabelle bremen_calling.shipcall +CREATE TABLE IF NOT EXISTS `shipcall` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `ship_id` int unsigned DEFAULT NULL, + `type` tinyint DEFAULT NULL, + `eta` datetime DEFAULT NULL, + `voyage` varchar(16) DEFAULT NULL, + `etd` datetime DEFAULT NULL, + `arrival_berth_id` int unsigned DEFAULT NULL, + `departure_berth_id` int unsigned DEFAULT NULL, + `tug_required` bit(1) DEFAULT NULL, + `pilot_required` bit(1) DEFAULT NULL, + `flags` int unsigned DEFAULT '0', + `pier_side` bit(1) DEFAULT NULL, + `bunkering` bit(1) DEFAULT NULL, + `replenishing_terminal` bit(1) DEFAULT NULL, + `replenishing_lock` bit(1) DEFAULT NULL, + `draft` float DEFAULT NULL, + `tidal_window_from` datetime DEFAULT NULL, + `tidal_window_to` datetime DEFAULT NULL, + `rain_sensitive_cargo` bit(1) DEFAULT b'0', + `recommended_tugs` int DEFAULT '0', + `anchored` bit(1) DEFAULT NULL, + `moored_lock` bit(1) DEFAULT NULL, + `canceled` bit(1) DEFAULT NULL, + `created` datetime DEFAULT CURRENT_TIMESTAMP, + `modified` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + KEY `FK_SHIPCALL_SHIP` (`ship_id`), + KEY `FK_SHIPCALL_BERTH_ARRIVAL` (`arrival_berth_id`), + KEY `FK_SHIPCALL_BERTH_DEPARTURE` (`departure_berth_id`), + CONSTRAINT `FK_SHIPCALL_BERTH_ARRIVAL` FOREIGN KEY (`arrival_berth_id`) REFERENCES `berth` (`id`), + CONSTRAINT `FK_SHIPCALL_BERTH_DEPARTURE` FOREIGN KEY (`departure_berth_id`) REFERENCES `berth` (`id`), + CONSTRAINT `FK_SHIPCALL_SHIP` FOREIGN KEY (`ship_id`) REFERENCES `ship` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='Incoming, outgoing or moving to another berth'; + +-- Daten Export vom Benutzer nicht ausgewählt + +-- Exportiere Struktur von Tabelle bremen_calling.shipcall_participant_map +CREATE TABLE IF NOT EXISTS `shipcall_participant_map` ( + `id` int NOT NULL AUTO_INCREMENT, + `shipcall_id` int unsigned DEFAULT NULL, + `participant_id` int unsigned DEFAULT NULL, + `created` datetime DEFAULT CURRENT_TIMESTAMP, + `modified` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + KEY `FK_MAP_PARTICIPANT_SHIPCALL` (`shipcall_id`), + KEY `FK_MAP_SHIPCALL_PARTICIPANT` (`participant_id`), + CONSTRAINT `FK_MAP_PARTICIPANT_SHIPCALL` FOREIGN KEY (`shipcall_id`) REFERENCES `shipcall` (`id`), + CONSTRAINT `FK_MAP_SHIPCALL_PARTICIPANT` FOREIGN KEY (`participant_id`) REFERENCES `participant` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='Associates a participant with a shipcall'; + +-- Daten Export vom Benutzer nicht ausgewählt + +-- Exportiere Struktur von Tabelle bremen_calling.shipcall_tug_map +CREATE TABLE IF NOT EXISTS `shipcall_tug_map` ( + `id` int NOT NULL AUTO_INCREMENT, + `shipcall_id` int unsigned NOT NULL COMMENT 'Ref to ship call', + `ship_id` int unsigned NOT NULL COMMENT 'Ref to ship (that is a tug)', + `created` datetime DEFAULT CURRENT_TIMESTAMP, + `modified` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + KEY `FK_SCT_SHIP` (`ship_id`), + KEY `FK_SCT_SHIPCALL` (`shipcall_id`), + CONSTRAINT `FK_SCT_SHIP` FOREIGN KEY (`ship_id`) REFERENCES `ship` (`id`), + CONSTRAINT `FK_SCT_SHIPCALL` FOREIGN KEY (`shipcall_id`) REFERENCES `shipcall` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='Mapping table that assigns tugs to a ship call'; + +-- Daten Export vom Benutzer nicht ausgewählt + +-- Exportiere Struktur von Tabelle bremen_calling.times +CREATE TABLE IF NOT EXISTS `times` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `eta_berth` datetime DEFAULT NULL, + `eta_berth_fixed` bit(1) DEFAULT NULL, + `etd_berth` datetime DEFAULT NULL, + `etd_berth_fixed` bit(1) DEFAULT NULL, + `lock_time` datetime DEFAULT NULL, + `lock_time_fixed` bit(1) DEFAULT NULL, + `zone_entry` datetime DEFAULT NULL, + `zone_entry_fixed` bit(1) DEFAULT NULL, + `operations_start` datetime DEFAULT NULL, + `operations_end` datetime DEFAULT NULL, + `remarks` varchar(512) DEFAULT NULL, + `shipcall_id` int unsigned NOT NULL, + `participant_id` int unsigned NOT NULL, + `created` datetime DEFAULT CURRENT_TIMESTAMP, + `modified` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + KEY `FK_TIME_SHIPCALL` (`shipcall_id`), + KEY `FK_TIME_PART` (`participant_id`), + CONSTRAINT `FK_TIME_PART` FOREIGN KEY (`participant_id`) REFERENCES `participant` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='the planned time for the participants work'; + +-- Daten Export vom Benutzer nicht ausgewählt + +-- Exportiere Struktur von Tabelle bremen_calling.user +CREATE TABLE IF NOT EXISTS `user` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `participant_id` int unsigned DEFAULT NULL, `first_name` varchar(45) DEFAULT NULL, `last_name` varchar(45) DEFAULT NULL, `user_name` varchar(45) DEFAULT NULL, @@ -26,185 +234,31 @@ CREATE TABLE `user` ( `user_phone` varchar(128) DEFAULT NULL, `password_hash` varchar(128) DEFAULT NULL, `api_key` varchar(256) DEFAULT NULL, - `created` DATETIME NULL DEFAULT current_timestamp(), - `modified` DATETIME NULL DEFAULT NULL ON UPDATE current_timestamp(), + `created` datetime DEFAULT CURRENT_TIMESTAMP, + `modified` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id`), - INDEX `FK_USER_PART` (`participant_id`), + KEY `FK_USER_PART` (`participant_id`), CONSTRAINT `FK_USER_PART` FOREIGN KEY (`participant_id`) REFERENCES `participant` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='member of a participant'; +) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='member of a participant'; +-- Daten Export vom Benutzer nicht ausgewählt -CREATE TABLE `berth` ( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `name` VARCHAR(128) NULL DEFAULT NULL COMMENT 'Descriptive name', - `participant_id` INT(10) UNSIGNED NULL DEFAULT NULL COMMENT 'If berth belongs to a participant, reference it here', - `lock` BIT(1) NULL DEFAULT NULL COMMENT 'The lock must be used', - `created` DATETIME NULL DEFAULT current_timestamp(), - `modified` DATETIME NULL DEFAULT NULL ON UPDATE current_timestamp(), - PRIMARY KEY (`id`), - INDEX `FK_BERTH_PART` (`participant_id`), - CONSTRAINT `FK_BERTH_PART` FOREIGN KEY (`participant_id`) REFERENCES `participant` (`id`) -) COMMENT='Berth of ship for a ship call' ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - - -CREATE TABLE `ship` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(45) DEFAULT NULL, - `imo` int(11) DEFAULT NULL, - `callsign` varchar(8) DEFAULT NULL, - `participant_id` INT(11) UNSIGNED NULL DEFAULT NULL, - `length` FLOAT NULL DEFAULT NULL, - `width` FLOAT NULL DEFAULT NULL, - `created` DATETIME NULL DEFAULT current_timestamp(), - `modified` DATETIME NULL DEFAULT NULL ON UPDATE current_timestamp(), +-- Exportiere Struktur von Tabelle bremen_calling.user_role_map +CREATE TABLE IF NOT EXISTS `user_role_map` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `user_id` int unsigned NOT NULL DEFAULT '0', + `role_id` int unsigned NOT NULL DEFAULT '0', + `created` datetime DEFAULT CURRENT_TIMESTAMP, + `modified` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id`), - INDEX `FK_SHIP_PARTICIPANT` (`participant_id`), - CONSTRAINT `FK_SHIP_PARTICIPANT` FOREIGN KEY (`participant_id`) REFERENCES `participant` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + KEY `FK_USER_ROLE` (`user_id`), + KEY `FK_ROLE_USER` (`role_id`), + CONSTRAINT `FK_ROLE_USER` FOREIGN KEY (`role_id`) REFERENCES `role` (`id`), + CONSTRAINT `FK_USER_ROLE` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='Assigns a user to a role'; +-- Daten Export vom Benutzer nicht ausgewählt -CREATE TABLE `shipcall` ( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `ship_id` INT(11) UNSIGNED NULL DEFAULT NULL, - `type` TINYINT(4) NULL DEFAULT NULL, - `eta` DATETIME NULL DEFAULT NULL, - `voyage` VARCHAR(16) NULL DEFAULT NULL, - `etd` DATETIME NULL DEFAULT NULL, - `arrival_berth_id` INT(10) UNSIGNED NULL DEFAULT NULL, - `departure_berth_id` INT(10) UNSIGNED NULL DEFAULT NULL, - `tug_required` BIT(1) NULL DEFAULT NULL, - `pilot_required` BIT(1) NULL DEFAULT NULL, - `flags` INT(10) UNSIGNED NULL DEFAULT 0, - `pier_side` BIT(1) NULL DEFAULT NULL, - `bunkering` BIT(1) NULL DEFAULT NULL, - `replenishing` BIT(1) NULL DEFAULT NULL, - `draft` FLOAT NULL DEFAULT NULL, - `tidal_window_from` DATETIME NULL DEFAULT NULL, - `tidal_window_to` DATETIME NULL DEFAULT NULL, - `rain_sensitive_cargo` BIT(1) NULL DEFAULT b'0', - `recommended_tugs` INT(11) NULL DEFAULT 0, - `created` DATETIME NULL DEFAULT current_timestamp(), - `modified` DATETIME NULL DEFAULT NULL ON UPDATE current_timestamp(), - PRIMARY KEY (`id`), - INDEX `FK_SHIPCALL_SHIP` (`ship_id`), - INDEX `FK_SHIPCALL_BERTH_ARRIVAL` (`arrival_berth_id`), - INDEX `FK_SHIPCALL_BERTH_DEPARTURE` (`departure_berth_id`), - CONSTRAINT `FK_SHIPCALL_BERTH_ARRIVAL` FOREIGN KEY (`arrival_berth_id`) REFERENCES `berth` (`id`), - CONSTRAINT `FK_SHIPCALL_BERTH_DEPARTURE` FOREIGN KEY (`departure_berth_id`) REFERENCES `berth` (`id`), - CONSTRAINT `FK_SHIPCALL_SHIP` FOREIGN KEY (`ship_id`) REFERENCES `ship` (`id`) -) COMMENT='Incoming, outgoing or moving to another berth' ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - - -CREATE TABLE `times` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `start_planned` datetime DEFAULT NULL, - `end_planned` datetime DEFAULT NULL, - `duration_planned` int(11) DEFAULT NULL, - `start_actual` datetime DEFAULT NULL, - `end_actual` datetime DEFAULT NULL, - `duration_actual` int(11) DEFAULT NULL, - `shipcall_id` int(11) UNSIGNED DEFAULT NULL, - `participant_id` int(11) UNSIGNED DEFAULT NULL, - `created` DATETIME NULL DEFAULT current_timestamp(), - `modified` DATETIME NULL DEFAULT NULL ON UPDATE current_timestamp(), - PRIMARY KEY (`id`), - INDEX `FK_TIME_SHIPCALL` (`shipcall_id`), - INDEX `FK_TIME_PART` (`participant_id`), - CONSTRAINT `FK_TIME_PART` FOREIGN KEY (`participant_id`) REFERENCES `participant` (`id`), - CONSTRAINT `FK_TIME_SHIPCALL` FOREIGN KEY (`shipcall_id`) REFERENCES `shipcall` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='the planned time for the participants work'; - - -CREATE TABLE `shipcall_participant_map` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `shipcall_id` int(10) unsigned DEFAULT NULL, - `participant_id` int(10) unsigned DEFAULT NULL, - `created` DATETIME NULL DEFAULT current_timestamp(), - `modified` DATETIME NULL DEFAULT NULL ON UPDATE current_timestamp(), - PRIMARY KEY (`id`), - INDEX `FK_MAP_PARTICIPANT_SHIPCALL` (`shipcall_id`), - INDEX `FK_MAP_SHIPCALL_PARTICIPANT` (`participant_id`), - CONSTRAINT `FK_MAP_PARTICIPANT_SHIPCALL` FOREIGN KEY (`shipcall_id`) REFERENCES `shipcall` (`id`), - CONSTRAINT `FK_MAP_SHIPCALL_PARTICIPANT` FOREIGN KEY (`participant_id`) REFERENCES `participant` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Associates a participant with a shipcall'; - - -CREATE TABLE `shipcall_tug_map` ( - `id` INT(11) NOT NULL AUTO_INCREMENT, - `shipcall_id` INT(11) UNSIGNED NOT NULL COMMENT 'Ref to ship call', - `ship_id` INT(11) UNSIGNED NOT NULL COMMENT 'Ref to ship (that is a tug)', - `created` DATETIME NULL DEFAULT current_timestamp(), - `modified` DATETIME NULL DEFAULT NULL ON UPDATE current_timestamp(), - PRIMARY KEY (`id`), - INDEX `FK_SCT_SHIP` (`ship_id`), - INDEX `FK_SCT_SHIPCALL` (`shipcall_id`), - CONSTRAINT `FK_SCT_SHIP` FOREIGN KEY (`ship_id`) REFERENCES `ship` (`id`), - CONSTRAINT `FK_SCT_SHIPCALL` FOREIGN KEY (`shipcall_id`) REFERENCES `shipcall` (`id`) -) COMMENT='Mapping table that assigns tugs to a ship call' ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - - -CREATE TABLE `notification` ( - `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, - `times_id` INT(11) UNSIGNED NOT NULL COMMENT 'times record that caused the notification', - `participant_id` INT(11) UNSIGNED NOT NULL COMMENT 'participant ref', - `acknowledged` BIT(1) NULL DEFAULT b'0' COMMENT 'true if UI acknowledged', - `level` TINYINT(4) NULL DEFAULT NULL COMMENT 'severity of the notification', - `type` TINYINT(4) NULL DEFAULT NULL COMMENT 'Email/UI/Other', - `message` VARCHAR(256) NULL DEFAULT NULL COMMENT 'individual message', - `created` DATETIME NULL DEFAULT current_timestamp(), - `modified` DATETIME NULL DEFAULT NULL ON UPDATE current_timestamp(), - PRIMARY KEY (`id`), - INDEX `FK_NOT_TIMES` (`times_id`), - INDEX `FK_NOT_PART` (`participant_id`), - CONSTRAINT `FK_NOT_PART` FOREIGN KEY (`participant_id`) REFERENCES `participant` (`id`), - CONSTRAINT `FK_NOT_TIMES` FOREIGN KEY (`times_id`) REFERENCES `times` (`id`) -) COMMENT='An entry corresponds to an alarm given by a violated rule during times update' ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - - -CREATE TABLE `role` ( - `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, - `name` VARCHAR(50) NOT NULL DEFAULT '0' COMMENT 'unique role name', - `description` VARCHAR(255) NULL DEFAULT '0' COMMENT 'role description', - `created` DATETIME NULL DEFAULT current_timestamp(), - `modified` DATETIME NULL DEFAULT NULL ON UPDATE current_timestamp(), - PRIMARY KEY (`id`), - UNIQUE INDEX `name` (`name`) -) COMMENT='logical group of securables for one or more user' DEFAULT CHARSET=utf8mb4 ENGINE=InnoDB; - - -CREATE TABLE `securable` ( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `name` VARCHAR(50) NOT NULL DEFAULT '', - `created` DATETIME NULL DEFAULT current_timestamp(), - `modified` DATETIME NULL DEFAULT NULL ON UPDATE current_timestamp(), - PRIMARY KEY (`id`), - UNIQUE INDEX `name` (`name`) -) COMMENT='Actual permission on a single(!) feature or operation' DEFAULT CHARSET=utf8mb4 ENGINE=InnoDB; - - -CREATE TABLE `user_role_map` ( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `user_id` INT(10) UNSIGNED NOT NULL DEFAULT 0, - `role_id` INT(10) UNSIGNED NOT NULL DEFAULT 0, - `created` DATETIME NULL DEFAULT current_timestamp(), - `modified` DATETIME NULL DEFAULT NULL ON UPDATE current_timestamp(), - PRIMARY KEY (`id`), - INDEX `FK_USER_ROLE` (`user_id`), - INDEX `FK_ROLE_USER` (`role_id`), - CONSTRAINT `FK_ROLE_USER` FOREIGN KEY (`role_id`) REFERENCES `role` (`id`), - CONSTRAINT `FK_USER_ROLE` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) -) COMMENT='Assigns a user to a role' DEFAULT CHARSET=utf8mb4 ENGINE=InnoDB; - - -CREATE TABLE `role_securable_map` ( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `role_id` INT(10) UNSIGNED NOT NULL, - `securable_id` INT(10) UNSIGNED NOT NULL, - `created` DATETIME NULL DEFAULT current_timestamp(), - `modified` DATETIME NULL DEFAULT NULL ON UPDATE current_timestamp(), - PRIMARY KEY (`id`), - INDEX `FK_ROLE_SECURABLE` (`role_id`), - INDEX `FK_SECURABLE_ROLE` (`securable_id`), - CONSTRAINT `FK_ROLE_SECURABLE` FOREIGN KEY (`role_id`) REFERENCES `role` (`id`), - CONSTRAINT `FK_SECURABLE_ROLE` FOREIGN KEY (`securable_id`) REFERENCES `securable` (`id`) -) COMMENT='Assigns securables to roles' DEFAULT CHARSET=utf8mb4 ENGINE=InnoDB; +/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */; +/*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; diff --git a/misc/sample_data.sql b/misc/sample_data.sql index 986d8f7..8e75954 100644 --- a/misc/sample_data.sql +++ b/misc/sample_data.sql @@ -1,140 +1,136 @@ --- MySQL dump 10.19 Distrib 10.3.38-MariaDB, for debian-linux-gnueabihf (armv8l) --- --- Host: localhost Database: bremen_calling --- ------------------------------------------------------ --- Server version 10.3.38-MariaDB-0+deb10u1 +-- -------------------------------------------------------- +-- Host: 127.0.0.1 +-- Server Version: 8.0.34-0ubuntu0.22.04.1 - (Ubuntu) +-- Server Betriebssystem: Linux +-- HeidiSQL Version: 10.2.0.5599 +-- -------------------------------------------------------- /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8mb4 */; -/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; -/*!40103 SET TIME_ZONE='+00:00' */; +/*!40101 SET NAMES utf8 */; +/*!50503 SET NAMES utf8mb4 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; --- --- Dumping data for table `berth` --- - -USE `bremen_calling`; - -LOCK TABLES `berth` WRITE; +-- Exportiere Daten aus Tabelle bremen_calling.berth: ~3 rows (ungefähr) /*!40000 ALTER TABLE `berth` DISABLE KEYS */; -INSERT INTO `berth` (`id`, `name`) VALUES (1,'Roland Mühle'),(2,'Stahlwerk'),(3,'Kellogs'); +INSERT INTO `berth` (`id`, `name`, `participant_id`, `lock`, `created`, `modified`, `deleted`) VALUES + (1, 'Roland Mühle', NULL, NULL, '2023-06-26 14:01:40', NULL, b'0'), + (2, 'Stahlwerk', NULL, NULL, '2023-06-26 14:01:40', NULL, b'0'), + (3, 'Kellogs', NULL, NULL, '2023-06-26 14:01:40', NULL, b'0'); /*!40000 ALTER TABLE `berth` ENABLE KEYS */; -UNLOCK TABLES; --- --- Dumping data for table `notification` --- - -LOCK TABLES `notification` WRITE; +-- Exportiere Daten aus Tabelle bremen_calling.notification: ~0 rows (ungefähr) /*!40000 ALTER TABLE `notification` DISABLE KEYS */; /*!40000 ALTER TABLE `notification` ENABLE KEYS */; -UNLOCK TABLES; --- --- Dumping data for table `participant` --- - -LOCK TABLES `participant` WRITE; +-- Exportiere Daten aus Tabelle bremen_calling.participant: ~11 rows (ungefähr) /*!40000 ALTER TABLE `participant` DISABLE KEYS */; -INSERT INTO `participant` (`id`, `name`, `street`, `postal_code`, `city`, `type`, `flags`, `created`, `modified`) VALUES (1,'Schick Informatik','Gottlieb-Daimler-Str. 8','73614','Schorndorf',1,42,'2023-04-17 07:18:19',NULL); +INSERT INTO `participant` (`id`, `name`, `street`, `postal_code`, `city`, `type`, `flags`, `created`, `modified`, `deleted`) VALUES + (1, 'Schick Informatik', 'Gottlieb-Daimler-Str. 8', '73614', 'Schorndorf', 1, 42, '2023-04-17 07:18:19', '2023-08-07 11:35:37', b'0'), + (2, 'Lotsenbrüderschaft Weser 1', '', '', '', 4, 0, '2023-08-10 07:07:41', NULL, b'0'), + (3, 'Bremer Schiffsmeldedienst', 'Hafenkopf II / Überseetor 20', '28217', 'Bremen', 1, 0, '2023-08-10 07:11:10', NULL, b'0'), + (4, 'BLG Cargo Logistics GmbH', '', '', '', 2, 0, '2023-08-10 07:14:40', NULL, b'0'), + (5, 'Schiffsmakler-Verband für Küsten und Seeschiffsbefrachter e.V.', '', '', '', 8, 0, '2023-08-10 07:15:56', NULL, b'0'), + (6, 'RMS Rhenus Maritime Services GmbH', '', '', '', 8, 0, '2023-08-10 07:19:29', NULL, b'0'), + (7, 'J.MÜLLER Weser GmbH & Co. KG', '', '', '', 10, 0, '2023-08-10 07:21:43', '2023-08-10 08:47:59', b'0'), + (8, 'Schiffahrtskontor Detra GmbH & Co.KG', '', '', '', 8, 0, '2023-08-10 07:23:04', NULL, b'0'), + (9, 'Boluda Deutschland GmbH', '', '', '', 64, 0, '2023-08-10 07:24:18', NULL, b'0'), + (10, 'Weserport GmbH', '', '', '', 10, 0, '2023-08-10 07:26:42', '2023-08-10 08:48:19', b'0'), + (11, 'Port Authority Bremen', '', '', '', 32, 0, '2023-08-10 07:28:11', NULL, b'0'); /*!40000 ALTER TABLE `participant` ENABLE KEYS */; -UNLOCK TABLES; --- --- Dumping data for table `role` --- - -LOCK TABLES `role` WRITE; +-- Exportiere Daten aus Tabelle bremen_calling.role: ~2 rows (ungefähr) /*!40000 ALTER TABLE `role` DISABLE KEYS */; -INSERT INTO `role` (`id`, `name`, `description`, `created`, `modified`) VALUES (1,'My first role','A very good description','2023-04-17 07:31:57',NULL),(2,'Another role','This role is very nice as well','2023-04-17 07:32:12',NULL); +INSERT INTO `role` (`id`, `name`, `description`, `created`, `modified`) VALUES + (1, 'My first role', 'A very good description', '2023-04-17 07:31:57', NULL), + (2, 'Another role', 'This role is very nice as well', '2023-04-17 07:32:12', NULL); /*!40000 ALTER TABLE `role` ENABLE KEYS */; -UNLOCK TABLES; --- --- Dumping data for table `role_securable_map` --- - -LOCK TABLES `role_securable_map` WRITE; +-- Exportiere Daten aus Tabelle bremen_calling.role_securable_map: ~0 rows (ungefähr) /*!40000 ALTER TABLE `role_securable_map` DISABLE KEYS */; /*!40000 ALTER TABLE `role_securable_map` ENABLE KEYS */; -UNLOCK TABLES; --- --- Dumping data for table `securable` --- - -LOCK TABLES `securable` WRITE; +-- Exportiere Daten aus Tabelle bremen_calling.securable: ~2 rows (ungefähr) /*!40000 ALTER TABLE `securable` DISABLE KEYS */; -INSERT INTO `securable` (`id`, `name`, `created`, `modified`) VALUES (1,'First secure thing','2023-04-17 07:38:12',NULL),(2,'Another secure thing','2023-04-17 07:38:22',NULL); +INSERT INTO `securable` (`id`, `name`, `created`, `modified`) VALUES + (1, 'First secure thing', '2023-04-17 07:38:12', NULL), + (2, 'Another secure thing', '2023-04-17 07:38:22', NULL); /*!40000 ALTER TABLE `securable` ENABLE KEYS */; -UNLOCK TABLES; --- --- Dumping data for table `ship` --- - -LOCK TABLES `ship` WRITE; +-- Exportiere Daten aus Tabelle bremen_calling.ship: ~2 rows (ungefähr) /*!40000 ALTER TABLE `ship` DISABLE KEYS */; +INSERT INTO `ship` (`id`, `name`, `imo`, `callsign`, `participant_id`, `length`, `width`, `is_tug`, `bollard_pull`, `eni`, `created`, `modified`, `deleted`) VALUES + (1, 'Dicke Berta', 1234567, 'DEBE', 1, 100, 20, b'0', NULL, NULL, '2023-06-27 10:43:02', NULL, b'0'), + (2, 'Maersk Neston', 9632167, '9V3532', 1, 210.07, 30.2, b'0', NULL, NULL, '2023-07-27 12:34:13', NULL, b'0'); /*!40000 ALTER TABLE `ship` ENABLE KEYS */; -UNLOCK TABLES; --- --- Dumping data for table `shipcall` --- - -LOCK TABLES `shipcall` WRITE; +-- Exportiere Daten aus Tabelle bremen_calling.shipcall: ~8 rows (ungefähr) /*!40000 ALTER TABLE `shipcall` DISABLE KEYS */; +INSERT INTO `shipcall` (`id`, `ship_id`, `type`, `eta`, `voyage`, `etd`, `arrival_berth_id`, `departure_berth_id`, `tug_required`, `pilot_required`, `flags`, `pier_side`, `bunkering`, `replenishing_terminal`, `replenishing_lock`, `draft`, `tidal_window_from`, `tidal_window_to`, `rain_sensitive_cargo`, `recommended_tugs`, `anchored`, `moored_lock`, `canceled`, `created`, `modified`) VALUES + (3, 1, 1, '2023-08-13 07:18:19', '43B', NULL, NULL, NULL, b'0', b'1', 0, b'0', b'1', NULL, NULL, NULL, NULL, NULL, b'0', 3, NULL, NULL, NULL, '2023-06-27 11:03:28', '2023-08-07 15:19:56'), + (4, 2, 1, '2023-08-14 10:43:02', '43', NULL, NULL, NULL, NULL, NULL, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, b'0', 0, NULL, NULL, NULL, '2023-07-27 12:36:49', '2023-08-07 15:19:56'), + (5, 1, 1, '2023-07-23 07:18:19', '43B', NULL, NULL, NULL, b'0', b'1', 0, b'0', b'1', NULL, NULL, NULL, NULL, NULL, b'0', 2, NULL, NULL, NULL, '2023-08-11 15:11:50', NULL), + (6, 1, 1, '2023-07-23 07:18:19', '43B', NULL, NULL, NULL, b'0', b'1', 0, b'0', b'1', NULL, NULL, NULL, NULL, NULL, b'0', 2, NULL, NULL, NULL, '2023-08-11 15:11:53', NULL), + (7, 1, 1, '2023-07-23 07:18:19', '43B', NULL, NULL, NULL, b'0', b'1', 0, b'0', b'1', NULL, NULL, NULL, NULL, NULL, b'0', 2, NULL, NULL, NULL, '2023-08-13 12:12:34', NULL), + (8, 1, 1, '2023-07-23 07:18:19', '43B', NULL, NULL, NULL, b'0', b'1', 0, b'0', b'1', NULL, NULL, NULL, NULL, NULL, b'0', 2, NULL, NULL, NULL, '2023-08-13 12:14:52', NULL), + (9, 1, 1, '2023-07-23 07:18:19', '43B', NULL, NULL, NULL, b'0', b'1', 0, b'0', b'1', NULL, NULL, NULL, NULL, NULL, b'0', 2, NULL, NULL, NULL, '2023-08-13 12:17:09', NULL), + (10, 1, 1, '2023-08-23 07:18:19', '43B', NULL, NULL, NULL, b'0', b'1', 0, b'0', b'1', NULL, NULL, NULL, NULL, NULL, b'0', 3, NULL, NULL, NULL, '2023-08-14 07:55:48', '2023-08-14 07:56:52'); /*!40000 ALTER TABLE `shipcall` ENABLE KEYS */; -UNLOCK TABLES; --- --- Dumping data for table `shipcall_participant_map` --- - -LOCK TABLES `shipcall_participant_map` WRITE; +-- Exportiere Daten aus Tabelle bremen_calling.shipcall_participant_map: ~6 rows (ungefähr) /*!40000 ALTER TABLE `shipcall_participant_map` DISABLE KEYS */; +INSERT INTO `shipcall_participant_map` (`id`, `shipcall_id`, `participant_id`, `created`, `modified`) VALUES + (1, 3, 2, '2023-08-11 15:01:23', NULL), + (2, 3, 4, '2023-08-11 15:01:29', NULL), + (3, 9, 2, '2023-08-13 12:17:17', NULL), + (4, 9, 4, '2023-08-13 12:17:18', NULL), + (24, 10, 3, '2023-08-14 08:48:30', NULL), + (26, 10, 9, '2023-08-14 09:03:29', NULL); /*!40000 ALTER TABLE `shipcall_participant_map` ENABLE KEYS */; -UNLOCK TABLES; --- --- Dumping data for table `times` --- +-- Exportiere Daten aus Tabelle bremen_calling.shipcall_tug_map: ~0 rows (ungefähr) +/*!40000 ALTER TABLE `shipcall_tug_map` DISABLE KEYS */; +/*!40000 ALTER TABLE `shipcall_tug_map` ENABLE KEYS */; -LOCK TABLES `times` WRITE; +-- Exportiere Daten aus Tabelle bremen_calling.times: ~0 rows (ungefähr) /*!40000 ALTER TABLE `times` DISABLE KEYS */; +INSERT INTO `times` (`id`, `eta_berth`, `eta_berth_fixed`, `etd_berth`, `etd_berth_fixed`, `lock_time`, `lock_time_fixed`, `zone_entry`, `zone_entry_fixed`, `operations_start`, `operations_end`, `remarks`, `shipcall_id`, `participant_id`, `created`, `modified`) VALUES + (1, '2023-05-18 07:18:19', NULL, '2023-05-18 09:18:19', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 3, 1, '2023-06-27 11:05:01', '2023-06-27 11:05:30'); /*!40000 ALTER TABLE `times` ENABLE KEYS */; -UNLOCK TABLES; --- --- Dumping data for table `user` --- - -LOCK TABLES `user` WRITE; +-- Exportiere Daten aus Tabelle bremen_calling.user: ~21 rows (ungefähr) /*!40000 ALTER TABLE `user` DISABLE KEYS */; -INSERT INTO `user` (`id`, `participant_id`, `first_name`, `last_name`, `user_name`, `password_hash`, `api_key`, `created`, `modified`) VALUES (1,1,'Daniel','Schick','dani',NULL,'0815','2023-04-17 07:15:41',NULL); +INSERT INTO `user` (`id`, `participant_id`, `first_name`, `last_name`, `user_name`, `user_email`, `user_phone`, `password_hash`, `api_key`, `created`, `modified`) VALUES + (1, 1, 'Daniel', 'Schick', 'dani', NULL, NULL, '$2b$12$qfjw4b3XvGuu0t6HR8OYGOzF5b8gmC6PyIIBNbIXMXEayJunEEKmi', '0815', '2023-04-17 07:15:41', '2023-08-11 11:11:34'), + (2, 1, 'Londo', 'Mollari', 'Londo', 'l.mollari@centauri.gov', '+01 555 324 2313', '$2b$12$VwmwvO2dxlOixWc1HjX3j.753SDJTMR.o7av/bVGTM2tLW2jQT0yy', NULL, '2023-06-27 08:34:55', NULL), + (3, 2, 'Maik', 'Baudeck', 'maikb', NULL, NULL, '$2b$12$4SxGRlinOrpEVvqDZcE.wOusMZYsepdc6vj1vDpNhbPtApxU8VGPi', '', '2023-08-10 07:09:35', '2023-08-11 11:11:55'), + (4, 3, 'Christin', 'Hollmann', 'christinh', NULL, NULL, '$2b$12$ul0QJmcuUhktDYDjcyEpx.6yY1ieLdaCxZ6a3SFSuTq94IqK4Y/re', '', '2023-08-10 07:12:05', '2023-08-11 11:10:33'), + (5, 3, 'Bastian', 'Güttner', 'bastiang', NULL, NULL, '$2b$12$0oCX3c2WyMykmxMoLqmpNubke713xhYlEEQgnxBV6Fj/TaUn.3/U6', '', '2023-08-10 07:12:26', '2023-08-11 11:11:13'), + (6, 3, 'Benjamin', 'Wiese', 'benjaminw', NULL, NULL, '$2b$12$RRj32KdLIf3D7z7cVWFqa.yZM5.ODOS0HqU3rdCuFrJS8HJ/rtqwy', '', '2023-08-10 07:13:01', '2023-08-11 11:11:16'), + (7, 1, 'Sladjan', 'Veselinovic', 'sladjanv', NULL, NULL, '$2b$12$4DctoCbZwxTvE39lXNRzneQ2kb/lXlJ5wEZ1CGbbw.rGM3nuAYjpa', '', '2023-08-10 07:13:39', '2023-08-11 11:11:45'), + (8, 1, 'Kersten', 'Gevers', 'kersteng', NULL, NULL, '$2b$12$zKX8iLPnXRmp5wD1Yp8P7e..U9R0A4ytbiMjd.l.IGkMzahcHPNWq', '', '2023-08-10 07:13:59', '2023-08-11 11:11:49'), + (9, 4, 'Dirk', 'Brunnert', 'dirkb', NULL, NULL, '$2b$12$HTeq/Fdfse6oElk7DLsQae5dtvWJloee.VtBH.THsj2kdcxxBkCDW', '', '2023-08-10 07:15:01', '2023-08-11 11:12:01'), + (10, 5, 'Thorsten', 'Fischer', 'thorstenf', NULL, NULL, '$2b$12$NHEpTNHuKU4ruPRIfd9yc.yv5faHGemFfRI3TISniqM7QNqHiyZpK', '', '2023-08-10 07:16:20', '2023-08-11 11:12:07'), + (11, 6, 'Lisa', 'Friedhoff', 'lisaf', NULL, NULL, '$2b$12$DJKJHGrQwfY9pwzgFfPds.DHGsygHyV3KDs38Hq4AUHPPs3jBPH3y', '', '2023-08-10 07:19:52', '2023-08-11 11:12:12'), + (12, 6, 'Dario', 'Fritschi', 'dariof', NULL, NULL, '$2b$12$MwCVTMQkN6zCAzCsE572Ye.M0nRDQNld4AgorLVyWq.DcQEmAy5lu', '', '2023-08-10 07:20:11', '2023-08-11 11:12:15'), + (13, 7, 'Hergen', 'Hanke', 'hergenh', NULL, NULL, '$2b$12$MKb6BDRrTbNd0qg5BdAS.upzlqxcWOgU/VEafJKSuzE9JLIWCimq6', '', '2023-08-10 07:22:09', '2023-08-11 11:12:24'), + (14, 8, 'Hardy', 'Paasch', 'hardyp', NULL, NULL, '$2b$12$l1lE/UqnYnOvci.N4j3zBOz6HC0z87ovnO0n6BIZYO7VN8gj.qGey', '', '2023-08-10 07:23:25', '2023-08-11 11:12:28'), + (15, 8, 'Marc', 'Pagel', 'marcp', NULL, NULL, '$2b$12$UCVJKzqX92Z8xZJ4kK0BRuFXMRdqcaXaGmBrqnYWARdKlPvZvLUZq', '', '2023-08-10 07:23:41', '2023-08-11 11:12:30'), + (16, 9, 'Andreas', 'Peukert', 'andreasp', NULL, NULL, '$2b$12$jNmciJAVR6p0IflvAthmk.j0SoOBvFHwDiEDKUHfwJq7baRsKg/LG', '', '2023-08-10 07:24:37', '2023-08-11 11:12:45'), + (17, 8, 'Christina', 'Rachiele', 'christinar', NULL, NULL, '$2b$12$BCsVgPRuIWPuuor07lprF.klQxvF901O3AXUhRrBJoEvYIjNQ.HKS', '', '2023-08-10 07:25:05', '2023-08-11 11:12:33'), + (18, 9, 'Sonia', 'Rekawek', 'soniar', NULL, NULL, '$2b$12$uHCkH6gu13yqllXBibLFIOWOpvctMC7NmojtXqDd6xsLq7bmvNOMu', '', '2023-08-10 07:25:27', '2023-08-11 11:12:48'), + (19, 6, 'Frank', 'Roelfs', 'frankr', NULL, NULL, '$2b$12$cEQAhUe9VJV6uTkfOY6/R.oAVfmFZQ4vS5G6BqoNEyaVHtFRDtB56', '', '2023-08-10 07:26:04', '2023-08-11 11:12:19'), + (20, 10, 'Vera', 'Schliedermann', 'veras', NULL, NULL, '$2b$12$FKcitW6W1HPwd.cdkZLGLeTFuzjsEIrbiKInysAKN.RibZ4gVLZHi', '', '2023-08-10 07:27:01', '2023-08-11 11:12:54'), + (21, 8, 'Michael', 'Strudthoff', 'michaels', NULL, NULL, '$2b$12$doTiywWpkso1UWB5eiAW1eoACP6rN4UDVt7qFFdRFvhhWUXikCmS2', '', '2023-08-10 07:27:27', '2023-08-11 11:12:37'), + (22, 4, 'Volker', 'Viohl', 'volkerv', NULL, NULL, '$2b$12$.YavQbWNE4eJDQA.ZNSKROYvMPWifBXyMX0IL0H2z50M720fpfTJW', '', '2023-08-10 07:27:50', '2023-08-11 11:12:04'), + (23, 11, 'Frauke', 'Zabel', 'fraukez', NULL, NULL, '$2b$12$rawQg6Cjl1yECGm9DOG8degdWdD.nZjEgGp8eXO98nh11QV1sEEEO', '', '2023-08-10 07:28:33', '2023-08-11 11:12:58'), + (24, 8, 'Jan', 'Zierow', 'janz', NULL, NULL, '$2b$12$CbnjUT42cf0mkIAqAURg3OksP9G3brmsE2GQTECTZ4.cVuhPn5D2G', '', '2023-08-10 07:28:55', '2023-08-11 11:12:39'); /*!40000 ALTER TABLE `user` ENABLE KEYS */; -UNLOCK TABLES; --- --- Dumping data for table `user_role_map` --- - -LOCK TABLES `user_role_map` WRITE; +-- Exportiere Daten aus Tabelle bremen_calling.user_role_map: ~0 rows (ungefähr) /*!40000 ALTER TABLE `user_role_map` DISABLE KEYS */; /*!40000 ALTER TABLE `user_role_map` ENABLE KEYS */; -UNLOCK TABLES; -/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; -/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; -/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */; +/*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; -/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; -/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; -/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; - --- Dump completed on 2023-04-27 9:09:13 diff --git a/src/BreCalClient/.editorconfig b/src/BreCalClient/.editorconfig new file mode 100644 index 0000000..5d552a4 --- /dev/null +++ b/src/BreCalClient/.editorconfig @@ -0,0 +1,135 @@ +[*.cs] + +# CS8073: The result of the expression is always the same since a value of this type is never equal to 'null' +dotnet_diagnostic.CS8073.severity = silent +csharp_using_directive_placement = outside_namespace:silent +csharp_prefer_simple_using_statement = true:suggestion +csharp_prefer_braces = true:silent +csharp_style_namespace_declarations = block_scoped:silent +csharp_style_prefer_method_group_conversion = true:silent +csharp_style_prefer_top_level_statements = true:silent +csharp_style_expression_bodied_methods = false:silent +csharp_style_expression_bodied_constructors = false:silent +csharp_style_expression_bodied_operators = false:silent +csharp_style_expression_bodied_properties = true:silent +csharp_style_expression_bodied_indexers = true:silent +csharp_style_expression_bodied_accessors = true:silent +csharp_style_expression_bodied_lambdas = true:silent +csharp_style_expression_bodied_local_functions = false:silent +csharp_style_throw_expression = true:suggestion +csharp_style_prefer_null_check_over_type_check = true:suggestion +csharp_prefer_simple_default_expression = true:suggestion +csharp_style_prefer_local_over_anonymous_function = true:suggestion +csharp_style_prefer_index_operator = true:suggestion +csharp_style_prefer_range_operator = true:suggestion +csharp_indent_labels = one_less_than_current +csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion +csharp_space_around_binary_operators = before_and_after +csharp_style_prefer_tuple_swap = true:suggestion +csharp_style_prefer_utf8_string_literals = true:suggestion +csharp_style_inlined_variable_declaration = true:suggestion +csharp_style_deconstructed_variable_declaration = true:suggestion +csharp_style_unused_value_assignment_preference = discard_variable:suggestion +csharp_style_unused_value_expression_statement_preference = discard_variable:silent +csharp_prefer_static_local_function = true:suggestion +csharp_style_prefer_readonly_struct = true:suggestion +csharp_style_allow_embedded_statements_on_same_line_experimental = true:silent +csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true:silent +csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true:silent +csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true:silent +csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = true:silent +csharp_style_conditional_delegate_call = true:suggestion +csharp_style_prefer_switch_expression = true:suggestion +csharp_style_prefer_pattern_matching = true:silent +csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion +csharp_style_pattern_matching_over_as_with_null_check = true:suggestion +csharp_style_prefer_not_pattern = true:suggestion +csharp_style_prefer_extended_property_pattern = true:suggestion +csharp_style_var_for_built_in_types = false:silent +csharp_style_var_when_type_is_apparent = false:silent +csharp_style_var_elsewhere = false:silent + +# IDE1006: Naming Styles +dotnet_diagnostic.IDE1006.severity = none + +[*.{cs,vb}] +#### Naming styles #### + +# Naming rules + +dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion +dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface +dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i + +dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.types_should_be_pascal_case.symbols = types +dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case + +dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members +dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case + +# Symbol specifications + +dotnet_naming_symbols.interface.applicable_kinds = interface +dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.interface.required_modifiers = + +dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum +dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.types.required_modifiers = + +dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method +dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.non_field_members.required_modifiers = + +# Naming styles + +dotnet_naming_style.begins_with_i.required_prefix = I +dotnet_naming_style.begins_with_i.required_suffix = +dotnet_naming_style.begins_with_i.word_separator = +dotnet_naming_style.begins_with_i.capitalization = pascal_case + +dotnet_naming_style.pascal_case.required_prefix = +dotnet_naming_style.pascal_case.required_suffix = +dotnet_naming_style.pascal_case.word_separator = +dotnet_naming_style.pascal_case.capitalization = pascal_case + +dotnet_naming_style.pascal_case.required_prefix = +dotnet_naming_style.pascal_case.required_suffix = +dotnet_naming_style.pascal_case.word_separator = +dotnet_naming_style.pascal_case.capitalization = pascal_case +dotnet_style_coalesce_expression = true:suggestion +dotnet_style_null_propagation = true:suggestion +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion +dotnet_style_prefer_auto_properties = true:silent +dotnet_style_object_initializer = true:suggestion +dotnet_style_collection_initializer = true:suggestion +dotnet_style_prefer_simplified_boolean_expressions = true:suggestion +dotnet_style_prefer_conditional_expression_over_assignment = true:silent +dotnet_style_prefer_conditional_expression_over_return = true:silent +dotnet_style_explicit_tuple_names = true:suggestion +dotnet_style_prefer_inferred_tuple_names = true:suggestion +dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion +dotnet_style_prefer_compound_assignment = true:suggestion +dotnet_style_prefer_simplified_interpolation = true:suggestion +dotnet_style_namespace_match_folder = true:suggestion +dotnet_style_operator_placement_when_wrapping = beginning_of_line +tab_width = 4 +indent_size = 4 +end_of_line = crlf +dotnet_style_readonly_field = true:suggestion +dotnet_style_predefined_type_for_locals_parameters_members = true:silent +dotnet_style_predefined_type_for_member_access = true:silent +dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent +dotnet_style_allow_multiple_blank_lines_experimental = true:silent +dotnet_style_allow_statement_immediately_after_block_experimental = true:silent +dotnet_code_quality_unused_parameters = all:suggestion +dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent +dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent +dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent +dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent +dotnet_style_qualification_for_field = false:silent +dotnet_style_qualification_for_property = false:silent +dotnet_style_qualification_for_method = false:silent +dotnet_style_qualification_for_event = false:silent diff --git a/src/BreCalClient/AboutDialog.xaml b/src/BreCalClient/AboutDialog.xaml new file mode 100644 index 0000000..b45900a --- /dev/null +++ b/src/BreCalClient/AboutDialog.xaml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + public partial class MainWindow : Window { + + #region Fields + private const int SHIPCALL_UPDATE_INTERVAL_SECONDS = 30; private readonly DefaultApi _api; private readonly ObservableCollection _controlModels = new(); @@ -34,6 +37,21 @@ namespace BreCalClient private readonly CancellationTokenSource _tokenSource = new(); private LoginResult? _loginResult; + #endregion + + #region Enums + + private enum ConnectionStatus + { + UNDEFINED, + SUCCESSFUL, + FAILED + } + + #endregion + + #region Construction + public MainWindow() { InitializeComponent(); @@ -41,11 +59,14 @@ namespace BreCalClient _api.Configuration.ApiKeyPrefix["Authorization"] = "Bearer"; } + #endregion + #region event handler private void Window_Loaded(object sender, RoutedEventArgs e) { - + labelGeneralStatus.Text = $"Connection {ConnectionStatus.UNDEFINED}"; + labelVersion.Text = "V. " + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; } private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) @@ -74,16 +95,20 @@ namespace BreCalClient this.busyIndicator.IsBusy = false; this._api.Configuration.ApiKey["Authorization"] = _loginResult.Token; this.LoadStaticLists(); + this.labelUsername.Text = $"{_loginResult.FirstName} {_loginResult.LastName}"; } } + labelGeneralStatus.Text = $"Connection {ConnectionStatus.SUCCESSFUL}"; } catch (ApiException ex) { this.labelLoginResult.Content = ex.Message; + labelGeneralStatus.Text = $"Connection {ConnectionStatus.FAILED}"; } catch(Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error); + labelGeneralStatus.Text = $"Connection {ConnectionStatus.FAILED}"; } } @@ -92,6 +117,56 @@ namespace BreCalClient this.Close(); } + private void buttonNew_Click(object sender, RoutedEventArgs e) + { + EditShipcallControl esc = new() + { + Participants = this._participants, + Ships = this._ships, + Berths = this._berths + }; + + if (esc.ShowDialog() ?? false) + { + // save new dialog model + + // add dialog model to list + + } + } + + private void buttonInfo_Click(object sender, RoutedEventArgs e) + { + AboutDialog ad = new(); + ad.ChangePasswordRequested += async (oldPw, newPw) => + { + if (_loginResult != null) + { + UserDetails ud = new() + { + Id = _loginResult.Id, + FirstName = _loginResult.FirstName, + LastName = _loginResult.LastName, + UserPhone = _loginResult.UserPhone, + OldPassword = oldPw, + NewPassword = newPw + }; + try + { + await _api.UserPutAsync(ud); + } + catch (Exception ex) + { + this.Dispatcher.Invoke(new Action(() => + { + MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error); + })); + } + } + }; + ad.ShowDialog(); + } + #endregion #region private methods @@ -106,7 +181,8 @@ namespace BreCalClient foreach(var ship in this._ships) _shipLookupDict[ship.Id] = ship; this._participants = await _api.ParticipantsGetAsync(); - + + List agencies = new(); foreach (Participant participant in this._participants) { this._participantLookupDict[participant.Id] = participant; @@ -115,7 +191,11 @@ namespace BreCalClient App.Participant = participant; EnableControlsForParticipant(); } + if(participant.IsFlagSet(Extensions.ParticipantType.AGENCY)) + agencies.Add(participant); } + this.searchFilterControl.SetAgencies(agencies); + _ = Task.Run(() => RefreshShipcalls()); } @@ -129,7 +209,24 @@ namespace BreCalClient { while (!_tokenSource.Token.IsCancellationRequested) { - List shipcalls = await _api.ShipcallsGetAsync(); + List? shipcalls = null; + try + { + shipcalls = await _api.ShipcallsGetAsync(); + this.Dispatcher.Invoke(new Action(() => + { + labelGeneralStatus.Text = $"Connection {ConnectionStatus.SUCCESSFUL}"; + labelGeneralStatus.Text = $"Ok"; + })); + } + catch (Exception ex) + { + this.Dispatcher.Invoke(new Action(() => + { + labelGeneralStatus.Text = $"Connection {ConnectionStatus.FAILED}"; + labelStatusBar.Text = ex.Message; + })); + } if (shipcalls != null) { foreach (Shipcall shipcall in shipcalls) @@ -152,19 +249,23 @@ namespace BreCalClient else { // no: create new entry - selectedSCMModel = new ShipcallControlModel(); - selectedSCMModel.Shipcall = shipcall; + selectedSCMModel = new() + { + Shipcall = shipcall + }; if (this._shipLookupDict.ContainsKey(shipcall.ShipId)) selectedSCMModel.Ship = this._shipLookupDict[shipcall.ShipId]; if (this._berthLookupDict.ContainsKey(shipcall.ArrivalBerthId ?? 0)) - selectedSCMModel.Berth = this._berthLookupDict[shipcall.ArrivalBerthId ?? 0].Name1; + selectedSCMModel.Berth = this._berthLookupDict[shipcall.ArrivalBerthId ?? 0].Name; _controlModels.Add(selectedSCMModel); this.Dispatcher.Invoke(new Action(() => { - ShipcallControl sc = new ShipcallControl(); - sc.Height = 120; - sc.ShipcallControlModel = selectedSCMModel; + ShipcallControl sc = new() + { + Height = 120, + ShipcallControlModel = selectedSCMModel + }; sc.TimesRequested += Sc_TimesRequested; sc.EditRequested += Sc_EditRequested; this.stackPanel.Children.Add(sc); @@ -213,9 +314,7 @@ namespace BreCalClient } - #endregion - - + } } diff --git a/src/BreCalClient/Properties/PublishProfiles/ClickOnceProfile.pubxml b/src/BreCalClient/Properties/PublishProfiles/ClickOnceProfile.pubxml new file mode 100644 index 0000000..4f7a307 --- /dev/null +++ b/src/BreCalClient/Properties/PublishProfiles/ClickOnceProfile.pubxml @@ -0,0 +1,47 @@ + + + + + 0 + 0.3.0.0 + False + Release + True + true + True + Web + https://www.bsmd-emswe.eu/client/ + False + True + True + False + Any CPU + bin\Release\net6.0-windows\app.publish\ + bin\publish\ + ClickOnce + False + False + False + (none) + False + net6.0-windows + True + Foreground + False + Publish.html + True + https://www.bsmd-emswe.eu/ + BreCalClient + Informatikbüro Daniel Schick + Bremen calling client + https://www.bsmd-emswe.eu/ + + + + true + .NET Desktop Runtime 6.0.16 (x64) + + + \ No newline at end of file diff --git a/src/BreCalClient/Resources/Resources.Designer.cs b/src/BreCalClient/Resources/Resources.Designer.cs index af500fb..c9772c2 100644 --- a/src/BreCalClient/Resources/Resources.Designer.cs +++ b/src/BreCalClient/Resources/Resources.Designer.cs @@ -140,6 +140,16 @@ namespace BreCalClient.Resources { } } + /// + /// Looks up a localized resource of type System.Byte[]. + /// + public static byte[] containership1 { + get { + object obj = ResourceManager.GetObject("containership1", resourceCulture); + return ((byte[])(obj)); + } + } + /// /// Looks up a localized resource of type System.Byte[]. /// @@ -188,6 +198,24 @@ namespace BreCalClient.Resources { } } + /// + /// Looks up a localized string similar to Anchored. + /// + public static string textAnchored { + get { + return ResourceManager.GetString("textAnchored", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Arrival terminal. + /// + public static string textArrivalTerminal { + get { + return ResourceManager.GetString("textArrivalTerminal", resourceCulture); + } + } + /// /// Looks up a localized string similar to Berth. /// @@ -206,6 +234,15 @@ namespace BreCalClient.Resources { } } + /// + /// Looks up a localized string similar to Bunkering. + /// + public static string textBunkering { + get { + return ResourceManager.GetString("textBunkering", resourceCulture); + } + } + /// /// Looks up a localized string similar to Callsign. /// @@ -215,6 +252,24 @@ namespace BreCalClient.Resources { } } + /// + /// Looks up a localized string similar to Cancel. + /// + public static string textCancel { + get { + return ResourceManager.GetString("textCancel", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cancelled. + /// + public static string textCancelled { + get { + return ResourceManager.GetString("textCancelled", resourceCulture); + } + } + /// /// Looks up a localized string similar to Categories. /// @@ -224,6 +279,60 @@ namespace BreCalClient.Resources { } } + /// + /// Looks up a localized string similar to Change. + /// + public static string textChange { + get { + return ResourceManager.GetString("textChange", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Change password. + /// + public static string textChangePassword { + get { + return ResourceManager.GetString("textChangePassword", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Close. + /// + public static string textClose { + get { + return ResourceManager.GetString("textClose", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Departure terminal. + /// + public static string textDepartureTerminal { + get { + return ResourceManager.GetString("textDepartureTerminal", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Draft. + /// + public static string textDraft { + get { + return ResourceManager.GetString("textDraft", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Edit ship call. + /// + public static string textEditShipcall { + get { + return ResourceManager.GetString("textEditShipcall", resourceCulture); + } + } + /// /// Looks up a localized string similar to Enter keyword. /// @@ -278,6 +387,24 @@ namespace BreCalClient.Resources { } } + /// + /// Looks up a localized string similar to Moored in lock. + /// + public static string textMooredLock { + get { + return ResourceManager.GetString("textMooredLock", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Mooring. + /// + public static string textMooring { + get { + return ResourceManager.GetString("textMooring", resourceCulture); + } + } + /// /// Looks up a localized string similar to New... /// @@ -287,6 +414,42 @@ namespace BreCalClient.Resources { } } + /// + /// Looks up a localized string similar to New password. + /// + public static string textNewPassword { + get { + return ResourceManager.GetString("textNewPassword", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to OK. + /// + public static string textOK { + get { + return ResourceManager.GetString("textOK", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Old password. + /// + public static string textOldPassword { + get { + return ResourceManager.GetString("textOldPassword", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Participants. + /// + public static string textParticipants { + get { + return ResourceManager.GetString("textParticipants", resourceCulture); + } + } + /// /// Looks up a localized string similar to Password. /// @@ -296,6 +459,78 @@ namespace BreCalClient.Resources { } } + /// + /// Looks up a localized string similar to Pier side. + /// + public static string textPierside { + get { + return ResourceManager.GetString("textPierside", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Pilot. + /// + public static string textPilot { + get { + return ResourceManager.GetString("textPilot", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Pilot required. + /// + public static string textPilotRequired { + get { + return ResourceManager.GetString("textPilotRequired", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Rain sensitive cargo. + /// + public static string textRainSensitiveCargo { + get { + return ResourceManager.GetString("textRainSensitiveCargo", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Recommended tugs. + /// + public static string textRecommendedTugs { + get { + return ResourceManager.GetString("textRecommendedTugs", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Repeat new password. + /// + public static string textRepeatNewPassword { + get { + return ResourceManager.GetString("textRepeatNewPassword", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Replenishing lock. + /// + public static string textReplenishingLock { + get { + return ResourceManager.GetString("textReplenishingLock", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Replenishing terminal. + /// + public static string textReplenishingTerminal { + get { + return ResourceManager.GetString("textReplenishingTerminal", resourceCulture); + } + } + /// /// Looks up a localized string similar to Search. /// @@ -305,6 +540,15 @@ namespace BreCalClient.Resources { } } + /// + /// Looks up a localized string similar to Ship. + /// + public static string textShip { + get { + return ResourceManager.GetString("textShip", resourceCulture); + } + } + /// /// Looks up a localized string similar to Ship length. /// @@ -323,6 +567,24 @@ namespace BreCalClient.Resources { } } + /// + /// Looks up a localized string similar to Terminal. + /// + public static string textTerminal { + get { + return ResourceManager.GetString("textTerminal", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Tidal window. + /// + public static string textTidalWindow { + get { + return ResourceManager.GetString("textTidalWindow", resourceCulture); + } + } + /// /// Looks up a localized string similar to to. /// @@ -332,6 +594,33 @@ namespace BreCalClient.Resources { } } + /// + /// Looks up a localized string similar to Tug. + /// + public static string textTug { + get { + return ResourceManager.GetString("textTug", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Tug required. + /// + public static string textTugRequired { + get { + return ResourceManager.GetString("textTugRequired", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Type. + /// + public static string textType { + get { + return ResourceManager.GetString("textType", resourceCulture); + } + } + /// /// Looks up a localized string similar to User login. /// @@ -350,6 +639,15 @@ namespace BreCalClient.Resources { } } + /// + /// Looks up a localized string similar to Voyage. + /// + public static string textVoyage { + get { + return ResourceManager.GetString("textVoyage", resourceCulture); + } + } + /// /// Looks up a localized resource of type System.Byte[]. /// diff --git a/src/BreCalClient/Resources/Resources.de.resx b/src/BreCalClient/Resources/Resources.de.resx index 4a14091..46c1c18 100644 --- a/src/BreCalClient/Resources/Resources.de.resx +++ b/src/BreCalClient/Resources/Resources.de.resx @@ -151,18 +151,51 @@ Agentur + + Ankerorder + + + Terminal Ankunft + Liegeplatz Liegeplätze + + Bunkeraufnahme + Rufzeichen + + Abbrechen + + + Annulliert + Kategorien + + Ändern + + + Password ändern + + + Schliessen + + + Terminal Abfahrt + + + Tiefgang + + + Schiffsanlauf bearbeiten + Suchbegriff eingeben @@ -181,30 +214,93 @@ Anmelden + + Festmacher in Schleuse + + + Festmacher + Neu.. + + Neues Passwort + + + OK + + + Altes Passwort + + + Teilnehmer + Passwort + + Anlegeseite + + + Lotse + + + Lotsorder + + + Regensensitive Ladung + + + Anzahl Schlepper + + + Neues Passwort wiederholen + + + Versorgungsaufnahme Schleuse + + + Versorgungsaufnahme Terminal + Suche + + Schiff + Schiffslänge Sortierung + + Terminal + + + Tidenfenster + bis + + Schlepper + + + Schlepperorder + + + Typ + Anmeldung Benutzername + + Reise + trafficlight_green.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 diff --git a/src/BreCalClient/Resources/Resources.resx b/src/BreCalClient/Resources/Resources.resx index e014eb2..6208d0f 100644 --- a/src/BreCalClient/Resources/Resources.resx +++ b/src/BreCalClient/Resources/Resources.resx @@ -142,6 +142,9 @@ containership.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + containership.ico;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + emergency_stop_button.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 @@ -157,18 +160,51 @@ Agency + + Anchored + + + Arrival terminal + Berth Berths + + Bunkering + Callsign + + Cancel + + + Cancelled + Categories + + Change + + + Change password + + + Close + + + Departure terminal + + + Draft + + + Edit ship call + Enter keyword @@ -187,30 +223,93 @@ Login + + Moored in lock + + + Mooring + New.. + + New password + + + OK + + + Old password + + + Participants + Password + + Pier side + + + Pilot + + + Pilot required + + + Rain sensitive cargo + + + Recommended tugs + + + Repeat new password + + + Replenishing lock + + + Replenishing terminal + Search + + Ship + Ship length Sort order + + Terminal + + + Tidal window + to + + Tug + + + Tug required + + + Type + User login User name + + Voyage + trafficlight_green.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 diff --git a/src/BreCalClient/Resources/containership.ico b/src/BreCalClient/Resources/containership.ico new file mode 100644 index 0000000..51fbac0 Binary files /dev/null and b/src/BreCalClient/Resources/containership.ico differ diff --git a/src/BreCalClient/SearchFilterControl.xaml b/src/BreCalClient/SearchFilterControl.xaml index 565610b..bca84da 100644 --- a/src/BreCalClient/SearchFilterControl.xaml +++ b/src/BreCalClient/SearchFilterControl.xaml @@ -7,7 +7,7 @@ xmlns:local="clr-namespace:BreCalClient" xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" mc:Ignorable="d" - d:DesignHeight="56" d:DesignWidth="800"> + d:DesignHeight="56" d:DesignWidth="800" Loaded="UserControl_Loaded"> @@ -27,7 +27,7 @@ - diff --git a/src/BreCalClient/SearchFilterControl.xaml.cs b/src/BreCalClient/SearchFilterControl.xaml.cs index 4a2d3c1..4b675f7 100644 --- a/src/BreCalClient/SearchFilterControl.xaml.cs +++ b/src/BreCalClient/SearchFilterControl.xaml.cs @@ -54,7 +54,12 @@ namespace BreCalClient private void logoImage_MouseUp(object sender, MouseButtonEventArgs e) { - if (LogoImageClicked != null) LogoImageClicked(); + LogoImageClicked?.Invoke(); + } + + private void UserControl_Loaded(object sender, System.Windows.RoutedEventArgs e) + { + this.comboBoxCategories.ItemsSource = Enum.GetValues(typeof(Shipcall.TypeEnum)); } #endregion diff --git a/src/BreCalClient/ShipcallControl.xaml b/src/BreCalClient/ShipcallControl.xaml index 012b51e..1aba6ba 100644 --- a/src/BreCalClient/ShipcallControl.xaml +++ b/src/BreCalClient/ShipcallControl.xaml @@ -6,6 +6,7 @@ xmlns:local="clr-namespace:BreCalClient" xmlns:p = "clr-namespace:BreCalClient.Resources" xmlns:db="clr-namespace:BreCalClient;assembly=BreCalClient" + xmlns:db2="clr-namespace:BreCalClient.misc.Model;assembly=BreCalClient" mc:Ignorable="d" d:DesignHeight="120" d:DesignWidth="800" Loaded="UserControl_Loaded"> @@ -29,7 +30,7 @@ - + @@ -39,10 +40,32 @@ - -