Skip to content

CaseValidate/CaseBuild scripts run without Namespace — EnsureNamespace is a no-op #14

@Giannoudis

Description

@Giannoudis

Problem

DerivedCaseValidator.CaseValidate() and DerivedCaseBuilder.CaseBuild() create
CaseChangeRuntimeSettings / CaseRelationRuntimeSettings without setting the
Namespace property. This causes EnsureNamespace(null) to return field names
unchanged (no-op per StringExtensions.EnsureNamespace).

Impact: Any CaseValidate or CaseBuild script that uses short field names
(e.g. HasField("SvNummer"), GetValue("Salary"), InitValue("Target", v))
silently fails — field lookups return false or null because Case.Fields
stores fully qualified names (DE.SvNummer).

This is inconsistent with PayrunProcessorRegulation, which correctly resolves
and sets Namespace from the derived regulation for every WageType/Collector script.

Existing CaseValidate actions were unaffected because they always passed fully
qualified names as string parameters (e.g. DEValidiereSteuerIdNummer("DE.SteuerIdNummer")).

Affected code paths

Class Method Settings type
DerivedCaseValidator CaseValidate CaseChangeRuntimeSettings
DerivedCaseValidator CaseRelationValidate CaseRelationRuntimeSettings
DerivedCaseBuilder CaseBuild CaseChangeRuntimeSettings
DerivedCaseBuilder CaseRelationBuild CaseRelationRuntimeSettings

Fix

  1. Load derived regulations once in the outer async entry point
  2. Pass them through the recursion
  3. In each script loop, resolve settings.Namespace from the DerivedCase.RegulationId
    (or DerivedCaseRelation.RegulationId)
  4. Change PayrollRuntimeSettings.Namespace from init to set

Regression risk

Low — adds the namespace that was always expected but never set.
Existing scripts that use fully qualified names are unaffected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions