Create assignment and un-assignment notifications

This commit is contained in:
Daniel Schick 2024-12-10 10:30:26 +01:00
parent 023f3357f3
commit ebb2182c4c
11 changed files with 236 additions and 60 deletions

View File

@ -1,7 +1,7 @@
//---------------------- //----------------------
// <auto-generated> // <auto-generated>
// Generated REST API Client Code Generator v1.16.0.0 on 05.12.2024 18:21:44 // Generated REST API Client Code Generator v1.16.0.0 on 10.12.2024 08:56:03
// Using the tool OpenAPI Generator v7.9.0 // Using the tool OpenAPI Generator v7.9.0
// </auto-generated> // </auto-generated>
//---------------------- //----------------------
@ -46,7 +46,7 @@ using System.Threading.Tasks;
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 1.6.0 * The version of the OpenAPI document: 1.7.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -850,7 +850,7 @@ namespace BreCalClient.misc.Api
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 1.6.0 * The version of the OpenAPI document: 1.7.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -1505,7 +1505,7 @@ namespace BreCalClient.misc.Api
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 1.6.0 * The version of the OpenAPI document: 1.7.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -2450,7 +2450,7 @@ namespace BreCalClient.misc.Api
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 1.6.0 * The version of the OpenAPI document: 1.7.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -3269,7 +3269,7 @@ namespace BreCalClient.misc.Api
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 1.6.0 * The version of the OpenAPI document: 1.7.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -3754,7 +3754,7 @@ namespace BreCalClient.misc.Api
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 1.6.0 * The version of the OpenAPI document: 1.7.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -4474,7 +4474,7 @@ namespace BreCalClient.misc.Client
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 1.6.0 * The version of the OpenAPI document: 1.7.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -4534,7 +4534,7 @@ namespace BreCalClient.misc.Client
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 1.6.0 * The version of the OpenAPI document: 1.7.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -4674,7 +4674,7 @@ namespace BreCalClient.misc.Client
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 1.6.0 * The version of the OpenAPI document: 1.7.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -4898,7 +4898,7 @@ namespace BreCalClient.misc.Client
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 1.6.0 * The version of the OpenAPI document: 1.7.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -5357,7 +5357,7 @@ namespace BreCalClient.misc.Client
string report = "C# SDK (BreCalClient.misc) Debug Report:\n"; string report = "C# SDK (BreCalClient.misc) Debug Report:\n";
report += " OS: " + System.Environment.OSVersion + "\n"; report += " OS: " + System.Environment.OSVersion + "\n";
report += " .NET Framework Version: " + System.Environment.Version + "\n"; report += " .NET Framework Version: " + System.Environment.Version + "\n";
report += " Version of the API: 1.6.0\n"; report += " Version of the API: 1.7.0\n";
report += " SDK Package Version: 1.0.0\n"; report += " SDK Package Version: 1.0.0\n";
return report; return report;
} }
@ -5426,7 +5426,7 @@ namespace BreCalClient.misc.Client
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 1.6.0 * The version of the OpenAPI document: 1.7.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -5446,7 +5446,7 @@ namespace BreCalClient.misc.Client
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 1.6.0 * The version of the OpenAPI document: 1.7.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -5503,7 +5503,7 @@ namespace BreCalClient.misc.Client
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 1.6.0 * The version of the OpenAPI document: 1.7.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -5536,7 +5536,7 @@ namespace BreCalClient.misc.Client
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 1.6.0 * The version of the OpenAPI document: 1.7.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -5569,7 +5569,7 @@ namespace BreCalClient.misc.Client
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 1.6.0 * The version of the OpenAPI document: 1.7.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -5660,7 +5660,7 @@ namespace BreCalClient.misc.Client
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 1.6.0 * The version of the OpenAPI document: 1.7.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -5777,7 +5777,7 @@ namespace BreCalClient.misc.Client
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 1.6.0 * The version of the OpenAPI document: 1.7.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -5861,7 +5861,7 @@ namespace BreCalClient.misc.Client
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 1.6.0 * The version of the OpenAPI document: 1.7.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -6120,7 +6120,7 @@ namespace BreCalClient.misc.Client
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 1.6.0 * The version of the OpenAPI document: 1.7.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -6148,7 +6148,7 @@ namespace BreCalClient.misc.Client
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 1.6.0 * The version of the OpenAPI document: 1.7.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -6218,7 +6218,7 @@ namespace BreCalClient.misc.Client
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 1.6.0 * The version of the OpenAPI document: 1.7.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -6245,7 +6245,7 @@ namespace BreCalClient.misc.Client
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 1.6.0 * The version of the OpenAPI document: 1.7.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -6312,7 +6312,7 @@ namespace BreCalClient.misc.Model
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 1.6.0 * The version of the OpenAPI document: 1.7.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -6477,7 +6477,7 @@ namespace BreCalClient.misc.Model
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 1.6.0 * The version of the OpenAPI document: 1.7.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -6568,7 +6568,7 @@ namespace BreCalClient.misc.Model
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 1.6.0 * The version of the OpenAPI document: 1.7.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -6656,7 +6656,7 @@ namespace BreCalClient.misc.Model
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 1.6.0 * The version of the OpenAPI document: 1.7.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -6697,7 +6697,7 @@ namespace BreCalClient.misc.Model
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 1.6.0 * The version of the OpenAPI document: 1.7.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -6822,7 +6822,7 @@ namespace BreCalClient.misc.Model
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 1.6.0 * The version of the OpenAPI document: 1.7.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -6887,7 +6887,7 @@ namespace BreCalClient.misc.Model
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 1.6.0 * The version of the OpenAPI document: 1.7.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -6915,7 +6915,7 @@ namespace BreCalClient.misc.Model
/// <param name="notifyPopup">notifyPopup.</param> /// <param name="notifyPopup">notifyPopup.</param>
/// <param name="exp">exp.</param> /// <param name="exp">exp.</param>
/// <param name="token">token.</param> /// <param name="token">token.</param>
public LoginResult(int id = default(int), int participantId = default(int), string firstName = default(string), string lastName = default(string), string userName = default(string), string userPhone = default(string), string userEmail = default(string), bool notifyEmail = default(bool), bool notifyWhatsapp = default(bool), bool notifySignal = default(bool), bool notifyPopup = default(bool), float exp = default(float), string token = default(string)) public LoginResult(int id = default(int), int participantId = default(int), string firstName = default(string), string lastName = default(string), string userName = default(string), string userPhone = default(string), string userEmail = default(string), bool? notifyEmail = default(bool?), bool? notifyWhatsapp = default(bool?), bool? notifySignal = default(bool?), bool? notifyPopup = default(bool?), float exp = default(float), string token = default(string))
{ {
this.Id = id; this.Id = id;
this.ParticipantId = participantId; this.ParticipantId = participantId;
@ -6994,7 +6994,7 @@ namespace BreCalClient.misc.Model
<example>true</example> <example>true</example>
*/ */
[DataMember(Name = "notify_email", EmitDefaultValue = true)] [DataMember(Name = "notify_email", EmitDefaultValue = true)]
public bool NotifyEmail { get; set; } public bool? NotifyEmail { get; set; }
/// <summary> /// <summary>
/// Gets or Sets NotifyWhatsapp /// Gets or Sets NotifyWhatsapp
/// </summary> /// </summary>
@ -7002,7 +7002,7 @@ namespace BreCalClient.misc.Model
<example>false</example> <example>false</example>
*/ */
[DataMember(Name = "notify_whatsapp", EmitDefaultValue = true)] [DataMember(Name = "notify_whatsapp", EmitDefaultValue = true)]
public bool NotifyWhatsapp { get; set; } public bool? NotifyWhatsapp { get; set; }
/// <summary> /// <summary>
/// Gets or Sets NotifySignal /// Gets or Sets NotifySignal
/// </summary> /// </summary>
@ -7010,7 +7010,7 @@ namespace BreCalClient.misc.Model
<example>false</example> <example>false</example>
*/ */
[DataMember(Name = "notify_signal", EmitDefaultValue = true)] [DataMember(Name = "notify_signal", EmitDefaultValue = true)]
public bool NotifySignal { get; set; } public bool? NotifySignal { get; set; }
/// <summary> /// <summary>
/// Gets or Sets NotifyPopup /// Gets or Sets NotifyPopup
/// </summary> /// </summary>
@ -7018,7 +7018,7 @@ namespace BreCalClient.misc.Model
<example>false</example> <example>false</example>
*/ */
[DataMember(Name = "notify_popup", EmitDefaultValue = true)] [DataMember(Name = "notify_popup", EmitDefaultValue = true)]
public bool NotifyPopup { get; set; } public bool? NotifyPopup { get; set; }
/// <summary> /// <summary>
/// Gets or Sets Exp /// Gets or Sets Exp
/// </summary> /// </summary>
@ -7084,7 +7084,7 @@ namespace BreCalClient.misc.Model
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 1.6.0 * The version of the OpenAPI document: 1.7.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -7203,7 +7203,7 @@ namespace BreCalClient.misc.Model
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 1.6.0 * The version of the OpenAPI document: 1.7.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -7235,7 +7235,12 @@ namespace BreCalClient.misc.Model
/// Enum TimeConflictResolved for value: time_conflict_resolved /// Enum TimeConflictResolved for value: time_conflict_resolved
/// </summary> /// </summary>
[EnumMember(Value = "time_conflict_resolved")] [EnumMember(Value = "time_conflict_resolved")]
TimeConflictResolved = 4 TimeConflictResolved = 4,
/// <summary>
/// Enum Unassigned for value: unassigned
/// </summary>
[EnumMember(Value = "unassigned")]
Unassigned = 5
} }
} }
@ -7244,7 +7249,7 @@ namespace BreCalClient.misc.Model
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 1.6.0 * The version of the OpenAPI document: 1.7.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -7275,7 +7280,7 @@ namespace BreCalClient.misc.Model
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 1.6.0 * The version of the OpenAPI document: 1.7.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -7316,7 +7321,7 @@ namespace BreCalClient.misc.Model
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 1.6.0 * The version of the OpenAPI document: 1.7.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -7516,7 +7521,7 @@ namespace BreCalClient.misc.Model
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 1.6.0 * The version of the OpenAPI document: 1.7.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -7598,7 +7603,7 @@ namespace BreCalClient.misc.Model
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 1.6.0 * The version of the OpenAPI document: 1.7.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -7736,7 +7741,7 @@ namespace BreCalClient.misc.Model
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 1.6.0 * The version of the OpenAPI document: 1.7.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -7948,7 +7953,7 @@ namespace BreCalClient.misc.Model
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 1.6.0 * The version of the OpenAPI document: 1.7.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -8354,7 +8359,7 @@ namespace BreCalClient.misc.Model
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 1.6.0 * The version of the OpenAPI document: 1.7.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -8395,7 +8400,7 @@ namespace BreCalClient.misc.Model
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 1.6.0 * The version of the OpenAPI document: 1.7.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */
@ -8750,7 +8755,7 @@ namespace BreCalClient.misc.Model
* *
* Administer DEBRE ship calls, times and notifications * Administer DEBRE ship calls, times and notifications
* *
* The version of the OpenAPI document: 1.6.0 * The version of the OpenAPI document: 1.7.0
* Contact: info@textbausteine.net * Contact: info@textbausteine.net
* Generated by: https://github.com/openapitools/openapi-generator.git * Generated by: https://github.com/openapitools/openapi-generator.git
*/ */

View File

@ -1700,21 +1700,27 @@ components:
example: johndoe example: johndoe
user_phone: user_phone:
type: string type: string
nullable: true
example: '1234567890' example: '1234567890'
user_email: user_email:
type: string type: string
nullable: true
example: no@where.com example: no@where.com
notify_email: notify_email:
type: boolean type: boolean
nullable: true
example: true example: true
notify_whatsapp: notify_whatsapp:
type: boolean type: boolean
nullable: true
example: false example: false
notify_signal: notify_signal:
type: boolean type: boolean
nullable: true
example: false example: false
notify_popup: notify_popup:
type: boolean type: boolean
nullable: true
example: false example: false
exp: exp:
type: number type: number
@ -1838,6 +1844,7 @@ components:
- next24h - next24h
- time_conflict - time_conflict
- time_conflict_resolved - time_conflict_resolved
- unassigned
example: time_conflict example: time_conflict
EvaluationType: EvaluationType:
description: Evaluation of the ship call description: Evaluation of the ship call

103
misc/notifications.md Normal file
View File

@ -0,0 +1,103 @@
# Benachrichtigungen
___
## Benachrichtigungs-Typen (Auslöser)
### 1. Teilnehmer wird zugeordnet
Ein Teilnehmer wird über die Anwendung einem Anlauf zugeordnet. Dies ist entweder die Agentur (durch BSMD zugeordnet) oder ein weiterer Teilnehmer außer dem Hafenamt, der durch die Agentur zugeordnet wird. Die Zuordnung des Hafenamts erfolgt automatisch bei Anlage des Anlaufs.
### 2. Morgenrunde ist relevant
Ein Teilnehmer ist einem Anlauf zugeordnet. Dieser Anlauf findet in den nächsten 24 Stunden statt und ist daher für die "Morgenrunde" relevant. Der Teilnehmer erhält dazu eine Benachrichtigung.
### 3. Zeitlicher Konflikt ("Ampel")
Durch unterschiedliche Zeitangaben der Teilnehmer wird die Ampel ausgelöst und stellt eine entsprechende Fehlermeldung dar. Die Benachrichtigung wird ausgelöst bei folgenden Ampel-Wechseln:
* grün -> gelb
* grün -> rot
* gelb -> rot
### 4. Auflösung zeitl. Konflikt
* rot -> gelb
* rot -> grün
* gelb -> grün
### 5. Abwählen eines Teilnehmer
Der Teilnehmer ist nicht mehr länger dem Anlauf zugeordnet.
## API
```yaml
NotificationType:
type: string
description: Type of notification
enum:
- assignment
- next24h
- time_conflict
- time_conflict_resolved
- unassigned
```
## Entfernen von Benachrichtigungen
Unter den folgenden Voraussetzungen werden Benachrichtigungen wieder aus dem System entfernt:
* Die Benachrichtigung ist älter als 3 Tage (n.B.: Zeitraum definieren)
* Ein Teilnehmer wird wieder abgewählt
* Ein zeitlicher Konflikt wird aufgelöst
## Ablauf der Benachrichtigungen
Eine Benachrichtung enthält folgende Informationen:
* Verweis auf den Anlauf (shipcall)
* ein Erstell- und Änderungsdatum
* einen Benachrichtigungs-Typ
* einen Zustand ("level")
Der Zustand steuert den Ablauf, wenn die Prüfungsfunktion die Anläufe durchsucht oder ein Anlauf gespeichert wird.
Wird einer der Zustände 1-3 erkannt wird geprüft, ob bereits eine Benachrichtigung vorhanden ist. Ist dies nicht der Fall, wird eine Benachrichtigung neu erstellt im Zustand "0".
Die Prüfungsfunktion durchläuft alle Benachrichtigungen. Abhängig vom Zustand (0-2) werden folgende Aktionen ausgeführt:
* Ist die Benachrichtigung um Zustand "0" und sind mind. 10 Minuten vergangen, wird die Benachrichtigung in den Zustand "1" versetzt.
* Ist die Benachrichtigung im Zustand "1" wird versucht, allen dafür eingetragenenen Benutzern eine E-Mail zu senden. Ist dies erfolgreich, wechselt die Benachrichtigung in den Zustand "2".
* Ist die Benachrichtigung im Zustand "2" und sind mind. 3 Tage vergangen wird die Benachrichtigung gelöscht.
```mermaid
---
title: Ablauf
---
stateDiagram-v2
state "Level 0" as lvl0
state "Level 1" as lvl1
state "Level 2" as lvl2
[*] --> lvl0: Zustand 1-3 erkannt
lvl0 --> lvl1: +10 min.
lvl1 --> lvl2: E-Mail Versand erfolgt
lvl2 --> [*]: +3 Tage ODER Zustand 1-3 nicht mehr relevant
lvl0 --> [*]: Zustand 1-3 nicht mehr relevant
```
## Bemerkungen
Für die Zukunft sind ggf. auch Benachrichtigungen via Whatsapp/Signal geplant. Diese verhalten sich analog zu den E-Mail Benachrichtigungen und werden nur einmal versendet. Die Anzahl der Zustände wird dabei erhöht bzw. der Wechsel in den Endzustand ensprechend angepasst.
## Benachrichtigungstext
... TBD

View File

@ -0,0 +1,10 @@
ALTER TABLE `notification`
ADD COLUMN `participant_id` INT UNSIGNED NULL DEFAULT NULL AFTER `shipcall_id`,
ADD INDEX `FK_NOTIFICATION_PARTICIPANT_idx` (`participant_id` ASC) VISIBLE;
;
ALTER TABLE `notification`
ADD CONSTRAINT `FK_NOTIFICATION_PARTICIPANT`
FOREIGN KEY (`participant_id`)
REFERENCES `participant` (`id`)
ON DELETE RESTRICT
ON UPDATE RESTRICT;

10
misc/weserport.md Normal file
View File

@ -0,0 +1,10 @@
# Schnittstelle Weserport Anforderungen
##
Automatische Zuordnung:
* Hafenamt
* Festmacher
* Lotsen (>120m l 13m br)

View File

@ -1,4 +1,5 @@
from BreCal.database.sql_handler import execute_sql_query_standalone from BreCal.database.sql_handler import execute_sql_query_standalone
import datetime import datetime
def get_user_data_for_id(user_id:int, expiration_time:int=90): def get_user_data_for_id(user_id:int, expiration_time:int=90):
@ -34,3 +35,9 @@ def get_port_ids_for_participant_id(participant_id:int):
query = "SELECT port_id FROM participant_port_map where participant_id = ?participant_id?" query = "SELECT port_id FROM participant_port_map where participant_id = ?participant_id?"
pdata = execute_sql_query_standalone(query=query, param={"participant_id":participant_id}) pdata = execute_sql_query_standalone(query=query, param={"participant_id":participant_id})
return pdata return pdata
def get_notification_for_shipcall_and_type(shipcall_id:int, notification_type:int):
"""helper function to load a notification for a shipcall and a specific type"""
query = "SELECT * FROM notification where shipcall_id = ?shipcall_id? and type = ?type?"
pdata = execute_sql_query_standalone(query=query, param={"shipcall_id":shipcall_id, "type":notification_type}, command_type="query")
return pdata

View File

@ -19,7 +19,7 @@ def GetNotifications(options):
commands = pydapper.using(pooledConnection) commands = pydapper.using(pooledConnection)
# query = SQLQuery.get_notifications() # query = SQLQuery.get_notifications()
# data = commands.query(query, model=model.Notification.from_query_row, param={"scid" : options["shipcall_id"]}) # data = commands.query(query, model=model.Notification.from_query_row, param={"scid" : options["shipcall_id"]})
data = commands.query("SELECT id, shipcall_id, level, type, message, created, modified FROM notification " + data = commands.query("SELECT id, shipcall_id, participant_id, level, type, message, created, modified FROM notification " +
"WHERE shipcall_id = ?scid?", model=model.Notification.from_query_row, param={"scid" : options["shipcall_id"]}) "WHERE shipcall_id = ?scid?", model=model.Notification.from_query_row, param={"scid" : options["shipcall_id"]})
pooledConnection.close() pooledConnection.close()

View File

@ -8,6 +8,7 @@ from .. import local_db
from ..services.auth_guard import check_jwt from ..services.auth_guard import check_jwt
from BreCal.database.update_database import evaluate_shipcall_state from BreCal.database.update_database import evaluate_shipcall_state
from BreCal.database.sql_utils import get_notification_for_shipcall_and_type
from BreCal.database.sql_queries import create_sql_query_shipcall_get, create_sql_query_shipcall_post, create_sql_query_shipcall_put, create_sql_query_history_post, create_sql_query_history_put, SQLQuery from BreCal.database.sql_queries import create_sql_query_shipcall_get, create_sql_query_shipcall_post, create_sql_query_shipcall_put, create_sql_query_history_post, create_sql_query_history_put, SQLQuery
from marshmallow import Schema, fields, ValidationError from marshmallow import Schema, fields, ValidationError
from BreCal.validators.validation_error import create_validation_error_response from BreCal.validators.validation_error import create_validation_error_response
@ -137,9 +138,11 @@ def PostShipcalls(schemaModel):
if 'participants' in schemaModel: if 'participants' in schemaModel:
# pquery = SQLQuery.get_shipcall_post_update_shipcall_participant_map() # pquery = SQLQuery.get_shipcall_post_update_shipcall_participant_map()
pquery = "INSERT INTO shipcall_participant_map (shipcall_id, participant_id, type) VALUES (?shipcall_id?, ?participant_id?, ?type?)" pquery = "INSERT INTO shipcall_participant_map (shipcall_id, participant_id, type) VALUES (?shipcall_id?, ?participant_id?, ?type?)"
nquery = "INSERT INTO notification (shipcall_id, participant_id, level, type) VALUES (?shipcall_id?, ?participant_id?, 0, 1)" # type = 1 is assignment
for participant_assignment in schemaModel["participants"]: for participant_assignment in schemaModel["participants"]:
commands.execute(pquery, param={"shipcall_id" : new_id, "participant_id" : participant_assignment["participant_id"], "type" : participant_assignment["type"]}) commands.execute(pquery, param={"shipcall_id" : new_id, "participant_id" : participant_assignment["participant_id"], "type" : participant_assignment["type"]})
# TODO: Create assignment notification for each participant commands.execute(nquery, param={"shipcall_id" : new_id, "participant_id" : participant_assignment["participant_id"]})
# apply 'Traffic Light' evaluation to obtain 'GREEN', 'YELLOW' or 'RED' evaluation state. The function internally updates the mysql database # apply 'Traffic Light' evaluation to obtain 'GREEN', 'YELLOW' or 'RED' evaluation state. The function internally updates the mysql database
# evaluate_shipcall_state(mysql_connector_instance=pooledConnection, shipcall_id=new_id) # new_id (last insert id) refers to the shipcall id # evaluate_shipcall_state(mysql_connector_instance=pooledConnection, shipcall_id=new_id) # new_id (last insert id) refers to the shipcall id
@ -233,6 +236,8 @@ def PutShipcalls(schemaModel):
# loop across passed participant ids, creating entries for those not present in pdata # loop across passed participant ids, creating entries for those not present in pdata
existing_notifications = get_notification_for_shipcall_and_type(schemaModel["id"], 1) # type = 1 is assignment
for participant_assignment in schemaModel["participants"]: for participant_assignment in schemaModel["participants"]:
found_participant = False found_participant = False
for elem in pdata: for elem in pdata:
@ -241,8 +246,18 @@ def PutShipcalls(schemaModel):
break break
if not found_participant: if not found_participant:
# nquery = SQLQuery.get_shipcall_post_update_shipcall_participant_map() # nquery = SQLQuery.get_shipcall_post_update_shipcall_participant_map()
nquery = "INSERT INTO shipcall_participant_map (shipcall_id, participant_id, type) VALUES (?shipcall_id?, ?participant_id?, ?type?)" spquery = "INSERT INTO shipcall_participant_map (shipcall_id, participant_id, type) VALUES (?shipcall_id?, ?participant_id?, ?type?)"
commands.execute(nquery, param={"shipcall_id" : schemaModel["id"], "participant_id" : participant_assignment["participant_id"], "type" : participant_assignment["type"]}) commands.execute(spquery, param={"shipcall_id" : schemaModel["id"], "participant_id" : participant_assignment["participant_id"], "type" : participant_assignment["type"]})
# create a notification but only if there is no existing notification in level 0
found_notification = False
for existing_notification in existing_notifications:
if existing_notification["participant_id"] == participant_assignment["participant_id"] and existing_notification["level"] == 1:
found_notification = True
break
if not found_notification:
nquery = "INSERT INTO notification (shipcall_id, participant_id, level, type) VALUES (?shipcall_id?, ?participant_id?, 0, 1)" # type = 1 is assignment
commands.execute(nquery, param={"shipcall_id" : schemaModel["id"], "participant_id" : participant_assignment["participant_id"]})
# loop across existing pdata entries, deleting those not present in participant list # loop across existing pdata entries, deleting those not present in participant list
for elem in pdata: for elem in pdata:
@ -250,14 +265,22 @@ def PutShipcalls(schemaModel):
for participant_assignment in schemaModel["participants"]: for participant_assignment in schemaModel["participants"]:
if(participant_assignment["participant_id"] == elem["participant_id"] and participant_assignment["type"] == elem["type"]): if(participant_assignment["participant_id"] == elem["participant_id"] and participant_assignment["type"] == elem["type"]):
found_participant = True found_participant = True
# TODO: Create assignment notification
break; break;
if not found_participant: if not found_participant:
# dquery = SQLQuery.get_shipcall_participant_map_delete_by_id() # dquery = SQLQuery.get_shipcall_participant_map_delete_by_id()
dquery = "DELETE FROM shipcall_participant_map WHERE id = ?existing_id?" dquery = "DELETE FROM shipcall_participant_map WHERE id = ?existing_id?"
commands.execute(dquery, param={"existing_id" : elem["id"]}) commands.execute(dquery, param={"existing_id" : elem["id"]})
# TODO: Create un-assignment notification # TODO: Create un-assignment notification but only if level > 0 else delete existing notification
for existing_notification in existing_notifications:
if existing_notification["participant_id"] == elem["participant_id"]:
if existing_notification["level"] == 0:
nquery = "DELETE FROM notification WHERE id = ?nid?"
commands.execute(nquery, param={"nid" : existing_notification["id"]})
else:
# create un-assignment notification
nquery = "INSERT INTO notification (shipcall_id, participant_id, level, type) VALUES (?shipcall_id?, ?participant_id?, 0, 5)"
commands.execute(nquery, param={"shipcall_id" : schemaModel["id"], "participant_id" : elem["participant_id"]})
break
# save history data # save history data
# TODO: set ETA properly # TODO: set ETA properly

View File

@ -0,0 +1,5 @@
# Version: 1.7.0
# Constants for the notification system
NOTIFICATION_COOLDOWN = 600 # 10 minutes until a notification gets real
NOTIFICATION_MAX_AGE_DAYS = 3 # 3 days until a notification gets deleted

View File

@ -143,6 +143,7 @@ class Notification:
""" """
id: int id: int
shipcall_id: int # 'shipcall record that caused the notification' shipcall_id: int # 'shipcall record that caused the notification'
participant_id: int # 'optional participant reference that needs to be specifically notified, if null all participants are notified'
level: int # 'severity of the notification' level: int # 'severity of the notification'
type: NotificationType # 'type of the notification' type: NotificationType # 'type of the notification'
message: str # 'individual message' message: str # 'individual message'
@ -161,8 +162,8 @@ class Notification:
} }
@classmethod @classmethod
def from_query_row(self, id, shipcall_id, level, type, message, created, modified): def from_query_row(self, id, shipcall_id, participant_id, level, type, message, created, modified):
return self(id, shipcall_id, level, NotificationType(type), message, created, modified) return self(id, shipcall_id, participant_id, level, NotificationType(type), message, created, modified)
@dataclass @dataclass
class Participant(Schema): class Participant(Schema):

View File

@ -55,11 +55,16 @@ def UpdateNotifications():
pooledConnection = getPoolConnection() pooledConnection = getPoolConnection()
commands = pydapper.using(pooledConnection) commands = pydapper.using(pooledConnection)
query = "SELECT * FROM notification WHERE level = 0 AND created < DATE(NOW() - INTERVAL 10 MINUTES)" query = "SELECT * FROM notification WHERE level = 0 AND created < DATE(NOW() - INTERVAL 10 MINUTE)"
data = commands.query(query, model=model.Notification) data = commands.query(query, model=model.Notification)
for notification in data: for notification in data:
notification.level = 1 notification.level = 1
commands.update(notification) commands.update(notification)
# TODO
# send "real" notifications to user
# ... E-Mail, messenger
pooledConnection.close() pooledConnection.close()
except Exception as ex: except Exception as ex:
logging.error(ex) logging.error(ex)