Added FieldWithRow interface and Joi Schema

This commit is contained in:
Alexander Cerutti
2022-11-09 19:30:04 +01:00
parent 4e548094d0
commit e4fc8feda8
2 changed files with 13 additions and 9 deletions

View File

@@ -22,6 +22,10 @@ export interface Field {
numberStyle?: string;
}
export interface FieldWithRow extends Field {
row?: 0 | 1;
}
export const Field = Joi.object<Field>().keys({
attributedValue: Joi.alternatives(
Joi.string().allow(""),
@@ -72,3 +76,9 @@ export const Field = Joi.object<Field>().keys({
otherwise: Joi.string().forbidden(),
}),
});
export const FieldWithRow = Field.concat(
Joi.object<FieldWithRow>().keys({
row: Joi.number().min(0).max(1),
}),
);