diff --git a/keypay-dotnet.sln b/keypay-dotnet.sln index 4631dd7..465af5f 100644 --- a/keypay-dotnet.sln +++ b/keypay-dotnet.sln @@ -1,9 +1,9 @@ - + Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.26228.4 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "keypay-dotnet", "src\keypay-dotnet\keypay-dotnet.csproj", "{93365E33-3B92-4EA6-AB42-FFECBC504138}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "keypay-dotnet", "src\keypay-dotnet\keypay-dotnet.csproj", "{93365E33-3B92-4EA6-AB42-FFECBC504138}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleApplication", "test\SampleApplication\SampleApplication.csproj", "{08F68476-5DE7-4C24-AEB5-3FFF29DF1C87}" EndProject diff --git a/src/keypay-dotnet/ApiFunctions/V2/PayScheduleFunction.cs b/src/keypay-dotnet/ApiFunctions/V2/PayScheduleFunction.cs index 3f91d19..6e62916 100644 --- a/src/keypay-dotnet/ApiFunctions/V2/PayScheduleFunction.cs +++ b/src/keypay-dotnet/ApiFunctions/V2/PayScheduleFunction.cs @@ -39,5 +39,10 @@ public void Delete(int businessId, int payCategoryId) { ApiRequest($"/business/{businessId}/payschedule/{payCategoryId}", Method.Delete); } + + public PayScheduleDateForecastResultApiModel GetNextPayDate(int businessId, int payScheduleId) + { + return ApiRequest($"/business/{businessId}/payschedule/{payScheduleId}/nextpaydate"); + } } } \ No newline at end of file diff --git a/src/keypay-dotnet/ApiRequestExecutor.cs b/src/keypay-dotnet/ApiRequestExecutor.cs index dbd72e1..0620bfc 100644 --- a/src/keypay-dotnet/ApiRequestExecutor.cs +++ b/src/keypay-dotnet/ApiRequestExecutor.cs @@ -6,6 +6,7 @@ using Newtonsoft.Json; using RestSharp; using RestSharp.Authenticators; +using RestSharp.Serializers; using RestSharp.Serializers.NewtonsoftJson; namespace KeyPay @@ -55,15 +56,14 @@ private RestClient GetClient(RestRequest request) var options = new RestClientOptions { BaseUrl = new Uri(baseUrl), - MaxTimeout = 600000 // 10 min timeout for long EI queries + Authenticator = Authenticator, + MaxTimeout = 600000, + // 10 min timeout for long EI queries }; + + var client = new RestClient(options, configureSerialization: s => s.UseNewtonsoftJson() ) ; - var client = new RestClient(options) - { - Authenticator = Authenticator - }; - - client.UseNewtonsoftJson(); + request.OnBeforeDeserialization = resp => HandleResponse(resp, request.Method, request.Resource); return client; diff --git a/src/keypay-dotnet/DomainModels/V2/Business/PayScheduleDateForecastResultApiModel.cs b/src/keypay-dotnet/DomainModels/V2/Business/PayScheduleDateForecastResultApiModel.cs new file mode 100644 index 0000000..cb8bff6 --- /dev/null +++ b/src/keypay-dotnet/DomainModels/V2/Business/PayScheduleDateForecastResultApiModel.cs @@ -0,0 +1,12 @@ +using System; + +namespace KeyPay.DomainModels.V2.Business +{ + public class PayScheduleDateForecastResultApiModel + { + public int PayScheduleId { get; set; } + public DateTime? NextScheduledPaidDate { get; set; } + public DateTime? NextScheduledFromDate { get; set; } + public DateTime? NextScheduledToDate { get; set; } + } +} \ No newline at end of file diff --git a/src/keypay-dotnet/Properties/AssemblyInfo.cs b/src/keypay-dotnet/Properties/AssemblyInfo.cs index 615825f..3292c18 100644 --- a/src/keypay-dotnet/Properties/AssemblyInfo.cs +++ b/src/keypay-dotnet/Properties/AssemblyInfo.cs @@ -1,13 +1,5 @@ using System.Reflection; using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("KeyPay")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyProduct("KeyPay")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -18,16 +10,3 @@ // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("93365e33-3b92-4ea6-ab42-ffecbc504138")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyInformationalVersion("1.1.0.18")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/keypay-dotnet/app.config b/src/keypay-dotnet/app.config index f10b4ac..84d2865 100644 --- a/src/keypay-dotnet/app.config +++ b/src/keypay-dotnet/app.config @@ -4,8 +4,24 @@ - + + + + + + + + + + + + + + + + + - \ No newline at end of file + diff --git a/src/keypay-dotnet/keypay-dotnet.csproj b/src/keypay-dotnet/keypay-dotnet.csproj index 395a751..53b9353 100644 --- a/src/keypay-dotnet/keypay-dotnet.csproj +++ b/src/keypay-dotnet/keypay-dotnet.csproj @@ -1,362 +1,34 @@ - - - + - Debug - AnyCPU - {93365E33-3B92-4EA6-AB42-FFECBC504138} Library - Properties KeyPay KeyPay - v4.6.1 - 512 - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 true - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - true + true + + + net6.0 + false + KeyPay-SKNG + KeyPay + 1.1.0.18-SKNG + 1.0.0.0 - - ..\..\packages\Microsoft.Bcl.AsyncInterfaces.5.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll - - - ..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll - True - - - ..\..\packages\RestSharp.108.0.1\lib\netstandard2.0\RestSharp.dll - - - ..\..\packages\RestSharp.Serializers.NewtonsoftJson.108.0.1\lib\netstandard2.0\RestSharp.Serializers.NewtonsoftJson.dll - - - - ..\..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll - - - - ..\..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll - - - - ..\..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll - - - ..\..\packages\System.Runtime.CompilerServices.Unsafe.5.0.0\lib\net45\System.Runtime.CompilerServices.Unsafe.dll - - - ..\..\packages\System.Text.Encodings.Web.5.0.0\lib\net461\System.Text.Encodings.Web.dll - - - ..\..\packages\System.Text.Json.5.0.0\lib\net461\System.Text.Json.dll - - - ..\..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll - - - ..\..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll - True - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + - - \ No newline at end of file diff --git a/src/keypay-dotnet/keypay-dotnet.nuspec b/src/keypay-dotnet/keypay-dotnet.nuspec index cfccfbc..c601fa7 100644 --- a/src/keypay-dotnet/keypay-dotnet.nuspec +++ b/src/keypay-dotnet/keypay-dotnet.nuspec @@ -15,12 +15,15 @@ Copyright 2022 keypay yourpayroll api payroll - - - - - - + + + + + + + + + diff --git a/src/keypay-dotnet/packages.config b/src/keypay-dotnet/packages.config deleted file mode 100644 index 486fe5e..0000000 --- a/src/keypay-dotnet/packages.config +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/test/SampleApplication/SampleApplication.csproj b/test/SampleApplication/SampleApplication.csproj index 3b1374e..0028815 100644 --- a/test/SampleApplication/SampleApplication.csproj +++ b/test/SampleApplication/SampleApplication.csproj @@ -1,23 +1,26 @@  - net461 + net700 win7-x86 - - - - - - - - - - - - - + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + diff --git a/test/SampleApplication/Startup.cs b/test/SampleApplication/Startup.cs index 3b17e8f..e3ebab1 100644 --- a/test/SampleApplication/Startup.cs +++ b/test/SampleApplication/Startup.cs @@ -36,6 +36,12 @@ public void ConfigureServices(IServiceCollection services) services.AddMvc(); // Adds a default in-memory implementation of IDistributedCache. services.AddDistributedMemoryCache(); + services.AddCookiePolicy(); + new CookiePolicyOptions + { + HttpOnly = Microsoft.AspNetCore.CookiePolicy.HttpOnlyPolicy.Always + }); ; + services.AddSession(options => {