From 3f6ef50883492f77995a7e27872d0b5ae17b9d6a Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Sun, 14 Feb 2021 11:36:32 +0100 Subject: bug: migrate to the DAG entity structure! --- bug/op_set_status.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'bug/op_set_status.go') diff --git a/bug/op_set_status.go b/bug/op_set_status.go index eb2c0ba4..fcf33f8c 100644 --- a/bug/op_set_status.go +++ b/bug/op_set_status.go @@ -21,21 +21,17 @@ type SetStatusOperation struct { // Sign-post method for gqlgen func (op *SetStatusOperation) IsOperation() {} -func (op *SetStatusOperation) base() *OpBase { - return &op.OpBase -} - func (op *SetStatusOperation) Id() entity.Id { - return idOperation(op) + return idOperation(op, &op.OpBase) } func (op *SetStatusOperation) Apply(snapshot *Snapshot) { snapshot.Status = op.Status - snapshot.addActor(op.Author) + snapshot.addActor(op.Author_) item := &SetStatusTimelineItem{ id: op.Id(), - Author: op.Author, + Author: op.Author_, UnixTime: timestamp.Timestamp(op.UnixTime), Status: op.Status, } @@ -44,7 +40,7 @@ func (op *SetStatusOperation) Apply(snapshot *Snapshot) { } func (op *SetStatusOperation) Validate() error { - if err := opBaseValidate(op, SetStatusOp); err != nil { + if err := op.OpBase.Validate(op, SetStatusOp); err != nil { return err } -- cgit From d0d7be8db010e2c68c98d0a34387e4fac0c4d6ee Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Sun, 14 Feb 2021 12:14:03 +0100 Subject: minor cleanups --- bug/op_set_status.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bug/op_set_status.go') diff --git a/bug/op_set_status.go b/bug/op_set_status.go index fcf33f8c..ca8c434a 100644 --- a/bug/op_set_status.go +++ b/bug/op_set_status.go @@ -51,7 +51,7 @@ func (op *SetStatusOperation) Validate() error { return nil } -// UnmarshalJSON is a two step JSON unmarshaling +// UnmarshalJSON is a two step JSON unmarshalling // This workaround is necessary to avoid the inner OpBase.MarshalJSON // overriding the outer op's MarshalJSON func (op *SetStatusOperation) UnmarshalJSON(data []byte) error { -- cgit From bd09541752ef4db008500d238762ebe7f2f7be39 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Sat, 20 Feb 2021 14:37:06 +0100 Subject: entity: no sign-post needed --- bug/op_set_status.go | 3 --- 1 file changed, 3 deletions(-) (limited to 'bug/op_set_status.go') diff --git a/bug/op_set_status.go b/bug/op_set_status.go index ca8c434a..e22ded54 100644 --- a/bug/op_set_status.go +++ b/bug/op_set_status.go @@ -18,9 +18,6 @@ type SetStatusOperation struct { Status Status `json:"status"` } -// Sign-post method for gqlgen -func (op *SetStatusOperation) IsOperation() {} - func (op *SetStatusOperation) Id() entity.Id { return idOperation(op, &op.OpBase) } -- cgit