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 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Bremer Schiffsmeldedienst
+
+
+
+
+ Informatikbüro Daniel Schick
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/BreCalClient/AboutDialog.xaml.cs b/src/BreCalClient/AboutDialog.xaml.cs
new file mode 100644
index 0000000..61e6154
--- /dev/null
+++ b/src/BreCalClient/AboutDialog.xaml.cs
@@ -0,0 +1,64 @@
+// Copyright (c) 2023 schick Informatik
+// Description: Show about info and allow user detail editing
+//
+
+using System;
+using System.Diagnostics;
+using System.Windows;
+using System.Windows.Controls;
+
+namespace BreCalClient
+{
+ ///
+ /// Interaction logic for AboutDialog.xaml
+ ///
+ public partial class AboutDialog : Window
+ {
+
+ #region Construction
+
+ public AboutDialog()
+ {
+ InitializeComponent();
+ }
+
+ #endregion
+
+ #region events
+
+ public event Action? ChangePasswordRequested;
+
+ #endregion
+
+ #region event handler
+
+ private void buttonClose_Click(object sender, RoutedEventArgs e)
+ {
+ this.Close();
+ }
+
+ private void buttonChangePassword_Click(object sender, RoutedEventArgs e)
+ {
+ this.ChangePasswordRequested?.Invoke(this.wpBoxOldPassword.Password, this.wpBoxNewPassword.Password);
+ }
+
+ private void Hyperlink_RequestNavigate(object sender, System.Windows.Navigation.RequestNavigateEventArgs e)
+ {
+ Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri) { UseShellExecute = true });
+ e.Handled = true;
+ }
+
+ private void wpBoxOldPassword_TextChanged(object sender, TextChangedEventArgs e)
+ {
+ this.buttonChangePassword.IsEnabled =
+ (this.wpBoxOldPassword.Password.Length > 0) &&
+ (this.wpBoxNewPassword.Password.Length > 0) &&
+ (this.wpBoxNewPasswordRepeat.Password.Length > 0) &&
+ this.wpBoxNewPassword.Password.Equals(this.wpBoxNewPasswordRepeat.Password) &&
+ (!this.wpBoxNewPassword.Password.Equals(this.wpBoxOldPassword.Password));
+ }
+
+ #endregion
+
+ }
+}
diff --git a/src/BreCalClient/BreCalClient.csproj b/src/BreCalClient/BreCalClient.csproj
index 85258c8..2dcf5a8 100644
--- a/src/BreCalClient/BreCalClient.csproj
+++ b/src/BreCalClient/BreCalClient.csproj
@@ -8,10 +8,11 @@
True
BreCalClient.App
E:\gitlager\git_brcal\misc\brecal.snk
- 0.1.0.0
- 0.1.0.0
+ 0.3.0.0
+ 0.3.0.0
Bremen calling client
A Windows WPF client for the Bremen calling API.
+ containership.ico
@@ -22,6 +23,7 @@
+
@@ -50,6 +52,10 @@
+
+
+
+
OpenApiCodeGenerator
@@ -62,6 +68,7 @@
+
diff --git a/src/BreCalClient/BreCalClient.sln b/src/BreCalClient/BreCalClient.sln
index 45314d5..469c133 100644
--- a/src/BreCalClient/BreCalClient.sln
+++ b/src/BreCalClient/BreCalClient.sln
@@ -3,7 +3,12 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.33627.172
MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BreCalClient", "BreCalClient.csproj", "{FA9E0A87-FBFB-4F2B-B5FA-46DE2E5E4BCB}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BreCalClient", "BreCalClient.csproj", "{FA9E0A87-FBFB-4F2B-B5FA-46DE2E5E4BCB}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{EE0DC107-4A84-442F-89B2-2FF2557F761A}"
+ ProjectSection(SolutionItems) = preProject
+ .editorconfig = .editorconfig
+ EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
diff --git a/src/BreCalClient/EditShipcallControl.xaml b/src/BreCalClient/EditShipcallControl.xaml
index e0c7f99..a269c97 100644
--- a/src/BreCalClient/EditShipcallControl.xaml
+++ b/src/BreCalClient/EditShipcallControl.xaml
@@ -4,9 +4,111 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:BreCalClient"
+ xmlns:p = "clr-namespace:BreCalClient.Resources"
+ xmlns:db="clr-namespace:BreCalClient;assembly=BreCalClient"
+ xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
mc:Ignorable="d"
- Title="EditShipcallControl" Height="450" Width="800">
+ Title="{x:Static p:Resources.textEditShipcall}" Height="466" Width="800" Loaded="Window_Loaded" ResizeMode="NoResize" Icon="Resources/containership.ico">
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/BreCalClient/EditShipcallControl.xaml.cs b/src/BreCalClient/EditShipcallControl.xaml.cs
index ec3d2c8..b22b005 100644
--- a/src/BreCalClient/EditShipcallControl.xaml.cs
+++ b/src/BreCalClient/EditShipcallControl.xaml.cs
@@ -1,5 +1,11 @@
-using System;
+// Copyright (c) 2023 schick Informatik
+// Description: Windows dialog to create / edit ship calls
+//
+
+using BreCalClient.misc.Model;
+using System;
using System.Collections.Generic;
+using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@@ -23,5 +29,104 @@ namespace BreCalClient
{
InitializeComponent();
}
+
+ #region Properties
+
+ public Shipcall Shipcall { get; set; } = new ();
+
+ public List Participants { get; set; } = new();
+
+ public List Berths { get; set; } = new();
+
+ public List Ships { get; set; } = new();
+
+ #endregion
+
+ #region Event handler
+
+ private void Window_Loaded(object sender, RoutedEventArgs e)
+ {
+ List aList = new();
+ List mList = new();
+ List pList = new();
+ List tList = new();
+ List terList = new();
+
+ foreach(Participant p in Participants)
+ {
+ if (p.IsFlagSet(Extensions.ParticipantType.AGENCY)) aList.Add(p);
+ if (p.IsFlagSet(Extensions.ParticipantType.MOORING)) mList.Add(p);
+ if (p.IsFlagSet(Extensions.ParticipantType.PILOT)) pList.Add(p);
+ if (p.IsFlagSet(Extensions.ParticipantType.TUG)) tList.Add(p);
+ if (p.IsFlagSet(Extensions.ParticipantType.TERMINAL)) terList.Add(p);
+ }
+
+ this.comboBoxAgency.ItemsSource = aList;
+ this.comboBoxMooring.ItemsSource = mList;
+ this.comboBoxPilot.ItemsSource = pList;
+ this.comboBoxTug.ItemsSource = tList;
+ this.comboBoxTerminal.ItemsSource = terList;
+
+ this.comboBoxShip.ItemsSource = Ships;
+ this.comboBoxCategories.ItemsSource = Enum.GetValues(typeof(Shipcall.TypeEnum));
+ this.comboBoxArrivalBerth.ItemsSource = this.Berths;
+ this.comboBoxDepartureBerth.ItemsSource = this.Berths;
+
+ this.CopyToControls();
+ }
+
+ private void buttonOK_Click(object sender, RoutedEventArgs e)
+ {
+ this.CopyToModel();
+ this.DialogResult = true; this.Close();
+ }
+
+ private void buttonCancel_Click(object sender, RoutedEventArgs e)
+ {
+ this.DialogResult= false; this.Close();
+ }
+
+ private void comboBoxShip_SelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ this.buttonOK.IsEnabled = this.comboBoxShip.SelectedItem != null;
+ }
+
+ #endregion
+
+ #region private methods
+
+ private void CopyToModel()
+ {
+ this.Shipcall.Type = (Shipcall.TypeEnum)this.comboBoxCategories.SelectedValue;
+ this.Shipcall.Eta = this.datePickerETA.Value ?? DateTime.Now;
+ this.Shipcall.Voyage = this.textBoxVoyage.Text.Trim();
+ this.Shipcall.Etd = this.datePickerETD.Value ?? DateTime.Now.AddDays(1);
+ this.Shipcall.Anchored = this.checkBoxAnchored.IsChecked;
+ this.Shipcall.ShipId = ((Ship)this.comboBoxShip.SelectedItem).Id;
+ this.Shipcall.ArrivalBerthId = (this.comboBoxArrivalBerth.SelectedValue != null) ? ((Berth)this.comboBoxArrivalBerth.SelectedValue).Id : null;
+ this.Shipcall.DepartureBerthId = (this.comboBoxDepartureBerth.SelectedValue != null) ? ((Berth)this.comboBoxDepartureBerth.SelectedValue).Id : null;
+ this.Shipcall.Bunkering = this.checkBoxBunkering.IsChecked;
+ this.Shipcall.Canceled = this.checkBoxCanceled.IsChecked;
+ this.Shipcall.Draft = (float?) this.doubleUpDownDraft.Value;
+ this.Shipcall.MooredLock = this.checkBoxMooredLock.IsChecked;
+ // this.Shipcall.PierSide = this.comboBoxPierside.SelectedValue;
+ this.Shipcall.RainSensitiveCargo = this.checkBoxRainsensitiveCargo.IsChecked;
+ this.Shipcall.PilotRequired = this.checkBoxPilotRequired.IsChecked;
+ this.Shipcall.ReplenishingLock = this.checkBoxReplenishingLock.IsChecked;
+ this.Shipcall.ReplenishingTerminal = this.checkBoxReplenishingTerminal.IsChecked;
+ this.Shipcall.RecommendedTugs = this.integerUpDownRecommendedTugs.Value;
+ this.Shipcall.TidalWindowFrom = this.datePickerTidalWindowFrom.Value;
+ this.Shipcall.TidalWindowTo = this.datePickerTidalWindowTo.Value;
+ this.Shipcall.TugReguired = this.checkBoxTugRequired.IsChecked;
+ }
+
+ private void CopyToControls()
+ {
+ if (this.Shipcall == null) return;
+
+ }
+
+ #endregion
+
}
}
diff --git a/src/BreCalClient/MainWindow.xaml b/src/BreCalClient/MainWindow.xaml
index 44f992b..fdc42d4 100644
--- a/src/BreCalClient/MainWindow.xaml
+++ b/src/BreCalClient/MainWindow.xaml
@@ -7,7 +7,7 @@
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:p = "clr-namespace:BreCalClient.Resources"
mc:Ignorable="d"
- Title="{DynamicResource textApplicationTitle}" Height="450" Width="800" Loaded="Window_Loaded" Closing="Window_Closing">
+ Title="{DynamicResource textApplicationTitle}" Height="450" Width="800" Loaded="Window_Loaded" Closing="Window_Closing" Icon="Resources/containership.ico">
@@ -57,8 +57,8 @@
-
-
+
+
@@ -87,9 +87,13 @@
+
+
-
-
+
+
+
+
@@ -101,18 +105,24 @@
-
-
-
+
-
+
-
+
+
+
+
+
+
+
+
+
diff --git a/src/BreCalClient/MainWindow.xaml.cs b/src/BreCalClient/MainWindow.xaml.cs
index 1d721e6..38b5462 100644
--- a/src/BreCalClient/MainWindow.xaml.cs
+++ b/src/BreCalClient/MainWindow.xaml.cs
@@ -21,6 +21,9 @@ namespace BreCalClient
///
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 @@
-
+
@@ -37,8 +37,8 @@
-
-
+
+
@@ -48,9 +48,9 @@
-
-
-
+
+
+
@@ -75,7 +75,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 @@
-
-
+
+
+
+
+
+
+
+
+
+
-
+
@@ -51,7 +74,7 @@
-
+
@@ -86,7 +109,7 @@
-
+
importBerthList = new();
+
+ try
+ {
+ do
+ {
+ while (reader.Read())
+ {
+ if (reader.FieldCount < 2)
+ {
+ throw new InvalidDataException("Sheet must have at least 2 Columns of data");
+ }
+ Berth b = new Berth();
+ if (reader.IsDBNull(0) && reader.IsDBNull(1)) continue;
+ if (!reader.IsDBNull(0)) b.Name = reader.GetString(0);
+ string participant_name;
+ if (!reader.IsDBNull(1)) participant_name = reader.GetString(1);
+
+ importBerthList.Add(b);
+ }
+ } while (reader.NextResult());
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show("Error reading Excel: " + ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
+ }
+
+
+ }
+
+ stream.Close();
+ }
}
private void buttonImportShipss_Click(object sender, RoutedEventArgs e)
diff --git a/src/RoleEditor/RoleEditor.csproj b/src/RoleEditor/RoleEditor.csproj
index d2383ef..a158f56 100644
--- a/src/RoleEditor/RoleEditor.csproj
+++ b/src/RoleEditor/RoleEditor.csproj
@@ -28,6 +28,7 @@
+
diff --git a/src/RoleEditor/RoleEditor.sln b/src/RoleEditor/RoleEditor.sln
index 6b98d6e..7fd8bd3 100644
--- a/src/RoleEditor/RoleEditor.sln
+++ b/src/RoleEditor/RoleEditor.sln
@@ -7,7 +7,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RoleEditor", "RoleEditor.cs
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "brecal.model", "..\brecal.model\brecal.model.csproj", "{F3BC5ADC-BF57-47DC-A5D5-CC4A13857DEE}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "brecal.mysql", "..\brecal.mysql\brecal.mysql.csproj", "{E88F908B-48C9-46BD-A3AE-C36FBE9EDF1F}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "brecal.mysql", "..\brecal.mysql\brecal.mysql.csproj", "{E88F908B-48C9-46BD-A3AE-C36FBE9EDF1F}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{17164AE2-AB25-4394-A865-4A8CF524D6DA}"
+ ProjectSection(SolutionItems) = preProject
+ .editorconfig = .editorconfig
+ EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
diff --git a/src/server/BreCal/__init__.py b/src/server/BreCal/__init__.py
index 5f67db0..e15818a 100644
--- a/src/server/BreCal/__init__.py
+++ b/src/server/BreCal/__init__.py
@@ -11,6 +11,7 @@ from .api import notifications
from .api import berths
from .api import ships
from .api import login
+from .api import user
sessions = dict()
@@ -39,6 +40,7 @@ def create_app(test_config=None):
app.register_blueprint(berths.bp)
app.register_blueprint(ships.bp)
app.register_blueprint(login.bp)
+ app.register_blueprint(user.bp)
logging.basicConfig(filename='brecal.log', level=logging.DEBUG, format='%(asctime)s | %(name)s | %(levelname)s | %(message)s')
diff --git a/src/server/BreCal/api/user.py b/src/server/BreCal/api/user.py
new file mode 100644
index 0000000..bbd5b4b
--- /dev/null
+++ b/src/server/BreCal/api/user.py
@@ -0,0 +1,24 @@
+from flask import Blueprint, request
+from ..schemas import model
+from .. import impl
+from ..services.auth_guard import auth_guard
+import json
+import logging
+
+bp = Blueprint('user', __name__)
+
+@bp.route('/user', methods=['put'])
+@auth_guard() # no restriction by role
+def PutUser():
+
+ try:
+ content = request.get_json(force=True)
+ loadedModel = model.UserSchema().load(data=content, many=False, partial=True)
+
+ except Exception as ex:
+ logging.error(ex)
+ print(ex)
+ return json.dumps("bad format"), 400
+
+ return impl.user.PutUser(loadedModel)
+
diff --git a/src/server/BreCal/impl/__init__.py b/src/server/BreCal/impl/__init__.py
index 4052c42..4e1e218 100644
--- a/src/server/BreCal/impl/__init__.py
+++ b/src/server/BreCal/impl/__init__.py
@@ -5,3 +5,4 @@ from . import shipcalls
from . import times
from . import ships
from . import login
+from . import user
\ No newline at end of file
diff --git a/src/server/BreCal/impl/berths.py b/src/server/BreCal/impl/berths.py
index 4d71958..6c41ba9 100644
--- a/src/server/BreCal/impl/berths.py
+++ b/src/server/BreCal/impl/berths.py
@@ -15,7 +15,7 @@ def GetBerths(token):
try:
pooledConnection = local_db.getPoolConnection()
commands = pydapper.using(pooledConnection)
- data = commands.query("SELECT id, name, participant_id, `lock`, created, modified FROM berth ORDER BY name", model=model.Berth)
+ data = commands.query("SELECT id, name, participant_id, `lock`, created, modified, deleted FROM berth ORDER BY name", model=model.Berth)
pooledConnection.close()
except Exception as ex:
diff --git a/src/server/BreCal/impl/login.py b/src/server/BreCal/impl/login.py
index ed0aab8..cef9e4c 100644
--- a/src/server/BreCal/impl/login.py
+++ b/src/server/BreCal/impl/login.py
@@ -14,7 +14,7 @@ def GetUser(options):
hash = bcrypt.hashpw(options["password"].encode('utf-8'), bcrypt.gensalt( 12 )).decode('utf8')
pooledConnection = local_db.getPoolConnection()
commands = pydapper.using(pooledConnection)
- data = commands.query("SELECT id, participant_id, first_name, last_name, user_name, user_email, user_phone, password_hash, api_key FROM user WHERE user_name = ?username? OR user_email = ?username?",
+ data = commands.query("SELECT id, participant_id, first_name, last_name, user_name, user_email, user_phone, password_hash, api_key, created, modified FROM user WHERE user_name = ?username? OR user_email = ?username?",
model=model.User, param={"username" : options["username"]})
pooledConnection.close()
# print(data)
diff --git a/src/server/BreCal/impl/participant.py b/src/server/BreCal/impl/participant.py
index e447b73..be1d7ec 100644
--- a/src/server/BreCal/impl/participant.py
+++ b/src/server/BreCal/impl/participant.py
@@ -17,9 +17,9 @@ def GetParticipant(options):
pooledConnection = local_db.getPoolConnection()
commands = pydapper.using(pooledConnection)
if "user_id" in options and options["user_id"]:
- data = commands.query("SELECT p.id as id, p.name as name, p.street as street, p.postal_code as postal_code, p.city as city, p.type as type, p.flags as flags, p.created as created, p.modified as modified FROM participant p INNER JOIN user u WHERE u.participant_id = p.id and u.id = ?userid?", model=model.Participant, param={"userid" : options["user_id"]})
+ data = commands.query("SELECT p.id as id, p.name as name, p.street as street, p.postal_code as postal_code, p.city as city, p.type as type, p.flags as flags, p.created as created, p.modified as modified, p.deleted as deleted FROM participant p INNER JOIN user u WHERE u.participant_id = p.id and u.id = ?userid?", model=model.Participant, param={"userid" : options["user_id"]})
else:
- data = commands.query("SELECT p.id as id, p.name as name, p.street as street, p.postal_code as postal_code, p.city as city, p.type as type, p.flags as flags, p.created as created, p.modified as modified FROM participant p ORDER BY p.name", model=model.Participant)
+ data = commands.query("SELECT id, name, street, postal_code, city, type, flags, created, modified, deleted FROM participant p ORDER BY p.name", model=model.Participant)
pooledConnection.close()
except Exception as ex:
diff --git a/src/server/BreCal/impl/shipcalls.py b/src/server/BreCal/impl/shipcalls.py
index 26a05bd..d59cd83 100644
--- a/src/server/BreCal/impl/shipcalls.py
+++ b/src/server/BreCal/impl/shipcalls.py
@@ -18,8 +18,8 @@ def GetShipcalls(options):
pooledConnection = local_db.getPoolConnection()
commands = pydapper.using(pooledConnection)
data = commands.query("SELECT id, ship_id, type, eta, voyage, etd, arrival_berth_id, departure_berth_id, tug_required, pilot_required, " +
- "flags, pier_side, bunkering, replenishing, draft, tidal_window_from, tidal_window_to, rain_sensitive_cargo, recommended_tugs, " +
- "created, modified FROM shipcall WHERE eta IS NULL OR eta >= DATE(NOW() - INTERVAL 2 DAY) " +
+ "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 FROM shipcall WHERE eta IS NULL OR eta >= DATE(NOW() - INTERVAL 2 DAY) " +
"ORDER BY eta", model=model.Shipcall)
for shipcall in data:
participant_query = "SELECT participant_id FROM shipcall_participant_map WHERE shipcall_id=?shipcall_id?";
diff --git a/src/server/BreCal/impl/ships.py b/src/server/BreCal/impl/ships.py
index 4345ac4..4288d7b 100644
--- a/src/server/BreCal/impl/ships.py
+++ b/src/server/BreCal/impl/ships.py
@@ -16,7 +16,7 @@ def GetShips(token):
pooledConnection = local_db.getPoolConnection()
commands = pydapper.using(pooledConnection)
- data = commands.query("SELECT id, name, imo, callsign, participant_id, length, width, created, modified FROM ship ORDER BY name", model=model.Ship)
+ data = commands.query("SELECT id, name, imo, callsign, participant_id, length, width, is_tug, bollard_pull, eni, created, modified, deleted FROM ship ORDER BY name", model=model.Ship)
pooledConnection.close()
except Exception as ex:
diff --git a/src/server/BreCal/impl/times.py b/src/server/BreCal/impl/times.py
index 6dc9bc1..359d8d0 100644
--- a/src/server/BreCal/impl/times.py
+++ b/src/server/BreCal/impl/times.py
@@ -18,7 +18,8 @@ def GetTimes(options):
pooledConnection = local_db.getPoolConnection()
commands = pydapper.using(pooledConnection)
- data = commands.query("SELECT id, start_planned, end_planned, duration_planned, start_actual, end_actual, duration_actual, shipcall_id, participant_id, created, modified FROM times " +
+ data = commands.query("SELECT 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 FROM times " +
"WHERE times.shipcall_id = ?scid?", model=model.Times, param={"scid" : options["shipcall_id"]})
pooledConnection.close()
diff --git a/src/server/BreCal/impl/user.py b/src/server/BreCal/impl/user.py
new file mode 100644
index 0000000..ece0d5f
--- /dev/null
+++ b/src/server/BreCal/impl/user.py
@@ -0,0 +1,71 @@
+import json
+import logging
+import pydapper
+import bcrypt
+
+from ..schemas import model
+from .. import local_db
+
+def PutUser(schemaModel):
+ """
+
+ :param schemaModel: The deserialized dict of the request
+ """
+
+ # This updates an *existing* entry
+ try:
+
+ pooledConnection = local_db.getPoolConnection()
+ commands = pydapper.using(pooledConnection)
+
+ # test if object to update is found
+
+ sentinel = object()
+ theuser = commands.query_single_or_default("SELECT * FROM user where id = ?id?", sentinel, param={"id" : schemaModel["id"]}, model=model.User)
+ if theuser is sentinel:
+ pooledConnection.close()
+ return json.dumps("no such record"), 404, {'Content-Type': 'application/json; charset=utf-8'}
+
+ # see if we need to update public fields
+ if "first_name" in schemaModel or "last_name" in schemaModel or "user_phone" in schemaModel:
+ query = "UPDATE user SET "
+ isNotFirst = False
+ for key in schemaModel.keys():
+ if key == "id":
+ continue
+ if key == "old_password":
+ continue
+ if key == "new_password":
+ continue
+ if isNotFirst:
+ query += ", "
+ isNotFirst = True
+ query += key + " = ?" + key + "? "
+
+ query += "WHERE id = ?id?"
+ affected_rows = commands.execute(query, param=schemaModel)
+
+ # update password if available and old pw is (correctly!) given
+ if "old_password" in schemaModel and schemaModel["old_password"] and "new_password" in schemaModel and schemaModel["new_password"]:
+ if bcrypt.checkpw(schemaModel["old_password"].encode("utf-8"), bytes(theuser.password_hash, "utf-8")): # old pw matches
+ password_hash = bcrypt.hashpw(schemaModel["new_password"].encode('utf-8'), bcrypt.gensalt( 12 )).decode('utf8')
+ query = "UPDATE user SET password_hash = ?password_hash? WHERE id = ?id?"
+ commands.execute(query, param={"password_hash" : password_hash, "id" : schemaModel["id"]})
+ else:
+ result = {}
+ result["message"] = "old password invalid"
+ return json.dumps(result), 400, {'Content-Type': 'application/json; charset=utf-8'}
+
+ pooledConnection.close()
+
+ return json.dumps({"id" : schemaModel["id"]}), 200
+
+ except Exception as ex:
+ logging.error(ex)
+ print(ex)
+ result = {}
+ result["message"] = "call failed"
+ return json.dumps(result), 500, {'Content-Type': 'application/json; charset=utf-8'}
+
+
+
diff --git a/src/server/BreCal/schemas/model.py b/src/server/BreCal/schemas/model.py
index 079954f..439098b 100644
--- a/src/server/BreCal/schemas/model.py
+++ b/src/server/BreCal/schemas/model.py
@@ -19,6 +19,7 @@ class Berth(Schema):
lock: bool
created: datetime
modified: datetime
+ deleted: bool
class Error(Schema):
message = fields.String(required=True,)
@@ -50,6 +51,7 @@ class Participant(Schema):
flags: int
created: datetime
modified: datetime
+ deleted: bool
class ParticipantList(Participant):
pass
@@ -73,12 +75,16 @@ class ShipcallSchema(Schema):
flags = fields.Int()
pier_side = fields.Bool()
bunkering = fields.Bool()
- replenishing = fields.Bool()
+ replenishing_terminal = fields.Bool()
+ replenishing_lock = fields.Bool()
draft = fields.Float()
tidal_window_from = fields.DateTime()
tidal_window_to = fields.DateTime()
rain_sensitive_cargo = fields.Bool()
recommended_tugs = fields.Int()
+ anchored = fields.Bool()
+ moored_lock = fields.Bool()
+ canceled = fields.Bool()
participants = fields.List(fields.Int)
created = fields.DateTime()
modified = fields.DateTime()
@@ -99,12 +105,16 @@ class Shipcall:
flags: int
pier_side: bool
bunkering: bool
- replenishing: bool
+ replenishing_terminal: bool
+ replenishing_lock: bool
draft: float
tidal_window_from: datetime
tidal_window_to: datetime
rain_sensitive_cargo: bool
recommended_tugs: int
+ anchored: bool
+ moored_lock: bool
+ canceled: bool
created: datetime
modified: datetime
participants: List[int] = field(default_factory=list)
@@ -120,27 +130,50 @@ class TimesSchema(Schema):
pass
id = fields.Int(Required=False)
- start_planned = fields.DateTime(Required=False)
- end_planned = fields.DateTime(Required = False)
- duration_planned = fields.Int(Required = False)
- start_actual = fields.DateTime(Required = False)
- end_actual = fields.DateTime(Required = False)
- duration_actual = fields.Int(Required = False)
+ eta_berth = fields.DateTime(Required = False)
+ eta_berth_fixed = fields.Bool(Required = False)
+ etd_berth = fields.DateTime(Required = False)
+ etd_berth_fixed = fields.Bool(Required = False)
+ lock_time = fields.DateTime(Required = False)
+ lock_time_fixed = fields.Bool(Required = False)
+ zone_entry = fields.DateTime(Required = False)
+ zone_entry_fixed = fields.Bool(Required = False)
+ operations_start = fields.DateTime(Required = False)
+ operations_end = fields.DateTime(Required = False)
+ remarks = fields.String(Required = False)
participant_id = fields.Int(Required = True)
shipcall_id = fields.Int(Required = True)
created = fields.DateTime(Required = False)
modified = fields.DateTime(Required = False)
+# deserialize PUT object target
+
+class UserSchema(Schema):
+ def __init__(self):
+ super().__init__(unknown=None)
+ pass
+ id = fields.Int(required=True)
+ first_name = fields.Str(required=False)
+ last_name = fields.Str(required=False)
+ user_phone = fields.Str(required=False)
+ old_password = fields.Str(required=False)
+ new_password = fields.Str(required=False)
+
@dataclass
class Times:
id: int
- start_planned: datetime
- end_planned: datetime
- duration_planned: int
- start_actual: datetime
- end_actual: datetime
- duration_actual: int
+ eta_berth: datetime
+ eta_berth_fixed: bool
+ etd_berth: datetime
+ etd_berth_fixed: bool
+ lock_time: datetime
+ lock_time_fixed: bool
+ zone_entry: datetime
+ zone_entry_fixed: bool
+ operations_start: datetime
+ operations_end: datetime
+ remarks: str
participant_id: int
shipcall_id: int
created: datetime
@@ -158,6 +191,8 @@ class User:
user_phone: str
password_hash: str
api_key: str
+ created: datetime
+ modified: datetime
@dataclass
class Ship(Schema):
@@ -168,8 +203,12 @@ class Ship(Schema):
participant_id: int
length: float
width: float
+ is_tug: bool
+ bollard_pull: int
+ eni: str
created: datetime
modified: datetime
+ deleted: bool
class TimesId(Schema):
pass