81 lines
1.7 KiB
TypeScript
81 lines
1.7 KiB
TypeScript
|
import { BaseEntity, BaseEntityPersist } from "@common/base/base-entity.model";
|
||
|
import { Guid } from "@common/types/guid";
|
||
|
|
||
|
|
||
|
export interface DescriptionTemplate extends BaseEntity {
|
||
|
label: string;
|
||
|
definition: DescriptionTemplateDefinition;
|
||
|
description: string;
|
||
|
}
|
||
|
|
||
|
export interface DescriptionTemplateDefinition {
|
||
|
sections?: DescriptionTemplateDefinitionSection[];
|
||
|
}
|
||
|
|
||
|
|
||
|
export interface DescriptionTemplateDefinitionSection {
|
||
|
id: Guid;
|
||
|
label: string;
|
||
|
description: string;
|
||
|
ordinal: number;
|
||
|
fields: FieldInSection[];
|
||
|
hasTemplates: boolean;
|
||
|
descriptionTemplates?: DescriptionTemplatesInSection[];
|
||
|
}
|
||
|
|
||
|
export interface DescriptionTemplatesInSection {
|
||
|
id: Guid;
|
||
|
descriptionTemplateId: Guid;
|
||
|
label: string;
|
||
|
minMultiplicity: number;
|
||
|
maxMultiplicity: number;
|
||
|
}
|
||
|
|
||
|
export interface FieldInSection {
|
||
|
id: Guid;
|
||
|
label: string;
|
||
|
placeholder: string;
|
||
|
description: string;
|
||
|
required: boolean;
|
||
|
ordinal: number;
|
||
|
}
|
||
|
|
||
|
//
|
||
|
// Persist
|
||
|
//
|
||
|
export interface DescriptionTemplatePersist extends BaseEntityPersist {
|
||
|
label: string;
|
||
|
definition: DescriptionTemplateDefinitionPersist;
|
||
|
description: string;
|
||
|
}
|
||
|
|
||
|
export interface DescriptionTemplateDefinitionPersist {
|
||
|
sections?: DescriptionTemplateDefinitionSectionPersist[];
|
||
|
}
|
||
|
|
||
|
export interface DescriptionTemplateDefinitionSectionPersist {
|
||
|
id: Guid;
|
||
|
label: string;
|
||
|
description: string;
|
||
|
ordinal: number;
|
||
|
fields: FieldInSectionPersist[];
|
||
|
hasTemplates: boolean;
|
||
|
descriptionTemplates?: DescriptionTemplatesInSectionPersist[];
|
||
|
}
|
||
|
|
||
|
export interface DescriptionTemplatesInSectionPersist {
|
||
|
id: Guid;
|
||
|
descriptionTemplateId: Guid;
|
||
|
label: string;
|
||
|
minMultiplicity: number;
|
||
|
maxMultiplicity: number;
|
||
|
}
|
||
|
|
||
|
export interface FieldInSectionPersist {
|
||
|
id: Guid;
|
||
|
label: string;
|
||
|
placeholder: string;
|
||
|
description: string;
|
||
|
required: boolean;
|
||
|
ordinal: number;
|
||
|
}
|