Regulator Overview
Payroll Consultants & HR Specialists
Regulators encode payroll domain knowledge into the engine.
They define calculation rules, data models, and reports in versioned, reusable regulation layers —
without depending on the software platform for domain changes.
Regulator
Scripting API · C# 14
No-Code / Low-Code
No-Code / Low-Code
C# as scripting syntax
Regulations use C# as an embedded scripting language for expressions and validations — written directly in JSON or YAML. No .NET project, no build toolchain, no software development background required. .NET is only needed for the Automator role.
Skill Levels
Regulators work at one or more of three levels depending on complexity:
Level 1
No-Code
JSON
Capture requirements, define tests, review results. Uses declarative actions — no scripting required.
Level 2
Low-Code
JSON · C# basics
Design and develop regulations: Cases, WageTypes, Collectors. Only basic C# method-call syntax needed.
Level 3
Code
JSON · C# intermediate
Custom Actions, advanced scripts, and custom Reports. Required only for logic beyond the built-in ecosystem.
What Regulators Do
📋 Model the Data
Define Cases and CaseFields for company, employee, national, and global data. Control availability, build logic, and validation per field.
🧮 Define Calculations
Create WageTypes and Collectors that compute payroll results. Attach C# scripts for custom calculation logic.
📚 Manage Reference Data
Build Lookups for external data tables — tax brackets, cantonal rates, or industry-specific coefficients. Supports range-based and multilingual values.
📄 Build Reports
Design report definitions with dynamic parameters and multilingual templates. Outputs include payslips, legal filings, and data exchanges.
🔗 Layer Regulations
Stack regulations (national → industry → company) using payroll layers. Derived regulations inherit and selectively override base logic.
✅ Test & Validate
Write Case-Tests and Payrun-Tests in JSON. Run them via the Payroll Console to validate calculation results against expected values.
Regulation Building Blocks
| Element | Purpose |
|---|---|
Case / CaseField |
Input data model for employee, company, and national events |
CaseRelation |
Conditional dependencies between cases |
WageType |
Payroll calculation line (wages, deductions, contributions) |
Collector |
Aggregation of WageType results (gross, net, tax bases) |
Lookup |
Reference data table (tax rates, coefficients, categories) |
Report |
Output definition for payslips, filings, and data exports |
Script |
Shared C# logic reusable across regulation objects |
Tools
| Tool | Purpose |
|---|---|
| Web Application | Regulation editor with inheritance-aware view |
| Payroll Console | Test, import, and export regulations |
| IDE (VS / Rider) | Debug Case and Payrun scripts locally |
| JSON / YAML | Regulation authoring format |
PayrollEngine.Client.Scripting |
NuGet package for local scripting runtime |
Next Steps
- No-Code / Low-Code Development — skill levels, actions, and scripting workflow
- Custom Actions — tutorial for building custom validation actions
- Regulation Design — layering, versioning, and design guidelines
- Testing — Case-Tests, Payrun-Tests, Report-Tests
- API Overview — understanding all three roles in context