@idpass/data-collect-core / FormClassifier
Class: FormClassifier
Defined in: services/FormClassifier.ts:68
Classifies forms into entity types based on the dependsOn topology.
The algorithm mirrors the proven logic from AppInstanceStore.loadEntityData:
- Top-level forms (no dependsOn) → Group
- Dependent forms that are themselves dependsOn targets → Individual
- Dependent forms that are NOT targets (in a mixed hierarchy) → Record
In simple configs where no non-top-level form is a target (e.g., household → individual), all dependent forms stay as Individual (no Record classification).
Constructors
Constructor
new FormClassifier():
FormClassifier
Returns
FormClassifier
Methods
classifyAll()
staticclassifyAll(forms):Map<string,FormClassification>
Defined in: services/FormClassifier.ts:72
Classify all forms and return a Map keyed by form name.
Parameters
forms
Returns
Map<string, FormClassification>
classifyForm()
staticclassifyForm(formName,forms):FormClassification
Defined in: services/FormClassifier.ts:172
Classify a single form by name within the context of all forms. Returns a safe default (Record) for unknown form names.
Parameters
formName
string