argos/dmp-frontend/src/app/core/model/dmp/dmp.ts

156 lines
4.2 KiB
TypeScript
Raw Normal View History

import { DmpStatus } from '@app/core/common/enum/dmp-status';
import { DatasetWizardModel } from '../dataset/dataset-wizard';
import { FunderModel } from "../funder/funder";
import { GrantListingModel } from "../grant/grant-listing";
import { OrganizationModel } from "../organisation/organization";
import { ProjectModel } from "../project/project";
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";
import { DmpDatasetProfile } from "./dmp-dataset-profile/dmp-dataset-profile";
import { DmpDynamicField } from "./dmp-dynamic-field";
import { DmpExtraField } from "./dmp-extra-field";
import { BaseEntity, BaseEntityPersist } from '@common/base/base-entity.model';
2023-10-27 17:56:19 +02:00
import { Description } from '../description/description';
2023-11-29 14:26:40 +01:00
import { DmpReference, ReferencePersist } from '../reference/reference';
import { DmpVersionStatus } from '@app/core/common/enum/dmp-version-status';
import { DmpAccessType } from '@app/core/common/enum/dmp-access-type';
import { DmpUserRole } from '@app/core/common/enum/dmp-user-role';
import { Guid } from '@common/types/guid';
import { DescriptionTemplate } from '../description-template/description-template';
2023-12-04 16:56:12 +01:00
import { EntityDoi } from '../entity-doi/entity-doi';
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;
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;
grant: GrantListingModel;
2019-08-20 17:32:42 +02:00
project: ProjectModel;
funder: FunderModel;
2020-07-29 17:04:19 +02:00
datasets: DatasetWizardModel[];
datasetsToBeFinalized: string[];
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;
extraFields: Array<DmpExtraField>;
2019-01-18 18:03:45 +01:00
dynamicFields: Array<DmpDynamicField>;
modified: Date;
extraProperties: Map<String, any>;
language: String;
2019-01-18 18:03:45 +01:00
}
export interface DmpBlueprint {
id: string;
label: string;
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-04 16:56:12 +01:00
entityDois: EntityDoi[];
2023-10-27 17:56:19 +02:00
2023-11-29 14:26:40 +01:00
// TODO: delete
// grant: GrantListingModel;
// project: ProjectModel;
// funder: FunderModel;
// organisations: OrganizationModel[];
// researchers: ResearcherModel[];
// datasets: DatasetWizardModel[];
// datasetsToBeFinalized: string[];
// profiles: DmpDatasetProfile[];
2023-11-29 14:26:40 +01: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;
}
export interface DmpDescriptionTemplate extends BaseEntity {
dmp: Dmp;
currentDescriptionTemplate: DescriptionTemplate; //TODO: what is this?
descriptionTemplates: DescriptionTemplate[]; //TODO: why it is array?
descriptionTemplateGroupId: Guid;
sectionId: Guid;
}
//
// Persist
//
export interface DmpPersist extends BaseEntityPersist {
label: string;
status: DmpStatus;
2023-11-29 14:26:40 +01:00
properties: string;
description: String;
language: String;
blueprint: DmpBlueprint;
accessType: DmpAccessType;
references: DmpReferencePersist[];
descriptionTemplates: DmpDescriptionTemplatePersist[];
}
export interface DmpReferencePersist extends BaseEntityPersist {
reference: ReferencePersist;
data: string;
}
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;
}