From fd6f54b13f57529942947681ff1c9f5ab5dac231 Mon Sep 17 00:00:00 2001 From: Max Novelli Date: Wed, 1 Apr 2026 14:43:59 +0200 Subject: [PATCH 1/9] latest npm packages --- package-lock.json | 103 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) diff --git a/package-lock.json b/package-lock.json index 4d05f8b9c..80cd3b22e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -226,6 +226,40 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/@angular-devkit/schematics-cli/node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@angular-devkit/schematics-cli/node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "engines": { + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/@angular-devkit/schematics-cli/node_modules/rxjs": { "version": "7.8.1", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", @@ -281,6 +315,40 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/@angular-devkit/schematics/node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@angular-devkit/schematics/node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "engines": { + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/@angular-devkit/schematics/node_modules/rxjs": { "version": "7.8.1", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", @@ -3245,6 +3313,40 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/@nestjs/schematics/node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@nestjs/schematics/node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "engines": { + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/@nestjs/schematics/node_modules/rxjs": { "version": "7.8.1", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", @@ -3478,6 +3580,7 @@ "version": "0.11.0", "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, "optional": true, "engines": { "node": ">=14" From 0cd1a6343c318410506be3ae1e5305a73962c0ba Mon Sep 17 00:00:00 2001 From: Max Novelli Date: Sun, 5 Apr 2026 22:41:38 +0200 Subject: [PATCH 2/9] added proposals and samples id to published data --- .../schemas/published-data.schema.ts | 28 ++++++++++++++++--- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/src/published-data/schemas/published-data.schema.ts b/src/published-data/schemas/published-data.schema.ts index 264f264cf..1be09e6dc 100644 --- a/src/published-data/schemas/published-data.schema.ts +++ b/src/published-data/schemas/published-data.schema.ts @@ -102,14 +102,34 @@ export class PublishedData extends QueryableClass { @ApiProperty({ type: [String], - required: true, + required: false, description: - "Array of one or more Dataset persistent identifier (pid) values that" + - " make up the published data.", + "Array of one or more datasets' persistent identifier values that" + + " are part of the published data.", }) - @Prop({ type: [String], required: true }) + @Prop({ type: [String], required: false }) datasetPids: string[]; + @ApiProperty({ + type: [String], + required: false, + description: + "Array of one or more proposals identifier values that" + + " are part of the published data.", + }) + @Prop({ type: [String], required: false }) + proposalIds: string[]; + + @ApiProperty({ + type: [String], + required: false, + description: + "Array of one or more samples identifier values that" + + " are part of the published data.", + }) + @Prop({ type: [String], required: false }) + sampleIds: string[]; + @ApiProperty({ type: Date, required: false, From 161fad75e3295ef5e22c14d1842fa1af99819391 Mon Sep 17 00:00:00 2001 From: Max Novelli Date: Tue, 7 Apr 2026 14:26:02 +0200 Subject: [PATCH 3/9] updated published data schema, create dto and update dto --- .../dto/update-published-data.v4.dto.ts | 87 ++++++++++++++----- .../schemas/published-data.schema.ts | 8 +- 2 files changed, 68 insertions(+), 27 deletions(-) diff --git a/src/published-data/dto/update-published-data.v4.dto.ts b/src/published-data/dto/update-published-data.v4.dto.ts index ad15dcee9..27a974e39 100644 --- a/src/published-data/dto/update-published-data.v4.dto.ts +++ b/src/published-data/dto/update-published-data.v4.dto.ts @@ -6,50 +6,91 @@ import { IsOptional, IsString, } from "class-validator"; -import { PartialType } from "@nestjs/swagger"; +import { ApiProperty, ApiTags, PartialType } from "@nestjs/swagger"; import { PublishedDataStatus } from "../interfaces/published-data.interface"; +@ApiTags("publishedData") export class UpdatePublishedDataV4Dto { - /** - * A name or title by which a resource is known. This field has the semantics of Dublin Core - * [dcmi:title](https://www.dublincore.org/specifications/dublin-core/dcmi-terms/terms/title/) - * and [DataCite title](https://datacite-metadata-schema.readthedocs.io/en/4.6/properties/title/). - */ + @ApiProperty({ + type: String, + required: true, + description: + "A name or title by which a resource is known. This field has the semantics of Dublin Core" + + " [dcmi:title](https://www.dublincore.org/specifications/dublin-core/dcmi-terms/terms/title/)" + + " and [DataCite title](https://datacite-metadata-schema.readthedocs.io/en/4.6/properties/title/).", + }) @IsString() readonly title: string; - /** - * A brief description of the resource and the context in which the resource was created. This field has the semantics of - * [DataCite description](https://datacite-metadata-schema.readthedocs.io/en/4.6/properties/description/) - * with [Abstract](https://datacite-metadata-schema.readthedocs.io/en/4.6/appendices/appendix-1/descriptionType/#abstract). - */ + @ApiProperty({ + type: String, + required: true, + description: + "A brief description of the resource and the context in which the resource was created. This field has the semantics" + + " of [DataCite description](https://datacite-metadata-schema.readthedocs.io/en/4.6/properties/description/)" + + " with [Abstract descriptionType](https://datacite-metadata-schema.readthedocs.io/en/4.6/appendices/appendix-1/descriptionType/#abstract).", + }) @IsString() readonly abstract: string; - /** - * Array of one or more Dataset persistent identifier (pid) values that make up the published data. - */ + @ApiProperty({ + type: [String], + required: false, + description: + "Array of one or more datasets' persistent identifier values that" + + " are part of this published data record.", + }) @IsArray() @IsString({ each: true }) readonly datasetPids: string[]; - /** - * Time when doi is successfully registered - */ + @ApiProperty({ + type: [String], + required: false, + description: + "Array of one or more proposals identifier values that" + + " are part of this published data record.", + }) + @IsArray() + @IsString({ each: true }) + readonly proposalIds: string[]; + + @ApiProperty({ + type: [String], + required: false, + description: + "Array of one or more samples identifier values that" + + " are part of this published data record.", + }) + @IsArray() + @IsString({ each: true }) + readonly sampleIds: string[]; + + @ApiProperty({ + type: Date, + required: false, + description: "Time when doi is successfully registered with registrar", + }) @IsDateString() @IsOptional() readonly registeredTime?: Date; - /** - * Indication of position in publication workflow e.g. registred, private, public - */ + @ApiProperty({ + enum: PublishedDataStatus, + description: + "Indication of position in publication workflow e.g. registred, private, public", + }) @IsEnum(PublishedDataStatus) @IsOptional() readonly status?: string; - /** - * JSON object containing the metadata. This will cover most optional fields of the DataCite schema, and will require a mapping from metadata subfields to DataCite Schema definitions. - */ + @ApiProperty({ + type: Object, + required: false, + default: {}, + description: + "JSON object containing the metadata. This will cover most optional fields of the DataCite schema, and will require a mapping from metadata subfields to DataCite Schema definitions", + }) @IsObject() @IsOptional() readonly metadata?: Record; diff --git a/src/published-data/schemas/published-data.schema.ts b/src/published-data/schemas/published-data.schema.ts index 1be09e6dc..b10c8b584 100644 --- a/src/published-data/schemas/published-data.schema.ts +++ b/src/published-data/schemas/published-data.schema.ts @@ -105,7 +105,7 @@ export class PublishedData extends QueryableClass { required: false, description: "Array of one or more datasets' persistent identifier values that" + - " are part of the published data.", + " are part of the published data record.", }) @Prop({ type: [String], required: false }) datasetPids: string[]; @@ -115,7 +115,7 @@ export class PublishedData extends QueryableClass { required: false, description: "Array of one or more proposals identifier values that" + - " are part of the published data.", + " are part of this published data record.", }) @Prop({ type: [String], required: false }) proposalIds: string[]; @@ -125,7 +125,7 @@ export class PublishedData extends QueryableClass { required: false, description: "Array of one or more samples identifier values that" + - " are part of the published data.", + " are part of this published data record.", }) @Prop({ type: [String], required: false }) sampleIds: string[]; @@ -133,7 +133,7 @@ export class PublishedData extends QueryableClass { @ApiProperty({ type: Date, required: false, - description: "Time when doi is successfully registered", + description: "Time when doi is successfully registered with registrar", }) @Prop({ type: Date, index: true, required: false }) registeredTime?: Date; From c22b316bbda40a3d25a741ffa648921a4e689dcf Mon Sep 17 00:00:00 2001 From: Max Novelli Date: Tue, 7 Apr 2026 14:31:10 +0200 Subject: [PATCH 4/9] added ownable fields to published data --- src/published-data/dto/update-published-data.v4.dto.ts | 3 ++- src/published-data/schemas/published-data.schema.ts | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/published-data/dto/update-published-data.v4.dto.ts b/src/published-data/dto/update-published-data.v4.dto.ts index 27a974e39..799acdb65 100644 --- a/src/published-data/dto/update-published-data.v4.dto.ts +++ b/src/published-data/dto/update-published-data.v4.dto.ts @@ -8,9 +8,10 @@ import { } from "class-validator"; import { ApiProperty, ApiTags, PartialType } from "@nestjs/swagger"; import { PublishedDataStatus } from "../interfaces/published-data.interface"; +import { OwnableDto } from "src/common/dto/ownable.dto"; @ApiTags("publishedData") -export class UpdatePublishedDataV4Dto { +export class UpdatePublishedDataV4Dto extends OwnableDto { @ApiProperty({ type: String, required: true, diff --git a/src/published-data/schemas/published-data.schema.ts b/src/published-data/schemas/published-data.schema.ts index b10c8b584..e3cd1b9d1 100644 --- a/src/published-data/schemas/published-data.schema.ts +++ b/src/published-data/schemas/published-data.schema.ts @@ -1,10 +1,10 @@ import { Prop, Schema, SchemaFactory } from "@nestjs/mongoose"; import { ApiProperty } from "@nestjs/swagger"; import { Document } from "mongoose"; -import { QueryableClass } from "src/common/schemas/queryable.schema"; import { v4 as uuidv4 } from "uuid"; import { PublishedDataStatus } from "../interfaces/published-data.interface"; import crypto from "crypto"; +import { OwnableClass } from "src/common/schemas/ownable.schema"; export type PublishedDataDocument = PublishedData & Document; @@ -15,7 +15,7 @@ export type PublishedDataDocument = PublishedData & Document; }, timestamps: true, }) -export class PublishedData extends QueryableClass { +export class PublishedData extends OwnableClass { @Prop({ type: String, unique: true, From dbf4ff052d56b45c5cfb95caed710a638a36b487 Mon Sep 17 00:00:00 2001 From: Max Novelli Date: Fri, 10 Apr 2026 14:10:24 +0200 Subject: [PATCH 5/9] fixed tests --- .../dto/update-published-data.v4.dto.ts | 27 ++++--- .../published-data.v4.controller.ts | 1 + .../{PublishedData.js => PublishedData_V3.js} | 75 +++++++++++++------ ...PublishedDataV4.js => PublishedData_V4.js} | 6 +- test/TestData.js | 1 + 5 files changed, 76 insertions(+), 34 deletions(-) rename test/{PublishedData.js => PublishedData_V3.js} (90%) rename test/{PublishedDataV4.js => PublishedData_V4.js} (98%) diff --git a/src/published-data/dto/update-published-data.v4.dto.ts b/src/published-data/dto/update-published-data.v4.dto.ts index 799acdb65..b82194a33 100644 --- a/src/published-data/dto/update-published-data.v4.dto.ts +++ b/src/published-data/dto/update-published-data.v4.dto.ts @@ -6,7 +6,12 @@ import { IsOptional, IsString, } from "class-validator"; -import { ApiProperty, ApiTags, PartialType } from "@nestjs/swagger"; +import { + ApiProperty, + ApiPropertyOptional, + ApiTags, + PartialType, +} from "@nestjs/swagger"; import { PublishedDataStatus } from "../interfaces/published-data.interface"; import { OwnableDto } from "src/common/dto/ownable.dto"; @@ -45,27 +50,27 @@ export class UpdatePublishedDataV4Dto extends OwnableDto { @IsString({ each: true }) readonly datasetPids: string[]; - @ApiProperty({ + @ApiPropertyOptional({ type: [String], - required: false, description: - "Array of one or more proposals identifier values that" + - " are part of this published data record.", + "Array of one or more proposal identifier values that " + + "are part of this published data record.", }) + @IsOptional() @IsArray() @IsString({ each: true }) - readonly proposalIds: string[]; + readonly proposalIds?: string[]; - @ApiProperty({ + @ApiPropertyOptional({ type: [String], - required: false, description: - "Array of one or more samples identifier values that" + - " are part of this published data record.", + "Array of one or more samples identifier values that " + + "are part of this published data record.", }) + @IsOptional() @IsArray() @IsString({ each: true }) - readonly sampleIds: string[]; + readonly sampleIds?: string[]; @ApiProperty({ type: Date, diff --git a/src/published-data/published-data.v4.controller.ts b/src/published-data/published-data.v4.controller.ts index 6ed23c5c0..b5e18223f 100644 --- a/src/published-data/published-data.v4.controller.ts +++ b/src/published-data/published-data.v4.controller.ts @@ -96,6 +96,7 @@ export class PublishedDataV4Controller { async create( @Body() createPublishedDataDto: CreatePublishedDataV4Dto, ): Promise { + console.log("published data v4 create"); return this.publishedDataService.create(createPublishedDataDto); } diff --git a/test/PublishedData.js b/test/PublishedData_V3.js similarity index 90% rename from test/PublishedData.js rename to test/PublishedData_V3.js index e8a1cb89c..521b5ce4b 100644 --- a/test/PublishedData.js +++ b/test/PublishedData_V3.js @@ -5,7 +5,6 @@ const sandbox = require("sinon").createSandbox(); let accessTokenArchiveManager = null, accessTokenAdminIngestor = null, - idOrigDatablock = null, pid = null, pidnonpublic = null, @@ -28,7 +27,7 @@ const nonpublictestdataset = { ownerGroup: "examplenonpublicgroup", }; -describe("1600: PublishedData: Test of access to published data", () => { +describe("1600: PublishedData: Test of access to published data V3", () => { before(async () => { db.collection("Dataset").deleteMany({}); db.collection("PublishedData").deleteMany({}); @@ -58,23 +57,53 @@ describe("1600: PublishedData: Test of access to published data", () => { .expect(TestData.EntryCreatedStatusCode) .expect("Content-Type", /json/) .then((res) => { - res.body.should.have.property("affiliation").and.equal(publishedData.affiliation); - res.body.should.have.property("creator").and.deep.equal(publishedData.creator); - res.body.should.have.property("publisher").and.equal(publishedData.publisher); - res.body.should.have.property("publicationYear").and.equal(publishedData.publicationYear); + res.body.should.have + .property("affiliation") + .and.equal(publishedData.affiliation); + res.body.should.have + .property("creator") + .and.deep.equal(publishedData.creator); + res.body.should.have + .property("publisher") + .and.equal(publishedData.publisher); + res.body.should.have + .property("publicationYear") + .and.equal(publishedData.publicationYear); res.body.should.have.property("title").and.equal(publishedData.title); res.body.should.have.property("url").and.equal(publishedData.url); - res.body.should.have.property("abstract").and.equal(publishedData.abstract); - res.body.should.have.property("dataDescription").and.equal(publishedData.dataDescription); - res.body.should.have.property("resourceType").and.equal(publishedData.resourceType); - res.body.should.have.property("numberOfFiles").and.equal(publishedData.numberOfFiles); - res.body.should.have.property("sizeOfArchive").and.equal(publishedData.sizeOfArchive); - res.body.should.have.property("pidArray").and.deep.equal(publishedData.pidArray); - res.body.should.have.property("authors").and.deep.equal(publishedData.authors); - res.body.should.have.property("scicatUser").and.equal(publishedData.scicatUser); - res.body.should.have.property("thumbnail").and.equal(publishedData.thumbnail); - res.body.should.have.property("relatedPublications").and.deep.equal(publishedData.relatedPublications); - res.body.should.have.property("downloadLink").and.equal(publishedData.downloadLink); + res.body.should.have + .property("abstract") + .and.equal(publishedData.abstract); + res.body.should.have + .property("dataDescription") + .and.equal(publishedData.dataDescription); + res.body.should.have + .property("resourceType") + .and.equal(publishedData.resourceType); + res.body.should.have + .property("numberOfFiles") + .and.equal(publishedData.numberOfFiles); + res.body.should.have + .property("sizeOfArchive") + .and.equal(publishedData.sizeOfArchive); + res.body.should.have + .property("pidArray") + .and.deep.equal(publishedData.pidArray); + res.body.should.have + .property("authors") + .and.deep.equal(publishedData.authors); + res.body.should.have + .property("scicatUser") + .and.equal(publishedData.scicatUser); + res.body.should.have + .property("thumbnail") + .and.equal(publishedData.thumbnail); + res.body.should.have + .property("relatedPublications") + .and.deep.equal(publishedData.relatedPublications); + res.body.should.have + .property("downloadLink") + .and.equal(publishedData.downloadLink); res.body.should.have.property("status").and.equal(publishedData.status); doi = encodeURIComponent(res.body["doi"]); }); @@ -140,7 +169,7 @@ describe("1600: PublishedData: Test of access to published data", () => { .post("/api/v3/PublishedData/" + doi + "/register") .set("Accept", "application/json") .set({ Authorization: `Bearer ${accessTokenAdminIngestor}` }) - .expect(TestData.SuccessfulPostStatusCode) + .expect(TestData.EntryCreatedStatusCode) .expect("Content-Type", /json/); }); @@ -149,7 +178,7 @@ describe("1600: PublishedData: Test of access to published data", () => { .get("/api/v3/PublishedData/" + doi) .set("Accept", "application/json") .set({ Authorization: `Bearer ${accessTokenAdminIngestor}` }) - .expect(TestData.SuccessfulGetStatusCode) + .expect(TestData.SuccessfulPostStatusCode) .expect("Content-Type", /json/) .then((res) => { res.body.should.have.property("status").and.equal("registered"); @@ -216,14 +245,18 @@ describe("1600: PublishedData: Test of access to published data", () => { it("0066: should fetch published data with filter", async () => { const filter = { where: { creator: "New Creator" } }; await request(appUrl) - .get(`/api/v3/PublishedData?filter=${encodeURIComponent(JSON.stringify(filter))}`) + .get( + `/api/v3/PublishedData?filter=${encodeURIComponent(JSON.stringify(filter))}`, + ) .set("Accept", "application/json") .set({ Authorization: `Bearer ${accessTokenAdminIngestor}` }) .expect(TestData.SuccessfulGetStatusCode) .expect("Content-Type", /json/) .then((res) => { res.body.length.should.equal(1); - res.body[0].should.have.property("creator").and.deep.equal(["New Creator"]); + res.body[0].should.have + .property("creator") + .and.deep.equal(["New Creator"]); res.body[0].should.have.property("thumbnail"); }); return request(appUrl) diff --git a/test/PublishedDataV4.js b/test/PublishedData_V4.js similarity index 98% rename from test/PublishedDataV4.js rename to test/PublishedData_V4.js index 131cb82db..201a41b6a 100644 --- a/test/PublishedDataV4.js +++ b/test/PublishedData_V4.js @@ -38,7 +38,7 @@ const nonpublictestdataset = { ownerGroup: "examplenonpublicgroup", }; -describe("1600: PublishedDataV4: Test of access to published data v4 endpoints", () => { +describe("1610: PublishedDataV4: Test of access to published data v4 endpoints", () => { before(async () => { db.collection("Dataset").deleteMany({}); db.collection("PublishedData").deleteMany({}); @@ -100,7 +100,9 @@ describe("1600: PublishedDataV4: Test of access to published data v4 endpoints", .expect(TestData.EntryCreatedStatusCode) .expect("Content-Type", /json/) .then((res) => { - res.body.should.have.property("title").and.be.string; + res.body.should.have + .property("title") + .and.be.string(publishedData.title); res.body.should.have.property("metadata"); res.body.metadata.should.have.property("publisher"); res.body.should.have.property("status").and.equal(defaultStatus); diff --git a/test/TestData.js b/test/TestData.js index aa6a59de9..63bdcbf71 100644 --- a/test/TestData.js +++ b/test/TestData.js @@ -1353,6 +1353,7 @@ const TestData = { landingPage: "doi.ess.eu/detail/", }, datasetPids: [], + ownerGroup: "admin", }, InstrumentCorrect1: { From 67fc9a278bc57ee4b930cd94f2d54d808f570315 Mon Sep 17 00:00:00 2001 From: Max Novelli Date: Fri, 10 Apr 2026 14:37:57 +0200 Subject: [PATCH 6/9] fixed test with correct return value --- test/PublishedData_V3.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/PublishedData_V3.js b/test/PublishedData_V3.js index 521b5ce4b..e38ce3a9c 100644 --- a/test/PublishedData_V3.js +++ b/test/PublishedData_V3.js @@ -169,7 +169,7 @@ describe("1600: PublishedData: Test of access to published data V3", () => { .post("/api/v3/PublishedData/" + doi + "/register") .set("Accept", "application/json") .set({ Authorization: `Bearer ${accessTokenAdminIngestor}` }) - .expect(TestData.EntryCreatedStatusCode) + .expect(TestData.SuccessfulPostStatusCode) .expect("Content-Type", /json/); }); From f21f555b7e4550cc4a2fc1fd68ac215516fdc07b Mon Sep 17 00:00:00 2001 From: Max Novelli Date: Tue, 14 Apr 2026 09:28:09 +0200 Subject: [PATCH 7/9] datasets' pids required in schema --- src/published-data/schemas/published-data.schema.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/published-data/schemas/published-data.schema.ts b/src/published-data/schemas/published-data.schema.ts index e3cd1b9d1..abf3ae2dc 100644 --- a/src/published-data/schemas/published-data.schema.ts +++ b/src/published-data/schemas/published-data.schema.ts @@ -102,7 +102,7 @@ export class PublishedData extends OwnableClass { @ApiProperty({ type: [String], - required: false, + required: true, description: "Array of one or more datasets' persistent identifier values that" + " are part of the published data record.", From e7efaad62bfc70ddb2ec35d15f83c6bfe7104a1a Mon Sep 17 00:00:00 2001 From: Max Novelli Date: Thu, 7 May 2026 12:32:25 +0200 Subject: [PATCH 8/9] included feedback on PR --- src/published-data/dto/update-published-data.v4.dto.ts | 2 +- src/published-data/schemas/published-data.schema.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/published-data/dto/update-published-data.v4.dto.ts b/src/published-data/dto/update-published-data.v4.dto.ts index b82194a33..6fc02a8bf 100644 --- a/src/published-data/dto/update-published-data.v4.dto.ts +++ b/src/published-data/dto/update-published-data.v4.dto.ts @@ -41,7 +41,7 @@ export class UpdatePublishedDataV4Dto extends OwnableDto { @ApiProperty({ type: [String], - required: false, + required: true, description: "Array of one or more datasets' persistent identifier values that" + " are part of this published data record.", diff --git a/src/published-data/schemas/published-data.schema.ts b/src/published-data/schemas/published-data.schema.ts index abf3ae2dc..a476df811 100644 --- a/src/published-data/schemas/published-data.schema.ts +++ b/src/published-data/schemas/published-data.schema.ts @@ -107,7 +107,7 @@ export class PublishedData extends OwnableClass { "Array of one or more datasets' persistent identifier values that" + " are part of the published data record.", }) - @Prop({ type: [String], required: false }) + @Prop({ type: [String], required: true }) datasetPids: string[]; @ApiProperty({ @@ -118,7 +118,7 @@ export class PublishedData extends OwnableClass { " are part of this published data record.", }) @Prop({ type: [String], required: false }) - proposalIds: string[]; + proposalIds?: string[]; @ApiProperty({ type: [String], @@ -128,7 +128,7 @@ export class PublishedData extends OwnableClass { " are part of this published data record.", }) @Prop({ type: [String], required: false }) - sampleIds: string[]; + sampleIds?: string[]; @ApiProperty({ type: Date, From abb17287a5dd37e9005cd048e34582c3c3c263d7 Mon Sep 17 00:00:00 2001 From: Max Novelli Date: Thu, 7 May 2026 14:12:34 +0200 Subject: [PATCH 9/9] removed console log --- src/published-data/published-data.v4.controller.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/published-data/published-data.v4.controller.ts b/src/published-data/published-data.v4.controller.ts index ae12835ee..a8ea40d9d 100644 --- a/src/published-data/published-data.v4.controller.ts +++ b/src/published-data/published-data.v4.controller.ts @@ -101,7 +101,6 @@ export class PublishedDataV4Controller { async create( @Body() createPublishedDataDto: CreatePublishedDataV4Dto, ): Promise { - console.log("published data v4 create"); return this.publishedDataService.create(createPublishedDataDto); }