|
1 | | -// TODO:ME - Adding custom terms makes the get dataset templates endpoint throw internal server error |
| 1 | +import { MetadataFieldPayload } from '../../../../datasets/infra/repositories/transformers/DatasetPayload' |
2 | 2 |
|
3 | 3 | export interface CollectionDatasetTemplatePayload { |
4 | 4 | id: number |
5 | 5 | name: string |
| 6 | + dataverseAlias: string |
6 | 7 | isDefault: boolean |
7 | 8 | usageCount: number |
8 | 9 | createTime: string |
9 | 10 | createDate: string |
10 | | - termsOfUseAndAccess: TermsOfUseAndAccess |
11 | | - datasetFields: DatasetFields |
| 11 | + // 👇 From Edit Template Metadata |
| 12 | + datasetFields: DatasetFieldsPayload |
12 | 13 | instructions: Instruction[] |
13 | | - dataverseAlias: string |
| 14 | + // 👇 From Edit Template Terms |
| 15 | + termsOfUseAndAccess: { |
| 16 | + id: number |
| 17 | + fileAccessRequest: boolean |
| 18 | + // This license property is going to be present if not custom terms are added in the UI |
| 19 | + license?: { |
| 20 | + id: number |
| 21 | + name: string |
| 22 | + shortDescription: string |
| 23 | + uri: string |
| 24 | + iconUrl?: string |
| 25 | + active: boolean |
| 26 | + isDefault: boolean |
| 27 | + sortOrder: number |
| 28 | + rightsIdentifier: string |
| 29 | + rightsIdentifierScheme?: string |
| 30 | + schemeUri: string |
| 31 | + languageCode: string |
| 32 | + } |
| 33 | + // Below fields are going to be present if are added in "Restricted Files + Terms of Access" |
| 34 | + termsOfAccess?: string // This is terms of access for restricted files in the JSF UI |
| 35 | + dataAccessPlace?: string |
| 36 | + originalArchive?: string |
| 37 | + availabilityStatus?: string |
| 38 | + sizeOfCollection?: string |
| 39 | + studyCompletion?: string |
| 40 | + contactForAccess?: string |
| 41 | + // Below fields are going to be present if custom terms are added in the UI, they will be mapped and grouped under customTerms |
| 42 | + termsOfUse?: string |
| 43 | + confidentialityDeclaration?: string |
| 44 | + specialPermissions?: string |
| 45 | + restrictions?: string |
| 46 | + citationRequirements?: string |
| 47 | + depositorRequirements?: string |
| 48 | + conditions?: string |
| 49 | + disclaimer?: string |
| 50 | + } |
14 | 51 | } |
15 | 52 |
|
16 | | -export interface TermsOfUseAndAccess { |
17 | | - id: number |
18 | | - license: License |
19 | | - // Below fields are going to be present if are added in "Restricted Files + Terms of Access" |
20 | | - termsOfAccess?: string // This is terms of access for restricted files in the JSF UI |
21 | | - dataAccessPlace?: string |
22 | | - originalArchive?: string |
23 | | - availabilityStatus?: string |
24 | | - sizeOfCollection?: string |
25 | | - studyCompletion?: string |
26 | | - // Below fields are going to be present if custom terms are added in the JSF UI |
27 | | - termsOfUse?: string |
28 | | - confidentialityDeclaration?: string |
29 | | - specialPermissions?: string |
30 | | - restrictions?: string |
31 | | - citationRequirements?: string |
32 | | - depositorRequirements?: string |
33 | | - conditions?: string |
34 | | - disclaimer?: string |
35 | | -} |
| 53 | +type DatasetFieldsPayload = Record<string, DatasetFieldInfoPayload> |
36 | 54 |
|
37 | | -export interface License { |
38 | | - id: number |
39 | | - name: string |
40 | | - shortDescription: string |
41 | | - uri: string |
42 | | - iconUrl: string |
43 | | - active: boolean |
44 | | - isDefault: boolean |
45 | | - sortOrder: number |
46 | | - rightsIdentifier: string |
47 | | - rightsIdentifierScheme: string |
48 | | - schemeUri: string |
49 | | - languageCode: string |
50 | | -} |
51 | | - |
52 | | -export interface DatasetFields { |
53 | | - citation: Citation |
54 | | -} |
55 | | - |
56 | | -export interface Citation { |
| 55 | +interface DatasetFieldInfoPayload { |
57 | 56 | displayName: string |
58 | 57 | name: string |
59 | | - fields: Field[] |
60 | | -} |
61 | | - |
62 | | -export interface Field { |
63 | | - typeName: string |
64 | | - multiple: boolean |
65 | | - typeClass: string |
66 | | - value: string |
| 58 | + fields: MetadataFieldPayload[] |
67 | 59 | } |
68 | 60 |
|
69 | | -export interface Instruction { |
| 61 | +interface Instruction { |
70 | 62 | instructionField: string |
71 | 63 | instructionText: string |
72 | 64 | } |
0 commit comments