Esempio n. 1
0
 def __map_to_event_bo(self, suggestion_id):
     event_bo = Event()
     event_bo.created = datetime.now()
     event_bo.modified = datetime.now()
     event_bo.event_type = EventTypes.ACTION
     event_bo.sub_type = EventActionSubTypes.SYSTEM
     event_bo.text = f"Lisätty tunnisteet:  "
     event_bo.suggestion_id = suggestion_id
     return event_bo
Esempio n. 2
0
 def __map_comments_to_comments_bo(self, comments, suggestion_id):
     comments_bo = []
     if comments is not None and len(comments) > 0:
         for comment in comments:
             comment_bo = Event()
             comment_bo.created = comment.created
             comment_bo.modified = comment.modified
             comment_bo.event_type = EventTypes.COMMENT
             comment_bo.text = comment.text
             comment_bo.suggestion_id = suggestion_id
             if comment_bo.user_id is None:
                 comment_bo.user_id = 1
             comments_bo.append(comment_bo)
     return comments_bo