File tree Expand file tree Collapse file tree 3 files changed +12
-0
lines changed
Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,13 @@ import { MultiLingStringDTO } from "@/DTOs/multi-ling-string.dto";
22import { ApiProperty } from "@nestjs/swagger" ;
33
44export class NewEventDTO {
5+ @ApiProperty ( {
6+ type : "string" ,
7+ nullable : false ,
8+ required : true ,
9+ } )
10+ eventKey : string ;
11+
512 @ApiProperty ( {
613 type : "string" ,
714 format : "date-time" ,
Original file line number Diff line number Diff line change @@ -7,6 +7,10 @@ export class Event extends TranslatableEntity {
77 readonly LBL_VENUE_WITH_ARTICLE_IF_NEEDED = "venueWithArticleIfNeeded" ;
88 readonly LBL_ADDRESS = "address" ;
99
10+ /** @dev Used to re-address the event and avoiding duplicates */
11+ @Column ( { nullable : false , unique : true } )
12+ eventKey : string ;
13+
1014 @Column ( { nullable : false } )
1115 eventStartDateTime : Date ;
1216
Original file line number Diff line number Diff line change @@ -137,6 +137,7 @@ export class EventService {
137137
138138 const newEventEntity : Event = this . eventRepository . create ( ) ;
139139 await this . eventRepository . save ( newEventEntity ) ; // otherwise relationship constraints don't work
140+ newEventEntity . eventKey = newEvent . eventKey ;
140141 newEventEntity . venueWithArticleIfNeeded =
141142 await this . multilingualStringService . createTranslations (
142143 newEvent . venueWithArticleIfNeeded ,
You can’t perform that action at this time.
0 commit comments