From fd5dbc8b37ed8fa82e6a3720c2dc41812966f93b Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Tue, 4 Feb 2025 10:12:29 +0100 Subject: [PATCH] Changed Win Target to .NET8, updated YAML for user notification event selection --- misc/BreCalApi.cs | 44 +++++++++++++++++++++++++--- misc/BreCalApi.yaml | 9 ++++++ misc/ReleaseNotes.md | 16 ++++++++++ misc/update_1.6_to_1.7.sql | 3 ++ src/BreCalClient/BreCalClient.csproj | 6 ++-- 5 files changed, 71 insertions(+), 7 deletions(-) diff --git a/misc/BreCalApi.cs b/misc/BreCalApi.cs index 5b792dd..1d8f258 100644 --- a/misc/BreCalApi.cs +++ b/misc/BreCalApi.cs @@ -1,8 +1,8 @@ //---------------------- // -// Generated REST API Client Code Generator v1.18.0.0 on 19.01.2025 19:58:28 -// Using the tool OpenAPI Generator v7.10.0 +// Generated REST API Client Code Generator v1.19.0.0 on 04.02.2025 10:01:05 +// Using the tool OpenAPI Generator v7.11.0 // //---------------------- @@ -381,6 +381,7 @@ namespace BreCalClient.misc.Api "application/json" }; var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; if (localVarContentType != null) { localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); @@ -505,6 +506,7 @@ namespace BreCalClient.misc.Api "application/json" }; var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; if (localVarContentType != null) { localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); @@ -635,6 +637,7 @@ namespace BreCalClient.misc.Api "application/json" }; var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; if (localVarContentType != null) { localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); @@ -757,6 +760,7 @@ namespace BreCalClient.misc.Api "application/json" }; var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; if (localVarContentType != null) { localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); @@ -1148,6 +1152,7 @@ namespace BreCalClient.misc.Api "application/json" }; var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; if (localVarContentType != null) { localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); @@ -1278,6 +1283,7 @@ namespace BreCalClient.misc.Api "application/json" }; var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; if (localVarContentType != null) { localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); @@ -1402,6 +1408,7 @@ namespace BreCalClient.misc.Api "application/json" }; var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; if (localVarContentType != null) { localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); @@ -1879,6 +1886,7 @@ namespace BreCalClient.misc.Api "application/json" }; var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; if (localVarContentType != null) { localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); @@ -1991,6 +1999,7 @@ namespace BreCalClient.misc.Api "application/json" }; var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; if (localVarContentType != null) { localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); @@ -2105,6 +2114,7 @@ namespace BreCalClient.misc.Api "application/json" }; var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; if (localVarContentType != null) { localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); @@ -2223,6 +2233,7 @@ namespace BreCalClient.misc.Api "application/json" }; var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; if (localVarContentType != null) { localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); @@ -2347,6 +2358,7 @@ namespace BreCalClient.misc.Api "application/json" }; var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; if (localVarContentType != null) { localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); @@ -2794,6 +2806,7 @@ namespace BreCalClient.misc.Api "application/json" }; var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; if (localVarContentType != null) { localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); @@ -2918,6 +2931,7 @@ namespace BreCalClient.misc.Api "application/json" }; var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; if (localVarContentType != null) { localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); @@ -3036,6 +3050,7 @@ namespace BreCalClient.misc.Api "application/json" }; var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; if (localVarContentType != null) { localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); @@ -3166,6 +3181,7 @@ namespace BreCalClient.misc.Api "application/json" }; var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; if (localVarContentType != null) { localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); @@ -3521,6 +3537,7 @@ namespace BreCalClient.misc.Api "application/json" }; var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; if (localVarContentType != null) { localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); @@ -3651,6 +3668,7 @@ namespace BreCalClient.misc.Api "application/json" }; var localVarContentType = BreCalClient.misc.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; if (localVarContentType != null) { localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); @@ -4014,7 +4032,7 @@ namespace BreCalClient.misc.Client { foreach (var value in headerParam.Value) { - request.AddHeader(headerParam.Key, value); + request.AddOrUpdateHeader(headerParam.Key, value); } } } @@ -4075,6 +4093,13 @@ namespace BreCalClient.misc.Client } } } + if (options.HeaderParameters != null) + { + if (options.HeaderParameters.TryGetValue("Content-Type", out var contentTypes) && contentTypes.Any(header => header.Contains("multipart/form-data"))) + { + request.AlwaysMultipartFormData = true; + } + } return request; } /// @@ -8804,7 +8829,8 @@ namespace BreCalClient.misc.Model /// notifyPopup. /// notifyWhatsapp. /// notifySignal. - 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), string userEmail = default(string), bool? notifyEmail = default(bool?), bool? notifyPopup = default(bool?), bool? notifyWhatsapp = default(bool?), bool? notifySignal = default(bool?)) + /// notifyOn. + 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), string userEmail = default(string), bool? notifyEmail = default(bool?), bool? notifyPopup = default(bool?), bool? notifyWhatsapp = default(bool?), bool? notifySignal = default(bool?), List notifyOn = default(List)) { this.Id = id; this.OldPassword = oldPassword; @@ -8817,6 +8843,7 @@ namespace BreCalClient.misc.Model this.NotifyPopup = notifyPopup; this.NotifyWhatsapp = notifyWhatsapp; this.NotifySignal = notifySignal; + this.NotifyOn = notifyOn; } /// /// Gets or Sets Id @@ -8907,6 +8934,14 @@ namespace BreCalClient.misc.Model [DataMember(Name = "notify_signal", EmitDefaultValue = true)] public bool? NotifySignal { get; set; } /// + /// Gets or Sets NotifyOn + /// + /* + ["assignment","next24h"] + */ + [DataMember(Name = "notify_on", EmitDefaultValue = true)] + public List NotifyOn { get; set; } + /// /// Returns the string presentation of the object /// /// String presentation of the object @@ -8925,6 +8960,7 @@ namespace BreCalClient.misc.Model sb.Append(" NotifyPopup: ").Append(NotifyPopup).Append("\n"); sb.Append(" NotifyWhatsapp: ").Append(NotifyWhatsapp).Append("\n"); sb.Append(" NotifySignal: ").Append(NotifySignal).Append("\n"); + sb.Append(" NotifyOn: ").Append(NotifyOn).Append("\n"); sb.Append("}\n"); return sb.ToString(); } diff --git a/misc/BreCalApi.yaml b/misc/BreCalApi.yaml index 41db732..cd1a6bd 100644 --- a/misc/BreCalApi.yaml +++ b/misc/BreCalApi.yaml @@ -1538,6 +1538,7 @@ components: eta: '2023-08-21T08:23:35Z' operation: update type: shipcall + notification: type: object description: a notification created by the engine if a times entry violates a rule @@ -1798,6 +1799,14 @@ components: type: boolean nullable: true example: false + notify_on: + type: array + nullable: true + items: + $ref: '#/components/schemas/NotificationType' + example: + - assignment + - next24h example: id: 42 old_password: oldpassword diff --git a/misc/ReleaseNotes.md b/misc/ReleaseNotes.md index e69de29..e41d291 100644 --- a/misc/ReleaseNotes.md +++ b/misc/ReleaseNotes.md @@ -0,0 +1,16 @@ +# Versionshistorie + +## 1.7 + +### YAML / API + +1. Notifications GET: Der Parameter "shipcall_id" ist jetzt optional für den Abruf von Benachrichtigungen. + +2. Notification: Enthält jetzt ein neues Feld "participant_id". Ist dieses gesetzt, richtet sich die Benachrichtigung an diesen Teilnehmer. Ist das Feld nicht vorhanden, richtet sich die Benachrichtigung an alle Beteiligten des shipcall + +3. Die Benutzerdaten (login_result) enthalten jetzt die Felder (Flags) der Zuordnung für die verschiedenen Benachrichtigungs-Wege, aktuell implementiert ist notify_email und notify_popup. Diese können auch über user_details analog zu Telefonnummer, Name etc. gesetzt werden. + +4. Die Enumeration NotificationType enthält jetzt nicht mehr den Benachrichtigungsweg, sondern den Typ des Ereignisses, das die Benachrichtigung ausgelöst hat. Aktuell werden 7 Ereignisse unterschieden. + +5. Die Benutzerdaten enthalten eine Liste NotifyOn vom Typ NotificationType. In dieser Aufzählung sind die Ereignisse enthalten, über die der Benutzer benachrichtigt werden will. Wenn diese Liste leer oder nicht vorhanden ist erhält der Benutzer keine Nachrichten, auch wenn er einen Benachrichtigungsweg ausgewählt hat. + diff --git a/misc/update_1.6_to_1.7.sql b/misc/update_1.6_to_1.7.sql index 14834d3..f14a108 100644 --- a/misc/update_1.6_to_1.7.sql +++ b/misc/update_1.6_to_1.7.sql @@ -8,3 +8,6 @@ ADD CONSTRAINT `FK_NOTIFICATION_PARTICIPANT` REFERENCES `participant` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT; + +ALTER TABLE `user` +ADD COLUMN `notify_event` INT NULL COMMENT 'Bitflag of selected notification event types that the user wants to be notified of' AFTER `notify_popup`; diff --git a/src/BreCalClient/BreCalClient.csproj b/src/BreCalClient/BreCalClient.csproj index 080b62e..606b6c6 100644 --- a/src/BreCalClient/BreCalClient.csproj +++ b/src/BreCalClient/BreCalClient.csproj @@ -2,7 +2,7 @@ WinExe - net6.0-windows + net8.0-windows7.0 enable true True @@ -122,8 +122,8 @@ - - + +