@@ -63,6 +63,18 @@ YYYY/Tests/CC.Test.CompanyCases.json → 2026/Tests/DE.Test.CompanyCases.
6363Test.YYYY.pecmd → Test.2026.pecmd
6464```
6565
66+ Rename test folders (replace ` {CC} ` , ` {nn} ` , ` {Scope} ` with actual values):
67+ ```
68+ YYYY/Tests/WT-TC{nn}-{CC}-{Scope}/ → 2026/Tests/WT-TC1000-DE-BaseSalary/
69+ YYYY/Tests/GUARD-TC{n}-{CC}-{Scope}/ → 2026/Tests/GUARD-TC1-DE-MandatoryFields/
70+ ```
71+
72+ Rename script files (replace ` {Scope} ` and ` {Domain} ` with actual domain names):
73+ ```
74+ YYYY/Scripts/WageTypeValueFunction.{Scope}.Action.cs → 2026/Scripts/WageTypeValueFunction.Gross.Action.cs
75+ YYYY/Scripts/{CC}{Domain}Algorithm.cs → 2026/Scripts/DE{Domain}Algorithm.cs
76+ ```
77+
6678Update ` .sln ` : replace ` YYYY ` folder references and ` .csproj ` filenames throughout.
6779
6880### 3. Configure ` YYYY/Directory.Build.props `
@@ -80,8 +92,26 @@ Update `.sln`: replace `YYYY` folder references and `.csproj` filenames througho
8092```
8193
8294### 5. Configure ` YYYY/regulation-package.json `
83- Update ` packageId ` , ` regulationName ` , and ` installFiles ` order.
84- Scripts must be listed before Cases and WageTypes.
95+ Update ` packageId ` , ` regulationName ` , and ` installFiles ` .
96+
97+ Scripts must be listed ** before** Cases and WageTypes (PE processes files in order).
98+
99+ Split Cases and WageTypes into separate files by domain:
100+ ``` json
101+ "installFiles" : [
102+ " Regulation/{CC}.{RegulationName}.{YYYY}.json" ,
103+ " Regulation/{CC}.{RegulationName}.Scripts.{YYYY}.json" ,
104+ " Regulation/{CC}.{RegulationName}.Collectors.{YYYY}.json" ,
105+ " Regulation/{CC}.{RegulationName}.Cases.Company.{YYYY}.json" ,
106+ " Regulation/{CC}.{RegulationName}.Cases.Employee.Core.{YYYY}.json" ,
107+ " Regulation/{CC}.{RegulationName}.WageTypes.Guard.{YYYY}.json" ,
108+ " Regulation/{CC}.{RegulationName}.WageTypes.Gross.{YYYY}.json" ,
109+ " Regulation/{CC}.{RegulationName}.WageTypes.Deductions.{YYYY}.json" ,
110+ " Regulation/{CC}.{RegulationName}.WageTypes.Employer.{YYYY}.json"
111+ ]
112+ ```
113+
114+ Add further ` Cases.Employee.{Scope} ` or ` WageTypes.{Scope} ` splits as needed.
85115
86116### 6. Configure ` YYYY/Regulation.CC.RegulationName.YYYY.csproj `
87117Update ` PackageId ` , ` Description ` , and ` PackageTags ` .
@@ -107,28 +137,73 @@ Copy `PayrollEngine.Exchange.schema.json` into:
107137# ## 10. Create `YYYY/Docs/`
108138Add analysis and design documentation :
109139` ` `
110- YYYY/Docs/{CC}.{RegulationName}-Analysis.md — system analysis, regulation overview
111- YYYY/Docs/{CC}.{RegulationName}-NoCodeDesign.md — No-Code/Low-Code action specification
112- YYYY/Docs/{CC}.{RegulationName}-TestSpec.md — test case calculations with source references
140+ YYYY/Docs/{CC}.{RegulationName}-Analysis.md — system analysis, regulation overview
141+ YYYY/Docs/{CC}.{RegulationName}-NoCodeDesign.md — No-Code/Low-Code action specification
142+ YYYY/Docs/{CC}.{RegulationName}-TestSpec.md — test case calculations with source references
143+ YYYY/Docs/{CC}.{RegulationName}-UpdateWorkflow.md — year-over-year update process
113144` ` `
114145
115146# ## 11. Implement regulation objects
116147Follow the [Country Bootstrap Guide](https://github.com/Payroll-Engine/Regulation.COM.Base/blob/main/Docs/Country-Bootstrap.md).
117148
118149Implement JSON files in `YYYY/Regulation/` :
119- - ` {CC}.{RegulationName}.{YYYY}.json` — regulation definition (name, attributes )
120- - ` {CC}.{RegulationName}.Scripts.{YYYY}.json` — script references
150+ - ` {CC}.{RegulationName}.{YYYY}.json` — regulation definition (name, namespace, validFrom )
151+ - ` {CC}.{RegulationName}.Scripts.{YYYY}.json` — script registrations (see Step 11a)
121152- ` {CC}.{RegulationName}.Collectors.{YYYY}.json` — collector definitions
122- - ` {CC}.{RegulationName}.Cases.{YYYY}.json` — employee + company case definitions
123- - ` {CC}.{RegulationName}.WageTypes.{YYYY}.json` — wage type definitions with actions
153+ - ` {CC}.{RegulationName}.Cases.Company.{YYYY}.json` — company case definitions
154+ - ` {CC}.{RegulationName}.Cases.Employee.Core.{YYYY}.json` — core employee cases
155+ - ` {CC}.{RegulationName}.Cases.Employee.{Scope}.{YYYY}.json` — additional employee case splits
156+ - ` {CC}.{RegulationName}.WageTypes.Guard.{YYYY}.json` — guard WTs (WT 1–9)
157+ - ` {CC}.{RegulationName}.WageTypes.Gross.{YYYY}.json` — gross income WTs
158+ - ` {CC}.{RegulationName}.WageTypes.Deductions.{YYYY}.json` — employee deduction WTs
159+ - ` {CC}.{RegulationName}.WageTypes.Employer.{YYYY}.json` — employer cost WTs
124160
125161Implement data file in `Data.Tax.YYYY/Regulation/` :
126162- ` {CC}.{RegulationName}.Data.Tax.{YYYY}.json` — tax brackets and rates as lookups
127163
128- # ## 12. Update `YYYY/Tests/TC01/TC01-BaseSalary.et.json`
129- Replace case field names with actual field names from your regulation.
130- Calculate and fill in the expected `wageTypeResults` and `collectorResults`.
131- Document the derivation in `YYYY/Tests/TC01/README.md`.
164+ # ## 11a. Register scripts in `Scripts.{YYYY}.json`
165+
166+ Every `.cs` file in `YYYY/Scripts/` must be registered in
167+ `{CC}.{RegulationName}.Scripts.{YYYY}.json`. The order matters :
168+ **Shared → Guard → domain Actions → CaseValidate → Algorithms**
169+
170+ ` ` ` json
171+ { "name": "WageTypeValue.Shared", "functionTypes": ["WageTypeValue"], "valueFile": "../Scripts/WageTypeValueFunction.Shared.Action.cs" },
172+ { "name": "WageTypeValue.Guard", "functionTypes": ["WageTypeValue"], "valueFile": "../Scripts/WageTypeValueFunction.Guard.Action.cs" },
173+ { "name": "WageTypeValue.{Scope}", "functionTypes": ["WageTypeValue"], "valueFile": "../Scripts/WageTypeValueFunction.{Scope}.Action.cs" },
174+ { "name": "CaseValidate", "functionTypes": ["CaseValidate"], "valueFile": "../Scripts/CaseValidateFunction.Action.cs" },
175+ { "name": "Algorithm.{CC}{Domain}Algorithm", "functionTypes": ["WageTypeValue"], "valueFile": "../Scripts/{CC}{Domain}Algorithm.cs" }
176+ ` ` `
177+
178+ Unregistered scripts are silently ignored by PE — a missing entry causes
179+ all actions defined in that file to return `0` with no error.
180+
181+ # ## 12. Implement test cases
182+
183+ **TC naming conventions (non-negotiable):**
184+ ```
185+ Wage type tests: WT-TC{nn}-{CC}-{Scope} e.g. WT-TC1000-DE-BaseSalary
186+ Guard tests: GUARD-TC{n}-{CC}-{Scope} e.g. GUARD-TC1-DE-MandatoryFields
187+ ```
188+
189+ Each TC lives in its own folder:
190+ ```
191+ YYYY/Tests/WT-TC{nn}-{CC}-{Scope}/
192+ WT-TC{nn}-{CC}-{Scope}-{YYYY}.et.json — payrun employee test
193+ WT-TC{nn}-{CC}-{Scope}.pecmd — single-TC runner
194+ README.md — purpose, scenario, derivation
195+ ```
196+
197+ For guard TCs the expected result is always empty:
198+ ```json
199+ "wageTypeResults": [],
200+ "collectorResults": []
201+ ```
202+
203+ Document the full derivation (formula + statutory source) in each TC's ` README.md ` .
204+
205+ Update ` YYYY/Test.All.pecmd ` with all TCs grouped by phase (Guards first,
206+ Company Case setters last — see ` YYYY/Tests/README.md ` ).
132207
133208### 13. First release
134209Remove ` .dev ` suffix in ` YYYY/Directory.Build.props ` :
0 commit comments