2023-10-27 19:10:21 +02:00
|
|
|
import { DescriptionTemplateFieldDataExternalDatasetType } from "@app/core/common/enum/description-template-field-data-external-dataset-type";
|
|
|
|
import { DescriptionTemplateFieldType } from "@app/core/common/enum/description-template-field-type";
|
|
|
|
import { DescriptionTemplateFieldValidationType } from "@app/core/common/enum/description-template-field-validation-type";
|
2023-10-30 14:30:46 +01:00
|
|
|
import { DescriptionTemplateStatus } from "@app/core/common/enum/description-template-status";
|
2023-11-24 17:42:23 +01:00
|
|
|
import { UserDescriptionTemplateRole } from "@app/core/common/enum/user-description-template-role";
|
2023-10-27 19:10:21 +02:00
|
|
|
import { BaseEntity } from "@common/base/base-entity.model";
|
2023-10-27 17:56:19 +02:00
|
|
|
import { Guid } from "@common/types/guid";
|
2023-10-27 19:10:21 +02:00
|
|
|
import { DescriptionTemplateType } from "../description-template-type/description-template-type";
|
2024-02-21 16:52:50 +01:00
|
|
|
import { ReferenceType } from "../reference-type/reference-type";
|
2023-11-24 17:42:23 +01:00
|
|
|
import { User } from "../user/user";
|
2023-10-27 17:56:19 +02:00
|
|
|
|
|
|
|
|
|
|
|
export interface DescriptionTemplate extends BaseEntity {
|
|
|
|
label: string;
|
|
|
|
description: string;
|
2023-10-27 19:10:21 +02:00
|
|
|
groupId: Guid;
|
|
|
|
version: string;
|
|
|
|
language: string;
|
|
|
|
type: DescriptionTemplateType;
|
2023-10-30 14:30:46 +01:00
|
|
|
status: DescriptionTemplateStatus;
|
2023-10-27 19:10:21 +02:00
|
|
|
definition: DescriptionTemplateDefinition;
|
2023-11-24 17:42:23 +01:00
|
|
|
users: UserDescriptionTemplate[];
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface UserDescriptionTemplate extends BaseEntity {
|
|
|
|
descriptionTemplate?: DescriptionTemplate;
|
|
|
|
role?: UserDescriptionTemplateRole;
|
|
|
|
user?: User;
|
2023-10-27 17:56:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface DescriptionTemplateDefinition {
|
2023-10-27 19:10:21 +02:00
|
|
|
pages?: DescriptionTemplatePage[];
|
2023-10-27 17:56:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-10-27 19:10:21 +02:00
|
|
|
export interface DescriptionTemplatePage {
|
2023-12-20 08:20:38 +01:00
|
|
|
id: string;
|
2023-10-27 17:56:19 +02:00
|
|
|
ordinal: number;
|
2023-10-27 19:10:21 +02:00
|
|
|
title: string;
|
2024-01-31 20:16:39 +01:00
|
|
|
sections: DescriptionTemplateSection[];
|
2023-10-27 17:56:19 +02:00
|
|
|
}
|
|
|
|
|
2023-10-27 19:10:21 +02:00
|
|
|
export interface DescriptionTemplateSection {
|
2023-12-20 08:20:38 +01:00
|
|
|
id: string;
|
2023-10-27 19:10:21 +02:00
|
|
|
ordinal: number;
|
|
|
|
defaultVisibility: boolean;
|
|
|
|
multiplicity: boolean;
|
|
|
|
title: string;
|
|
|
|
description: string;
|
2024-01-31 20:16:39 +01:00
|
|
|
sections: DescriptionTemplateSection[];
|
2023-10-27 19:10:21 +02:00
|
|
|
fieldSets: DescriptionTemplateFieldSet[];
|
2023-10-27 17:56:19 +02:00
|
|
|
}
|
|
|
|
|
2023-10-27 19:10:21 +02:00
|
|
|
export interface DescriptionTemplateFieldSet {
|
2023-12-20 08:20:38 +01:00
|
|
|
id: string;
|
2023-10-27 19:10:21 +02:00
|
|
|
ordinal: number;
|
|
|
|
numbering: string;
|
|
|
|
title: string;
|
2023-10-27 17:56:19 +02:00
|
|
|
description: string;
|
2023-10-27 19:10:21 +02:00
|
|
|
extendedDescription: string;
|
|
|
|
additionalInformation: string;
|
|
|
|
multiplicity: DescriptionTemplateMultiplicity
|
|
|
|
hasCommentField: boolean;
|
|
|
|
fields: DescriptionTemplateField[];
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface DescriptionTemplateField {
|
2023-12-20 08:20:38 +01:00
|
|
|
id: string;
|
2023-10-27 17:56:19 +02:00
|
|
|
ordinal: number;
|
2023-11-24 17:42:23 +01:00
|
|
|
numbering?: string;
|
|
|
|
schematics?: string[];
|
|
|
|
defaultValue?: string;
|
|
|
|
visibilityRules?: DescriptionTemplateRule[];
|
|
|
|
validations?: DescriptionTemplateFieldValidationType[];
|
2023-10-27 19:10:21 +02:00
|
|
|
includeInExport: boolean;
|
2023-11-24 17:42:23 +01:00
|
|
|
data?: DescriptionTemplateBaseFieldData;
|
2023-10-27 17:56:19 +02:00
|
|
|
}
|
|
|
|
|
2023-10-27 19:10:21 +02:00
|
|
|
export interface DescriptionTemplateRule {
|
|
|
|
target: string;
|
|
|
|
value: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface DescriptionTemplateMultiplicity {
|
|
|
|
min: number;
|
|
|
|
max: number;
|
|
|
|
placeholder: string;
|
|
|
|
tableView: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface DescriptionTemplateBaseFieldData {
|
2023-10-27 17:56:19 +02:00
|
|
|
label: string;
|
2023-11-24 17:42:23 +01:00
|
|
|
fieldType: DescriptionTemplateFieldType;
|
2023-10-27 17:56:19 +02:00
|
|
|
}
|
|
|
|
|
2023-10-27 19:10:21 +02:00
|
|
|
|
|
|
|
//
|
|
|
|
// Field Types
|
|
|
|
//
|
2024-01-31 20:16:39 +01:00
|
|
|
export interface DescriptionTemplateLabelData extends DescriptionTemplateBaseFieldData {
|
2023-10-27 19:10:21 +02:00
|
|
|
}
|
|
|
|
|
2024-01-31 20:16:39 +01:00
|
|
|
export interface DescriptionTemplateLabelAndMultiplicityData extends DescriptionTemplateBaseFieldData {
|
|
|
|
multipleSelect: boolean;
|
2023-10-27 19:10:21 +02:00
|
|
|
}
|
|
|
|
|
2024-01-31 20:16:39 +01:00
|
|
|
export interface DescriptionTemplateExternalDatasetData extends DescriptionTemplateLabelAndMultiplicityData {
|
2023-11-24 17:42:23 +01:00
|
|
|
type?: DescriptionTemplateFieldDataExternalDatasetType;
|
2023-10-27 19:10:21 +02:00
|
|
|
}
|
|
|
|
|
2024-02-09 21:46:05 +01:00
|
|
|
export interface DescriptionTemplateReferenceTypeData extends DescriptionTemplateLabelAndMultiplicityData {
|
2024-02-21 16:52:50 +01:00
|
|
|
referenceType?: ReferenceType;
|
2023-10-27 19:10:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface DescriptionTemplateRadioBoxData extends DescriptionTemplateBaseFieldData {
|
2023-11-24 17:42:23 +01:00
|
|
|
options: DescriptionTemplateRadioBoxOption[];
|
2023-10-27 19:10:21 +02:00
|
|
|
}
|
|
|
|
|
2024-01-31 20:16:39 +01:00
|
|
|
export interface DescriptionTemplateSelectData extends DescriptionTemplateLabelAndMultiplicityData {
|
|
|
|
options: DescriptionTemplateSelectOption[];
|
2023-10-27 19:10:21 +02:00
|
|
|
}
|
|
|
|
|
2023-11-24 17:42:23 +01:00
|
|
|
export interface DescriptionTemplateUploadData extends DescriptionTemplateBaseFieldData {
|
2023-10-27 19:10:21 +02:00
|
|
|
types: DescriptionTemplateUploadOption[];
|
2023-11-24 17:42:23 +01:00
|
|
|
maxFileSizeInMB: number;
|
2023-10-27 19:10:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// Others
|
|
|
|
//
|
2024-01-31 20:16:39 +01:00
|
|
|
|
|
|
|
export interface DescriptionTemplateSelectOption {
|
|
|
|
label: string;
|
|
|
|
value: string;
|
2023-10-27 17:56:19 +02:00
|
|
|
}
|
|
|
|
|
2023-10-27 19:10:21 +02:00
|
|
|
export interface DescriptionTemplateRadioBoxOption {
|
2023-10-27 17:56:19 +02:00
|
|
|
label: string;
|
2023-10-27 19:10:21 +02:00
|
|
|
value: string;
|
2023-10-27 17:56:19 +02:00
|
|
|
}
|
|
|
|
|
2023-10-27 19:10:21 +02:00
|
|
|
export interface DescriptionTemplateUploadOption {
|
2023-10-27 17:56:19 +02:00
|
|
|
label: string;
|
2023-10-27 19:10:21 +02:00
|
|
|
value: string;
|
2023-10-27 17:56:19 +02:00
|
|
|
}
|