aboutsummaryrefslogtreecommitdiffstats
path: root/bug/op_create.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2021-02-14 11:36:32 +0100
committerMichael Muré <batolettre@gmail.com>2021-02-14 12:19:50 +0100
commit3f6ef50883492f77995a7e27872d0b5ae17b9d6a (patch)
tree97677642f1b01c73c8c5a708ea0ec67ced8c402f /bug/op_create.go
parent99b9dd84cb4b0cfd3eb1fd50b07c8b826eb52d19 (diff)
downloadgit-bug-3f6ef50883492f77995a7e27872d0b5ae17b9d6a.tar.gz
bug: migrate to the DAG entity structure!
Diffstat (limited to 'bug/op_create.go')
-rw-r--r--bug/op_create.go16
1 files changed, 6 insertions, 10 deletions
diff --git a/bug/op_create.go b/bug/op_create.go
index 1e944d13..2423e571 100644
--- a/bug/op_create.go
+++ b/bug/op_create.go
@@ -30,12 +30,8 @@ type CreateOperation struct {
// Sign-post method for gqlgen
func (op *CreateOperation) IsOperation() {}
-func (op *CreateOperation) base() *OpBase {
- return &op.OpBase
-}
-
func (op *CreateOperation) Id() entity.Id {
- return idOperation(op)
+ return idOperation(op, &op.OpBase)
}
// OVERRIDE
@@ -61,8 +57,8 @@ func (op *CreateOperation) Apply(snapshot *Snapshot) {
snapshot.id = op.Id()
- snapshot.addActor(op.Author)
- snapshot.addParticipant(op.Author)
+ snapshot.addActor(op.Author_)
+ snapshot.addParticipant(op.Author_)
snapshot.Title = op.Title
@@ -70,12 +66,12 @@ func (op *CreateOperation) Apply(snapshot *Snapshot) {
comment := Comment{
id: commentId,
Message: op.Message,
- Author: op.Author,
+ Author: op.Author_,
UnixTime: timestamp.Timestamp(op.UnixTime),
}
snapshot.Comments = []Comment{comment}
- snapshot.Author = op.Author
+ snapshot.Author = op.Author_
snapshot.CreateTime = op.Time()
snapshot.Timeline = []TimelineItem{
@@ -90,7 +86,7 @@ func (op *CreateOperation) GetFiles() []repository.Hash {
}
func (op *CreateOperation) Validate() error {
- if err := opBaseValidate(op, CreateOp); err != nil {
+ if err := op.OpBase.Validate(op, CreateOp); err != nil {
return err
}