aboutsummaryrefslogtreecommitdiffstats
path: root/entities/bug/op_create.go
diff options
context:
space:
mode:
Diffstat (limited to 'entities/bug/op_create.go')
-rw-r--r--entities/bug/op_create.go13
1 files changed, 8 insertions, 5 deletions
diff --git a/entities/bug/op_create.go b/entities/bug/op_create.go
index fdfa131b..2afea406 100644
--- a/entities/bug/op_create.go
+++ b/entities/bug/op_create.go
@@ -32,7 +32,9 @@ func (op *CreateOperation) Apply(snapshot *Snapshot) {
return
}
- snapshot.id = op.Id()
+ // the Id of the Bug/Snapshot is the Id of the first Operation: CreateOperation
+ opId := op.Id()
+ snapshot.id = opId
snapshot.addActor(op.Author())
snapshot.addParticipant(op.Author())
@@ -40,10 +42,11 @@ func (op *CreateOperation) Apply(snapshot *Snapshot) {
snapshot.Title = op.Title
comment := Comment{
- id: entity.CombineIds(snapshot.Id(), op.Id()),
- Message: op.Message,
- Author: op.Author(),
- UnixTime: timestamp.Timestamp(op.UnixTime),
+ combinedId: entity.CombineIds(snapshot.id, opId),
+ targetId: opId,
+ Message: op.Message,
+ Author: op.Author(),
+ unixTime: timestamp.Timestamp(op.UnixTime),
}
snapshot.Comments = []Comment{comment}