66{YYYY}/Setup.pecmd
77```
88
9- Full setup: deletes existing data, imports regulation + data regulation + test tenant.
9+ Full setup: deletes existing data, imports regulation + data regulations + test tenant.
1010
1111## Run All
1212
@@ -25,14 +25,29 @@ For CI/CD (no persistence):
2525
2626## Teardown
2727
28- Removes the test payroll and payrun without deleting the regulation:
29-
3028``` pecmd
3129{YYYY}/Delete.Tests.pecmd
3230```
3331
3432---
3533
34+ ## TC Naming Convention
35+
36+ ** Guard TCs** use ` GUARD-TC{N} ` where ` N ` mirrors the Guard WageType number:
37+
38+ | Guard WT | TC Prefix | Covers |
39+ | :---| :---| :---|
40+ | WT 1 ` Guard ` | ` GUARD-TC1 ` | Mandatory employee fields |
41+ | WT {n} ` Guard{X} ` | ` GUARD-TC{n} ` | {Description} |
42+
43+ Multiple scenarios for the same Guard WT share the same TC number and are distinguished
44+ by their directory suffix. Example: ` GUARD-TC1-{CC}-{Field1}Missing ` and
45+ ` GUARD-TC1-{CC}-{Field2}Missing ` both test WT 1.
46+
47+ ** WT TCs** use ` WT-TC{WageTypeNumber}-{CC}-{ShortDescription} ` .
48+
49+ ---
50+
3651## Test Suite Structure — ` Test.All.pecmd `
3752
3853` Test.All.pecmd ` runs all TCs in a fixed phase order. The order is NOT alphabetical
@@ -42,57 +57,109 @@ or numeric — it reflects **calculation dependencies** and **Company Case state
4257
4358| Phase | Scope | WTs | Rationale |
4459| :---| :---| :---| :---|
45- | 1 — Guards | Guards | 1–{n} | No dependencies; must run first |
46- | 2 — Technical | Contribution base | {nn} | All contribution WTs depend on this; no own dependencies |
60+ | 1 — Guards | Guard WTs | 1–{n} | No dependencies; must run first |
61+ | 2 — Technical | Contribution base / runtime setters | {nn} | All contribution WTs depend on this; no own dependencies |
4762| 3 — Gross | Gross income | 1000–{nnnn} | No inter-WT dependencies |
48- | 4 — Deductions | Employee deductions | 5000–{nnnn} | All read WT {nn} (contribution base) |
63+ | 4 — Deductions | Employee deductions | 5000–{nnnn} | Read contribution base WT; WT {nnn} reads prior-period results |
4964| 5 — Net | Net pay | 6500 | Reads GrossCollector − DeductionsCollector |
50- | 6 — Employer | Employer costs | 6600–{nnnn} | All read WT {nn} ( contribution base) |
51- | ** Last — ConvenioConfig ** | ** Company Cases** | ** {relevant WTs}** | ** Sets non-zero Company Cases — must run last** |
65+ | 6 — Employer | Employer costs | 6600–{nnnn} | Read contribution base WT |
66+ | ** Last — Company Cases ** | ** TCs with non-default Company Cases** | ** {relevant WTs}** | ** Sets non-zero Company Cases — must run last** |
5267
5368### Company Case Contamination Rule
5469
5570` CleanTest ` removes the test employee after each TC but ** Company Cases persist**
5671across the entire test run. Any TC that sets a Company Case to a non-default value
57- ** must run in the last phase** — otherwise all subsequent TCs see the modified
58- Company Case values and produce unexpected results.
72+ ** must run in the last phase** — otherwise all subsequent TCs see the modified Company
73+ Case values and produce unexpected results.
5974
6075See ` BestPractices-Testing.md ` — * "Company Cases — Shared State in Test.All.pecmd"* .
6176
62- ---
77+ ### {WT nn} Dependency Chain
6378
64- ## Business Test Cases
79+ > Add a dependency chain diagram when a central WT is read by many others.
80+ > Example: BaseCotizacion / ProrataFactor / FiscaalLoon patterns.
81+ > Delete this section if not applicable.
6582
66- | TC | Folder | Key Parameter | Focus |
67- | :---| :---| :---| :---|
68- | WT-TC{nn} | [ WT-TC{nn}-{CC}-{Scope}] ( WT-TC{nn}-{CC}-{Scope}/ ) | {e.g. BaseSalary €3.000} | {Description — e.g. Base scenario, full period} |
83+ ```
84+ WT {nn} ({TechnicalWTName})
85+ └─ WT {n1} {Name1} (× {rate1}%)
86+ └─ WT {n2} {Name2} (× {rate2}%)
87+ ```
6988
7089---
7190
7291## Guard Test Cases
7392
74- | TC | Folder | Trigger | Focus |
93+ | TC | Folder | Type | Trigger | Focus |
94+ | :---| :---| :---:| :---| :---|
95+ | GUARD-TC1 | [ GUARD-TC1-{CC}-{Scope}] ( GUARD-TC1-{CC}-{Scope}/ ) | ET | ` {Field} ` not set | AbortExecution: mandatory field missing |
96+ | GUARD-TC{n} | [ GUARD-TC{n}-{CC}-{Scope}] ( GUARD-TC{n}-{CC}-{Scope}/ ) | CT | {Condition} | CaseInvalid: {validation rule} |
97+
98+ > ** ET** = PayrunEmployeeTest   ; |  ; ** CT** = CaseTest
99+
100+ ---
101+
102+ ## WT Test Cases
103+
104+ ### {Category 1 — e.g. Technical / Contribution Base}
105+
106+ | TC | Folder | Focus |
107+ | :---| :---| :---|
108+ | WT-TC{nn} | [ WT-TC{nn}-{CC}-{Scope}] ( WT-TC{nn}-{CC}-{Scope}/ ) | {Description} |
109+
110+ ### {Category 2 — e.g. Gross Income}
111+
112+ | TC | Folder | Focus |
113+ | :---| :---| :---|
114+ | WT-TC{nn} | [ WT-TC{nn}-{CC}-{Scope}] ( WT-TC{nn}-{CC}-{Scope}/ ) | {Description} |
115+
116+ ### {Category 3 — e.g. Employee Deductions}
117+
118+ | TC | Folder | Focus |
119+ | :---| :---| :---|
120+ | WT-TC{nn} | [ WT-TC{nn}-{CC}-{Scope}] ( WT-TC{nn}-{CC}-{Scope}/ ) | {Description} |
121+
122+ ### {Category 4 — e.g. Employer Costs}
123+
124+ | TC | Folder | Focus |
125+ | :---| :---| :---|
126+ | WT-TC{nn} | [ WT-TC{nn}-{CC}-{Scope}] ( WT-TC{nn}-{CC}-{Scope}/ ) | {Description} |
127+
128+ ### {Last Phase — Company Case TCs}
129+
130+ | TC | Folder | Focus |
131+ | :---| :---| :---|
132+ | WT-TC{nn} | [ WT-TC{nn}-{CC}-{Scope}] ( WT-TC{nn}-{CC}-{Scope}/ ) | {Description — sets Company Case} |
133+
134+ ---
135+
136+ ## Business Test Cases
137+
138+ > Optional section for integration / end-to-end TCs that cover the full payroll
139+ > calculation chain (all WTs in a single payrun). Delete if not used.
140+
141+ | TC | Folder | Key Input | Focus |
75142| :---| :---| :---| :---|
76- | GUARD -TC{n } | [ GUARD -TC{n }-{CC}-{Scope}] ( GUARD -TC{n }-{CC}-{Scope}/) | {missing field/lookup } | AbortExecution on {condition } |
143+ | WT -TC{nn } | [ WT -TC{nn }-{CC}-{Scope}] ( WT -TC{nn }-{CC}-{Scope}/) | {e.g. BaseSalary EUR 3,000 } | {Description } |
77144
78145---
79146
80- ## Test Data
147+ ## Test Data Files
81148
82149| File | Description |
83150| :---| :---|
84- | ` {CC}.Test.Setup.json ` | Tenant, user, division, employee, payroll, payrun |
85- | ` {CC}.Test.CompanyCases.json ` | Company cases: employer registration, rate overrides |
151+ | ` {CC}.Test.Setup.json ` | Tenant, user, division, employee, payroll, payrun + all regulation layers |
152+ | ` {CC}.Test.CompanyCases.json ` | Company cases: employer registration, rate overrides, timeline data |
86153
87154---
88155
89156## Statutory Parameters ({YYYY})
90157
158+ > These values are the primary reference for TC assertions.
159+ > Always cite the source publication and article.
160+
91161| Parameter | Value | Source |
92162| :---| :---| :---|
93- | {Rate name} | {value} | {Authority} — * {Publication name / Article}* |
94- | {Ceiling name} | {value} | {Authority} — * {Publication name / Article}* |
95- | {Threshold name} | {value} | {Authority} — * {Publication name / Article}* |
96-
97- > Replace placeholder values with official statutory parameters.
98- > Always cite the source publication, article, and effective date.
163+ | {Rate 1} | {value} | {Authority} — * {Publication / Article}* |
164+ | {Ceiling 1} | {value} | {Authority} — * {Publication / Article}* |
165+ | {Threshold 1} | {value} | {Authority} — * {Publication / Article}* |
0 commit comments