1using System.Collections.ObjectModel;
2using System.Globalization;
16 private readonly Dictionary<string, string?> values =
new();
21 public IDictionary<string, string?>
Values => this.values;
26 public ObservableCollection<KycPage>
Pages {
get; } =
new();
35 Page.InitFieldValueNotifications(this.values);
48 if (Field is not
null)
50 Field.ValidationText =
null;
58 if (Field is not
null)
60 Field.ValidationText =
null;
75 if (Mapping.Equals(
"BDATE", StringComparison.OrdinalIgnoreCase))
77 string[] DateMappings = [
"BDAY",
"BMONTH",
"BYEAR"];
79 return DateMappings.Select(f => this.FindMapping(f)).Any(f => f);
81 else if (Mapping.Equals(
"ORGREPBDATE", StringComparison.OrdinalIgnoreCase))
83 string[] DateMappings = [
"ORGREPBDAY",
"ORGREPBMONTH",
"ORGREPBYEAR"];
85 return DateMappings.Select(f => this.FindMapping(f)).Any(f => f);
89 return this.FindMapping(Mapping);
93 private bool FindMapping(
string Mapping)
97 if (Page.
AllFields.Any(f => f.Mappings.Any(m => m.Key == Mapping)) ||
98 Page.
AllSections.Any(s => s.AllFields.Any(f => f.Mappings.Any(m => m.Key == Mapping))))
Represents a set of localized strings, addressable by language code (e.g. "en", "sv").
Represents a page in a KYC process containing fields and sections.
ObservableCollection< KycSection > AllSections
Gets all sections contained in the page.
ObservableCollection< ObservableKycField > AllFields
Gets all fields directly contained in the page (excluding sections).
Represents a parsed KYC process with pages, fields, and current values.
void ClearValidation()
Clears validation state (error messages and flags) across all fields.
KycLocalizedText? Name
Optional process-level localized name for display.
ObservableCollection< KycPage > Pages
Gets the collection of pages in the KYC process.
void Initialize()
Initializes page value-change notifications.
IDictionary< string, string?> Values
Gets a modifiable dictionary of field values keyed by field identifier.
bool HasMapping(string Mapping)
Determines if the process contains a mapping for a specific identity property.
The base KYC field model. Use as-is for generic fields, or subclass for custom logic.