Skip to content

Commit 3662309

Browse files
author
Jani Giannoudis
committed
payroll runtime: added access to lookup range brackets
updated version to 0.9.0-beta.16
1 parent 0dbb3ac commit 3662309

4 files changed

Lines changed: 30 additions & 5 deletions

File tree

Client.Services/PayrollEngine.Client.Services.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
</PropertyGroup>
1515

1616
<ItemGroup>
17-
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="10.0.2" />
18-
<PackageReference Include="PayrollEngine.Client.Scripting" Version="0.9.0-beta.15" />
19-
<PackageReference Include="PayrollEngine.Client.Test" Version="0.9.0-beta.15" />
17+
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="10.0.3" />
18+
<PackageReference Include="PayrollEngine.Client.Scripting" Version="0.9.0-beta.16" />
19+
<PackageReference Include="PayrollEngine.Client.Test" Version="0.9.0-beta.16" />
2020
</ItemGroup>
2121

2222
<!-- include xml documention files and json schemas to the nuget package -->

Client.Services/PayrollEngine.Client.Services.xml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Client.Services/Scripting.Runtime.Api/PayrollRuntime.cs

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
using System.Text.Json;
44
using System.Threading.Tasks;
55
using System.Collections.Generic;
6+
using CultureInfo = System.Globalization.CultureInfo;
67
using PayrollEngine.Client.Model;
78
using PayrollEngine.Client.Service;
89
using PayrollEngine.Client.Service.Api;
9-
using CultureInfo = System.Globalization.CultureInfo;
1010

1111
namespace PayrollEngine.Client.Scripting.Runtime.Api;
1212

@@ -513,6 +513,28 @@ public virtual string GetLookup(string lookupName, string lookupKey, string cult
513513
return result;
514514
}
515515

516+
/// <inheritdoc />
517+
public List<Tuple<string, string, decimal, decimal, decimal?>> GetLookupRanges(string lookupName,
518+
decimal? rangeValue = null)
519+
{
520+
var brackets = new List<Tuple<string, string, decimal, decimal, decimal?>>();
521+
var lookups = PayrollService.GetLookupRangesAsync(new(TenantId, PayrollId),
522+
lookupNames: [lookupName],
523+
rangeValue: rangeValue).Result;
524+
foreach (var lookup in lookups)
525+
{
526+
if (lookup.Brackets == null)
527+
{
528+
continue;
529+
}
530+
foreach (var bracket in lookup.Brackets)
531+
{
532+
brackets.Add(new(bracket.Key, bracket.Value, bracket.RangeStart, bracket.RangeEnd, bracket.RangeValue));
533+
}
534+
}
535+
return brackets;
536+
}
537+
516538
/// <inheritdoc />
517539
public virtual string GetRangeLookup(string lookupName, decimal rangeValue,
518540
string lookupKey = null, string culture = null)

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFramework>net10.0</TargetFramework>
5-
<Version>0.9.0-beta.15</Version>
5+
<Version>0.9.0-beta.16</Version>
66
<FileVersion>0.9.0</FileVersion>
77
<InformationalVersion></InformationalVersion>
88
<Authors>Jani Giannoudis</Authors>

0 commit comments

Comments
 (0)