@eventconnectors/ndtrc_model 1.1.0 → 1.2.1
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/LICENSE +190 -0
- package/README.md +105 -0
- package/dist/index.cjs +930 -0
- package/dist/index.d.cts +58174 -0
- package/dist/index.d.ts +58174 -0
- package/dist/index.js +826 -0
- package/package.json +51 -10
- package/.claude/settings.local.json +0 -14
- package/CLAUDE.md +0 -54
- package/eventconnectors-ndtrc_model-1.0.4.tgz +0 -0
- package/index.js +0 -36
- package/src/__tests__/model.test.js +0 -327
- package/src/model/ConvertedEntry.js +0 -22
- package/src/model/FetchedEntry.js +0 -55
- package/src/model/ff/Acl.js +0 -13
- package/src/model/ff/ItemLink.js +0 -25
- package/src/model/ff/Route.js +0 -95
- package/src/model/ndtrc/Address.js +0 -70
- package/src/model/ndtrc/Calendar.js +0 -255
- package/src/model/ndtrc/Categories.js +0 -54
- package/src/model/ndtrc/ContactInfo.js +0 -188
- package/src/model/ndtrc/ExtraPriceInformation.js +0 -16
- package/src/model/ndtrc/File.js +0 -155
- package/src/model/ndtrc/GISCoordinate.js +0 -19
- package/src/model/ndtrc/Location.js +0 -23
- package/src/model/ndtrc/Performer.js +0 -9
- package/src/model/ndtrc/PriceElement.js +0 -64
- package/src/model/ndtrc/Promotion.js +0 -51
- package/src/model/ndtrc/RouteInfo.js +0 -34
- package/src/model/ndtrc/SubItemGroup.js +0 -102
- package/src/model/ndtrc/TRCItem.js +0 -136
- package/src/model/ndtrc/TRCItemCategories.js +0 -105
- package/src/model/ndtrc/TRCItemDetail.js +0 -10
- package/src/model/ndtrc/TRCItemGroup.js +0 -74
- package/src/model/ndtrc/TRCItemRelation.js +0 -13
- package/src/model/ndtrc/Translations.js +0 -8
- package/src/model/ndtrc/enums.js +0 -33
- package/src/resources/schema/NDTRC-types-EVENTS.txt +0 -0
- package/src/resources/schema/NDTRC-types-locaties.txt +0 -0
- package/src/util/CategoryMap.js +0 -194
- package/src/util/StringUtils.js +0 -12
package/src/model/ff/Route.js
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
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;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
const StringUtils = require('../../util/StringUtils'); // Import StringUtils voor validaties
|
|
2
|
-
|
|
3
|
-
class Address {
|
|
4
|
-
constructor({
|
|
5
|
-
main = false,
|
|
6
|
-
reservation = false,
|
|
7
|
-
title = '',
|
|
8
|
-
city = '',
|
|
9
|
-
citytrcid = '',
|
|
10
|
-
country = 'NL',
|
|
11
|
-
housenr = '',
|
|
12
|
-
street = '',
|
|
13
|
-
streettrcid = '',
|
|
14
|
-
zipcode = '',
|
|
15
|
-
province = '',
|
|
16
|
-
neighbourhood = '',
|
|
17
|
-
district = '',
|
|
18
|
-
gisCoordinates = []
|
|
19
|
-
} = {}) {
|
|
20
|
-
Object.assign(this, {
|
|
21
|
-
main,
|
|
22
|
-
reservation,
|
|
23
|
-
title,
|
|
24
|
-
city,
|
|
25
|
-
citytrcid,
|
|
26
|
-
country,
|
|
27
|
-
housenr,
|
|
28
|
-
street,
|
|
29
|
-
streettrcid,
|
|
30
|
-
zipcode,
|
|
31
|
-
province,
|
|
32
|
-
neighbourhood,
|
|
33
|
-
district,
|
|
34
|
-
gisCoordinates
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Controleert of het adres leeg is.
|
|
40
|
-
* @returns {boolean}
|
|
41
|
-
*/
|
|
42
|
-
isEmpty() {
|
|
43
|
-
return [
|
|
44
|
-
this.title,
|
|
45
|
-
this.city,
|
|
46
|
-
this.housenr,
|
|
47
|
-
this.street,
|
|
48
|
-
this.zipcode,
|
|
49
|
-
this.province
|
|
50
|
-
].every(StringUtils.isEmpty) &&
|
|
51
|
-
(!this.gisCoordinates.length || this.gisCoordinates.every(coord => coord.isEmpty?.()));
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Normaliseert adresvelden (zipcode en city).
|
|
56
|
-
*/
|
|
57
|
-
normaliseAdresItems() {
|
|
58
|
-
if (this.zipcode?.match(/(\d{4})\s*(\w{2})/)) {
|
|
59
|
-
this.zipcode = this.zipcode.toUpperCase().replace(/(\d{4})\s*(\w{2})/, '$1 $2');
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
if (this.city?.match(/^[a-z\s]+$/i)) {
|
|
63
|
-
this.city = this.city
|
|
64
|
-
.toLowerCase()
|
|
65
|
-
.replace(/\b\w/g, char => char.toUpperCase()); // Hoofdletter per woord
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
module.exports = Address;
|
|
@@ -1,255 +0,0 @@
|
|
|
1
|
-
// Calendar.js
|
|
2
|
-
|
|
3
|
-
const moment = require("moment");
|
|
4
|
-
const Contactinfo = require("./ContactInfo");
|
|
5
|
-
|
|
6
|
-
class Calendar {
|
|
7
|
-
constructor() {
|
|
8
|
-
this.singleDates = [];
|
|
9
|
-
this.patternDates = [];
|
|
10
|
-
|
|
11
|
-
this.opens = [];
|
|
12
|
-
this.closeds = [];
|
|
13
|
-
this.soldouts = [];
|
|
14
|
-
this.cancelleds = [];
|
|
15
|
-
|
|
16
|
-
this.excludeholidays = false;
|
|
17
|
-
this.cancelled = false;
|
|
18
|
-
this.soldout = false;
|
|
19
|
-
this.onrequest = false;
|
|
20
|
-
this.alwaysopen = false;
|
|
21
|
-
this.comment = null;
|
|
22
|
-
this.calendarType = null;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
static CalendarType = {
|
|
26
|
-
NONE: "NONE",
|
|
27
|
-
ALWAYSOPEN: "ALWAYSOPEN",
|
|
28
|
-
ONREQUEST: "ONREQUEST",
|
|
29
|
-
OPENINGTIMES: "OPENINGTIMES",
|
|
30
|
-
PATTERNDATES: "PATTERNDATES",
|
|
31
|
-
SINGLEDATES: "SINGLEDATES",
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
cleanupData() {
|
|
35
|
-
this.singleDates.forEach((singleDate) => {
|
|
36
|
-
if (singleDate.when) {
|
|
37
|
-
singleDate.when = singleDate.when.filter((when) => when.isValid());
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
this.patternDates.forEach((patternDate) => {
|
|
42
|
-
patternDate.opens.forEach((open) => {
|
|
43
|
-
open.whens = open.whens.filter((when) => when.isValid());
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
if (patternDate.opens.length && !patternDate.recurrencyType) {
|
|
47
|
-
patternDate.recurrencyType = PatternDate.RecurrencyType.WEEKLY;
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
["opens", "closeds", "cancelleds", "soldouts"].forEach((prop) => {
|
|
52
|
-
this[prop].forEach((exceptionDate) => {
|
|
53
|
-
exceptionDate.whens = exceptionDate.whens.filter((when) =>
|
|
54
|
-
when.isValid()
|
|
55
|
-
);
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
determineCalendarType() {
|
|
61
|
-
if (this.calendarType !== null) return;
|
|
62
|
-
|
|
63
|
-
if (this.alwaysopen) {
|
|
64
|
-
this.calendarType = Calendar.CalendarType.ALWAYSOPEN;
|
|
65
|
-
} else if (this.onrequest) {
|
|
66
|
-
this.calendarType = Calendar.CalendarType.ONREQUEST;
|
|
67
|
-
} else if (this.singleDates.length > 0) {
|
|
68
|
-
this.calendarType = Calendar.CalendarType.SINGLEDATES;
|
|
69
|
-
} else if (this.patternDates.length > 0) {
|
|
70
|
-
const firstPattern = this.patternDates[0];
|
|
71
|
-
if (!firstPattern.enddate && !firstPattern.startdate) {
|
|
72
|
-
this.calendarType = Calendar.CalendarType.OPENINGTIMES;
|
|
73
|
-
} else {
|
|
74
|
-
this.calendarType = Calendar.CalendarType.PATTERNDATES;
|
|
75
|
-
}
|
|
76
|
-
} else {
|
|
77
|
-
this.calendarType = Calendar.CalendarType.NONE;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
class SingleDate {
|
|
83
|
-
constructor(date = null, when = []) {
|
|
84
|
-
this.date = date ? moment(date) : null;
|
|
85
|
-
this.when = when;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
equals(other) {
|
|
89
|
-
if (this === other) return true;
|
|
90
|
-
if (!(other instanceof SingleDate)) return false;
|
|
91
|
-
|
|
92
|
-
if (!this.date.isSame(other.date)) return false;
|
|
93
|
-
if (this.when.length !== other.when.length) return false;
|
|
94
|
-
|
|
95
|
-
return this.when.every((when, index) => when.equals(other.when[index]));
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
class PatternDate {
|
|
100
|
-
constructor() {
|
|
101
|
-
this.startdate = null;
|
|
102
|
-
this.enddate = null;
|
|
103
|
-
this.recurrencyType = null;
|
|
104
|
-
|
|
105
|
-
this.occurrence = null;
|
|
106
|
-
this.recurrence = null;
|
|
107
|
-
this.opens = [];
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
static RecurrencyType = {
|
|
111
|
-
DAILY: "daily",
|
|
112
|
-
WEEKLY: "weekly",
|
|
113
|
-
MONTHLY_SIMPLE: "monthlySimple",
|
|
114
|
-
MONTHLY_COMPLEX: "monthlyComplex",
|
|
115
|
-
YEARLY: "yearly",
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
equals(other) {
|
|
119
|
-
if (this === other) return true;
|
|
120
|
-
if (!(other instanceof PatternDate)) return false;
|
|
121
|
-
|
|
122
|
-
const datesEqual =
|
|
123
|
-
(!this.startdate && !other.startdate) ||
|
|
124
|
-
this.startdate.isSame(other.startdate);
|
|
125
|
-
const endDatesEqual =
|
|
126
|
-
(!this.enddate && !other.enddate) || this.enddate.isSame(other.enddate);
|
|
127
|
-
|
|
128
|
-
return (
|
|
129
|
-
datesEqual &&
|
|
130
|
-
endDatesEqual &&
|
|
131
|
-
this.recurrencyType === other.recurrencyType &&
|
|
132
|
-
this.occurrence === other.occurrence &&
|
|
133
|
-
this.recurrence === other.recurrence &&
|
|
134
|
-
this.opensEquals(other.opens)
|
|
135
|
-
);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
opensEquals(otherOpens) {
|
|
139
|
-
if (this.opens.length !== otherOpens.length) return false;
|
|
140
|
-
return this.opens.every((open, index) => open.equals(otherOpens[index]));
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
class Open {
|
|
145
|
-
constructor() {
|
|
146
|
-
this.month = null;
|
|
147
|
-
this.weeknumber = null;
|
|
148
|
-
this.daynumber = null;
|
|
149
|
-
this.day = null;
|
|
150
|
-
this.whens = [];
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
equals(other) {
|
|
154
|
-
if (this === other) return true;
|
|
155
|
-
if (!(other instanceof Open)) return false;
|
|
156
|
-
|
|
157
|
-
return (
|
|
158
|
-
this.month === other.month &&
|
|
159
|
-
this.weeknumber === other.weeknumber &&
|
|
160
|
-
this.daynumber === other.daynumber &&
|
|
161
|
-
this.day === other.day &&
|
|
162
|
-
this.whensEquals(other.whens)
|
|
163
|
-
);
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
whensEquals(otherWhens) {
|
|
167
|
-
if (this.whens.length !== otherWhens.length) return false;
|
|
168
|
-
return this.whens.every((when, index) => when.equals(otherWhens[index]));
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
class When {
|
|
173
|
-
constructor(timestart = null, timeend = null, status = null, valid=null) {
|
|
174
|
-
this.timestart = timestart;
|
|
175
|
-
this.valid = valid;
|
|
176
|
-
this.timeend = timeend;
|
|
177
|
-
this.status = status;
|
|
178
|
-
this.statustranslations = [];
|
|
179
|
-
this.extrainformations = [];
|
|
180
|
-
this.url = Contactinfo.Url ? new Contactinfo.Url() : [];
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
equals(other) {
|
|
184
|
-
if (this === other) return true;
|
|
185
|
-
if (!(other instanceof When)) return false;
|
|
186
|
-
|
|
187
|
-
return this.timestart === other.timestart && this.timeend === other.timeend;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
isValid() {
|
|
191
|
-
return this.isTimeValid(this.timestart) || this.isTimeValid(this.timeend);
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
isTimeValid(time) {
|
|
195
|
-
return time && time.trim().length > 0;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
static Status = {
|
|
199
|
-
NORMAL: "normal",
|
|
200
|
-
CANCELLED: "cancelled",
|
|
201
|
-
SOLDOUT: "soldout",
|
|
202
|
-
MOVEDTO: "movedto",
|
|
203
|
-
PREMIERE: "premiere",
|
|
204
|
-
REPRISE: "reprise",
|
|
205
|
-
};
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
class StatusTranslation {
|
|
209
|
-
constructor(lang = null, text = null) {
|
|
210
|
-
this.lang = lang;
|
|
211
|
-
this.text = text;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
class ExtraInformation {
|
|
216
|
-
constructor(lang = null, text = null) {
|
|
217
|
-
this.lang = lang;
|
|
218
|
-
this.text = text;
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
class ExceptionDate {
|
|
223
|
-
constructor(date = null, whens = []) {
|
|
224
|
-
this.date = date ? moment(date) : null;
|
|
225
|
-
this.whens = whens;
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
class Comment {
|
|
230
|
-
constructor(label = null, commentTranslations = []) {
|
|
231
|
-
this.label = label;
|
|
232
|
-
this.commentTranslations = commentTranslations;
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
class CommentTranslation {
|
|
237
|
-
constructor(label = null, lang = null) {
|
|
238
|
-
this.label = label;
|
|
239
|
-
this.lang = lang;
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
// Export the classes
|
|
244
|
-
module.exports = {
|
|
245
|
-
Calendar,
|
|
246
|
-
SingleDate,
|
|
247
|
-
PatternDate,
|
|
248
|
-
Open,
|
|
249
|
-
When,
|
|
250
|
-
StatusTranslation,
|
|
251
|
-
ExtraInformation,
|
|
252
|
-
ExceptionDate,
|
|
253
|
-
Comment,
|
|
254
|
-
CommentTranslation,
|
|
255
|
-
};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
// FeedData.js
|
|
2
|
-
|
|
3
|
-
const categories = {
|
|
4
|
-
"evenementen": "2.3",
|
|
5
|
-
"Beurs": "2.3.1",
|
|
6
|
-
"Braderie": "2.3.2",
|
|
7
|
-
"Congres": "2.3.4",
|
|
8
|
-
"Corso of Optocht": "2.3.5",
|
|
9
|
-
"Culinair": "2.3.6",
|
|
10
|
-
"Excursie": "2.7.2",
|
|
11
|
-
"Kermis": "2.3.8",
|
|
12
|
-
"Lezing/Debat": "2.3.9",
|
|
13
|
-
"Markt": "2.3.10",
|
|
14
|
-
"Open Dag": "2.3.11",
|
|
15
|
-
"Rondleiding": "2.3.12",
|
|
16
|
-
"Sportevenement": "2.3.13",
|
|
17
|
-
"Workshop": "2.3.15",
|
|
18
|
-
"Wandeltocht": "2.3.17",
|
|
19
|
-
"Varia": "2.3.18",
|
|
20
|
-
"Grootstedelijk evenement": "2.3.23",
|
|
21
|
-
"Rommelmarkt": "2.4.6",
|
|
22
|
-
"Film": "2.5.2",
|
|
23
|
-
"Jeugd": "2.3.25",
|
|
24
|
-
"Wijkfeest": "2.3.26",
|
|
25
|
-
"Speeltuin": "2.3.27",
|
|
26
|
-
"Festivals": "2.4",
|
|
27
|
-
"Cultureel festival": "2.4.1",
|
|
28
|
-
"Filmfestival": "2.4.2",
|
|
29
|
-
"Muziekfestival": "2.4.3",
|
|
30
|
-
"Theaterfestival": "2.4.4",
|
|
31
|
-
"Jeugdfestival": "2.4.5",
|
|
32
|
-
"Festival": "2.4.7",
|
|
33
|
-
"Dancefestival": "2.4.8",
|
|
34
|
-
"Muziek": "2.6",
|
|
35
|
-
"Dance": "2.6.1",
|
|
36
|
-
"Jazz of Wereldmuziek": "2.6.2",
|
|
37
|
-
"Klassieke muziek": "2.6.3",
|
|
38
|
-
"Lichte muziek": "2.6.4",
|
|
39
|
-
"Pop en Rock": "2.6.5",
|
|
40
|
-
"R&B en Soul": "2.6.6",
|
|
41
|
-
"Muziek overig": "2.6.8",
|
|
42
|
-
"Gezelschap/orkest": "2.6.9",
|
|
43
|
-
"Theater": "2.9",
|
|
44
|
-
"Cabaret": "2.9.1",
|
|
45
|
-
"Dans en Ballet": "2.9.2",
|
|
46
|
-
"Jeugdtheater": "2.9.3",
|
|
47
|
-
"Musical of Show": "2.9.4",
|
|
48
|
-
"Opera": "2.9.5",
|
|
49
|
-
"Theater en Toneel": "2.9.6",
|
|
50
|
-
"Tentoonstellingen": "2.12",
|
|
51
|
-
"Tentoonstelling": "2.3.14"
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
module.exports = { categories };
|
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
const StringUtils = require('../../util/StringUtils'); // Import StringUtils voor validaties
|
|
2
|
-
|
|
3
|
-
class Contactinfo {
|
|
4
|
-
constructor({
|
|
5
|
-
label = '',
|
|
6
|
-
mails = [],
|
|
7
|
-
phones = [],
|
|
8
|
-
faxes = [],
|
|
9
|
-
urls = [],
|
|
10
|
-
addresses = [],
|
|
11
|
-
mail = null,
|
|
12
|
-
phone = null,
|
|
13
|
-
fax = null,
|
|
14
|
-
address = null
|
|
15
|
-
} = {}) {
|
|
16
|
-
this.label = label;
|
|
17
|
-
this.mails = mails.map(mail => new Contactinfo.Mail(mail));
|
|
18
|
-
this.phones = phones.map(phone => new Contactinfo.Phone(phone));
|
|
19
|
-
this.faxes = faxes.map(fax => new Contactinfo.Fax(fax));
|
|
20
|
-
this.urls = urls.map(url => new Contactinfo.Url(url));
|
|
21
|
-
this.addresses = addresses.map(address => new Contactinfo.Address(address));
|
|
22
|
-
this.mail = mail ? new Contactinfo.Mail(mail) : null;
|
|
23
|
-
this.phone = phone ? new Contactinfo.Phone(phone) : null;
|
|
24
|
-
this.fax = fax ? new Contactinfo.Fax(fax) : null;
|
|
25
|
-
this.address = address ? new Contactinfo.Address(address) : null;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Converteert naar V1 formaat.
|
|
30
|
-
*/
|
|
31
|
-
convertToV1() {
|
|
32
|
-
if (this.mails.length && (!this.mail || this.mail.isEmpty())) {
|
|
33
|
-
this.mail = this.mails[0];
|
|
34
|
-
}
|
|
35
|
-
if (this.addresses.length && (!this.address || this.address.isEmpty())) {
|
|
36
|
-
this.address = this.addresses[0];
|
|
37
|
-
}
|
|
38
|
-
if (this.faxes.length && (!this.fax || this.fax.isEmpty())) {
|
|
39
|
-
this.fax = this.faxes[0];
|
|
40
|
-
}
|
|
41
|
-
if (this.phones.length && (!this.phone || this.phone.isEmpty())) {
|
|
42
|
-
this.phone = this.phones[0];
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Converteert naar V2 formaat.
|
|
48
|
-
*/
|
|
49
|
-
convertToV2() {
|
|
50
|
-
this.mails = this.mail ? [this.mail] : [];
|
|
51
|
-
this.addresses = this.address ? [this.address] : [];
|
|
52
|
-
this.faxes = this.fax ? [this.fax] : [];
|
|
53
|
-
this.phones = this.phone ? [this.phone] : [];
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Subklasse: Mail
|
|
59
|
-
*/
|
|
60
|
-
Contactinfo.Mail = class Mail {
|
|
61
|
-
constructor({
|
|
62
|
-
email = '',
|
|
63
|
-
descriptioncode = '',
|
|
64
|
-
reservations = false,
|
|
65
|
-
descriptionTranslations = []
|
|
66
|
-
} = {}) {
|
|
67
|
-
this.email = email;
|
|
68
|
-
this.descriptioncode = descriptioncode;
|
|
69
|
-
this.reservations = reservations;
|
|
70
|
-
this.descriptionTranslations = descriptionTranslations.map(
|
|
71
|
-
translation => new Contactinfo.DescriptionTranslation(translation)
|
|
72
|
-
);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
isEmpty() {
|
|
76
|
-
return StringUtils.isEmpty(this.email);
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Subklasse: Phone
|
|
82
|
-
*/
|
|
83
|
-
Contactinfo.Phone = class Phone {
|
|
84
|
-
constructor({
|
|
85
|
-
number = '',
|
|
86
|
-
descriptioncode = '',
|
|
87
|
-
reservations = false,
|
|
88
|
-
descriptionTranslations = []
|
|
89
|
-
} = {}) {
|
|
90
|
-
this.number = number;
|
|
91
|
-
this.descriptioncode = descriptioncode;
|
|
92
|
-
this.reservations = reservations;
|
|
93
|
-
this.descriptionTranslations = descriptionTranslations.map(
|
|
94
|
-
translation => new Contactinfo.DescriptionTranslation(translation)
|
|
95
|
-
);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
isEmpty() {
|
|
99
|
-
return StringUtils.isEmpty(this.number);
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Subklasse: Fax
|
|
105
|
-
*/
|
|
106
|
-
Contactinfo.Fax = class Fax {
|
|
107
|
-
constructor({
|
|
108
|
-
number = '',
|
|
109
|
-
descriptioncode = '',
|
|
110
|
-
reservations = false,
|
|
111
|
-
descriptionTranslations = []
|
|
112
|
-
} = {}) {
|
|
113
|
-
this.number = number;
|
|
114
|
-
this.descriptioncode = descriptioncode;
|
|
115
|
-
this.reservations = reservations;
|
|
116
|
-
this.descriptionTranslations = descriptionTranslations.map(
|
|
117
|
-
translation => new Contactinfo.DescriptionTranslation(translation)
|
|
118
|
-
);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
isEmpty() {
|
|
122
|
-
return StringUtils.isEmpty(this.number);
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* Subklasse: Url
|
|
128
|
-
*/
|
|
129
|
-
Contactinfo.Url = class Url {
|
|
130
|
-
constructor({
|
|
131
|
-
url = null,
|
|
132
|
-
descriptioncode = '',
|
|
133
|
-
targetLanguage = '',
|
|
134
|
-
reservations = false,
|
|
135
|
-
urlServiceType = null,
|
|
136
|
-
descriptionTranslations = []
|
|
137
|
-
} = {}) {
|
|
138
|
-
this.url = url;
|
|
139
|
-
this.descriptioncode = descriptioncode;
|
|
140
|
-
this.targetLanguage = targetLanguage;
|
|
141
|
-
this.reservations = reservations;
|
|
142
|
-
this.urlServiceType = urlServiceType;
|
|
143
|
-
this.descriptionTranslations = descriptionTranslations.map(
|
|
144
|
-
translation => new Contactinfo.DescriptionTranslation(translation)
|
|
145
|
-
);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
isEmpty() {
|
|
149
|
-
return this.url === null;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
static getTypeFromString(type) {
|
|
153
|
-
if (!Contactinfo.Url.URLServiceType[type]) {
|
|
154
|
-
throw new Error(`No enum found with type: ${type}`);
|
|
155
|
-
}
|
|
156
|
-
return Contactinfo.Url.URLServiceType[type];
|
|
157
|
-
}
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* Enum: URLServiceType
|
|
162
|
-
*/
|
|
163
|
-
Contactinfo.Url.URLServiceType = {
|
|
164
|
-
general: 'general',
|
|
165
|
-
booking: 'booking',
|
|
166
|
-
review: 'review',
|
|
167
|
-
video: 'video',
|
|
168
|
-
webshop: 'webshop',
|
|
169
|
-
socialmedia: 'socialmedia',
|
|
170
|
-
lastminute: 'lastminute',
|
|
171
|
-
virtualtour: 'virtualtour',
|
|
172
|
-
dmo: 'dmo',
|
|
173
|
-
sustainability: 'sustainability',
|
|
174
|
-
venuefinder: 'venuefinder',
|
|
175
|
-
travelbase: 'travelbase'
|
|
176
|
-
};
|
|
177
|
-
|
|
178
|
-
/**
|
|
179
|
-
* Subklasse: DescriptionTranslation
|
|
180
|
-
*/
|
|
181
|
-
Contactinfo.DescriptionTranslation = class DescriptionTranslation {
|
|
182
|
-
constructor({ lang = '', label = '' } = {}) {
|
|
183
|
-
this.lang = lang;
|
|
184
|
-
this.label = label;
|
|
185
|
-
}
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
-
module.exports = Contactinfo;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
class ExtraPriceInformation {
|
|
2
|
-
constructor({ lang = '', text = '' } = {}) {
|
|
3
|
-
this.lang = lang;
|
|
4
|
-
this.text = text;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Controleert of de velden leeg zijn.
|
|
9
|
-
* @returns {boolean}
|
|
10
|
-
*/
|
|
11
|
-
isEmpty() {
|
|
12
|
-
return !this.lang && !this.text;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
module.exports = ExtraPriceInformation;
|