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";
|
2024-03-27 16:09:10 +01:00
|
|
|
import { Reference } from "../reference/reference";
|
2024-04-09 12:19:32 +02:00
|
|
|
import { DescriptionTemplateVersionStatus } from "@app/core/common/enum/description-template-version-status";
|
2023-10-27 17:56:19 +02:00
|
|
|
|
|
|
|
|
|
|
|
export interface DescriptionTemplate extends BaseEntity {
|
2024-03-20 11:35:55 +01:00
|
|
|
label?: string;
|
|
|
|
description?: string;
|
|
|
|
groupId?: Guid;
|
|
|
|
version?: string;
|
|
|
|
language?: string;
|
|
|
|
type?: DescriptionTemplateType;
|
|
|
|
status?: DescriptionTemplateStatus;
|
|
|
|
definition?: DescriptionTemplateDefinition;
|
|
|
|
users?: UserDescriptionTemplate[];
|
2024-04-09 12:19:32 +02:00
|
|
|
versionStatus?: DescriptionTemplateVersionStatus;
|
2023-11-24 17:42:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
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 {
|
2024-03-20 11:35:55 +01:00
|
|
|
id?: string;
|
|
|
|
ordinal?: number;
|
|
|
|
title?: string;
|
|
|
|
sections?: DescriptionTemplateSection[];
|
2023-10-27 17:56:19 +02:00
|
|
|
}
|
|
|
|
|
2023-10-27 19:10:21 +02:00
|
|
|
export interface DescriptionTemplateSection {
|
2024-03-20 11:35:55 +01:00
|
|
|
id?: string;
|
|
|
|
ordinal?: number;
|
|
|
|
defaultVisibility?: boolean;
|
|
|
|
title?: string;
|
|
|
|
description?: string;
|
|
|
|
sections?: DescriptionTemplateSection[];
|
|
|
|
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
|
2024-04-24 13:07:51 +02:00
|
|
|
hasMultiplicity: boolean;
|
2023-10-27 19:10:21 +02:00
|
|
|
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[];
|
2024-05-02 14:57:19 +02:00
|
|
|
defaultValue?: DescriptionTemplateDefaultValue;
|
2023-11-24 17:42:23 +01:00
|
|
|
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
|
|
|
}
|
|
|
|
|
2024-05-02 14:57:19 +02:00
|
|
|
export interface DescriptionTemplateDefaultValue {
|
|
|
|
textValue: string;
|
|
|
|
dateValue: Date;
|
|
|
|
booleanValue: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-10-27 19:10:21 +02:00
|
|
|
export interface DescriptionTemplateRule {
|
|
|
|
target: string;
|
2024-03-27 16:09:10 +01:00
|
|
|
textValue: string;
|
|
|
|
dateValue: Date;
|
2024-05-02 09:46:36 +02:00
|
|
|
booleanValue: boolean;
|
2023-10-27 19:10:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
2024-03-27 10:39:41 +01:00
|
|
|
multipleSelect?: boolean;
|
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;
|
2024-03-27 16:09:10 +01:00
|
|
|
}
|