(snapshot *Snapshot)
| 27 | } |
| 28 | |
| 29 | func (op *AddCommentOperation) Apply(snapshot *Snapshot) { |
| 30 | snapshot.addActor(op.Author()) |
| 31 | snapshot.addParticipant(op.Author()) |
| 32 | |
| 33 | opId := op.Id() |
| 34 | |
| 35 | comment := Comment{ |
| 36 | combinedId: entity.CombineIds(snapshot.Id(), opId), |
| 37 | targetId: opId, |
| 38 | Message: op.Message, |
| 39 | Author: op.Author(), |
| 40 | Files: op.Files, |
| 41 | unixTime: timestamp.Timestamp(op.UnixTime), |
| 42 | } |
| 43 | |
| 44 | snapshot.Comments = append(snapshot.Comments, comment) |
| 45 | |
| 46 | item := &AddCommentTimelineItem{ |
| 47 | CommentTimelineItem: NewCommentTimelineItem(comment), |
| 48 | } |
| 49 | |
| 50 | snapshot.Timeline = append(snapshot.Timeline, item) |
| 51 | } |
| 52 | |
| 53 | func (op *AddCommentOperation) GetFiles() []repository.Hash { |
| 54 | return op.Files |
nothing calls this directly
no test coverage detected