fix:#75 refactoring duplicate function

This commit is contained in:
Elmar Kresse
2025-04-27 13:53:34 +02:00
parent f34a8dfb9f
commit 57c2fcb7ad
8 changed files with 238 additions and 151 deletions

View File

@@ -194,6 +194,11 @@ func NewEvent(collection *core.Collection, event model.Event) (*Event, error) {
ev.SetBookedAt(event.BookedAt)
ev.SetCourse(event.Course)
ev.SetSemester(event.Semester)
ev.SetCompulsory(event.Compulsory)
if event.UUID == "" {
event.UUID = uuid.NewString()
}
ev.SetUUID(event.UUID)
return ev, nil
}