diff --git a/docs/ApiValidationRules.md b/docs/ApiValidationRules.md new file mode 100644 index 0000000..701a681 --- /dev/null +++ b/docs/ApiValidationRules.md @@ -0,0 +1,226 @@ +# Rest-API validation rules for the backend + +___ + +* Rules defined here only apply to calls that change data (POST / PUT /DELETE requests) +* Violation of these rules should result in 400 bad request +* These are not high-level rules that change color of a data entry in the app + +## Change history + +|Date|Edit|Author| +|--|--|--| +|2.2.24 | Document created, first draft | Daniel Schick | + +## Global constants and definitions + +### Participant type + +The participant type is a bit flag that encodes which user groups a participant belongs to. Note: A participant may belong to **multiple** groups so this flag has to be bitwise evaluated. + +|Value|Group| +|-----|-----| +| 1 | BSMD | +| 2 | Terminal | +| 4 | Pilot | +| 8 | Agency | +| 16 | Mooring | +| 32 | Port authority | +| 64 | Tug | + +### Participant flag + +The participant data record contains a field called "flag" which is also bitwise encoded. The purpose of this flag is to allow user authorization on a finer level. Currently the following flag(s) are defined: + +| Value | Significance | +| ------|--------------| +| 1 | If this flag is set on a shipcall record with participant type Agency (8), all participants of type BSMD (1) may edit the record. + +### Shipcall type + +The shipcall type which is set in the shipcall record may have the following values + +| Value | Meaning | +|-------|---------| +| 1 | Incoming | +| 2 | Outgoing | +| 3 | Shifting (changing berths) | + +## All queries + +### Token evaluation + +The identity of the caller can be retrieved from the token. This contains an id (="user id") and more importantly, the "participant_id". Every call is only allow if the user is properly authorized to perform the call or modify the dataset. + +At this time, authorization is performed on a participant level. This means that all users that belong to a particular participant have the same rights. + +### Modifying unknown entities + +PUT / DELETE calls referencing entities that are not found in the database will receive an 404 reply. This is already implemented in the underlying code and therefore not mentioned in this document. This evaluation should precede the API validation so in this document we assume the entities are existing. + +### Return value + +If a validation rule fails the call should return 400 (Bad request) including an error message in the format already in use: + +```json +{ + "message" : "reason why this call failed" +} +``` + +### Time values + +Date and date+time values are specified as text formatted in [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339#section-5.6), e.g. + +```json +{ + "created" : "2024-01-27T18:00:21Z" +} +``` + +Usually the "Z" is missing at the end indicating local time. + +## /shipcall POST + +1. The call may only be performed by a user belonging to participant group type BSMD. +2. Reference checking: The dataset includes multiple fields referring other tables. The validation must make sure the referenced entities exist. This includes the following fields: + | Field | Referenced table | + |-------|------------------| + | ship_id | ship | + | arrival_berth_id | berth | + | departure_berth_id | berth | + | participants | 1. participant_id values may appear more once 2. types may only appear once and must not include type "BSMD".| + + +3. Check for reasonable values for the following fields: + + | Field | Validation | + |-------|------------| + | eta | value must be in the future | + | type | value must be one of the values defined above | + | voyage | if set must be <= 16 chars and no special characters | + | etd | must be in the future | + | flags | must be a combination of the flags defined above | + | draft | 0 <= value <= 20 | + | tidal_window_from | value must be in the future | + | tidal_window_to | value must be in the future, value must be > tidal_window_from | + | recommended_tugs | 0 < value < 10 | + | canceled | may not be set on POST | + | evaluation | may not be set | + | evaluation_message | may not be set | + +#### Required fields +* eta / etd (depending on value of type: 1: eta, 2: etd, 3: both) +* type +* ship_id +* arrival_berth_id / departure_berth_id (depending on type, see above) +* assigned participant for agency + +## /shipcall PUT + +1. The call may only be performed by a user belonging to participant group type BSMD. +2. If a agency is selected via the shipcall_participant_map entry, users of this agency may also edit the shipcall. Care has to be taken: The agency must have been set _before_ a member of the group may edit the record. +In other words: no setting the agency and editing the record by a member of the agency within the same call. +3. See value rules in /shipcall POST. Exception: Canceled may be set but only if not already set. +4. A cancelled shipcall may not be changed (is logical delete) + +#### Required fields + +The id field is required, missing fields will not be updated. + +## /times POST + +1. A new dataset may only be created by a user _not_ belonging to participant group BSMD. +2. A new dataset may only be created if a dataset of this type is not already present for the participant type. +3. A new dataset may only be created if the user belongs to the participant group assigned to the shipcall with the appropriate type (see shipcall_participant_map). This actually trumps rule #1 but may return a different error message. +4. Reference checking: The dataset includes multiple fields referring other tables. The validation must make sure the referenced entities exist. This includes the following fields: + | Field | Referenced table | + |-------|------------------| + | shipcall_id | shipcall | + | participant_id | participant | + | berth_id | berth | + +5. Check for reasonable values for the following fields: + + | Field | Validation | + |-------|------------| + | eta_berth, etd_berth, lock_time, zone_entry, operations_start, operations_end | if set these values must be in the future| + | remarks, berth_info | must be <= 512 chars | + | participant_type | must not be BSMD | + +#### Required fields + +This depends on the shipcall and participant type: + +##### Incoming + +AGENCY, PILOT, PORT_AUTHORITY, MOORING, TUG: + +eta_berth, shipcall_id, participant_id, participant_type + +TERMINAL: + +operations_start, shipcall_id, participant_id, participant_type + +##### Outgoing + +AGENCY, PILOT, PORT_AUTHORITY, MOORING, TUG: + +etd_berth, shipcall_id, participant_id, participant_type + +TERMINAL: + +operations_end, shipcall_id, participant_id, participant_type + +##### Shifting + +AGENCY, PILOT, PORT_AUTHORITY, MOORING, TUG: + +eta_berth, etd_berth, shipcall_id, participant_id, participant_type + +TERMINAL: + +operations_start, operations_end, shipcall_id, participant_id, participant_type + + +## /times PUT + +1. A dataset may only be changed by a user belonging to the same participant as the times dataset is referring to. +2. See reference and value checking as specified in /times POST. + +#### Required fields + +The id field is required, missing fields will not be updated. + +## /times DELETE + +1. A dataset may only be changed by a user belonging to the same participant as the times dataset is referring to. +2. The dataset may not be deleted already. + +## /ship POST + +1. The call may only be performed by a user belonging to participant group type BSMD. +2. A ship may only be added if there is no other ship with the same IMO number already present in the database. +3. Check for reasonable values for the following fields: + + | Field | Validation | + |-------|------------| + | name | Length < 64, no special characters | + | IMO | 7-digit number. See [here](https://de.wikipedia.org/wiki/IMO-Nummer) for clarification. | + | callsign | Length <= 8, no special characters | + | Length | 0 < value < 1000 | + | Width | 0 < value < 100 | + | bollard_pull | 0 < value < 500, only allowed if is_tug = 1 | + +## /ship PUT + +1. The call may only be performed by a user belonging to participant group type BSMD. +2. The IMO number field may not be changed since it serves the purpose of a primary (matching) key. +3. See value rules in /ship POST +4. The id field is required, missing fields will not be updated + + +## /ship DELETE + +1. The call may only be performed by a user belonging to participant group type BSMD. +2. The dataset may not be deleted already. diff --git a/docs/BremenCalling_Ampelfunktion.xlsx b/docs/BremenCalling_Ampelfunktion.xlsx new file mode 100644 index 0000000..025c94e Binary files /dev/null and b/docs/BremenCalling_Ampelfunktion.xlsx differ diff --git a/misc/Ampelfunktion.md b/misc/Ampelfunktion.md new file mode 100644 index 0000000..1274ba7 --- /dev/null +++ b/misc/Ampelfunktion.md @@ -0,0 +1,46 @@ + + +# Ampelfunktion Bremen Calling + +## Einleitung + + + +## Regeln + +[Zurück](../README.md) + +___ + + +| Ampelfunktionen | Beschreibung | Definition | Bemerkungen | +|-----------------|-----------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------| +| | | | | +| 0001 | Nicht alle Zeiten sind zugeordnet | Bedingungen:
- Header der Zeile ist zugeordnet (Agentur, Festmacher usw.)
- Zugeordnete Zeit ist leer | | +| 0001 - A | Agentur / einkommend | times_agency:
- participant_id = ausgefüllt
- ETA Berth = leer
___zum Zeitpunkt 20 Std vor___
shipcall:
- eta | gelb | +| 0001 - B | Agentur / ausgehend + Verholung | times_agency:
- participant_id = ausgefüllt
- ETD Berth = leer
___zum Zeitpunkt 20 Std vor___
shipcall:
- etd | gelb | +| 0001 - C | Festmacher / einkommend | times_mooring:
- participant_id = ausgefüllt
- ETA Berth = leer
___zum Zeitpunkt 16 Std vor___
times_agency:
- ETA Berth | gelb | +| 0001 - D | Festmacher / ausgehend + Verholung | times_mooring:
- participant_id = ausgefüllt
- ETD Berth = leer
___zum Zeitpunkt 16 Std vor___
times_agency:
- ETD Berth | gelb | +| 0001 - F | Hafenamt / einkommend | times_portauthority:
- participant_id = ausgefüllt
- ETA Berth = leer
___zum Zeitpunkt 16 Std vor___
times_agency:
- ETA Berth | gelb | +| 0001 - G | Hafenamt / ausgehend + Verholung | times_portauthority:
- participant_id = ausgefüllt
- ETD Berth = leer
___zum Zeitpunkt 16 Std vor___
times_agency:
- ETD Berth | gelb | +| 0001 - H | Lotsen / einkommend | times_pilot:
- participant_id = ausgefüllt
- ETA Berth = leer
______
times_agency:
- ETA Berth < 16 Stunden entfernt | gelb | +| 0001 - I | Lotsen / ausgehend + Verholung | times_pilot:
- participant_id = ausgefüllt
- ETD Berth = leer
______
times_agency:
- ETD Berth < 16 Stunden entfernt | gelb | +| 0001 - J | Schlepper / einkommend | times_tug:
- participant_id = ausgefüllt
- ETA Berth = leer
______
times_agency:
- ETA Berth < 16 Stunden entfernt | gelb | +| 0001 - K | Schlepper / ausgehend + Verholung | times_tug:
- participant_id = ausgefüllt
- ETD Berth = leer
___zum Zeitpunkt 16 Std vor___
times_agency:
- ETD Berth | gelb | +| 0001 - L | Terminal / einkommend | times_terminal:
- participant_id = ausgefüllt
- Operation Start = leer
___zum Zeitpunkt 16 Std vor___
times_agency:
- ETA Berth | gelb, aktuell __deaktiviert__! | +| 0001 - M | Terminal / ausgehend + Verholung | times_terminal:
- participant_id = ausgefüllt
- Operation Ende = leer
___zum Zeitpunkt 16 Std vor___
times_agency:
- ETD Berth | gelb, aktuell __deaktiviert__! | +| 0002 | Zeiten für einen Eintrag weichen voneinander ab | Bedingungen:
- Header der Zeile ist zugeordnet (Agentur, Festmacher usw. - außer BSMD-Spalte)
- Zeiten ungleich (leere Einträge nicht berücksichtigen => 0001) | | +| 0002 - A | Agentur + Festmacher + Hafenamt + Lotsen + Schlepper / einkommend | Schnittmenge aus:
times_agency:
- ETA Berth
____und____
times_mooring:
- ETA Berth
____und____
times_portauthority:
- ETA Berth
____und____
times_pilot:
- ETA Berth
____und____
times_tug:
- ETA Berth | rot | +| 0002 - B | Agentur + Festmacher + Hafenamt + Lotsen + Schlepper / ausgehend | Schnittmenge aus:
times_agency:
- ETD Berth
____und____
times_mooring:
- ETD Berth
____und____
times_portauthority:
- ETD Berth
____und____
times_pilot:
- ETD Berth
____und____
times_tug:
- ETD Berth | rot | +| 0002 - C | Agentur + Festmacher + Hafenamt + Lotsen + Schlepper / Verholung | Schnittmenge aus:
times_agency:
- ETA Berth
- ETD Berth
____und____
times_mooring:
- ETA Berth
- ETD Berth
____und____
times_portauthority:
- ETA Berth
- ETD Berth
____und____
times_pilot:
- ETA Berth
- ETD Berth
____und____
times_tug:
- ETA Berth
- ETD Berth | rot | +| 0003 | Arbeitszeit überschneidet sich mit Fahrtzeit | Bedingungen:
- Header der Zeile ist zugeordnet (Terminal)
- Zeiten passt nicht zu Ankunft / Abfahrt (leere Einträge nicht berücksichtigen => 0001) | | +| 0003 - A | Terminal / einkommend | times_terminal:
- Operation Start
___vor (kleiner als)____
times_agency:
- ETA Berth | rot, aktuell __deaktiviert__! | +| 0003 - B | Terminal / ausgehend + Verholung | times_terminal:
- Operation Ende
___nach (größer als)____
times_agency:
- ETD Berth | rot, aktuell __deaktiviert__! | +| 0004 | Tidezeiten passen nicht zu Fahrzeiten | Bedingungen:
- Header der Zeile ist zugeordnet (Agentur)
- Tidezeit ausgefüllt | | +| 0004 - A | Agentur / einkommend | times_agency:
- ETA Berth
___vor (kleiner als)____
times_agency:
- Tidefenster von
___und/oder___nach (größer als)____
times_agency:
- Tidefenster bis | rot | +| 0004 - B | Agentur / ausgehend + Verholung | times_agency:
- ETD Berth
___vor (kleiner als)____
times_agency:
- Tidefenster von
___und/oder___nach (größer als)____
times_agency:
- Tidefenster bis | rot | +| 0005 | Zu viele Schiffe mit gleicher Fahrtzeit | Bedingungen:
- Header der Zeile ist zugeordnet (Agentur)
- Übergreifend über die Einträge | | +| 0005 - A | Agentur / einkommend + ausgehend + Verholung | ____Zählen wenn gleich:____
times_agency:
- ETA Berth
___und____
times_agency:
- ETD Berth
___mehr als 3____
| gelb | +| 0006 | Agentur und Terminal planen mit unterschiedlichen Liegeplätzen | Bedingungen:
- Header der Zeile ist zugeordnet (Agentur / Terminal)
- LP jeweils ausgefüllt | | +| 0006 - A | Agentur + Terminal (Liegeplatz) / einkommend + ausgehend + Verholung | times_agency:
- Liegeplatz
____ungleich____
times_terminal:
- Liegeplatz | gelb | +| 0006 - B | Agentur + Terminal (Anlegeseite) / einkommend + ausgehend + Verholung | times_agency:
- Anlegeseite
____ungleich____
times_terminal:
- Anlegeseite | gelb | \ No newline at end of file diff --git a/misc/BreCalApi.cs b/misc/BreCalApi.cs index 81a3371..a15073d 100644 --- a/misc/BreCalApi.cs +++ b/misc/BreCalApi.cs @@ -1,7 +1,7 @@ //---------------------- // -// Generated REST API Client Code Generator v1.9.8.0 on 03.04.2024 10:37:27 +// Generated REST API Client Code Generator v1.9.8.0 on 06.05.2024 13:42:21 // Using the tool OpenAPI Generator v7.4.0 // //---------------------- @@ -46,7 +46,7 @@ using System.Web; * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.2.0 + * The version of the OpenAPI document: 1.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -850,7 +850,7 @@ namespace BreCalClient.misc.Api * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.2.0 + * The version of the OpenAPI document: 1.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -1505,7 +1505,7 @@ namespace BreCalClient.misc.Api * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.2.0 + * The version of the OpenAPI document: 1.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -2290,7 +2290,7 @@ namespace BreCalClient.misc.Api * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.2.0 + * The version of the OpenAPI document: 1.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -3109,7 +3109,7 @@ namespace BreCalClient.misc.Api * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.2.0 + * The version of the OpenAPI document: 1.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -3594,7 +3594,7 @@ namespace BreCalClient.misc.Api * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.2.0 + * The version of the OpenAPI document: 1.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -4330,7 +4330,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.2.0 + * The version of the OpenAPI document: 1.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -4390,7 +4390,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.2.0 + * The version of the OpenAPI document: 1.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -4530,7 +4530,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.2.0 + * The version of the OpenAPI document: 1.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -4748,7 +4748,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.2.0 + * The version of the OpenAPI document: 1.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -4842,7 +4842,7 @@ namespace BreCalClient.misc.Client { new Dictionary { {"url", "https://brecal.bsmd-emswe.eu"}, - {"description", "Development server hosted on vcup"}, + {"description", "Test server hosted on vcup"}, } } }; @@ -5207,7 +5207,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.2.0\n"; + report += " Version of the API: 1.3.0\n"; report += " SDK Package Version: 1.0.0\n"; return report; } @@ -5276,7 +5276,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.2.0 + * The version of the OpenAPI document: 1.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -5296,7 +5296,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.2.0 + * The version of the OpenAPI document: 1.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -5353,7 +5353,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.2.0 + * The version of the OpenAPI document: 1.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -5386,7 +5386,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.2.0 + * The version of the OpenAPI document: 1.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -5419,7 +5419,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.2.0 + * The version of the OpenAPI document: 1.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -5510,7 +5510,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.2.0 + * The version of the OpenAPI document: 1.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -5627,7 +5627,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.2.0 + * The version of the OpenAPI document: 1.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -5711,7 +5711,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.2.0 + * The version of the OpenAPI document: 1.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -5970,7 +5970,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.2.0 + * The version of the OpenAPI document: 1.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -5998,7 +5998,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.2.0 + * The version of the OpenAPI document: 1.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -6068,7 +6068,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.2.0 + * The version of the OpenAPI document: 1.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -6095,7 +6095,7 @@ namespace BreCalClient.misc.Client * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.2.0 + * The version of the OpenAPI document: 1.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -6162,7 +6162,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.2.0 + * The version of the OpenAPI document: 1.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -6288,7 +6288,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.2.0 + * The version of the OpenAPI document: 1.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -6373,7 +6373,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.2.0 + * The version of the OpenAPI document: 1.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -6446,7 +6446,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.2.0 + * The version of the OpenAPI document: 1.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -6486,7 +6486,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.2.0 + * The version of the OpenAPI document: 1.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -6596,7 +6596,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.2.0 + * The version of the OpenAPI document: 1.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -6658,7 +6658,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.2.0 + * The version of the OpenAPI document: 1.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -6784,7 +6784,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.2.0 + * The version of the OpenAPI document: 1.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -6888,7 +6888,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.2.0 + * The version of the OpenAPI document: 1.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -6923,7 +6923,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.2.0 + * The version of the OpenAPI document: 1.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -6953,7 +6953,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.2.0 + * The version of the OpenAPI document: 1.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -6993,7 +6993,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.2.0 + * The version of the OpenAPI document: 1.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -7150,7 +7150,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.2.0 + * The version of the OpenAPI document: 1.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -7226,7 +7226,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.2.0 + * The version of the OpenAPI document: 1.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -7396,7 +7396,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.2.0 + * The version of the OpenAPI document: 1.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -7701,7 +7701,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.2.0 + * The version of the OpenAPI document: 1.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -7741,7 +7741,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.2.0 + * The version of the OpenAPI document: 1.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -8023,7 +8023,7 @@ namespace BreCalClient.misc.Model * * Administer DEBRE ship calls, times and notifications * - * The version of the OpenAPI document: 1.2.0 + * The version of the OpenAPI document: 1.3.0 * Contact: info@textbausteine.net * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/misc/BreCalApi.yaml b/misc/BreCalApi.yaml index 51b27e8..06c6b96 100644 --- a/misc/BreCalApi.yaml +++ b/misc/BreCalApi.yaml @@ -2,7 +2,7 @@ openapi: 3.0.0 x-stoplight: id: mwv4y8vcnopwr info: - version: 1.2.0 + version: 1.3.0 title: Bremen calling API description: 'Administer DEBRE ship calls, times and notifications' termsOfService: 'https://www.bsmd.de/' @@ -15,7 +15,7 @@ info: url: 'https://www.bsmd.de/license' servers: - url: 'https://brecal.bsmd-emswe.eu' - description: Development server hosted on vcup + description: Test server hosted on vcup tags: - name: user - name: shipcall diff --git a/misc/ReleaseNotes.md b/misc/ReleaseNotes.md new file mode 100644 index 0000000..e69de29 diff --git a/misc/disclaimer.html b/misc/disclaimer.html new file mode 100644 index 0000000..7341c15 --- /dev/null +++ b/misc/disclaimer.html @@ -0,0 +1,67 @@ + + + + Information gemäß Art. 13 und Art. 14 DSGVO für Auftraggeber Software BremenCalling + + + +

Information gemäß Art. 13 und Art. 14 DSGVO für Auftraggeber +Software BremenCalling

+
+Hier erhalten Sie Informationen gem. Art. 13 DSGVO über unseren Umgang mit Ihren Daten, wenn Sie die von uns betriebene Software „Bremen Calling“ nutzen. +

+Verantwortlicher: +

+ +

+BREMER SCHIFFSMELDEDIENST Kapt. P. Langbein e.K.
+Vertreten durch die Geschäftsführer Bastian Güttner und Benjamin Wiese
+Hafenkopf II / Überseetor 20, 28217 Bremen / Germany
+Tel. +49 (0) 421 38 48 27
+E-Mail : report@bsmd.de
+

+ +

Zweck der Datenverarbeitung:

+ +

Rechtsgrundlage für die Datenverarbeitung:

+Art. 6 Abs. 1 lit. b DSGVO (Vertrag, vorvertragliche Maßnahmen auf Anfrage der betroffenen Person) +

Berechtigte Interesse des Verantwortlichen:

+Hier nicht einschlägig. + +

Wozu benötigen wir Ihre Daten? („Hintergründe für die Bereitstellung der Daten“):

+Wenn Sie unsere Software nutzen möchten, müssen wir Sie als Benutzer einrichten. Dies geschieht auf der Grundlage Ihrer (firmenbezogenen) E-Mail-Adresse und Ihres Namens. +

Holen wir bei anderen Stellen außer bei Ihnen selber Informationen über Sie ein?

+Nein. +

Empfänger der Daten:

+Wir verarbeiten Ihre Daten nur innerhalb des BSMD. +

Übermittlung in Drittländer:

+Eine Übermittlung Ihrer Daten in Staaten außerhalb der EU findet nicht statt. +

Dauer der Speicherung:

+Wir speichern Ihre Daten, solange wie Ihr Vertrag zur Nutzung unserer Software mit Ihnen besteht. Nach dem Ende unserer Geschäftsbeziehung stellen wir Ihre Benutzerdaten inaktiv und löschen sie nach sechs Monaten. Wir erarbeiten derzeit ein Löschkonzept, das ein systematisches Löschen von personenbezogenen Daten ermöglicht. +

Ihre Rechte in Bezug auf Ihre Daten:

+

+Sie können von uns Auskunft verlangen ob wir persönliche Daten von Ihnen speichern, und wenn ja, welche das sind und was wir damit tun (Art. 15 DSGVO). +

+

+Sollten wir unrichtige oder unvollständige Daten von Ihnen haben, können Sie die Berichtigung dieser Daten verlangen (Art. 16 DSGVO). +

+

+Sie können auch die Löschung Ihrer Daten verlangen (Art. 17 DSGVO). Es kann jedoch Gründe geben, aus denen wir Ihre Daten trotz Ihres Wunsches nicht löschen dürfen oder löschen müssen. Diese Gründe bestimmt das Gesetz. Wenn Sie von uns die Löschung Ihrer Daten verlangen, werden wir prüfen, ob möglicherweise solche Gründe vorliegen. Wenn nicht, löschen wir Ihre Daten. Die Alternative zur Löschung Ihrer Daten ist in bestimmten Fällen die Einschränkung der Verarbeitung Ihrer personenbezogenen Daten (Art. 18 DSGVO). Auch dabei gilt: lassen Sie uns wissen, wie Sie verfahren wollen, dann prüfen wir die gesetzlichen Vorgaben und finden einen Weg, der Ihre und unsere Interessen ausgleicht. +

+

+Art. 20 DSGVO sieht vor, dass wir Ihnen in bestimmten Fällen Ihre persönlichen Daten in einem strukturierten, gängigen und maschinenlesbaren Format zur Verfügung stellen müssen, wenn Sie es wünschen. +

+

+Möchten Sie von Ihren hier beschriebenen Rechten Gebrauch machen, genügt eine E-Mail an bremencalling@bsmd.de. +

+

+Wenn Sie der Meinung sind, dass wir die Datenschutzvorgaben für die Verarbeitung Ihrer Daten auf diesen Webseiten nicht einhalten, können Sie sich bei einer Datenschutz-Aufsichtsbehörde beschweren. Eine Liste der in Deutschland zuständigen Datenschutz-Aufsichtsbehörden finden Sie hier: +https://www.bfdi.bund.de/DE/Infothek/Anschriften_Links/anschriften_links-node.html. +

+
+

+Stand dieser Datenschutzinformationen: April 2024 +

+ \ No newline at end of file diff --git a/misc/version.txt b/misc/version.txt index 4e0321e..fd76c73 100644 --- a/misc/version.txt +++ b/misc/version.txt @@ -1 +1 @@ -1.2.0.0 \ No newline at end of file +1.3.0.0 \ No newline at end of file diff --git a/src/BreCalClient/App.config b/src/BreCalClient/App.config index 7422aba..3dd7a2e 100644 --- a/src/BreCalClient/App.config +++ b/src/BreCalClient/App.config @@ -1,6 +1,7 @@  +
@@ -8,6 +9,23 @@
+ + + + + + + + + + + + + + + + + diff --git a/src/BreCalClient/BreCalClient.csproj b/src/BreCalClient/BreCalClient.csproj index 31cc3d0..6333a24 100644 --- a/src/BreCalClient/BreCalClient.csproj +++ b/src/BreCalClient/BreCalClient.csproj @@ -8,8 +8,8 @@ True BreCalClient.App ..\..\misc\brecal.snk - 1.2.0.10 - 1.2.0.0 + 1.2.2.3 + 1.2.2.3 Bremen calling client A Windows WPF client for the Bremen calling API. containership.ico @@ -17,6 +17,7 @@ + @@ -73,6 +74,7 @@ OpenApiCodeGenerator BreCalApi.cs + diff --git a/src/BreCalClient/BreCalClient.sln b/src/BreCalClient/BreCalClient.sln index 469c133..fa8a760 100644 --- a/src/BreCalClient/BreCalClient.sln +++ b/src/BreCalClient/BreCalClient.sln @@ -10,6 +10,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution .editorconfig = .editorconfig EndProjectSection EndProject +Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "Setup", "..\Setup\Setup.vdproj", "{CDC1EC53-8D75-4F8B-B627-A76B126380D4}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -20,6 +22,8 @@ Global {FA9E0A87-FBFB-4F2B-B5FA-46DE2E5E4BCB}.Debug|Any CPU.Build.0 = Debug|Any CPU {FA9E0A87-FBFB-4F2B-B5FA-46DE2E5E4BCB}.Release|Any CPU.ActiveCfg = Release|Any CPU {FA9E0A87-FBFB-4F2B-B5FA-46DE2E5E4BCB}.Release|Any CPU.Build.0 = Release|Any CPU + {CDC1EC53-8D75-4F8B-B627-A76B126380D4}.Debug|Any CPU.ActiveCfg = Debug + {CDC1EC53-8D75-4F8B-B627-A76B126380D4}.Release|Any CPU.ActiveCfg = Release EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/BreCalClient/DateTimePickerExt.cs b/src/BreCalClient/DateTimePickerExt.cs new file mode 100644 index 0000000..d3642d4 --- /dev/null +++ b/src/BreCalClient/DateTimePickerExt.cs @@ -0,0 +1,41 @@ +using System.Text.RegularExpressions; +using System.Windows.Input; +using Xceed.Wpf.Toolkit; + +namespace BreCalClient +{ + public class DateTimePickerExt : DateTimePicker + { + protected override void OnPreviewTextInput(TextCompositionEventArgs e) + { + base.OnPreviewTextInput(e); + if (this.Template.FindName("PART_TextBox", this) is not WatermarkTextBox tb) return; + + // strip input after caret + string subText = (tb.CaretIndex > 0) ? this.Text[..tb.CaretIndex] : tb.Text; // Range operator instead of Substring(0, tb.CaretIndex) + string text = subText + e.Text; + + // System.Diagnostics.Debug.WriteLine("C:" + this.Text + " E: " + e.Text + " Caret: " + tb.CaretIndex + " Subt: " + subText); + + // 10 char eingabe "am Stück" + if (Regex.IsMatch(text, @"^\d{10}")) + { + e.Handled = true; + tb.Text = Regex.Replace(text, @"(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})", "$1.$2.20$3 $4:$5"); + tb.CaretIndex = tb.Text.Length; + tb.SelectedText = ""; + } + + // nur die Zeit wird markiert und mit 4 Zahlen befüllt, diese Regel setzt den Doppelpunkt + else if (Regex.IsMatch(text, @"^(\d{2}\.\d{2}\. \d{4} \d{3})")) + { + e.Handled = true; + tb.Text = Regex.Replace(text, @"(\d{2}\.\d{2}\. \d{4} \d{2})(\d)(.*)", "$1:$2"); + // System.Diagnostics.Trace.WriteLine("Replaced: " + tb.Text); + tb.CaretIndex = tb.Text.Length; + tb.Select(tb.Text.Length, 0); + } + + } + } +} diff --git a/src/BreCalClient/EditShipcallControl.xaml b/src/BreCalClient/EditShipcallControl.xaml index 6ebe2cf..71eac00 100644 --- a/src/BreCalClient/EditShipcallControl.xaml +++ b/src/BreCalClient/EditShipcallControl.xaml @@ -4,7 +4,7 @@ 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:p = "clr-namespace:BreCalClient.Resources" xmlns:api="clr-namespace:BreCalClient.misc.Model" xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" mc:Ignorable="d" Left="{local:SettingBinding W1Left}" Top="{local:SettingBinding W1Top}" @@ -46,7 +46,7 @@ diff --git a/src/BreCalClient/SearchFilterControl.xaml.cs b/src/BreCalClient/SearchFilterControl.xaml.cs index c176c27..92ac773 100644 --- a/src/BreCalClient/SearchFilterControl.xaml.cs +++ b/src/BreCalClient/SearchFilterControl.xaml.cs @@ -128,22 +128,17 @@ namespace BreCalClient private void logoImage_MouseUp(object sender, MouseButtonEventArgs e) { LogoImageClicked?.Invoke(); - } - - private void UserControl_Loaded(object sender, System.Windows.RoutedEventArgs e) - { - - } + } private void datePickerETAFrom_SelectedDateChanged(object sender, SelectionChangedEventArgs e) { - this._model.EtaFrom = this.datePickerETAFrom.SelectedDate; + this._model.EtaFrom = this.datePickerETAFrom.SelectedDate?.Date; SearchFilterChanged?.Invoke(); } private void datePickerETATo_SelectedDateChanged(object sender, SelectionChangedEventArgs e) { - this._model.EtaTo = datePickerETATo.SelectedDate; + this._model.EtaTo = datePickerETATo.SelectedDate?.Date; SearchFilterChanged?.Invoke(); } @@ -212,6 +207,13 @@ namespace BreCalClient { this._model.MineOnly = this.checkBoxOwn.IsChecked; SearchFilterChanged?.Invoke(); + } + + private void toggleButton24Hrs_Click(object sender, System.Windows.RoutedEventArgs e) + { + this.datePickerETAFrom.SelectedDate = DateTime.Now; + this.datePickerETATo.SelectedDate = DateTime.Now.AddDays(1); + SearchFilterChanged?.Invoke(); } #endregion diff --git a/src/BreCalClient/ShipcallControl.xaml b/src/BreCalClient/ShipcallControl.xaml index be22432..9ade1f9 100644 --- a/src/BreCalClient/ShipcallControl.xaml +++ b/src/BreCalClient/ShipcallControl.xaml @@ -5,8 +5,8 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:p = "clr-namespace:BreCalClient.Resources" xmlns:sets="clr-namespace:BreCalClient.Properties" - xmlns:db="clr-namespace:BreCalClient;assembly=BreCalClient" - mc:Ignorable="d" + xmlns:db="clr-namespace:BreCalClient;assembly=BreCalClient" + mc:Ignorable="d" d:DesignHeight="135" d:DesignWidth="800"> @@ -123,12 +123,12 @@