Skip to content

ValidatedRecord

Describes a validated DecisionInput with eventual RecordError.

export type ValidatedRecord = LoadedRecord & {
uuid: string;
loaded: LoadedRecord['input'];
input: DecisionInput;
errors: RecordError[];
};

Extends LoadedRecord.

Adds a unique uuid (one is generated is if not provided in the input object).

In case of validation errors, overrides the input attribute with normalized data to make sure it matches the shape DecisionInput shape.

The original input, eventually invalid, is available as loaded.