@eventconnectors/ndtrc_model 1.0.6 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +5 -0
- package/package.json +2 -2
- package/src/model/ff/Acl.js +13 -0
- package/src/model/ff/ItemLink.js +25 -0
- package/src/model/ff/Route.js +95 -0
package/index.js
CHANGED
|
@@ -3,6 +3,11 @@
|
|
|
3
3
|
// Exporteer alles in één keer vanuit de respectieve bestanden
|
|
4
4
|
|
|
5
5
|
module.exports = {
|
|
6
|
+
// FeedFactory Route Model
|
|
7
|
+
Route: require("./src/model/ff/Route"),
|
|
8
|
+
Acl: require("./src/model/ff/Acl"),
|
|
9
|
+
ItemLink: require("./src/model/ff/ItemLink"),
|
|
10
|
+
|
|
6
11
|
// Exporteer alle klassen uit de modelbestanden
|
|
7
12
|
ConvertedEntry: require("./src/model/ConvertedEntry"),
|
|
8
13
|
FetchedEntry: require("./src/model/FetchedEntry"),
|
package/package.json
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
class ItemLink {
|
|
2
|
+
constructor({
|
|
3
|
+
type = null,
|
|
4
|
+
id = ''
|
|
5
|
+
} = {}) {
|
|
6
|
+
this.type = type;
|
|
7
|
+
this.id = id;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
static Type = {
|
|
11
|
+
ALIAS: 'alias',
|
|
12
|
+
COMMENT: 'comment',
|
|
13
|
+
PARENT: 'parent',
|
|
14
|
+
CHILD: 'child',
|
|
15
|
+
|
|
16
|
+
fromString(type) {
|
|
17
|
+
if (Object.values(ItemLink.Type).includes(type)) {
|
|
18
|
+
return type;
|
|
19
|
+
}
|
|
20
|
+
throw new Error(`Invalid ItemLink Type: ${type}`);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
module.exports = ItemLink;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
const moment = require('moment');
|
|
2
|
+
const Acl = require('./Acl');
|
|
3
|
+
const ItemLink = require('./ItemLink');
|
|
4
|
+
const { Calendar } = require('../ndtrc/Calendar');
|
|
5
|
+
const Contactinfo = require('../ndtrc/ContactInfo');
|
|
6
|
+
const TRCItemCategories = require('../ndtrc/TRCItemCategories');
|
|
7
|
+
const File = require('../ndtrc/File');
|
|
8
|
+
const TRCItemDetail = require('../ndtrc/TRCItemDetail');
|
|
9
|
+
const TrcitemRelation = require('../ndtrc/TRCItemRelation');
|
|
10
|
+
const Location = require('../ndtrc/Location');
|
|
11
|
+
const RouteInfo = require('../ndtrc/RouteInfo');
|
|
12
|
+
const Translations = require('../ndtrc/Translations');
|
|
13
|
+
|
|
14
|
+
class Route {
|
|
15
|
+
constructor({
|
|
16
|
+
id = null,
|
|
17
|
+
trcid = '',
|
|
18
|
+
creationdate = null,
|
|
19
|
+
availablefrom = null,
|
|
20
|
+
availableto = null,
|
|
21
|
+
lastupdated = null,
|
|
22
|
+
lastimportedon = null,
|
|
23
|
+
createdby = '',
|
|
24
|
+
lastupdatedby = '',
|
|
25
|
+
owner = '',
|
|
26
|
+
legalowner = '',
|
|
27
|
+
externalid = '',
|
|
28
|
+
validator = '',
|
|
29
|
+
validatedby = null,
|
|
30
|
+
wfstatus = null,
|
|
31
|
+
cidn = '',
|
|
32
|
+
productiontrcid = '',
|
|
33
|
+
keywords = '',
|
|
34
|
+
markers = '',
|
|
35
|
+
userorganisation = '',
|
|
36
|
+
entitytype = 'ROUTE',
|
|
37
|
+
acl = null,
|
|
38
|
+
location = null,
|
|
39
|
+
translations = null,
|
|
40
|
+
trcItemCategories = null,
|
|
41
|
+
trcitemRelation = null,
|
|
42
|
+
files = [],
|
|
43
|
+
links = [],
|
|
44
|
+
trcItemDetails = [],
|
|
45
|
+
contactinfo = null,
|
|
46
|
+
calendar = null,
|
|
47
|
+
routeInfo = null
|
|
48
|
+
} = {}) {
|
|
49
|
+
this.id = id;
|
|
50
|
+
this.trcid = trcid;
|
|
51
|
+
this.creationdate = creationdate ? moment(creationdate) : null;
|
|
52
|
+
this.availablefrom = availablefrom ? moment(availablefrom) : null;
|
|
53
|
+
this.availableto = availableto ? moment(availableto) : null;
|
|
54
|
+
this.lastupdated = lastupdated ? moment(lastupdated) : null;
|
|
55
|
+
this.lastimportedon = lastimportedon ? moment(lastimportedon) : null;
|
|
56
|
+
this.createdby = createdby;
|
|
57
|
+
this.lastupdatedby = lastupdatedby;
|
|
58
|
+
this.owner = owner;
|
|
59
|
+
this.legalowner = legalowner;
|
|
60
|
+
this.externalid = externalid;
|
|
61
|
+
this.validator = validator;
|
|
62
|
+
this.validatedby = validatedby;
|
|
63
|
+
this.wfstatus = wfstatus;
|
|
64
|
+
this.cidn = cidn;
|
|
65
|
+
this.productiontrcid = productiontrcid;
|
|
66
|
+
this.keywords = keywords;
|
|
67
|
+
this.markers = markers;
|
|
68
|
+
this.userorganisation = userorganisation;
|
|
69
|
+
this.entitytype = entitytype;
|
|
70
|
+
this.acl = acl ? new Acl(acl) : null;
|
|
71
|
+
this.location = location ? new Location(location) : null;
|
|
72
|
+
this.translations = translations ? new Translations(translations) : new Translations();
|
|
73
|
+
this.trcItemCategories = trcItemCategories ? new TRCItemCategories(trcItemCategories) : null;
|
|
74
|
+
this.trcitemRelation = trcitemRelation ? new TrcitemRelation(trcitemRelation) : null;
|
|
75
|
+
this.files = files.map(file => new File(file));
|
|
76
|
+
this.links = links.map(link => new ItemLink(link));
|
|
77
|
+
this.trcItemDetails = trcItemDetails.map(detail => new TRCItemDetail(detail));
|
|
78
|
+
this.contactinfo = contactinfo ? new Contactinfo(contactinfo) : null;
|
|
79
|
+
this.calendar = calendar ? new Calendar(calendar) : null;
|
|
80
|
+
this.routeInfo = routeInfo ? new RouteInfo(routeInfo) : null;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
static WFStatus = {
|
|
84
|
+
DRAFT: 'draft',
|
|
85
|
+
READY_FOR_VALIDATION: 'readyforvalidation',
|
|
86
|
+
APPROVED: 'approved',
|
|
87
|
+
REJECTED: 'rejected',
|
|
88
|
+
DELETED: 'deleted',
|
|
89
|
+
ARCHIVED: 'archived'
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
static EntityType = 'ROUTE';
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
module.exports = Route;
|