@intelact/bright 0.9.104 → 0.9.105

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,6 +2,16 @@ import { Post } from '../post/post.model';
2
2
  import { Metric } from '../metric/metric.model';
3
3
  import { User } from '../user/user.model';
4
4
  import { StatusLabel, StatusType } from '../common';
5
+ import { Item } from '../item';
6
+ import { Context } from '../ui';
7
+ export interface IBoostAuthorisation {
8
+ edit: boolean;
9
+ publish: boolean;
10
+ unpublish: boolean;
11
+ end: boolean;
12
+ delete: boolean;
13
+ isValid: boolean;
14
+ }
5
15
  export declare class Boost {
6
16
  id: number;
7
17
  title: string;
@@ -22,4 +32,10 @@ export declare class Boost {
22
32
  get totalLikes(): Metric;
23
33
  get totalShares(): Metric;
24
34
  get totalDownloads(): Metric;
35
+ authorisation: IBoostAuthorisation;
36
+ validators: Item<boolean>[];
37
+ setValidators(): void;
38
+ validate(): void;
39
+ get statusContext(): Context;
40
+ get labelContext(): Context;
25
41
  }
@@ -17,6 +17,8 @@ const user_model_1 = require("../user/user.model");
17
17
  const common_1 = require("../common");
18
18
  const metric_1 = require("../metric");
19
19
  const user_1 = require("../user");
20
+ const item_1 = require("../item");
21
+ const ui_1 = require("../ui");
20
22
  let Boost = class Boost {
21
23
  id;
22
24
  title;
@@ -51,6 +53,95 @@ let Boost = class Boost {
51
53
  get totalDownloads() {
52
54
  return this?.metrics?.find(i => i.event === user_1.UserEvent.Download);
53
55
  }
56
+ authorisation = {
57
+ edit: false,
58
+ publish: false,
59
+ unpublish: false,
60
+ end: false,
61
+ delete: false,
62
+ isValid: false
63
+ };
64
+ validators;
65
+ setValidators() {
66
+ this.validators = [
67
+ new item_1.Item({
68
+ name: 'title',
69
+ title: 'boostTitle',
70
+ value: false,
71
+ icon: 't'
72
+ }),
73
+ new item_1.Item({
74
+ name: 'period',
75
+ title: 'boostPeriod',
76
+ value: false,
77
+ icon: 'calendar'
78
+ }),
79
+ new item_1.Item({
80
+ name: 'items',
81
+ title: 'boostPosts',
82
+ value: false,
83
+ icon: 'book'
84
+ })
85
+ ];
86
+ }
87
+ validate() {
88
+ if (!this.validators) {
89
+ this.setValidators();
90
+ }
91
+ this.authorisation.edit = false;
92
+ this.authorisation.delete = false;
93
+ this.authorisation.publish = false;
94
+ this.authorisation.unpublish = false;
95
+ this.authorisation.end = false;
96
+ this.authorisation.isValid = true;
97
+ if (this.status === common_1.StatusType.Draft) {
98
+ this.authorisation.edit = true;
99
+ this.authorisation.delete = true;
100
+ }
101
+ if (this.status === common_1.StatusType.Published &&
102
+ this.label === common_1.StatusLabel.Upcoming) {
103
+ this.authorisation.unpublish = true;
104
+ }
105
+ if (this.status === common_1.StatusType.Published &&
106
+ this.label === common_1.StatusLabel.Live) {
107
+ this.authorisation.end = true;
108
+ }
109
+ let validator;
110
+ if (!this.title || this.title.trim().length === 0) {
111
+ validator = this.validators?.find(i => i.name === 'title');
112
+ validator.value = false;
113
+ this.authorisation.isValid = false;
114
+ }
115
+ if (!this.startDate || !this.endDate) {
116
+ validator = this.validators?.find(i => i.name === 'period');
117
+ validator.value = false;
118
+ this.authorisation.isValid = false;
119
+ }
120
+ if (!this.items || this.items.length === 0) {
121
+ validator = this.validators?.find(i => i.name === 'items');
122
+ validator.value = false;
123
+ this.authorisation.isValid = false;
124
+ }
125
+ if (this.status === common_1.StatusType.Draft) {
126
+ const isExpired = this.label === common_1.StatusLabel.Expired;
127
+ const isEnded = this.label === common_1.StatusLabel.Ended;
128
+ this.authorisation.publish = !isExpired && !isEnded;
129
+ }
130
+ }
131
+ get statusContext() {
132
+ return this.status === common_1.StatusType.Published ? ui_1.Context.Info : ui_1.Context.Secondary;
133
+ }
134
+ get labelContext() {
135
+ return this.label === common_1.StatusLabel.Expired
136
+ ? ui_1.Context.Secondary
137
+ : this.label === common_1.StatusLabel.Live
138
+ ? ui_1.Context.Danger
139
+ : this.label === common_1.StatusLabel.Upcoming
140
+ ? ui_1.Context.Success
141
+ : this.label === common_1.StatusLabel.Ended
142
+ ? ui_1.Context.Dark
143
+ : ui_1.Context.Secondary;
144
+ }
54
145
  };
55
146
  exports.Boost = Boost;
56
147
  __decorate([
@@ -106,6 +197,37 @@ __decorate([
106
197
  (0, class_transformer_1.Type)(() => Date),
107
198
  __metadata("design:type", Date)
108
199
  ], Boost.prototype, "updatedOn", void 0);
200
+ __decorate([
201
+ (0, class_transformer_1.Expose)({ groups: ['admin'] }),
202
+ __metadata("design:type", Object)
203
+ ], Boost.prototype, "authorisation", void 0);
204
+ __decorate([
205
+ (0, class_transformer_1.Expose)({ groups: ['admin'] }),
206
+ (0, class_transformer_1.Type)(() => item_1.Item),
207
+ __metadata("design:type", Array)
208
+ ], Boost.prototype, "validators", void 0);
209
+ __decorate([
210
+ (0, class_transformer_1.Expose)({ groups: ['admin'] }),
211
+ __metadata("design:type", Function),
212
+ __metadata("design:paramtypes", []),
213
+ __metadata("design:returntype", void 0)
214
+ ], Boost.prototype, "setValidators", null);
215
+ __decorate([
216
+ (0, class_transformer_1.Expose)({ groups: ['admin'] }),
217
+ __metadata("design:type", Function),
218
+ __metadata("design:paramtypes", []),
219
+ __metadata("design:returntype", void 0)
220
+ ], Boost.prototype, "validate", null);
221
+ __decorate([
222
+ (0, class_transformer_1.Expose)({ groups: ['admin'] }),
223
+ __metadata("design:type", String),
224
+ __metadata("design:paramtypes", [])
225
+ ], Boost.prototype, "statusContext", null);
226
+ __decorate([
227
+ (0, class_transformer_1.Expose)({ groups: ['admin'] }),
228
+ __metadata("design:type", String),
229
+ __metadata("design:paramtypes", [])
230
+ ], Boost.prototype, "labelContext", null);
109
231
  exports.Boost = Boost = __decorate([
110
232
  (0, class_transformer_1.Expose)({ groups: ['admin'] }),
111
233
  __metadata("design:paramtypes", [Object])
@@ -1 +1 @@
1
- {"version":3,"file":"boost.model.js","sourceRoot":"","sources":["../../src/boost/boost.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAAiD;AACjD,mDAA0C;AAC1C,yDAAgD;AAChD,mDAA0C;AAC1C,sCAAoD;AACpD,sCAAuC;AAC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CAAC;AAmChB;IADC,IAAA,0BAAM,EAAC,EAAE,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;;4CAQ7B;AAID;IAFC,IAAA,0BAAM,EAAC,EAAE,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IAC7B,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,WAAI,CAAC;;yCACW;AAS5B;IADC,IAAA,0BAAM,EAAC,EAAE,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;;;;0CAuB7B;AAOD;IADC,IAAA,0BAAM,EAAC,EAAE,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;;;;qCA2D7B;AAMD;IAAC,IAAA,0BAAM,EAAC,EAAE,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;;;0CAG7B;AAMD;IAAC,IAAA,0BAAM,EAAC,EAAE,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;;;yCAW7B;gBAnOW,KAAK;IADjB,IAAA,0BAAM,EAAC,EAAE,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;;GACjB,KAAK,CAoOjB"}
@@ -13,6 +13,8 @@ import { Context } from '../ui/context.enum';
13
13
  import { Popularity } from '../popularity/popularity.model';
14
14
  import { IPostAdditionals } from './post.additionals';
15
15
  export interface IPostAuthorization {
16
+ edit: boolean;
17
+ delete: boolean;
16
18
  draft: boolean;
17
19
  approve: boolean;
18
20
  publish: boolean;
@@ -21,6 +23,7 @@ export interface IPostAuthorization {
21
23
  unarchive: boolean;
22
24
  block: boolean;
23
25
  unblock: boolean;
26
+ isValid: boolean;
24
27
  }
25
28
  export declare class Post {
26
29
  id: number;
@@ -58,6 +61,8 @@ export declare class Post {
58
61
  feedback: Feedback;
59
62
  collection: Post[];
60
63
  gallery: GalleryItem[];
64
+ authorisation: IPostAuthorization;
65
+ validators: Item<boolean>[];
61
66
  constructor(props?: Partial<Post>);
62
67
  get type(): PostType;
63
68
  get seen(): Metric;
@@ -65,9 +70,8 @@ export declare class Post {
65
70
  get like(): Metric;
66
71
  get share(): Metric;
67
72
  get download(): Metric;
68
- getStatusAuthorizations(): IPostAuthorization;
69
- getPublishValidators(): Item[];
70
- validateForPublish(): boolean;
71
- getStatusContext(): Context;
72
- static getIcon(postType: PostType, custom?: boolean): "file-lines" | "microphone" | "circle-play" | "newspaper" | "headphones" | "book-open" | "/assets/icons/content-type-article.svg" | "/assets/icons/content-type-book.svg" | "/assets/icons/content-type-audio.svg" | "/assets/icons/content-type-video.svg" | "/assets/icons/content-type-news.svg" | "/assets/icons/content-type-event.svg";
73
+ setValidators(): void;
74
+ validate(): void;
75
+ get statusContext(): Context;
76
+ static getIcon(postType: PostType, custom?: boolean): "/assets/icons/content-type-article.svg" | "file-lines" | "/assets/icons/content-type-book.svg" | "book-open" | "/assets/icons/content-type-audio.svg" | "headphones" | "/assets/icons/content-type-video.svg" | "circle-play" | "/assets/icons/content-type-news.svg" | "newspaper" | "/assets/icons/content-type-event.svg" | "microphone";
73
77
  }
@@ -60,6 +60,20 @@ class Post {
60
60
  feedback;
61
61
  collection;
62
62
  gallery;
63
+ authorisation = {
64
+ edit: false,
65
+ delete: false,
66
+ draft: false,
67
+ approve: false,
68
+ publish: false,
69
+ unpublish: false,
70
+ archive: false,
71
+ unarchive: false,
72
+ block: false,
73
+ unblock: false,
74
+ isValid: false
75
+ };
76
+ validators;
63
77
  constructor(props) {
64
78
  Object.assign(this, props);
65
79
  }
@@ -81,177 +95,158 @@ class Post {
81
95
  get download() {
82
96
  return this?.metrics?.find(i => i.event === user_1.UserEvent.Download);
83
97
  }
84
- getStatusAuthorizations() {
85
- switch (this.status) {
86
- case status_type_1.StatusType.Draft:
87
- return {
88
- draft: false,
89
- approve: true,
90
- publish: true,
91
- unpublish: false,
92
- archive: true,
93
- unarchive: false,
94
- block: true,
95
- unblock: false
96
- };
97
- case status_type_1.StatusType.Ready:
98
- return {
99
- draft: true,
100
- approve: false,
101
- publish: true,
102
- unpublish: false,
103
- archive: false,
104
- unarchive: false,
105
- block: true,
106
- unblock: false
107
- };
108
- case status_type_1.StatusType.Published:
109
- return {
110
- draft: false,
111
- approve: false,
112
- publish: false,
113
- unpublish: true,
114
- archive: true,
115
- unarchive: false,
116
- block: true,
117
- unblock: false
118
- };
119
- case status_type_1.StatusType.Archived:
120
- return {
121
- draft: false,
122
- approve: false,
123
- publish: false,
124
- unpublish: false,
125
- archive: false,
126
- unarchive: true,
127
- block: false,
128
- unblock: false
129
- };
130
- case status_type_1.StatusType.Blocked:
131
- return {
132
- draft: false,
133
- approve: false,
134
- publish: false,
135
- unpublish: false,
136
- archive: false,
137
- unarchive: false,
138
- block: false,
139
- unblock: true
140
- };
141
- default:
142
- return {
143
- draft: false,
144
- approve: false,
145
- publish: false,
146
- unpublish: false,
147
- archive: false,
148
- unarchive: false,
149
- block: false,
150
- unblock: false
151
- };
152
- }
153
- }
154
- getPublishValidators() {
98
+ setValidators() {
155
99
  const postType = this.postType;
156
- const validators = [];
157
- validators.push(new item_model_1.Item({
158
- name: 'author',
159
- title: 'author',
160
- icon: 'user'
161
- }));
162
- validators.push(new item_model_1.Item({
163
- name: 'title',
164
- title: 'title',
165
- icon: 't'
166
- }));
167
- validators.push(new item_model_1.Item({
168
- name: 'description',
169
- title: 'daysescription',
170
- icon: 'align-left'
171
- }));
172
- validators.push(new item_model_1.Item({
173
- name: 'image',
174
- title: 'image',
175
- icon: 'image'
176
- }));
177
- validators.push(new item_model_1.Item({
178
- name: 'feed',
179
- title: 'postFeed',
180
- icon: 'mobile-screen'
181
- }));
100
+ this.validators = [
101
+ new item_model_1.Item({
102
+ name: 'author',
103
+ title: 'author',
104
+ icon: 'user'
105
+ }),
106
+ new item_model_1.Item({
107
+ name: 'title',
108
+ title: 'title',
109
+ icon: 't'
110
+ }),
111
+ new item_model_1.Item({
112
+ name: 'description',
113
+ title: 'daysescription',
114
+ icon: 'align-left'
115
+ }),
116
+ new item_model_1.Item({
117
+ name: 'image',
118
+ title: 'image',
119
+ icon: 'image'
120
+ }),
121
+ new item_model_1.Item({
122
+ name: 'feed',
123
+ title: 'postFeed',
124
+ icon: 'mobile-screen'
125
+ })
126
+ ];
182
127
  if ([post_type_1.PostType.Article, post_type_1.PostType.Event, post_type_1.PostType.News].includes(postType)) {
183
- validators.push(new item_model_1.Item({
128
+ this.validators.push(new item_model_1.Item({
184
129
  name: 'content',
185
130
  title: 'content',
186
131
  icon: 'align-justify'
187
132
  }));
188
133
  }
189
134
  if (postType === post_type_1.PostType.Book) {
190
- validators.push(new item_model_1.Item({
135
+ this.validators.push(new item_model_1.Item({
191
136
  name: 'pdf',
192
137
  title: 'pdf',
193
138
  icon: 'file-pdf'
194
139
  }));
195
140
  }
196
141
  if (postType === post_type_1.PostType.Audio) {
197
- validators.push(new item_model_1.Item({
142
+ this.validators.push(new item_model_1.Item({
198
143
  name: 'audio',
199
144
  title: 'audio',
200
145
  icon: 'microphone'
201
146
  }));
202
147
  }
203
148
  if (postType === post_type_1.PostType.Video) {
204
- validators.push(new item_model_1.Item({
149
+ this.validators.push(new item_model_1.Item({
205
150
  name: 'video',
206
151
  title: 'video',
207
152
  icon: 'file-video'
208
153
  }));
209
154
  }
210
155
  if (postType === post_type_1.PostType.Event) {
211
- validators.push(new item_model_1.Item({
156
+ this.validators.push(new item_model_1.Item({
212
157
  name: 'schedule',
213
158
  title: 'eventSchedule',
214
159
  icon: 'calendar-days'
215
160
  }));
216
161
  }
217
- return validators;
218
162
  }
219
- validateForPublish() {
220
- if (!this.status)
221
- return false;
163
+ validate() {
164
+ if (!this.validators) {
165
+ this.setValidators();
166
+ }
167
+ this.authorisation.edit = false;
168
+ this.authorisation.delete = false;
169
+ this.authorisation.draft = false;
170
+ this.authorisation.approve = false;
171
+ this.authorisation.publish = false;
172
+ this.authorisation.unpublish = false;
173
+ this.authorisation.archive = false;
174
+ this.authorisation.unarchive = false;
175
+ this.authorisation.block = false;
176
+ this.authorisation.unblock = false;
177
+ this.authorisation.isValid = true;
178
+ let validator;
179
+ const contentMandatory = [post_type_1.PostType.Article, post_type_1.PostType.Event, post_type_1.PostType.News];
222
180
  if (!this.author) {
223
- return false;
181
+ validator = this.validators?.find(i => i.name === 'author');
182
+ validator.value = false;
183
+ this.authorisation.isValid = false;
224
184
  }
225
185
  if (this.description?.trim()?.length === 0) {
226
- return false;
186
+ validator = this.validators?.find(i => i.name === 'description');
187
+ validator.value = false;
188
+ this.authorisation.isValid = false;
227
189
  }
228
190
  if (this.imageUrl?.trim()?.length === 0) {
229
- return false;
191
+ validator = this.validators?.find(i => i.name === 'image');
192
+ validator.value = false;
193
+ this.authorisation.isValid = false;
230
194
  }
231
195
  if (this.feedUrl?.trim()?.length) {
232
- return false;
196
+ validator = this.validators?.find(i => i.name === 'feed');
197
+ validator.value = false;
198
+ this.authorisation.isValid = false;
233
199
  }
234
- const contentMandatory = [post_type_1.PostType.Article, post_type_1.PostType.Event, post_type_1.PostType.News];
235
200
  if (contentMandatory.includes(this.type) && !this.content?.trim()) {
236
- return false;
201
+ validator = this.validators?.find(i => i.name === 'content');
202
+ validator.value = false;
203
+ this.authorisation.isValid = false;
237
204
  }
238
205
  if (this.type === post_type_1.PostType.Book && !this.pdfUrl?.trim()) {
239
- return false;
206
+ validator = this.validators?.find(i => i.name === 'pdf');
207
+ validator.value = false;
208
+ this.authorisation.isValid = false;
240
209
  }
241
210
  if (this.type === post_type_1.PostType.Audio && !this.mediaUrl?.trim()) {
242
- return false;
211
+ validator = this.validators?.find(i => i.name === 'audio');
212
+ validator.value = false;
213
+ this.authorisation.isValid = false;
243
214
  }
244
215
  if (this.type === post_type_1.PostType.Video && !this.mediaUrl?.trim()) {
245
- return false;
216
+ validator = this.validators?.find(i => i.name === 'video');
217
+ validator.value = false;
218
+ this.authorisation.isValid = false;
246
219
  }
247
220
  if (this.type === post_type_1.PostType.Event && !this.info?.events || this.info.events?.length === 0) {
248
- return false;
221
+ validator = this.validators?.find(i => i.name === 'event');
222
+ validator.value = false;
223
+ this.authorisation.isValid = false;
224
+ }
225
+ if (this.status === status_type_1.StatusType.Draft) {
226
+ this.authorisation.edit = true;
227
+ this.authorisation.approve = true;
228
+ this.authorisation.delete = true;
229
+ this.authorisation.archive = true;
230
+ this.authorisation.block = true;
231
+ }
232
+ if (this.status === status_type_1.StatusType.Ready) {
233
+ this.authorisation.publish = true;
234
+ this.authorisation.archive = true;
235
+ this.authorisation.block = true;
236
+ }
237
+ if (this.status === status_type_1.StatusType.Published) {
238
+ this.authorisation.unpublish = true;
239
+ this.authorisation.archive = true;
240
+ this.authorisation.block = true;
241
+ }
242
+ if (this.status === status_type_1.StatusType.Archived) {
243
+ this.authorisation.unarchive = true;
244
+ }
245
+ if (this.status === status_type_1.StatusType.Blocked) {
246
+ this.authorisation.unblock = true;
249
247
  }
250
- return true;
251
248
  }
252
- getStatusContext() {
253
- if (!this.status)
254
- return;
249
+ get statusContext() {
255
250
  return this.status === status_type_1.StatusType.Draft
256
251
  ? context_enum_1.Context.Secondary
257
252
  : this.status === status_type_1.StatusType.Ready
@@ -456,28 +451,30 @@ __decorate([
456
451
  ], Post.prototype, "gallery", void 0);
457
452
  __decorate([
458
453
  (0, class_transformer_1.Expose)({ groups: ['admin'] }),
459
- __metadata("design:type", Function),
460
- __metadata("design:paramtypes", []),
461
- __metadata("design:returntype", Object)
462
- ], Post.prototype, "getStatusAuthorizations", null);
454
+ __metadata("design:type", Object)
455
+ ], Post.prototype, "authorisation", void 0);
463
456
  __decorate([
464
457
  (0, class_transformer_1.Expose)({ groups: ['admin'] }),
465
- __metadata("design:type", Function),
466
- __metadata("design:paramtypes", []),
467
- __metadata("design:returntype", Array)
468
- ], Post.prototype, "getPublishValidators", null);
458
+ (0, class_transformer_1.Type)(() => item_model_1.Item),
459
+ __metadata("design:type", Array)
460
+ ], Post.prototype, "validators", void 0);
469
461
  __decorate([
470
462
  (0, class_transformer_1.Expose)({ groups: ['admin'] }),
471
463
  __metadata("design:type", Function),
472
464
  __metadata("design:paramtypes", []),
473
- __metadata("design:returntype", Boolean)
474
- ], Post.prototype, "validateForPublish", null);
465
+ __metadata("design:returntype", void 0)
466
+ ], Post.prototype, "setValidators", null);
475
467
  __decorate([
476
468
  (0, class_transformer_1.Expose)({ groups: ['admin'] }),
477
469
  __metadata("design:type", Function),
478
470
  __metadata("design:paramtypes", []),
479
- __metadata("design:returntype", String)
480
- ], Post.prototype, "getStatusContext", null);
471
+ __metadata("design:returntype", void 0)
472
+ ], Post.prototype, "validate", null);
473
+ __decorate([
474
+ (0, class_transformer_1.Expose)({ groups: ['admin'] }),
475
+ __metadata("design:type", String),
476
+ __metadata("design:paramtypes", [])
477
+ ], Post.prototype, "statusContext", null);
481
478
  __decorate([
482
479
  (0, class_transformer_1.Expose)(),
483
480
  __metadata("design:type", Function),
@@ -1 +1 @@
1
- {"version":3,"file":"post.model.js","sourceRoot":"","sources":["../../src/post/post.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA4D;AAE5D,mDAA0C;AAC1C,yDAAgD;AAChD,kEAAyD;AACzD,sDAA6C;AAC7C,4DAAuD;AACvD,+DAAsD;AACtD,mDAA0C;AAC1C,yDAAgD;AAChD,uDAAmD;AACnD,2CAAuC;AACvC,qDAA4C;AAC5C,qEAA4D;AAE5D,kCAAoC;AAapC,MAAa,IAAI;IAIhB,EAAE,CAAS;IAGX,IAAI,CAAS;IAKb,KAAK,CAAS;IAGd,WAAW,CAAS;IAGpB,OAAO,CAAS;IAahB,IAAI,CAAmB;IAIvB,QAAQ,CAAS;IAOjB,IAAI,CAAW;IAOf,OAAO,CAAS;IAKhB,MAAM,CAAS;IAGf,QAAQ,CAAS;IAGjB,OAAO,CAAS;IAGhB,QAAQ,CAAS;IAGjB,SAAS,CAAS;IAKlB,MAAM,CAAa;IAGnB,QAAQ,CAAW;IAInB,MAAM,CAAS;IAKf,UAAU,CAAa;IAevB,OAAO,CAAW;IAMlB,SAAS,CAAO;IAIhB,SAAS,CAAO;IAIhB,SAAS,CAAO;IAIhB,SAA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;;;yCAa7B;AAGM;IADN,IAAA,0BAAM,GAAE;;;;yBAgBR"}
@@ -2,6 +2,16 @@ import { StatusType } from "../common/status.type";
2
2
  import { StatusLabel } from "../common/status.label";
3
3
  import { Metric } from "../metric/metric.model";
4
4
  import { User } from "../user/user.model";
5
+ import { Item } from "../item";
6
+ import { Context } from "../ui";
7
+ export interface IPromotionAuthorisation {
8
+ edit: boolean;
9
+ publish: boolean;
10
+ unpublish: boolean;
11
+ end: boolean;
12
+ delete: boolean;
13
+ isValid: boolean;
14
+ }
5
15
  export declare class Promotion {
6
16
  id: number;
7
17
  title: string;
@@ -21,6 +31,12 @@ export declare class Promotion {
21
31
  statusChangedOn: Date;
22
32
  publishedBy: User;
23
33
  publishedOn: Date;
34
+ authorisation: IPromotionAuthorisation;
35
+ validators: Item<boolean>[];
24
36
  constructor(props?: Partial<Promotion>);
25
37
  get totalSeen(): Metric;
38
+ setValidators(): void;
39
+ validate(): void;
40
+ get statusContext(): Context;
41
+ get labelContext(): Context;
26
42
  }