Skip to content

Commit 3eb37fd

Browse files
author
Jani Giannoudis
committed
restructure template — year-based sub-project layout, Data.Tax sub-project, updated README/TEMPLATE/CHANGELOG
YYYY/ — new year sub-project (main regulation) - Directory.Build.props, regulation-package.json, Regulation.CC.RegulationName.YYYY.csproj, nuget.config - Scripts/: WageTypeValueFunction.Action.cs (added {CC}CalculateProrata action), CaseValidateFunction.Action.cs (renamed action to {CC}ValidateNationalId) - Tests/: CC.Test.Setup.json (new — includes Payroll layer configuration), CC.Test.CompanyCases.json, Tests/README.md - Test
1 parent 1647877 commit 3eb37fd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+670
-484
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121

2222
- name: Read version
2323
id: version
24+
working-directory: 'YYYY'
2425
run: |
2526
VERSION=$(grep -oP '(?<=<Version>)[^<]+' Directory.Build.props)
2627
echo "version=${VERSION}" >> $GITHUB_OUTPUT
@@ -43,13 +44,17 @@ jobs:
4344
--store-password-in-clear-text
4445
4546
- name: Restore
47+
working-directory: 'YYYY'
4648
run: dotnet restore
4749

4850
- name: Build
51+
working-directory: 'YYYY'
4952
run: dotnet build --configuration Release --no-restore
5053

5154
- name: Pack
55+
working-directory: 'YYYY'
5256
run: dotnet pack --configuration Release --no-build --output ./nupkgs
5357

5458
- name: List packages
59+
working-directory: 'YYYY'
5560
run: ls -la ./nupkgs/

.github/workflows/release.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name: Release
22

3-
# Triggered automatically when Directory.Build.props changes on main.
3+
# Triggered automatically when YYYY/Directory.Build.props changes on main.
44
# Skips silently if the version ends with ".dev" or the tag already exists.
55
# Can also be triggered manually via workflow_dispatch — version is always
6-
# read from Directory.Build.props, never entered as an input.
6+
# read from YYYY/Directory.Build.props, never entered as an input.
77
#
88
# Required secret: PAT_DISPATCH
99
# Classic PAT with scopes: repo, workflow, write:packages, read:packages
@@ -13,7 +13,7 @@ on:
1313
push:
1414
branches: [main]
1515
paths:
16-
- Directory.Build.props
16+
- 'YYYY/Directory.Build.props'
1717
workflow_dispatch: {}
1818

1919
permissions:
@@ -32,9 +32,10 @@ jobs:
3232
token: ${{ secrets.PAT_DISPATCH }}
3333
fetch-depth: 0
3434

35-
# ── Read version from Directory.Build.props ──────────────────────────
35+
# ── Read version from YYYY/Directory.Build.props ──────────────────────
3636
- name: Read version
3737
id: version
38+
working-directory: 'YYYY'
3839
run: |
3940
VERSION=$(grep -oP '(?<=<Version>)[^<]+' Directory.Build.props)
4041
echo "version=${VERSION}" >> $GITHUB_OUTPUT
@@ -91,6 +92,7 @@ jobs:
9192
# ── Sync regulation-package.json version ─────────────────────────────
9293
- name: Sync regulation-package.json
9394
if: steps.version.outputs.is_dev != 'true' && steps.guard.outputs.skip != 'true'
95+
working-directory: 'YYYY'
9496
run: |
9597
VERSION="${{ steps.version.outputs.version }}"
9698
if [ -f regulation-package.json ]; then
@@ -125,14 +127,17 @@ jobs:
125127
126128
- name: Restore
127129
if: steps.version.outputs.is_dev != 'true' && steps.guard.outputs.skip != 'true'
130+
working-directory: 'YYYY'
128131
run: dotnet restore
129132

130133
- name: Build
131134
if: steps.version.outputs.is_dev != 'true' && steps.guard.outputs.skip != 'true'
135+
working-directory: 'YYYY'
132136
run: dotnet build --configuration Release --no-restore
133137

134138
- name: Pack
135139
if: steps.version.outputs.is_dev != 'true' && steps.guard.outputs.skip != 'true'
140+
working-directory: 'YYYY'
136141
run: dotnet pack --configuration Release --no-build --output ./nupkgs
137142

138143
# ── Publish to GitHub Packages ────────────────────────────────────────
@@ -141,6 +146,7 @@ jobs:
141146
# private repo → private package (requires read:packages PAT)
142147
- name: Publish to GitHub Packages
143148
if: steps.version.outputs.is_dev != 'true' && steps.guard.outputs.skip != 'true'
149+
working-directory: 'YYYY'
144150
run: |
145151
dotnet nuget push ./nupkgs/*.nupkg \
146152
--source "https://nuget.pkg.github.com/Payroll-Engine/index.json" \
@@ -158,4 +164,4 @@ jobs:
158164
name: v${{ steps.version.outputs.version }}
159165
prerelease: ${{ steps.version.outputs.is_prerelease }}
160166
generate_release_notes: true
161-
files: ./nupkgs/*.nupkg
167+
files: 'YYYY/nupkgs/*.nupkg'

CHANGELOG.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# CHANGELOG — {CC}.{RegulationName}
2+
3+
All notable changes to this regulation are documented in this file.
4+
5+
Each entry corresponds to a regulation release (functional or data sub-project).
6+
A new release is only created when the content has changed — unchanged sub-projects
7+
carry no new release.
8+
9+
---
10+
11+
## [{CC}.{RegulationName}.{YYYY}] — {YYYY}-01-01
12+
13+
### Initial release
14+
15+
Full implementation of the {CC} {RegulationName} regulation for payroll year {YYYY}.
16+
17+
**Scope:**
18+
19+
| Component | Description |
20+
|---|---|
21+
| BaseSalary with prorata | Calendar-day prorata via Indienst/Uitdienst (WT 10 + WT 1000) |
22+
| TaxWithheld | Annual projection via TaxParameter lookup |
23+
| NetPay | GrossIncome − Deductions |
24+
| NationalId validation | Checksum validation |
25+
26+
**Cases (Employee):** `{CC}.Salary`, `{CC}.Personal`, `{CC}.Employment`
27+
28+
**Cases (Company):** `{CC}.Configuration`
29+
30+
**Collectors:** `{CC}.GrossIncome`, `{CC}.Deductions`, `{CC}.EmployerCost`
31+
32+
### Data — Initial statutory parameters {YYYY}
33+
34+
| Sub-project | Content | Source | Update Cycle |
35+
|---|---|---|---|
36+
| `{CC}.{RegulationName}.Data.Tax` | Tax brackets and rates | Official statutory source | Annual |

Data.Tax.YYYY/Delete.pecmd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
RegulationDelete {CC}.{RegulationName}.Data.Tax /tenantidentifier:{CC}.{RegulationName} /trydelete
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<Project>
2+
3+
<PropertyGroup>
4+
<TargetFramework>net10.0</TargetFramework>
5+
<Version>{YYYY}.1-beta.dev</Version>
6+
<FileVersion>{YYYY}.1.0</FileVersion>
7+
<InformationalVersion></InformationalVersion>
8+
<Authors>{Provider}</Authors>
9+
<Company>{Provider}</Company>
10+
<Copyright>© {YYYY} {Provider}</Copyright>
11+
<Product>Payroll Engine Data Regulation {CC}.{RegulationName}.Data.Tax {YYYY}</Product>
12+
<PackageProjectUrl>https://payrollengine.org/</PackageProjectUrl>
13+
<RepositoryUrl>https://github.com/{Provider}/Regulation.{CC}.{RegulationName}.git</RepositoryUrl>
14+
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
15+
</PropertyGroup>
16+
17+
<PropertyGroup>
18+
<!-- Disable NuGet vulnerability audit — regulation packages have no runtime dependencies -->
19+
<NuGetAudit>false</NuGetAudit>
20+
</PropertyGroup>
21+
22+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
23+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
24+
<WarningsAsErrors />
25+
<NoWarn>1701;1702;8034;AD0001</NoWarn>
26+
</PropertyGroup>
27+
28+
</Project>
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<PackageId>{Provider}.Regulation.{CC}.{RegulationName}.Data.Tax</PackageId>
5+
<Description>{CC} {RegulationName} data regulation — tax rates and parameters {YYYY}</Description>
6+
<PackageTags>payrollengine;regulation;data-regulation;country-{cc}</PackageTags>
7+
<PackageReadmeFile>README.md</PackageReadmeFile>
8+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
9+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
10+
</PropertyGroup>
11+
12+
<ItemGroup>
13+
<EmbeddedResource Include="Regulation\**\*.json" />
14+
<EmbeddedResource Include="Schemas\**\*" />
15+
</ItemGroup>
16+
17+
<ItemGroup>
18+
<None Include="regulation-package.json">
19+
<Pack>True</Pack>
20+
<PackagePath>regulation/</PackagePath>
21+
</None>
22+
<None Include="Regulation\**\*.json">
23+
<Pack>True</Pack>
24+
<PackagePath>regulation/Regulation/</PackagePath>
25+
</None>
26+
<None Include="README.md">
27+
<Pack>True</Pack>
28+
<PackagePath>\</PackagePath>
29+
</None>
30+
</ItemGroup>
31+
32+
<!-- publish package -->
33+
<Target Name="PublishPackage" AfterTargets="Pack" Condition="exists('$(PayrollEnginePackageDir)')">
34+
<ItemGroup>
35+
<NuGetPackage Include="$(MSBuildProjectDirectory)\bin\$(Configuration)\$(PackageId).*.nupkg" />
36+
</ItemGroup>
37+
<Message Importance="High" Text="Publish package..." />
38+
<Copy SourceFiles="@(NuGetPackage)"
39+
DestinationFolder="$(PayrollEnginePackageDir)" />
40+
</Target>
41+
42+
</Project>

Data.Tax.YYYY/Schemas/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copy PayrollEngine.Exchange.schema.json here
2+
#
3+
# Source: PayrollEngine main repo or any regulation repo Schemas/ folder
4+
# Required for JSON $schema validation in editors and CI.

Data.Tax.YYYY/Setup.pecmd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### Setup {CC}.{RegulationName}.Data.Tax {YYYY} ###
2+
### Requires {CC}.{RegulationName} regulation already installed ###
3+
PayrollImport Regulation/{CC}.{RegulationName}.Data.Tax.{YYYY}.json

Data.Tax.YYYY/nuget.config

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<clear />
5+
<add key="github" value="https://nuget.pkg.github.com/Payroll-Engine/index.json" />
6+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
7+
<!-- Local dev packages folder — remove or adjust for your environment -->
8+
<add key="PayrollEngine" value="C:\Shared\PayrollEngine\Repos\PayrollEngine\Packages" />
9+
</packageSources>
10+
<packageSourceCredentials>
11+
<github>
12+
<add key="Username" value="github-actions" />
13+
<add key="ClearTextPassword" value="%GITHUB_TOKEN%" />
14+
</github>
15+
</packageSourceCredentials>
16+
<packageSourceMapping>
17+
<packageSource key="PayrollEngine">
18+
<package pattern="PayrollEngine.Regulation.*" />
19+
</packageSource>
20+
<packageSource key="github">
21+
<package pattern="PayrollEngine.*" />
22+
</packageSource>
23+
<packageSource key="nuget.org">
24+
<package pattern="*" />
25+
</packageSource>
26+
</packageSourceMapping>
27+
</configuration>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"packageId": "{Provider}.Regulation.{CC}.{RegulationName}.Data.Tax",
3+
"regulationName": "{CC}.{RegulationName}.Data.Tax",
4+
"version": "{YYYY}.1-beta.dev",
5+
"baseRegulations": [ "{CC}.{RegulationName}" ],
6+
"installFiles": [
7+
"Regulation/{CC}.{RegulationName}.Data.Tax.{YYYY}.json"
8+
]
9+
}

0 commit comments

Comments
 (0)