2023-12-06 22:10:01 +01:00
|
|
|
import { DmpAccessType } from '@app/core/common/enum/dmp-access-type';
|
2023-10-20 17:01:09 +02:00
|
|
|
import { DmpStatus } from '@app/core/common/enum/dmp-status';
|
2023-12-06 22:10:01 +01:00
|
|
|
import { DmpUserRole } from '@app/core/common/enum/dmp-user-role';
|
|
|
|
import { DmpVersionStatus } from '@app/core/common/enum/dmp-version-status';
|
|
|
|
import { BaseEntity, BaseEntityPersist } from '@common/base/base-entity.model';
|
|
|
|
import { Guid } from '@common/types/guid';
|
2023-10-20 17:01:09 +02:00
|
|
|
import { DatasetWizardModel } from '../dataset/dataset-wizard';
|
2023-12-06 22:10:01 +01:00
|
|
|
import { DescriptionTemplate } from '../description-template/description-template';
|
|
|
|
import { Description } from '../description/description';
|
|
|
|
import { EntityDoi } from '../entity-doi/entity-doi';
|
2023-10-20 17:01:09 +02:00
|
|
|
import { FunderModel } from "../funder/funder";
|
2019-08-01 09:54:40 +02:00
|
|
|
import { GrantListingModel } from "../grant/grant-listing";
|
2023-10-20 17:01:09 +02:00
|
|
|
import { OrganizationModel } from "../organisation/organization";
|
|
|
|
import { ProjectModel } from "../project/project";
|
2023-12-28 16:18:49 +01:00
|
|
|
import { ReferencePersist } from '../reference/reference';
|
2019-01-18 18:03:45 +01:00
|
|
|
import { ResearcherModel } from "../researcher/researcher";
|
2023-11-29 14:26:40 +01:00
|
|
|
import { User, UserModel } from "../user/user";
|
2019-05-28 09:49:09 +02:00
|
|
|
import { UserInfoListingModel } from "../user/user-info-listing";
|
2023-09-11 07:57:09 +02:00
|
|
|
import { DmpDatasetProfile } from "./dmp-dataset-profile/dmp-dataset-profile";
|
2023-10-20 17:01:09 +02:00
|
|
|
import { DmpDynamicField } from "./dmp-dynamic-field";
|
2023-09-20 08:34:39 +02:00
|
|
|
import { DmpExtraField } from "./dmp-extra-field";
|
2023-12-28 16:18:49 +01:00
|
|
|
import { DmpBlueprint } from '../dmp-blueprint/dmp-blueprint';
|
|
|
|
import { DmpReference } from './dmp-reference';
|
2019-01-18 18:03:45 +01:00
|
|
|
|
2023-11-29 14:26:40 +01:00
|
|
|
export interface DmpModel { //TODO: Delete
|
2019-01-18 18:03:45 +01:00
|
|
|
id: string;
|
|
|
|
label: string;
|
|
|
|
groupId: String;
|
2023-10-20 17:01:09 +02:00
|
|
|
profile: DmpBlueprint;
|
2019-01-18 18:03:45 +01:00
|
|
|
version: number;
|
2019-12-13 12:15:12 +01:00
|
|
|
status: DmpStatus;
|
2019-01-18 18:03:45 +01:00
|
|
|
lockable: boolean;
|
|
|
|
description: String;
|
2019-08-01 09:54:40 +02:00
|
|
|
grant: GrantListingModel;
|
2019-08-20 17:32:42 +02:00
|
|
|
project: ProjectModel;
|
|
|
|
funder: FunderModel;
|
2020-07-29 17:04:19 +02:00
|
|
|
datasets: DatasetWizardModel[];
|
2019-07-01 11:35:09 +02:00
|
|
|
datasetsToBeFinalized: string[];
|
2023-09-11 07:57:09 +02:00
|
|
|
profiles: DmpDatasetProfile[];
|
2019-01-18 18:03:45 +01:00
|
|
|
organisations: OrganizationModel[];
|
|
|
|
researchers: ResearcherModel[];
|
|
|
|
associatedUsers: UserModel[];
|
2019-05-28 09:49:09 +02:00
|
|
|
users: UserInfoListingModel[];
|
2019-01-18 18:03:45 +01:00
|
|
|
creator: UserModel;
|
2023-09-20 08:34:39 +02:00
|
|
|
extraFields: Array<DmpExtraField>;
|
2019-01-18 18:03:45 +01:00
|
|
|
dynamicFields: Array<DmpDynamicField>;
|
2020-02-10 17:21:06 +01:00
|
|
|
modified: Date;
|
2020-06-03 11:13:31 +02:00
|
|
|
extraProperties: Map<String, any>;
|
2020-06-18 14:55:15 +02:00
|
|
|
language: String;
|
2019-01-18 18:03:45 +01:00
|
|
|
}
|
2023-09-22 08:34:12 +02:00
|
|
|
|
2023-10-27 17:56:19 +02:00
|
|
|
export interface Dmp extends BaseEntity {
|
|
|
|
label: string;
|
|
|
|
version: number;
|
|
|
|
status: DmpStatus;
|
2023-11-29 14:26:40 +01:00
|
|
|
versionStatus: DmpVersionStatus;
|
|
|
|
properties: string;
|
2023-10-27 17:56:19 +02:00
|
|
|
groupId: String;
|
2023-11-29 14:26:40 +01:00
|
|
|
description: String;
|
2023-10-27 17:56:19 +02:00
|
|
|
finalizedAt: Date;
|
2023-11-29 14:26:40 +01:00
|
|
|
publishedAt: Date;
|
|
|
|
creator: User;
|
|
|
|
accessType: DmpAccessType;
|
2023-10-27 17:56:19 +02:00
|
|
|
blueprint: DmpBlueprint;
|
2023-11-29 14:26:40 +01:00
|
|
|
language: String;
|
|
|
|
publicAfter: Date;
|
|
|
|
dmpReferences: DmpReference[];
|
|
|
|
dmpUsers: DmpUser[];
|
|
|
|
descriptions: Description[];
|
2023-12-28 16:18:49 +01:00
|
|
|
dmpDescriptionTemplates: DmpDescriptionTemplate[];
|
2023-12-04 16:56:12 +01:00
|
|
|
entityDois: EntityDoi[];
|
2023-10-27 17:56:19 +02:00
|
|
|
|
2023-12-06 22:10:01 +01:00
|
|
|
|
2023-11-29 14:26:40 +01:00
|
|
|
// TODO: delete
|
2023-10-27 19:10:21 +02:00
|
|
|
// grant: GrantListingModel;
|
|
|
|
// project: ProjectModel;
|
|
|
|
// funder: FunderModel;
|
|
|
|
// organisations: OrganizationModel[];
|
|
|
|
// researchers: ResearcherModel[];
|
|
|
|
|
|
|
|
// datasets: DatasetWizardModel[];
|
|
|
|
// datasetsToBeFinalized: string[];
|
|
|
|
// profiles: DmpDatasetProfile[];
|
|
|
|
|
|
|
|
|
2023-11-29 14:26:40 +01:00
|
|
|
|
2023-10-27 19:10:21 +02:00
|
|
|
// associatedUsers: UserModel[];
|
|
|
|
// users: UserInfoListingModel[];
|
|
|
|
// creator: UserModel;
|
|
|
|
// extraFields: Array<DmpExtraField>;
|
|
|
|
// dynamicFields: Array<DmpDynamicField>;
|
|
|
|
// extraProperties: Map<String, any>;
|
|
|
|
// language: String;
|
|
|
|
}
|
|
|
|
|
2023-11-29 14:26:40 +01:00
|
|
|
export interface DmpUser extends BaseEntity {
|
|
|
|
dmp: Dmp;
|
|
|
|
user: User;
|
|
|
|
role: DmpUserRole;
|
|
|
|
}
|
|
|
|
|
2023-12-01 18:18:41 +01:00
|
|
|
export interface DmpDescriptionTemplate extends BaseEntity {
|
|
|
|
dmp: Dmp;
|
|
|
|
currentDescriptionTemplate: DescriptionTemplate; //TODO: what is this?
|
|
|
|
descriptionTemplates: DescriptionTemplate[]; //TODO: why it is array?
|
|
|
|
descriptionTemplateGroupId: Guid;
|
|
|
|
sectionId: Guid;
|
|
|
|
}
|
|
|
|
|
2023-10-27 19:10:21 +02:00
|
|
|
//
|
|
|
|
// Persist
|
|
|
|
//
|
|
|
|
export interface DmpPersist extends BaseEntityPersist {
|
|
|
|
label: string;
|
|
|
|
status: DmpStatus;
|
2023-11-29 14:26:40 +01:00
|
|
|
properties: string;
|
|
|
|
description: String;
|
|
|
|
language: String;
|
2023-12-28 16:18:49 +01:00
|
|
|
blueprint: Guid;
|
2023-11-29 14:26:40 +01:00
|
|
|
accessType: DmpAccessType;
|
|
|
|
references: DmpReferencePersist[];
|
|
|
|
descriptionTemplates: DmpDescriptionTemplatePersist[];
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface DmpReferencePersist extends BaseEntityPersist {
|
2023-12-28 16:18:49 +01:00
|
|
|
reference?: ReferencePersist;
|
|
|
|
data?: string;
|
2023-11-29 14:26:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface DmpDescriptionTemplatePersist extends BaseEntityPersist {
|
|
|
|
descriptionTemplateGroupId: Guid;
|
|
|
|
sectionId: Guid;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface CloneDmpPersist {
|
|
|
|
id: Guid;
|
|
|
|
label: string;
|
|
|
|
description: String;
|
|
|
|
descriptions: Guid[];
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface NewVersionDmpPersist {
|
|
|
|
id: Guid;
|
|
|
|
label: string;
|
|
|
|
description: String;
|
|
|
|
blueprintId: Guid;
|
|
|
|
descriptions: Guid[];
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface DmpUserPersist {
|
|
|
|
user: Guid;
|
|
|
|
role: DmpUserRole;
|
2023-12-06 22:10:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface DmpUserRemovePersist {
|
|
|
|
id: Guid;
|
|
|
|
dmpId: Guid;
|
|
|
|
role: DmpUserRole;
|
2023-09-22 08:34:12 +02:00
|
|
|
}
|