@eventconnectors/ndtrc_model 1.0.6 → 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 +52 -11
- 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 -31
- 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/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
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
class PriceElement {
|
|
2
|
-
constructor({
|
|
3
|
-
freeentrance = false,
|
|
4
|
-
priceValue = null,
|
|
5
|
-
description = null,
|
|
6
|
-
comments = [],
|
|
7
|
-
extraPriceInformations = []
|
|
8
|
-
} = {}) {
|
|
9
|
-
this.freeentrance = freeentrance;
|
|
10
|
-
this.priceValue = priceValue ? new PriceElement.PriceValue(priceValue) : null;
|
|
11
|
-
this.description = description ? new PriceElement.Description(description) : null;
|
|
12
|
-
this.comments = comments.map(comment => new PriceElement.Comment(comment));
|
|
13
|
-
this.extraPriceInformations = extraPriceInformations.map(
|
|
14
|
-
info => new PriceElement.ExtraPriceInformation(info)
|
|
15
|
-
);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
PriceElement.Description = class Description {
|
|
20
|
-
constructor({ value = null, descriptionTranslations = [] } = {}) {
|
|
21
|
-
this.value = value;
|
|
22
|
-
this.descriptionTranslations = descriptionTranslations.map(
|
|
23
|
-
translation => new PriceElement.Description.DescriptionTranslation(translation)
|
|
24
|
-
);
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
PriceElement.Description.PriceDescriptionValue = {
|
|
29
|
-
Adults: 'Adults',
|
|
30
|
-
Children: 'Children',
|
|
31
|
-
Groups: 'Groups',
|
|
32
|
-
CJP: 'CJP',
|
|
33
|
-
Pasholders: 'Pasholders',
|
|
34
|
-
Lastminute: 'Lastminute'
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
PriceElement.Description.DescriptionTranslation = class DescriptionTranslation {
|
|
38
|
-
constructor({ lang = '', text = '' } = {}) {
|
|
39
|
-
this.lang = lang;
|
|
40
|
-
this.text = text;
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
PriceElement.ExtraPriceInformation = class ExtraPriceInformation {
|
|
45
|
-
constructor({ lang = '', text = '' } = {}) {
|
|
46
|
-
this.lang = lang;
|
|
47
|
-
this.text = text;
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
PriceElement.PriceValue = class PriceValue {
|
|
52
|
-
constructor({ from = null, until = null } = {}) {
|
|
53
|
-
this.from = from;
|
|
54
|
-
this.until = until;
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
PriceElement.Comment = class Comment {
|
|
59
|
-
constructor({ text = '' } = {}) {
|
|
60
|
-
this.text = text;
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
module.exports = PriceElement;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
const moment = require('moment');
|
|
2
|
-
const Contactinfo = require('./ContactInfo');
|
|
3
|
-
const Calendar = require('./Calendar');
|
|
4
|
-
|
|
5
|
-
class Promotion {
|
|
6
|
-
constructor({
|
|
7
|
-
product = '',
|
|
8
|
-
promotionType = null,
|
|
9
|
-
discount = null,
|
|
10
|
-
translations = [],
|
|
11
|
-
detailsUrls = [],
|
|
12
|
-
startDate = null,
|
|
13
|
-
endDate = null,
|
|
14
|
-
enabled = true,
|
|
15
|
-
opens = []
|
|
16
|
-
} = {}) {
|
|
17
|
-
this.product = product;
|
|
18
|
-
this.promotionType = promotionType;
|
|
19
|
-
this.discount = discount ? new Promotion.Discount(discount) : null;
|
|
20
|
-
this.translations = translations.map(translation => new Promotion.PromotionTranslation(translation));
|
|
21
|
-
this.detailsUrls = detailsUrls.map(url => new Contactinfo.Url(url));
|
|
22
|
-
this.startDate = startDate ? moment(startDate) : null;
|
|
23
|
-
this.endDate = endDate ? moment(endDate) : null;
|
|
24
|
-
this.enabled = enabled;
|
|
25
|
-
this.opens = opens.map(open => new Calendar.PatternDate.Open(open));
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
Promotion.Discount = class Discount {
|
|
30
|
-
constructor({ free = false, percentage = null, amount = null } = {}) {
|
|
31
|
-
this.free = free;
|
|
32
|
-
this.percentage = percentage;
|
|
33
|
-
this.amount = amount;
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
Promotion.PromotionTranslation = class PromotionTranslation {
|
|
38
|
-
constructor({ lang = '', description = '' } = {}) {
|
|
39
|
-
this.lang = lang;
|
|
40
|
-
this.description = description;
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
Promotion.PromotionType = {
|
|
45
|
-
free: 'free',
|
|
46
|
-
discount: 'discount',
|
|
47
|
-
gift: 'gift',
|
|
48
|
-
allowance: 'allowance'
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
module.exports = Promotion;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
const Address = require('./Address');
|
|
2
|
-
|
|
3
|
-
class RouteInfo {
|
|
4
|
-
constructor({
|
|
5
|
-
type = null,
|
|
6
|
-
url = '',
|
|
7
|
-
distanceInKilometers = null,
|
|
8
|
-
durationInMinutes = null,
|
|
9
|
-
start = null,
|
|
10
|
-
end = null
|
|
11
|
-
} = {}) {
|
|
12
|
-
this.type = type;
|
|
13
|
-
this.url = url;
|
|
14
|
-
this.distanceInKilometers = distanceInKilometers;
|
|
15
|
-
this.durationInMinutes = durationInMinutes;
|
|
16
|
-
this.start = start ? new Address(start) : null;
|
|
17
|
-
this.end = end ? new Address(end) : null;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
static Type = {
|
|
21
|
-
ROUTE_MAKER: 'route_maker',
|
|
22
|
-
ROUTE_IQ: 'route_iq',
|
|
23
|
-
ODP_ROUTES: 'odp_routes',
|
|
24
|
-
|
|
25
|
-
fromString(type) {
|
|
26
|
-
if (Object.values(RouteInfo.Type).includes(type)) {
|
|
27
|
-
return type;
|
|
28
|
-
}
|
|
29
|
-
throw new Error(`Invalid Type: ${type}`);
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
module.exports = RouteInfo;
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
class SubItemGroup {
|
|
2
|
-
constructor({
|
|
3
|
-
trcid = '',
|
|
4
|
-
type = null,
|
|
5
|
-
categories = [],
|
|
6
|
-
subItemTranslations = [],
|
|
7
|
-
media = []
|
|
8
|
-
} = {}) {
|
|
9
|
-
this.trcid = trcid;
|
|
10
|
-
this.type = type ? new SubItemGroup.Type(type) : null;
|
|
11
|
-
this.categories = categories.map(category => new SubItemGroup.Category(category));
|
|
12
|
-
this.subItemTranslations = subItemTranslations.map(
|
|
13
|
-
translation => new SubItemGroup.SubItemTranslation(translation)
|
|
14
|
-
);
|
|
15
|
-
this.media = media.map(file => new File(file));
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
cleanEmptyItems() {
|
|
19
|
-
this.categories = this.categories.filter(category => {
|
|
20
|
-
const dataType = category.datatype?.toLowerCase();
|
|
21
|
-
if (dataType === 'freetext' && !category.value) return false;
|
|
22
|
-
if (['multichoice', 'choice'].includes(dataType) && !category.valueid) return false;
|
|
23
|
-
return true;
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
SubItemGroup.SubItemTranslation = class SubItemTranslation {
|
|
29
|
-
constructor({ lang = '', title = '' } = {}) {
|
|
30
|
-
this.lang = lang;
|
|
31
|
-
this.title = title;
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
SubItemGroup.Type = class Type {
|
|
36
|
-
constructor({ catid = '', isDefault = false, categoryTranslations = [] } = {}) {
|
|
37
|
-
this.catid = catid;
|
|
38
|
-
this.isDefault = isDefault;
|
|
39
|
-
this.categoryTranslations = categoryTranslations.map(
|
|
40
|
-
translation => new SubItemGroup.CategoryTranslation(translation)
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
SubItemGroup.Category = class Category {
|
|
46
|
-
constructor({
|
|
47
|
-
catid = '',
|
|
48
|
-
valueid = '',
|
|
49
|
-
value = '',
|
|
50
|
-
datatype = '',
|
|
51
|
-
categoryvalues = [],
|
|
52
|
-
categoryTranslations = [],
|
|
53
|
-
parentCategoryTranslations = [],
|
|
54
|
-
valueCategoryTranslations = []
|
|
55
|
-
} = {}) {
|
|
56
|
-
this.catid = catid;
|
|
57
|
-
this.valueid = valueid;
|
|
58
|
-
this.value = value;
|
|
59
|
-
this.datatype = datatype;
|
|
60
|
-
this.categoryvalues = categoryvalues.map(
|
|
61
|
-
value => new SubItemGroup.CategoryValue(value)
|
|
62
|
-
);
|
|
63
|
-
this.categoryTranslations = categoryTranslations.map(
|
|
64
|
-
translation => new SubItemGroup.CategoryTranslation(translation)
|
|
65
|
-
);
|
|
66
|
-
this.parentCategoryTranslations = parentCategoryTranslations.map(
|
|
67
|
-
translation => new SubItemGroup.CategoryTranslation(translation)
|
|
68
|
-
);
|
|
69
|
-
this.valueCategoryTranslations = valueCategoryTranslations.map(
|
|
70
|
-
translation => new SubItemGroup.CategoryTranslation(translation)
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
SubItemGroup.CategoryValue = class CategoryValue {
|
|
76
|
-
constructor({ catid = '', categorytranslations = [] } = {}) {
|
|
77
|
-
this.catid = catid;
|
|
78
|
-
this.categorytranslations = categorytranslations.map(
|
|
79
|
-
translation => new SubItemGroup.CategoryTranslation(translation)
|
|
80
|
-
);
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
SubItemGroup.CategoryTranslation = class CategoryTranslation {
|
|
85
|
-
constructor({
|
|
86
|
-
catid = '',
|
|
87
|
-
lang = '',
|
|
88
|
-
label = '',
|
|
89
|
-
unit = '',
|
|
90
|
-
value = '',
|
|
91
|
-
explanation = ''
|
|
92
|
-
} = {}) {
|
|
93
|
-
this.catid = catid;
|
|
94
|
-
this.lang = lang;
|
|
95
|
-
this.label = label;
|
|
96
|
-
this.unit = unit;
|
|
97
|
-
this.value = value;
|
|
98
|
-
this.explanation = explanation;
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
module.exports = SubItemGroup;
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
const moment = require('moment');
|
|
2
|
-
const Calendar = require('./Calendar');
|
|
3
|
-
const Contactinfo = require('./ContactInfo');
|
|
4
|
-
const TRCItemCategories = require('./TRCItemCategories');
|
|
5
|
-
const Performer = require('./Performer');
|
|
6
|
-
const File = require('./File');
|
|
7
|
-
const TRCItemDetail = require('./TRCItemDetail');
|
|
8
|
-
const TrcitemRelation = require('./TRCItemRelation');
|
|
9
|
-
const Location = require('./Location');
|
|
10
|
-
const PriceElement = require('./PriceElement');
|
|
11
|
-
const ExtraPriceInformation = require('./ExtraPriceInformation');
|
|
12
|
-
const RouteInfo = require('./RouteInfo');
|
|
13
|
-
const Translations = require('./Translations');
|
|
14
|
-
const Promotion = require('./Promotion');
|
|
15
|
-
|
|
16
|
-
class TRCItem {
|
|
17
|
-
constructor({
|
|
18
|
-
trcid = '',
|
|
19
|
-
creationdate = null,
|
|
20
|
-
availablefrom = null,
|
|
21
|
-
availableto = null,
|
|
22
|
-
lastupdated = null,
|
|
23
|
-
lastimportedon = null,
|
|
24
|
-
createdby = '',
|
|
25
|
-
lastupdatedby = '',
|
|
26
|
-
owner = '',
|
|
27
|
-
legalowner = '',
|
|
28
|
-
externalid = '',
|
|
29
|
-
slug = '',
|
|
30
|
-
validator = '',
|
|
31
|
-
validatedby = null,
|
|
32
|
-
wfstatus = null,
|
|
33
|
-
cidn = '',
|
|
34
|
-
published = false,
|
|
35
|
-
deleted = false,
|
|
36
|
-
offline = null,
|
|
37
|
-
isprivate = null,
|
|
38
|
-
entitytype = null,
|
|
39
|
-
productiontrcid = '',
|
|
40
|
-
calendar = null,
|
|
41
|
-
contactinfo = null,
|
|
42
|
-
trcItemCategories = null,
|
|
43
|
-
performers = [],
|
|
44
|
-
files = [],
|
|
45
|
-
trcItemDetails = [],
|
|
46
|
-
trcitemRelation = null,
|
|
47
|
-
keywords = '',
|
|
48
|
-
markers = '',
|
|
49
|
-
location = null,
|
|
50
|
-
locationRef = '',
|
|
51
|
-
userorganisation = '',
|
|
52
|
-
priceElements = [],
|
|
53
|
-
extrapriceinformations = [],
|
|
54
|
-
routeInfo = null,
|
|
55
|
-
translations = null,
|
|
56
|
-
promotions = [],
|
|
57
|
-
forceOverwrite = false
|
|
58
|
-
} = {}) {
|
|
59
|
-
this.trcid = trcid;
|
|
60
|
-
this.creationdate = creationdate ? moment(creationdate) : null;
|
|
61
|
-
this.availablefrom = availablefrom ? moment(availablefrom) : null;
|
|
62
|
-
this.availableto = availableto ? moment(availableto) : null;
|
|
63
|
-
this.lastupdated = lastupdated ? moment(lastupdated) : null;
|
|
64
|
-
this.lastimportedon = lastimportedon ? moment(lastimportedon) : null;
|
|
65
|
-
this.createdby = createdby;
|
|
66
|
-
this.lastupdatedby = lastupdatedby;
|
|
67
|
-
this.owner = owner;
|
|
68
|
-
this.legalowner = legalowner;
|
|
69
|
-
this.externalid = externalid;
|
|
70
|
-
this.slug = slug;
|
|
71
|
-
this.validator = validator;
|
|
72
|
-
this.validatedby = validatedby;
|
|
73
|
-
this.wfstatus = wfstatus;
|
|
74
|
-
this.cidn = cidn;
|
|
75
|
-
this.published = published;
|
|
76
|
-
this.deleted = deleted;
|
|
77
|
-
this.offline = offline;
|
|
78
|
-
this.isprivate = isprivate;
|
|
79
|
-
this.entitytype = entitytype;
|
|
80
|
-
this.productiontrcid = productiontrcid;
|
|
81
|
-
this.calendar = calendar ? new Calendar(calendar) : null;
|
|
82
|
-
this.contactinfo = contactinfo ? new Contactinfo(contactinfo) : null;
|
|
83
|
-
this.trcItemCategories = trcItemCategories ? new TRCItemCategories(trcItemCategories) : null;
|
|
84
|
-
this.performers = performers.map(performer => new Performer(performer));
|
|
85
|
-
this.files = files.map(file => new File(file));
|
|
86
|
-
this.trcItemDetails = trcItemDetails.map(detail => new TRCItemDetail(detail));
|
|
87
|
-
this.trcitemRelation = trcitemRelation ? new TrcitemRelation(trcitemRelation) : null;
|
|
88
|
-
this.keywords = keywords;
|
|
89
|
-
this.markers = markers;
|
|
90
|
-
this.location = location ? new Location(location) : null;
|
|
91
|
-
this.locationRef = locationRef;
|
|
92
|
-
this.userorganisation = userorganisation;
|
|
93
|
-
this.priceElements = priceElements.map(element => new PriceElement(element));
|
|
94
|
-
this.extrapriceinformations = extrapriceinformations.map(
|
|
95
|
-
info => new ExtraPriceInformation(info)
|
|
96
|
-
);
|
|
97
|
-
this.routeInfo = routeInfo ? new RouteInfo(routeInfo) : null;
|
|
98
|
-
this.translations = translations ? new Translations(translations) : new Translations();
|
|
99
|
-
this.promotions = promotions.map(promotion => new Promotion(promotion));
|
|
100
|
-
this.forceOverwrite = forceOverwrite;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
TRCItem.WFStatus = {
|
|
105
|
-
DRAFT: 'draft',
|
|
106
|
-
READY_FOR_VALIDATION: 'readyforvalidation',
|
|
107
|
-
APPROVED: 'approved',
|
|
108
|
-
REJECTED: 'rejected',
|
|
109
|
-
DELETED: 'deleted',
|
|
110
|
-
ARCHIVED: 'archived'
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
TRCItem.EntityType = {
|
|
114
|
-
EVENEMENT: 'EVENEMENT',
|
|
115
|
-
LOCATIE: 'LOCATIE',
|
|
116
|
-
EVENEMENTGROEP: 'EVENEMENTGROEP',
|
|
117
|
-
PLAATSREGIO: 'PLAATSREGIO',
|
|
118
|
-
ROUTE: 'ROUTE',
|
|
119
|
-
VENUE: 'VENUE'
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
TRCItem.Category = class Category {
|
|
123
|
-
constructor({ id = '', translations = [] } = {}) {
|
|
124
|
-
this.id = id;
|
|
125
|
-
this.translations = translations.map(translation => new TRCItem.Category.Translation(translation));
|
|
126
|
-
}
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
TRCItem.Category.Translation = class Translation {
|
|
130
|
-
constructor({ lang = '', text = '' } = {}) {
|
|
131
|
-
this.lang = lang;
|
|
132
|
-
this.text = text;
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
module.exports = TRCItem;
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
const StringUtils = require('../../util/StringUtils'); // Import StringUtils voor validaties
|
|
2
|
-
|
|
3
|
-
class TRCItemCategories {
|
|
4
|
-
constructor({ types = [], categories = [], soldout = null, canceled = null } = {}) {
|
|
5
|
-
this.types = types.map(type => new TRCItemCategories.Type(type));
|
|
6
|
-
this.categories = categories.map(category => new TRCItemCategories.Category(category));
|
|
7
|
-
this.soldout = soldout;
|
|
8
|
-
this.canceled = canceled;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
cleanEmptyItems() {
|
|
12
|
-
this.categories = this.categories.filter(category => {
|
|
13
|
-
if (!category || StringUtils.isEmpty(category.catid)) return false;
|
|
14
|
-
|
|
15
|
-
const dataType = category.datatype?.toLowerCase();
|
|
16
|
-
if (dataType === 'freetext' && !category.value) return false;
|
|
17
|
-
if (dataType === 'multichoice' && !category.categoryvalues.length) return false;
|
|
18
|
-
if (dataType === 'choice' && !category.valueid) return false;
|
|
19
|
-
|
|
20
|
-
return true;
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
this.types = this.types.filter(type => type && !StringUtils.isEmpty(type.catid));
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
TRCItemCategories.Type = class Type {
|
|
28
|
-
constructor({ catid = '', isDefault = false, categoryTranslations = [] } = {}) {
|
|
29
|
-
this.catid = catid;
|
|
30
|
-
this.isDefault = isDefault;
|
|
31
|
-
this.categoryTranslations = categoryTranslations.map(
|
|
32
|
-
translation => new TRCItemCategories.CategoryTranslation(translation)
|
|
33
|
-
);
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
TRCItemCategories.Category = class Category {
|
|
38
|
-
constructor({
|
|
39
|
-
catid = '',
|
|
40
|
-
valueid = '',
|
|
41
|
-
value = '',
|
|
42
|
-
datatype = '',
|
|
43
|
-
categoryvalues = [],
|
|
44
|
-
categoryTranslations = [],
|
|
45
|
-
parentCategoryTranslations = [],
|
|
46
|
-
valueCategoryTranslations = []
|
|
47
|
-
} = {}) {
|
|
48
|
-
this.catid = catid;
|
|
49
|
-
this.valueid = valueid;
|
|
50
|
-
this.value = value;
|
|
51
|
-
this.datatype = datatype;
|
|
52
|
-
this.categoryvalues = categoryvalues.map(
|
|
53
|
-
value => new TRCItemCategories.CategoryValue(value)
|
|
54
|
-
);
|
|
55
|
-
this.categoryTranslations = categoryTranslations.map(
|
|
56
|
-
translation => new TRCItemCategories.CategoryTranslation(translation)
|
|
57
|
-
);
|
|
58
|
-
this.parentCategoryTranslations = parentCategoryTranslations.map(
|
|
59
|
-
translation => new TRCItemCategories.CategoryTranslation(translation)
|
|
60
|
-
);
|
|
61
|
-
this.valueCategoryTranslations = valueCategoryTranslations.map(
|
|
62
|
-
translation => new TRCItemCategories.CategoryTranslation(translation)
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
TRCItemCategories.Category.DataType = {
|
|
68
|
-
YESNO: 'yesno',
|
|
69
|
-
NULLABLE_YESNO: 'nullableyesno',
|
|
70
|
-
CHOICE: 'choice',
|
|
71
|
-
MULTICHOICE: 'multichoice',
|
|
72
|
-
FREETEXT: 'freetext',
|
|
73
|
-
INTEGER: 'integer',
|
|
74
|
-
DECIMAL: 'decimal',
|
|
75
|
-
DATE: 'date'
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
TRCItemCategories.CategoryValue = class CategoryValue {
|
|
79
|
-
constructor({ catid = '', categorytranslations = [] } = {}) {
|
|
80
|
-
this.catid = catid;
|
|
81
|
-
this.categorytranslations = categorytranslations.map(
|
|
82
|
-
translation => new TRCItemCategories.CategoryTranslation(translation)
|
|
83
|
-
);
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
TRCItemCategories.CategoryTranslation = class CategoryTranslation {
|
|
88
|
-
constructor({
|
|
89
|
-
catid = '',
|
|
90
|
-
lang = '',
|
|
91
|
-
label = '',
|
|
92
|
-
unit = '',
|
|
93
|
-
value = '',
|
|
94
|
-
explanation = ''
|
|
95
|
-
} = {}) {
|
|
96
|
-
this.catid = catid;
|
|
97
|
-
this.lang = lang;
|
|
98
|
-
this.label = label;
|
|
99
|
-
this.unit = unit;
|
|
100
|
-
this.value = value;
|
|
101
|
-
this.explanation = explanation;
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
module.exports = TRCItemCategories;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
class TRCItemDetail {
|
|
2
|
-
constructor({ lang = '', longdescription = '', shortdescription = '', title = '' } = {}) {
|
|
3
|
-
this.lang = lang;
|
|
4
|
-
this.longdescription = longdescription;
|
|
5
|
-
this.shortdescription = shortdescription;
|
|
6
|
-
this.title = title;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
module.exports = TRCItemDetail;
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
const moment = require('moment');
|
|
2
|
-
const Calendar = require('./Calendar');
|
|
3
|
-
const Contactinfo = require('./ContactInfo');
|
|
4
|
-
const TRCItemCategories = require('./TRCItemCategories');
|
|
5
|
-
const File = require('./File');
|
|
6
|
-
const TRCItemDetail = require('./TRCItemDetail');
|
|
7
|
-
const PriceElement = require('./PriceElement');
|
|
8
|
-
const Translations = require('./Translations');
|
|
9
|
-
const Promotion = require('./Promotion');
|
|
10
|
-
const TRCItem = require('./TRCItem');
|
|
11
|
-
|
|
12
|
-
class TRCItemGroup {
|
|
13
|
-
constructor({
|
|
14
|
-
trcid = '',
|
|
15
|
-
creationdate = null,
|
|
16
|
-
availablefrom = null,
|
|
17
|
-
availableto = null,
|
|
18
|
-
lastupdated = null,
|
|
19
|
-
lastimportedon = null,
|
|
20
|
-
createdby = '',
|
|
21
|
-
lastupdatedby = '',
|
|
22
|
-
owner = '',
|
|
23
|
-
legalowner = '',
|
|
24
|
-
externalid = '',
|
|
25
|
-
validator = '',
|
|
26
|
-
wfstatus = null,
|
|
27
|
-
calendar = null,
|
|
28
|
-
contactinfo = null,
|
|
29
|
-
trcItemCategories = null,
|
|
30
|
-
files = [],
|
|
31
|
-
trcItemDetails = [],
|
|
32
|
-
keywords = '',
|
|
33
|
-
markers = '',
|
|
34
|
-
userorganisation = '',
|
|
35
|
-
priceElements = [],
|
|
36
|
-
translations = null,
|
|
37
|
-
promotions = [],
|
|
38
|
-
eventLinks = []
|
|
39
|
-
} = {}) {
|
|
40
|
-
this.trcid = trcid;
|
|
41
|
-
this.creationdate = creationdate ? moment(creationdate) : null;
|
|
42
|
-
this.availablefrom = availablefrom ? moment(availablefrom) : null;
|
|
43
|
-
this.availableto = availableto ? moment(availableto) : null;
|
|
44
|
-
this.lastupdated = lastupdated ? moment(lastupdated) : null;
|
|
45
|
-
this.lastimportedon = lastimportedon ? moment(lastimportedon) : null;
|
|
46
|
-
this.createdby = createdby;
|
|
47
|
-
this.lastupdatedby = lastupdatedby;
|
|
48
|
-
this.owner = owner;
|
|
49
|
-
this.legalowner = legalowner;
|
|
50
|
-
this.externalid = externalid;
|
|
51
|
-
this.validator = validator;
|
|
52
|
-
this.wfstatus = wfstatus;
|
|
53
|
-
this.calendar = calendar ? new Calendar(calendar) : null;
|
|
54
|
-
this.contactinfo = contactinfo ? new Contactinfo(contactinfo) : null;
|
|
55
|
-
this.trcItemCategories = trcItemCategories ? new TRCItemCategories(trcItemCategories) : null;
|
|
56
|
-
this.files = files.map(file => new File(file));
|
|
57
|
-
this.trcItemDetails = trcItemDetails.map(detail => new TRCItemDetail(detail));
|
|
58
|
-
this.keywords = keywords;
|
|
59
|
-
this.markers = markers;
|
|
60
|
-
this.userorganisation = userorganisation;
|
|
61
|
-
this.priceElements = priceElements.map(element => new PriceElement(element));
|
|
62
|
-
this.translations = translations ? new Translations(translations) : new Translations();
|
|
63
|
-
this.promotions = promotions.map(promotion => new Promotion(promotion));
|
|
64
|
-
this.eventLinks = eventLinks.map(link => new TRCItemGroup.EventLink(link));
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
TRCItemGroup.EventLink = class EventLink {
|
|
69
|
-
constructor({ eventId = '' } = {}) {
|
|
70
|
-
this.eventId = eventId;
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
module.exports = TRCItemGroup;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
const SubItemGroup = require('./SubItemGroup');
|
|
2
|
-
|
|
3
|
-
class TrcitemRelation {
|
|
4
|
-
constructor({ subItemGroups = [] } = {}) {
|
|
5
|
-
this.subItemGroups = subItemGroups.map(group => new SubItemGroup(group));
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
cleanEmptyItems() {
|
|
9
|
-
this.subItemGroups.forEach(group => group.cleanEmptyItems());
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
module.exports = TrcitemRelation;
|
package/src/model/ndtrc/enums.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
// enums.js
|
|
2
|
-
|
|
3
|
-
const Status = Object.freeze({
|
|
4
|
-
NORMAL: 'normal',
|
|
5
|
-
CANCELLED: 'cancelled',
|
|
6
|
-
SOLDOUT: 'soldout',
|
|
7
|
-
MOVEDTO: 'movedto',
|
|
8
|
-
PREMIERE: 'premiere',
|
|
9
|
-
REPPRISE: 'reprise',
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
const CalendarType = Object.freeze({
|
|
13
|
-
NONE: 'NONE',
|
|
14
|
-
ALWAYSOPEN: 'ALWAYSOPEN',
|
|
15
|
-
ONREQUEST: 'ONREQUEST',
|
|
16
|
-
OPENINGTIMES: 'OPENINGTIMES',
|
|
17
|
-
PATTERNDATES: 'PATTERNDATES',
|
|
18
|
-
SINGLEDATES: 'SINGLEDATES',
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
const RecurrencyType = Object.freeze({
|
|
22
|
-
DAILY: 'daily',
|
|
23
|
-
WEEKLY: 'weekly',
|
|
24
|
-
MONTHLY_SIMPLE: 'monthlySimple',
|
|
25
|
-
MONTHLY_COMPLEX: 'monthlyComplex',
|
|
26
|
-
YEARLY: 'yearly',
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
module.exports = {
|
|
30
|
-
Status,
|
|
31
|
-
CalendarType,
|
|
32
|
-
RecurrencyType,
|
|
33
|
-
};
|
|
File without changes
|
|
File without changes
|