diff --git a/src/files/domain/models/FileModel.ts b/src/files/domain/models/FileModel.ts index 6b51cada..abf95d71 100644 --- a/src/files/domain/models/FileModel.ts +++ b/src/files/domain/models/FileModel.ts @@ -28,8 +28,8 @@ export interface FileModel { checksum?: FileChecksum metadataId?: number tabularTags?: string[] - creationDate?: Date - publicationDate?: Date + creationDate?: string + publicationDate?: string deleted: boolean tabularData: boolean fileAccessRequest?: boolean diff --git a/src/files/infra/repositories/transformers/fileTransformers.ts b/src/files/infra/repositories/transformers/fileTransformers.ts index b39f6284..f0476de1 100644 --- a/src/files/infra/repositories/transformers/fileTransformers.ts +++ b/src/files/infra/repositories/transformers/fileTransformers.ts @@ -81,10 +81,10 @@ const transformFilePayloadToFile = (filePayload: FilePayload): FileModel => { ...(filePayload.dataFile.fileMetadataId && { metadataId: filePayload.dataFile.fileMetadataId }), ...(filePayload.dataFile.tabularTags && { tabularTags: filePayload.dataFile.tabularTags }), ...(filePayload.dataFile.creationDate && { - creationDate: new Date(filePayload.dataFile.creationDate) + creationDate: filePayload.dataFile.creationDate }), ...(filePayload.dataFile.publicationDate && { - publicationDate: new Date(filePayload.dataFile.publicationDate) + publicationDate: filePayload.dataFile.publicationDate }), deleted: filePayload.dataFile.deleted, tabularData: filePayload.dataFile.tabularData, diff --git a/test/testHelpers/files/filesHelper.ts b/test/testHelpers/files/filesHelper.ts index abe6bc0b..c499fd84 100644 --- a/test/testHelpers/files/filesHelper.ts +++ b/test/testHelpers/files/filesHelper.ts @@ -32,7 +32,7 @@ export const createFileModel = (): FileModel => { previousDataFileId: 4, md5: '29e413e0c881e17314ce8116fed4d1a7', metadataId: 4, - creationDate: new Date('2023-07-11'), + creationDate: '2023-07-11', embargo: { dateAvailable: new Date('2023-07-11'), reason: 'test' @@ -59,7 +59,7 @@ export const createFileModel = (): FileModel => { originalSize: 127426, originalName: 'originalName', tabularTags: ['tag1', 'tag2'], - publicationDate: new Date('2023-07-11') + publicationDate: '2023-07-11' } }