Skip to content

Commit a1cef4b

Browse files
committed
feat: add jsdoc about lastUpdateTime
1 parent e76e9d9 commit a1cef4b

File tree

2 files changed

+60
-1
lines changed

2 files changed

+60
-1
lines changed

src/datasets/domain/models/Dataset.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ export interface DatasetVersionInfo {
2222
minorNumber: number
2323
state: DatasetVersionState
2424
createTime: Date
25+
/**
26+
* The timestamp of the last update to this dataset version.
27+
* Format: ISO 8601 string (e.g., "2023-06-01T12:34:56Z").
28+
* Used for optimistic concurrency control to detect concurrent updates.
29+
*/
2530
lastUpdateTime: string
2631
releaseTime?: Date
2732
deaccessionNote?: string

src/files/domain/models/FileModel.ts

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { DvObjectOwnerNode } from '../../../core/domain/models/DvObjectOwnerNode'
1+
import { DvObjectOwnerNode, DvObjectType } from '../../../core/domain/models/DvObjectOwnerNode'
22

33
export interface FileModel {
44
id: number
@@ -30,6 +30,11 @@ export interface FileModel {
3030
tabularTags?: string[]
3131
creationDate?: string
3232
publicationDate?: string
33+
/**
34+
* The timestamp of the last update to this file record.
35+
* Format: ISO 8601 string (e.g., "2023-06-01T12:34:56Z").
36+
* Used for optimistic concurrency control to detect concurrent updates.
37+
*/
3338
lastUpdateTime: string
3439
deleted: boolean
3540
tabularData: boolean
@@ -46,3 +51,52 @@ export interface FileChecksum {
4651
type: string
4752
value: string
4853
}
54+
55+
const fileModelExample: FileModel = {
56+
id: 123,
57+
persistentId: 'doi:10.1234/example',
58+
name: 'data.csv',
59+
pidURL: 'http://example.com/file/123',
60+
sizeBytes: 2048,
61+
version: 1,
62+
description: 'Sample data file',
63+
restricted: false,
64+
latestRestricted: false,
65+
directoryLabel: '/data',
66+
datasetVersionId: 1,
67+
categories: ['survey', 'demographics'],
68+
contentType: 'text/csv',
69+
friendlyType: 'CSV',
70+
embargo: {
71+
dateAvailable: new Date('2024-12-31'),
72+
reason: 'Embargo until publication'
73+
},
74+
storageIdentifier: 's3://bucket/key',
75+
originalFormat: 'csv',
76+
originalFormatLabel: 'CSV',
77+
originalSize: 2048,
78+
originalName: 'data_original.csv',
79+
UNF: 'UNF:6:abc123',
80+
rootDataFileId: 123,
81+
previousDataFileId: 122,
82+
md5: 'd41d8cd98f00b204e9800998ecf8427e',
83+
checksum: {
84+
type: 'MD5',
85+
value: 'd41d8cd98f00b204e9800998ecf8427e'
86+
},
87+
metadataId: 456,
88+
tabularTags: ['tabular', 'data'],
89+
creationDate: '2024-01-01T12:00:00Z',
90+
publicationDate: '2024-06-01T12:00:00Z',
91+
lastUpdateTime: '2024-06-15T12:34:56Z',
92+
deleted: false,
93+
tabularData: true,
94+
fileAccessRequest: false,
95+
isPartOf: {
96+
type: 'dataverse' as DvObjectType,
97+
displayName: 'My Dataverse',
98+
identifier: 'my-dataverse'
99+
}
100+
}
101+
102+
fileModelExample.lastUpdateTime

0 commit comments

Comments
 (0)