diff --git a/misc/BreCalApi.cs b/misc/BreCalApi.cs index e2237d7..1fd1fe8 100644 --- a/misc/BreCalApi.cs +++ b/misc/BreCalApi.cs @@ -1,8 +1,8 @@ //---------------------- // -// Generated REST API Client Code Generator v1.8.7.0 on 13.10.2023 10:51:41 -// Using the tool OpenAPI Generator v7.0.1 +// Generated REST API Client Code Generator v1.8.4.0 on 23.10.2023 09:06:40 +// Using the tool OpenAPI Generator v7.0.0 // //---------------------- @@ -70,7 +70,7 @@ namespace BreCalClient.misc.Api /// Gets a list of all berths registered /// /// - /// + /// /// /// Thrown when fails to make API call /// Index associated with the operation. @@ -88,7 +88,7 @@ namespace BreCalClient.misc.Api /// Returns a JWT session token and user data if successful /// /// - /// + /// /// /// Thrown when fails to make API call /// Login credentials @@ -108,7 +108,7 @@ namespace BreCalClient.misc.Api /// Gets a list of notifications pursuant to a specified participant and ship call /// /// - /// + /// /// /// Thrown when fails to make API call /// **Id of participant**. *Example: 2*. Id returned through loading of participant @@ -128,7 +128,7 @@ namespace BreCalClient.misc.Api /// gets a particular participant entry corresponding to user id /// /// - /// + /// /// /// Thrown when fails to make API call /// **Id of user**. *Example: 2*. User id returned by verify call. (optional) @@ -139,19 +139,21 @@ namespace BreCalClient.misc.Api /// Gets a list of ship calls /// /// Thrown when fails to make API call + /// number of days in the past to include in the result. *Example: 7*. (optional) /// Index associated with the operation. /// List<Shipcall> - List ShipcallsGet(int operationIndex = 0); + List ShipcallsGet(int? pastDays = default(int?), int operationIndex = 0); /// /// Gets a list of ship calls /// /// - /// + /// /// /// Thrown when fails to make API call + /// number of days in the past to include in the result. *Example: 7*. (optional) /// Index associated with the operation. /// ApiResponse of List<Shipcall> - ApiResponse> ShipcallsGetWithHttpInfo(int operationIndex = 0); + ApiResponse> ShipcallsGetWithHttpInfo(int? pastDays = default(int?), int operationIndex = 0); /// /// Create a new ship call /// @@ -164,7 +166,7 @@ namespace BreCalClient.misc.Api /// Create a new ship call /// /// - /// + /// /// /// Thrown when fails to make API call /// Creates a new ship call. **Do not** provide id parameter. @@ -183,7 +185,7 @@ namespace BreCalClient.misc.Api /// Updates a ship call /// /// - /// + /// /// /// Thrown when fails to make API call /// Creates a new ship call. The id parameter is **required**. @@ -201,7 +203,7 @@ namespace BreCalClient.misc.Api /// gets a list of registered shipcalls /// /// - /// + /// /// /// Thrown when fails to make API call /// Index associated with the operation. @@ -219,7 +221,7 @@ namespace BreCalClient.misc.Api /// Delete a times entry for a ship call. /// /// - /// + /// /// /// Thrown when fails to make API call /// @@ -238,7 +240,7 @@ namespace BreCalClient.misc.Api /// Get all recorded times for a a ship call /// /// - /// + /// /// /// Thrown when fails to make API call /// **Id**. *Example: 42*. Id of referenced ship call. (optional) @@ -257,7 +259,7 @@ namespace BreCalClient.misc.Api /// Create a new times entry for a ship call /// /// - /// + /// /// /// Thrown when fails to make API call /// Times entry that will be added to the ship call. **Do not** provide id parameter. @@ -276,7 +278,7 @@ namespace BreCalClient.misc.Api /// Update a times entry for a ship call /// /// - /// + /// /// /// Thrown when fails to make API call /// Times entry that will be added to the ship call. The id parameter is **required**. @@ -295,7 +297,7 @@ namespace BreCalClient.misc.Api /// Update user details (first/last name, phone, password) /// /// - /// + /// /// /// Thrown when fails to make API call /// User details @@ -314,7 +316,7 @@ namespace BreCalClient.misc.Api /// Gets a list of all berths registered /// /// - /// + /// /// /// Thrown when fails to make API call /// Index associated with the operation. @@ -325,7 +327,7 @@ namespace BreCalClient.misc.Api /// Gets a list of all berths registered /// /// - /// + /// /// /// Thrown when fails to make API call /// Index associated with the operation. @@ -336,7 +338,7 @@ namespace BreCalClient.misc.Api /// Returns a JWT session token and user data if successful /// /// - /// + /// /// /// Thrown when fails to make API call /// Login credentials @@ -348,7 +350,7 @@ namespace BreCalClient.misc.Api /// Returns a JWT session token and user data if successful /// /// - /// + /// /// /// Thrown when fails to make API call /// Login credentials @@ -360,7 +362,7 @@ namespace BreCalClient.misc.Api /// Gets a list of notifications pursuant to a specified participant and ship call /// /// - /// + /// /// /// Thrown when fails to make API call /// **Id of participant**. *Example: 2*. Id returned through loading of participant @@ -373,7 +375,7 @@ namespace BreCalClient.misc.Api /// Gets a list of notifications pursuant to a specified participant and ship call /// /// - /// + /// /// /// Thrown when fails to make API call /// **Id of participant**. *Example: 2*. Id returned through loading of participant @@ -386,7 +388,7 @@ namespace BreCalClient.misc.Api /// gets a particular participant entry corresponding to user id /// /// - /// + /// /// /// Thrown when fails to make API call /// **Id of user**. *Example: 2*. User id returned by verify call. (optional) @@ -398,7 +400,7 @@ namespace BreCalClient.misc.Api /// gets a particular participant entry corresponding to user id /// /// - /// + /// /// /// Thrown when fails to make API call /// **Id of user**. *Example: 2*. User id returned by verify call. (optional) @@ -410,29 +412,31 @@ namespace BreCalClient.misc.Api /// Gets a list of ship calls /// /// - /// + /// /// /// Thrown when fails to make API call + /// number of days in the past to include in the result. *Example: 7*. (optional) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of List<Shipcall> - System.Threading.Tasks.Task> ShipcallsGetAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> ShipcallsGetAsync(int? pastDays = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Gets a list of ship calls /// /// - /// + /// /// /// Thrown when fails to make API call + /// number of days in the past to include in the result. *Example: 7*. (optional) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Shipcall>) - System.Threading.Tasks.Task>> ShipcallsGetWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ShipcallsGetWithHttpInfoAsync(int? pastDays = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Create a new ship call /// /// - /// + /// /// /// Thrown when fails to make API call /// Creates a new ship call. **Do not** provide id parameter. @@ -444,7 +448,7 @@ namespace BreCalClient.misc.Api /// Create a new ship call /// /// - /// + /// /// /// Thrown when fails to make API call /// Creates a new ship call. **Do not** provide id parameter. @@ -456,7 +460,7 @@ namespace BreCalClient.misc.Api /// Updates a ship call /// /// - /// + /// /// /// Thrown when fails to make API call /// Creates a new ship call. The id parameter is **required**. @@ -468,7 +472,7 @@ namespace BreCalClient.misc.Api /// Updates a ship call /// /// - /// + /// /// /// Thrown when fails to make API call /// Creates a new ship call. The id parameter is **required**. @@ -480,7 +484,7 @@ namespace BreCalClient.misc.Api /// gets a list of registered shipcalls /// /// - /// + /// /// /// Thrown when fails to make API call /// Index associated with the operation. @@ -491,7 +495,7 @@ namespace BreCalClient.misc.Api /// gets a list of registered shipcalls /// /// - /// + /// /// /// Thrown when fails to make API call /// Index associated with the operation. @@ -502,7 +506,7 @@ namespace BreCalClient.misc.Api /// Delete a times entry for a ship call. /// /// - /// + /// /// /// Thrown when fails to make API call /// @@ -514,7 +518,7 @@ namespace BreCalClient.misc.Api /// Delete a times entry for a ship call. /// /// - /// + /// /// /// Thrown when fails to make API call /// @@ -526,7 +530,7 @@ namespace BreCalClient.misc.Api /// Get all recorded times for a a ship call /// /// - /// + /// /// /// Thrown when fails to make API call /// **Id**. *Example: 42*. Id of referenced ship call. (optional) @@ -538,7 +542,7 @@ namespace BreCalClient.misc.Api /// Get all recorded times for a a ship call /// /// - /// + /// /// /// Thrown when fails to make API call /// **Id**. *Example: 42*. Id of referenced ship call. (optional) @@ -550,7 +554,7 @@ namespace BreCalClient.misc.Api /// Create a new times entry for a ship call /// /// - /// + /// /// /// Thrown when fails to make API call /// Times entry that will be added to the ship call. **Do not** provide id parameter. @@ -562,7 +566,7 @@ namespace BreCalClient.misc.Api /// Create a new times entry for a ship call /// /// - /// + /// /// /// Thrown when fails to make API call /// Times entry that will be added to the ship call. **Do not** provide id parameter. @@ -574,7 +578,7 @@ namespace BreCalClient.misc.Api /// Update a times entry for a ship call /// /// - /// + /// /// /// Thrown when fails to make API call /// Times entry that will be added to the ship call. The id parameter is **required**. @@ -586,7 +590,7 @@ namespace BreCalClient.misc.Api /// Update a times entry for a ship call /// /// - /// + /// /// /// Thrown when fails to make API call /// Times entry that will be added to the ship call. The id parameter is **required**. @@ -598,7 +602,7 @@ namespace BreCalClient.misc.Api /// Update user details (first/last name, phone, password) /// /// - /// + /// /// /// Thrown when fails to make API call /// User details @@ -610,7 +614,7 @@ namespace BreCalClient.misc.Api /// Update user details (first/last name, phone, password) /// /// - /// + /// /// /// Thrown when fails to make API call /// User details @@ -724,7 +728,7 @@ namespace BreCalClient.misc.Api set { _exceptionFactory = value; } } /// - /// Gets a list of all berths registered + /// Gets a list of all berths registered /// /// Thrown when fails to make API call /// Index associated with the operation. @@ -735,7 +739,7 @@ namespace BreCalClient.misc.Api return localVarResponse.Data; } /// - /// Gets a list of all berths registered + /// Gets a list of all berths registered /// /// Thrown when fails to make API call /// Index associated with the operation. @@ -779,7 +783,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Gets a list of all berths registered + /// Gets a list of all berths registered /// /// Thrown when fails to make API call /// Index associated with the operation. @@ -791,7 +795,7 @@ namespace BreCalClient.misc.Api return localVarResponse.Data; } /// - /// Gets a list of all berths registered + /// Gets a list of all berths registered /// /// Thrown when fails to make API call /// Index associated with the operation. @@ -836,7 +840,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Returns a JWT session token and user data if successful + /// Returns a JWT session token and user data if successful /// /// Thrown when fails to make API call /// Login credentials @@ -848,7 +852,7 @@ namespace BreCalClient.misc.Api return localVarResponse.Data; } /// - /// Returns a JWT session token and user data if successful + /// Returns a JWT session token and user data if successful /// /// Thrown when fails to make API call /// Login credentials @@ -900,7 +904,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Returns a JWT session token and user data if successful + /// Returns a JWT session token and user data if successful /// /// Thrown when fails to make API call /// Login credentials @@ -913,7 +917,7 @@ namespace BreCalClient.misc.Api return localVarResponse.Data; } /// - /// Returns a JWT session token and user data if successful + /// Returns a JWT session token and user data if successful /// /// Thrown when fails to make API call /// Login credentials @@ -966,7 +970,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Gets a list of notifications pursuant to a specified participant and ship call + /// Gets a list of notifications pursuant to a specified participant and ship call /// /// Thrown when fails to make API call /// **Id of participant**. *Example: 2*. Id returned through loading of participant @@ -979,7 +983,7 @@ namespace BreCalClient.misc.Api return localVarResponse.Data; } /// - /// Gets a list of notifications pursuant to a specified participant and ship call + /// Gets a list of notifications pursuant to a specified participant and ship call /// /// Thrown when fails to make API call /// **Id of participant**. *Example: 2*. Id returned through loading of participant @@ -1027,7 +1031,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Gets a list of notifications pursuant to a specified participant and ship call + /// Gets a list of notifications pursuant to a specified participant and ship call /// /// Thrown when fails to make API call /// **Id of participant**. *Example: 2*. Id returned through loading of participant @@ -1041,7 +1045,7 @@ namespace BreCalClient.misc.Api return localVarResponse.Data; } /// - /// Gets a list of notifications pursuant to a specified participant and ship call + /// Gets a list of notifications pursuant to a specified participant and ship call /// /// Thrown when fails to make API call /// **Id of participant**. *Example: 2*. Id returned through loading of participant @@ -1090,7 +1094,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// gets a particular participant entry corresponding to user id + /// gets a particular participant entry corresponding to user id /// /// Thrown when fails to make API call /// **Id of user**. *Example: 2*. User id returned by verify call. (optional) @@ -1102,7 +1106,7 @@ namespace BreCalClient.misc.Api return localVarResponse.Data; } /// - /// gets a particular participant entry corresponding to user id + /// gets a particular participant entry corresponding to user id /// /// Thrown when fails to make API call /// **Id of user**. *Example: 2*. User id returned by verify call. (optional) @@ -1151,7 +1155,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// gets a particular participant entry corresponding to user id + /// gets a particular participant entry corresponding to user id /// /// Thrown when fails to make API call /// **Id of user**. *Example: 2*. User id returned by verify call. (optional) @@ -1164,7 +1168,7 @@ namespace BreCalClient.misc.Api return localVarResponse.Data; } /// - /// gets a particular participant entry corresponding to user id + /// gets a particular participant entry corresponding to user id /// /// Thrown when fails to make API call /// **Id of user**. *Example: 2*. User id returned by verify call. (optional) @@ -1214,23 +1218,25 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Gets a list of ship calls + /// Gets a list of ship calls /// /// Thrown when fails to make API call + /// number of days in the past to include in the result. *Example: 7*. (optional) /// Index associated with the operation. /// List<Shipcall> - public List ShipcallsGet(int operationIndex = 0) + public List ShipcallsGet(int? pastDays = default(int?), int operationIndex = 0) { - BreCalClient.misc.Client.ApiResponse> localVarResponse = ShipcallsGetWithHttpInfo(); + BreCalClient.misc.Client.ApiResponse> localVarResponse = ShipcallsGetWithHttpInfo(pastDays); return localVarResponse.Data; } /// - /// Gets a list of ship calls + /// Gets a list of ship calls /// /// Thrown when fails to make API call + /// number of days in the past to include in the result. *Example: 7*. (optional) /// Index associated with the operation. /// ApiResponse of List<Shipcall> - public BreCalClient.misc.Client.ApiResponse> ShipcallsGetWithHttpInfo(int operationIndex = 0) + public BreCalClient.misc.Client.ApiResponse> ShipcallsGetWithHttpInfo(int? pastDays = default(int?), int operationIndex = 0) { BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); string[] _contentTypes = new string[] { @@ -1249,6 +1255,10 @@ namespace BreCalClient.misc.Api { localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + if (pastDays != null) + { + localVarRequestOptions.QueryParameters.Add(BreCalClient.misc.Client.ClientUtils.ParameterToMultiMap("", "past_days", pastDays)); + } localVarRequestOptions.Operation = "DefaultApi.ShipcallsGet"; localVarRequestOptions.OperationIndex = operationIndex; // authentication (ApiKey) required @@ -1269,25 +1279,27 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Gets a list of ship calls + /// Gets a list of ship calls /// /// Thrown when fails to make API call + /// number of days in the past to include in the result. *Example: 7*. (optional) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of List<Shipcall> - public async System.Threading.Tasks.Task> ShipcallsGetAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> ShipcallsGetAsync(int? pastDays = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - BreCalClient.misc.Client.ApiResponse> localVarResponse = await ShipcallsGetWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); + BreCalClient.misc.Client.ApiResponse> localVarResponse = await ShipcallsGetWithHttpInfoAsync(pastDays, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } /// - /// Gets a list of ship calls + /// Gets a list of ship calls /// /// Thrown when fails to make API call + /// number of days in the past to include in the result. *Example: 7*. (optional) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Shipcall>) - public async System.Threading.Tasks.Task>> ShipcallsGetWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ShipcallsGetWithHttpInfoAsync(int? pastDays = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { BreCalClient.misc.Client.RequestOptions localVarRequestOptions = new BreCalClient.misc.Client.RequestOptions(); string[] _contentTypes = new string[] { @@ -1306,6 +1318,10 @@ namespace BreCalClient.misc.Api { localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + if (pastDays != null) + { + localVarRequestOptions.QueryParameters.Add(BreCalClient.misc.Client.ClientUtils.ParameterToMultiMap("", "past_days", pastDays)); + } localVarRequestOptions.Operation = "DefaultApi.ShipcallsGet"; localVarRequestOptions.OperationIndex = operationIndex; // authentication (ApiKey) required @@ -1326,7 +1342,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Create a new ship call + /// Create a new ship call /// /// Thrown when fails to make API call /// Creates a new ship call. **Do not** provide id parameter. @@ -1338,7 +1354,7 @@ namespace BreCalClient.misc.Api return localVarResponse.Data; } /// - /// Create a new ship call + /// Create a new ship call /// /// Thrown when fails to make API call /// Creates a new ship call. **Do not** provide id parameter. @@ -1390,7 +1406,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Create a new ship call + /// Create a new ship call /// /// Thrown when fails to make API call /// Creates a new ship call. **Do not** provide id parameter. @@ -1403,7 +1419,7 @@ namespace BreCalClient.misc.Api return localVarResponse.Data; } /// - /// Create a new ship call + /// Create a new ship call /// /// Thrown when fails to make API call /// Creates a new ship call. **Do not** provide id parameter. @@ -1456,7 +1472,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Updates a ship call + /// Updates a ship call /// /// Thrown when fails to make API call /// Creates a new ship call. The id parameter is **required**. @@ -1468,7 +1484,7 @@ namespace BreCalClient.misc.Api return localVarResponse.Data; } /// - /// Updates a ship call + /// Updates a ship call /// /// Thrown when fails to make API call /// Creates a new ship call. The id parameter is **required**. @@ -1520,7 +1536,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Updates a ship call + /// Updates a ship call /// /// Thrown when fails to make API call /// Creates a new ship call. The id parameter is **required**. @@ -1533,7 +1549,7 @@ namespace BreCalClient.misc.Api return localVarResponse.Data; } /// - /// Updates a ship call + /// Updates a ship call /// /// Thrown when fails to make API call /// Creates a new ship call. The id parameter is **required**. @@ -1586,7 +1602,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// gets a list of registered shipcalls + /// gets a list of registered shipcalls /// /// Thrown when fails to make API call /// Index associated with the operation. @@ -1597,7 +1613,7 @@ namespace BreCalClient.misc.Api return localVarResponse.Data; } /// - /// gets a list of registered shipcalls + /// gets a list of registered shipcalls /// /// Thrown when fails to make API call /// Index associated with the operation. @@ -1641,7 +1657,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// gets a list of registered shipcalls + /// gets a list of registered shipcalls /// /// Thrown when fails to make API call /// Index associated with the operation. @@ -1653,7 +1669,7 @@ namespace BreCalClient.misc.Api return localVarResponse.Data; } /// - /// gets a list of registered shipcalls + /// gets a list of registered shipcalls /// /// Thrown when fails to make API call /// Index associated with the operation. @@ -1698,7 +1714,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Delete a times entry for a ship call. + /// Delete a times entry for a ship call. /// /// Thrown when fails to make API call /// @@ -1709,7 +1725,7 @@ namespace BreCalClient.misc.Api TimesDeleteWithHttpInfo(id); } /// - /// Delete a times entry for a ship call. + /// Delete a times entry for a ship call. /// /// Thrown when fails to make API call /// @@ -1755,7 +1771,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Delete a times entry for a ship call. + /// Delete a times entry for a ship call. /// /// Thrown when fails to make API call /// @@ -1767,7 +1783,7 @@ namespace BreCalClient.misc.Api await TimesDeleteWithHttpInfoAsync(id, operationIndex, cancellationToken).ConfigureAwait(false); } /// - /// Delete a times entry for a ship call. + /// Delete a times entry for a ship call. /// /// Thrown when fails to make API call /// @@ -1814,7 +1830,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Get all recorded times for a a ship call + /// Get all recorded times for a a ship call /// /// Thrown when fails to make API call /// **Id**. *Example: 42*. Id of referenced ship call. (optional) @@ -1826,7 +1842,7 @@ namespace BreCalClient.misc.Api return localVarResponse.Data; } /// - /// Get all recorded times for a a ship call + /// Get all recorded times for a a ship call /// /// Thrown when fails to make API call /// **Id**. *Example: 42*. Id of referenced ship call. (optional) @@ -1875,7 +1891,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Get all recorded times for a a ship call + /// Get all recorded times for a a ship call /// /// Thrown when fails to make API call /// **Id**. *Example: 42*. Id of referenced ship call. (optional) @@ -1888,7 +1904,7 @@ namespace BreCalClient.misc.Api return localVarResponse.Data; } /// - /// Get all recorded times for a a ship call + /// Get all recorded times for a a ship call /// /// Thrown when fails to make API call /// **Id**. *Example: 42*. Id of referenced ship call. (optional) @@ -1938,7 +1954,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Create a new times entry for a ship call + /// Create a new times entry for a ship call /// /// Thrown when fails to make API call /// Times entry that will be added to the ship call. **Do not** provide id parameter. @@ -1950,7 +1966,7 @@ namespace BreCalClient.misc.Api return localVarResponse.Data; } /// - /// Create a new times entry for a ship call + /// Create a new times entry for a ship call /// /// Thrown when fails to make API call /// Times entry that will be added to the ship call. **Do not** provide id parameter. @@ -2002,7 +2018,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Create a new times entry for a ship call + /// Create a new times entry for a ship call /// /// Thrown when fails to make API call /// Times entry that will be added to the ship call. **Do not** provide id parameter. @@ -2015,7 +2031,7 @@ namespace BreCalClient.misc.Api return localVarResponse.Data; } /// - /// Create a new times entry for a ship call + /// Create a new times entry for a ship call /// /// Thrown when fails to make API call /// Times entry that will be added to the ship call. **Do not** provide id parameter. @@ -2068,7 +2084,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Update a times entry for a ship call + /// Update a times entry for a ship call /// /// Thrown when fails to make API call /// Times entry that will be added to the ship call. The id parameter is **required**. @@ -2080,7 +2096,7 @@ namespace BreCalClient.misc.Api return localVarResponse.Data; } /// - /// Update a times entry for a ship call + /// Update a times entry for a ship call /// /// Thrown when fails to make API call /// Times entry that will be added to the ship call. The id parameter is **required**. @@ -2132,7 +2148,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Update a times entry for a ship call + /// Update a times entry for a ship call /// /// Thrown when fails to make API call /// Times entry that will be added to the ship call. The id parameter is **required**. @@ -2145,7 +2161,7 @@ namespace BreCalClient.misc.Api return localVarResponse.Data; } /// - /// Update a times entry for a ship call + /// Update a times entry for a ship call /// /// Thrown when fails to make API call /// Times entry that will be added to the ship call. The id parameter is **required**. @@ -2198,7 +2214,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Update user details (first/last name, phone, password) + /// Update user details (first/last name, phone, password) /// /// Thrown when fails to make API call /// User details @@ -2209,7 +2225,7 @@ namespace BreCalClient.misc.Api UserPutWithHttpInfo(userDetails); } /// - /// Update user details (first/last name, phone, password) + /// Update user details (first/last name, phone, password) /// /// Thrown when fails to make API call /// User details @@ -2261,7 +2277,7 @@ namespace BreCalClient.misc.Api return localVarResponse; } /// - /// Update user details (first/last name, phone, password) + /// Update user details (first/last name, phone, password) /// /// Thrown when fails to make API call /// User details @@ -2273,7 +2289,7 @@ namespace BreCalClient.misc.Api await UserPutWithHttpInfoAsync(userDetails, operationIndex, cancellationToken).ConfigureAwait(false); } /// - /// Update user details (first/last name, phone, password) + /// Update user details (first/last name, phone, password) /// /// Thrown when fails to make API call /// User details @@ -3622,7 +3638,7 @@ namespace BreCalClient.misc.Client /// /// Gets or sets the base path for API access. /// - public virtual string BasePath + public virtual string BasePath { get { return _basePath; } set { _basePath = value; } @@ -5016,41 +5032,41 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Id == input.Id || this.Id.Equals(input.Id) - ) && + ) && ( this.Name == input.Name || (this.Name != null && this.Name.Equals(input.Name)) - ) && + ) && ( this.OwnerId == input.OwnerId || (this.OwnerId != null && this.OwnerId.Equals(input.OwnerId)) - ) && + ) && ( this.AuthorityId == input.AuthorityId || (this.AuthorityId != null && this.AuthorityId.Equals(input.AuthorityId)) - ) && + ) && ( this.VarLock == input.VarLock || (this.VarLock != null && this.VarLock.Equals(input.VarLock)) - ) && + ) && ( this.Created == input.Created || (this.Created != null && this.Created.Equals(input.Created)) - ) && + ) && ( this.Modified == input.Modified || (this.Modified != null && this.Modified.Equals(input.Modified)) - ) && + ) && ( this.Deleted == input.Deleted || this.Deleted.Equals(input.Deleted) @@ -5204,12 +5220,12 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Username == input.Username || (this.Username != null && this.Username.Equals(input.Username)) - ) && + ) && ( this.Password == input.Password || (this.Password != null && @@ -5329,7 +5345,7 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Message == input.Message || (this.Message != null && @@ -5434,7 +5450,7 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.VarId == input.VarId || this.VarId.Equals(input.VarId) @@ -5591,39 +5607,39 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Id == input.Id || this.Id.Equals(input.Id) - ) && + ) && ( this.ParticipantId == input.ParticipantId || this.ParticipantId.Equals(input.ParticipantId) - ) && + ) && ( this.FirstName == input.FirstName || (this.FirstName != null && this.FirstName.Equals(input.FirstName)) - ) && + ) && ( this.LastName == input.LastName || (this.LastName != null && this.LastName.Equals(input.LastName)) - ) && + ) && ( this.UserName == input.UserName || (this.UserName != null && this.UserName.Equals(input.UserName)) - ) && + ) && ( this.UserPhone == input.UserPhone || (this.UserPhone != null && this.UserPhone.Equals(input.UserPhone)) - ) && + ) && ( this.Exp == input.Exp || this.Exp.Equals(input.Exp) - ) && + ) && ( this.Token == input.Token || (this.Token != null && @@ -5825,37 +5841,37 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Id == input.Id || this.Id.Equals(input.Id) - ) && + ) && ( this.TimesId == input.TimesId || this.TimesId.Equals(input.TimesId) - ) && + ) && ( this.ParticipantId == input.ParticipantId || this.ParticipantId.Equals(input.ParticipantId) - ) && + ) && ( this.NotificationType == input.NotificationType || this.NotificationType.Equals(input.NotificationType) - ) && + ) && ( this.Timestamp == input.Timestamp || (this.Timestamp != null && this.Timestamp.Equals(input.Timestamp)) - ) && + ) && ( this.Acknowledged == input.Acknowledged || this.Acknowledged.Equals(input.Acknowledged) - ) && + ) && ( this.Created == input.Created || (this.Created != null && this.Created.Equals(input.Created)) - ) && + ) && ( this.Modified == input.Modified || (this.Modified != null && @@ -6045,50 +6061,50 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Id == input.Id || this.Id.Equals(input.Id) - ) && + ) && ( this.Name == input.Name || (this.Name != null && this.Name.Equals(input.Name)) - ) && + ) && ( this.Street == input.Street || (this.Street != null && this.Street.Equals(input.Street)) - ) && + ) && ( this.PostalCode == input.PostalCode || (this.PostalCode != null && this.PostalCode.Equals(input.PostalCode)) - ) && + ) && ( this.City == input.City || (this.City != null && this.City.Equals(input.City)) - ) && + ) && ( this.Type == input.Type || this.Type.Equals(input.Type) - ) && + ) && ( this.Flags == input.Flags || (this.Flags != null && this.Flags.Equals(input.Flags)) - ) && + ) && ( this.Created == input.Created || (this.Created != null && this.Created.Equals(input.Created)) - ) && + ) && ( this.Modified == input.Modified || (this.Modified != null && this.Modified.Equals(input.Modified)) - ) && + ) && ( this.Deleted == input.Deleted || this.Deleted.Equals(input.Deleted) @@ -6252,11 +6268,11 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.ParticipantId == input.ParticipantId || this.ParticipantId.Equals(input.ParticipantId) - ) && + ) && ( this.Type == input.Type || this.Type.Equals(input.Type) @@ -6454,65 +6470,65 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Id == input.Id || this.Id.Equals(input.Id) - ) && + ) && ( this.Name == input.Name || (this.Name != null && this.Name.Equals(input.Name)) - ) && + ) && ( this.Imo == input.Imo || (this.Imo != null && this.Imo.Equals(input.Imo)) - ) && + ) && ( this.Callsign == input.Callsign || (this.Callsign != null && this.Callsign.Equals(input.Callsign)) - ) && + ) && ( this.ParticipantId == input.ParticipantId || (this.ParticipantId != null && this.ParticipantId.Equals(input.ParticipantId)) - ) && + ) && ( this.Length == input.Length || (this.Length != null && this.Length.Equals(input.Length)) - ) && + ) && ( this.Width == input.Width || (this.Width != null && this.Width.Equals(input.Width)) - ) && + ) && ( this.IsTug == input.IsTug || this.IsTug.Equals(input.IsTug) - ) && + ) && ( this.BollardPull == input.BollardPull || (this.BollardPull != null && this.BollardPull.Equals(input.BollardPull)) - ) && + ) && ( this.Eni == input.Eni || (this.Eni != null && this.Eni.Equals(input.Eni)) - ) && + ) && ( this.Created == input.Created || (this.Created != null && this.Created.Equals(input.Created)) - ) && + ) && ( this.Modified == input.Modified || (this.Modified != null && this.Modified.Equals(input.Modified)) - ) && + ) && ( this.Deleted == input.Deleted || this.Deleted.Equals(input.Deleted) @@ -6887,140 +6903,140 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Id == input.Id || this.Id.Equals(input.Id) - ) && + ) && ( this.ShipId == input.ShipId || this.ShipId.Equals(input.ShipId) - ) && + ) && ( this.Type == input.Type || this.Type.Equals(input.Type) - ) && + ) && ( this.Eta == input.Eta || (this.Eta != null && this.Eta.Equals(input.Eta)) - ) && + ) && ( this.Voyage == input.Voyage || (this.Voyage != null && this.Voyage.Equals(input.Voyage)) - ) && + ) && ( this.Etd == input.Etd || (this.Etd != null && this.Etd.Equals(input.Etd)) - ) && + ) && ( this.ArrivalBerthId == input.ArrivalBerthId || (this.ArrivalBerthId != null && this.ArrivalBerthId.Equals(input.ArrivalBerthId)) - ) && + ) && ( this.DepartureBerthId == input.DepartureBerthId || (this.DepartureBerthId != null && this.DepartureBerthId.Equals(input.DepartureBerthId)) - ) && + ) && ( this.TugRequired == input.TugRequired || (this.TugRequired != null && this.TugRequired.Equals(input.TugRequired)) - ) && + ) && ( this.PilotRequired == input.PilotRequired || (this.PilotRequired != null && this.PilotRequired.Equals(input.PilotRequired)) - ) && + ) && ( this.Flags == input.Flags || (this.Flags != null && this.Flags.Equals(input.Flags)) - ) && + ) && ( this.PierSide == input.PierSide || (this.PierSide != null && this.PierSide.Equals(input.PierSide)) - ) && + ) && ( this.Bunkering == input.Bunkering || (this.Bunkering != null && this.Bunkering.Equals(input.Bunkering)) - ) && + ) && ( this.ReplenishingTerminal == input.ReplenishingTerminal || (this.ReplenishingTerminal != null && this.ReplenishingTerminal.Equals(input.ReplenishingTerminal)) - ) && + ) && ( this.ReplenishingLock == input.ReplenishingLock || (this.ReplenishingLock != null && this.ReplenishingLock.Equals(input.ReplenishingLock)) - ) && + ) && ( this.Draft == input.Draft || (this.Draft != null && this.Draft.Equals(input.Draft)) - ) && + ) && ( this.TidalWindowFrom == input.TidalWindowFrom || (this.TidalWindowFrom != null && this.TidalWindowFrom.Equals(input.TidalWindowFrom)) - ) && + ) && ( this.TidalWindowTo == input.TidalWindowTo || (this.TidalWindowTo != null && this.TidalWindowTo.Equals(input.TidalWindowTo)) - ) && + ) && ( this.RainSensitiveCargo == input.RainSensitiveCargo || (this.RainSensitiveCargo != null && this.RainSensitiveCargo.Equals(input.RainSensitiveCargo)) - ) && + ) && ( this.RecommendedTugs == input.RecommendedTugs || (this.RecommendedTugs != null && this.RecommendedTugs.Equals(input.RecommendedTugs)) - ) && + ) && ( this.Anchored == input.Anchored || (this.Anchored != null && this.Anchored.Equals(input.Anchored)) - ) && + ) && ( this.MooredLock == input.MooredLock || (this.MooredLock != null && this.MooredLock.Equals(input.MooredLock)) - ) && + ) && ( this.Canceled == input.Canceled || (this.Canceled != null && this.Canceled.Equals(input.Canceled)) - ) && + ) && ( this.Evaluation == input.Evaluation || (this.Evaluation != null && this.Evaluation.Equals(input.Evaluation)) - ) && + ) && ( this.EvaluationMessage == input.EvaluationMessage || (this.EvaluationMessage != null && this.EvaluationMessage.Equals(input.EvaluationMessage)) - ) && + ) && ( this.Participants == input.Participants || this.Participants != null && input.Participants != null && this.Participants.SequenceEqual(input.Participants) - ) && + ) && ( this.Created == input.Created || (this.Created != null && this.Created.Equals(input.Created)) - ) && + ) && ( this.Modified == input.Modified || (this.Modified != null && @@ -7386,99 +7402,99 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Id == input.Id || this.Id.Equals(input.Id) - ) && + ) && ( this.EtaBerth == input.EtaBerth || (this.EtaBerth != null && this.EtaBerth.Equals(input.EtaBerth)) - ) && + ) && ( this.EtaBerthFixed == input.EtaBerthFixed || (this.EtaBerthFixed != null && this.EtaBerthFixed.Equals(input.EtaBerthFixed)) - ) && + ) && ( this.EtdBerth == input.EtdBerth || (this.EtdBerth != null && this.EtdBerth.Equals(input.EtdBerth)) - ) && + ) && ( this.EtdBerthFixed == input.EtdBerthFixed || (this.EtdBerthFixed != null && this.EtdBerthFixed.Equals(input.EtdBerthFixed)) - ) && + ) && ( this.LockTime == input.LockTime || (this.LockTime != null && this.LockTime.Equals(input.LockTime)) - ) && + ) && ( this.LockTimeFixed == input.LockTimeFixed || (this.LockTimeFixed != null && this.LockTimeFixed.Equals(input.LockTimeFixed)) - ) && + ) && ( this.ZoneEntry == input.ZoneEntry || (this.ZoneEntry != null && this.ZoneEntry.Equals(input.ZoneEntry)) - ) && + ) && ( this.ZoneEntryFixed == input.ZoneEntryFixed || (this.ZoneEntryFixed != null && this.ZoneEntryFixed.Equals(input.ZoneEntryFixed)) - ) && + ) && ( this.OperationsStart == input.OperationsStart || (this.OperationsStart != null && this.OperationsStart.Equals(input.OperationsStart)) - ) && + ) && ( this.OperationsEnd == input.OperationsEnd || (this.OperationsEnd != null && this.OperationsEnd.Equals(input.OperationsEnd)) - ) && + ) && ( this.Remarks == input.Remarks || (this.Remarks != null && this.Remarks.Equals(input.Remarks)) - ) && + ) && ( this.ShipcallId == input.ShipcallId || this.ShipcallId.Equals(input.ShipcallId) - ) && + ) && ( this.ParticipantId == input.ParticipantId || this.ParticipantId.Equals(input.ParticipantId) - ) && + ) && ( this.BerthId == input.BerthId || (this.BerthId != null && this.BerthId.Equals(input.BerthId)) - ) && + ) && ( this.BerthInfo == input.BerthInfo || (this.BerthInfo != null && this.BerthInfo.Equals(input.BerthInfo)) - ) && + ) && ( this.PierSide == input.PierSide || (this.PierSide != null && this.PierSide.Equals(input.PierSide)) - ) && + ) && ( this.ParticipantType == input.ParticipantType || (this.ParticipantType != null && this.ParticipantType.Equals(input.ParticipantType)) - ) && + ) && ( this.Created == input.Created || (this.Created != null && this.Created.Equals(input.Created)) - ) && + ) && ( this.Modified == input.Modified || (this.Modified != null && @@ -7695,31 +7711,31 @@ namespace BreCalClient.misc.Model { return false; } - return + return ( this.Id == input.Id || this.Id.Equals(input.Id) - ) && + ) && ( this.OldPassword == input.OldPassword || (this.OldPassword != null && this.OldPassword.Equals(input.OldPassword)) - ) && + ) && ( this.NewPassword == input.NewPassword || (this.NewPassword != null && this.NewPassword.Equals(input.NewPassword)) - ) && + ) && ( this.FirstName == input.FirstName || (this.FirstName != null && this.FirstName.Equals(input.FirstName)) - ) && + ) && ( this.LastName == input.LastName || (this.LastName != null && this.LastName.Equals(input.LastName)) - ) && + ) && ( this.UserPhone == input.UserPhone || (this.UserPhone != null && diff --git a/misc/BreCalApi.yaml b/misc/BreCalApi.yaml index 7d42c09..82a36d0 100644 --- a/misc/BreCalApi.yaml +++ b/misc/BreCalApi.yaml @@ -68,13 +68,13 @@ paths: /shipcalls: get: summary: Gets a list of ship calls - #parameters: - # - name: participant_id - # in: query - # required: true - # description: "**Id of participant**. *Example: 2*. Id of participant entity requesting ship calls" - # schema: - # type: integer + parameters: + - name: past_days + in: query + required: false + description: "number of days in the past to include in the result. *Example: 7*." + schema: + type: integer responses: 200: description: ship call list @@ -348,7 +348,7 @@ components: required: - id - ship_id - - type + - type properties: id: $ref: "#/components/schemas/shipcallId" diff --git a/src/BreCalClient/MainWindow.xaml.cs b/src/BreCalClient/MainWindow.xaml.cs index f565e62..582d65d 100644 --- a/src/BreCalClient/MainWindow.xaml.cs +++ b/src/BreCalClient/MainWindow.xaml.cs @@ -47,6 +47,8 @@ namespace BreCalClient private bool? _showCanceled = null; private SortOrder? _sortOrder; + private int searchPastDays = 0; + // private bool _filterChanged = false; // private bool _sequenceChanged = false; @@ -293,7 +295,11 @@ namespace BreCalClient List? shipcalls = null; try { - shipcalls = await _api.ShipcallsGetAsync(); + if(this.searchPastDays != 0) + shipcalls = await _api.ShipcallsGetAsync(this.searchPastDays); + else + shipcalls = await _api.ShipcallsGetAsync(); + this.Dispatcher.Invoke(new Action(() => { labelGeneralStatus.Text = $"Connection {ConnectionStatus.SUCCESSFUL}"; @@ -430,6 +436,21 @@ namespace BreCalClient { SearchFilterModel sfm = this.searchFilterControl.SearchFilter; + if( sfm.EtaFrom.HasValue && sfm.EtaFrom < DateTime.Now.AddDays(-2)) + { + int daysInThePast = (int)Math.Ceiling((DateTime.Now - sfm.EtaFrom.Value).TotalDays); + if (this.searchPastDays != daysInThePast) + { + this.searchPastDays = daysInThePast; + _refreshImmediately = true; // set flag to avoid timer loop termination + _tokenSource.Cancel(); // force timer loop end + } + } + else + { + searchPastDays = 0; + } + this._visibleControlModels.Clear(); // first add everything this._visibleControlModels.AddRange(_allShipcallsDict.Values); diff --git a/src/server/BreCal/api/shipcalls.py b/src/server/BreCal/api/shipcalls.py index 51c79d6..8d97616 100644 --- a/src/server/BreCal/api/shipcalls.py +++ b/src/server/BreCal/api/shipcalls.py @@ -17,6 +17,7 @@ def GetShipcalls(): token = request.headers.get('Authorization') options = {} options["participant_id"] = request.args.get("participant_id") + options["past_days"] = request.args.get("past_days", default=2, type=int) return impl.shipcalls.GetShipcalls(options) else: diff --git a/src/server/BreCal/impl/shipcalls.py b/src/server/BreCal/impl/shipcalls.py index afea9f4..0f5113a 100644 --- a/src/server/BreCal/impl/shipcalls.py +++ b/src/server/BreCal/impl/shipcalls.py @@ -19,10 +19,12 @@ def GetShipcalls(options): pooledConnection = local_db.getPoolConnection() commands = pydapper.using(pooledConnection) + data = commands.query("SELECT id, ship_id, type, eta, voyage, etd, arrival_berth_id, departure_berth_id, tug_required, pilot_required, " + "flags, pier_side, bunkering, replenishing_terminal, replenishing_lock, draft, tidal_window_from, tidal_window_to, rain_sensitive_cargo, recommended_tugs, " + - "anchored, moored_lock, canceled, evaluation, evaluation_message, created, modified FROM shipcall WHERE eta IS NULL OR eta >= DATE(NOW() - INTERVAL 2 DAY) " + - "ORDER BY eta", model=model.Shipcall) + "anchored, moored_lock, canceled, evaluation, evaluation_message, created, modified FROM shipcall WHERE ((type = 1 OR type = 2) AND eta >= DATE(NOW() - INTERVAL %d DAY) " % (options["past_days"]) + + "OR (type = 3 AND etd >= DATE(NOW() - INTERVAL %d DAY)) " % (options["past_days"]) + + "ORDER BY eta" , model=model.Shipcall) for shipcall in data: participant_query = "SELECT participant_id, type FROM shipcall_participant_map WHERE shipcall_id=?shipcall_id?"; for record in commands.query(participant_query, model=dict, param={"shipcall_id" : shipcall.id}, buffered=False):