aboutsummaryrefslogtreecommitdiffstats
path: root/entities/bug/op_set_status.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2022-08-20 10:52:11 +0200
committerMichael Muré <batolettre@gmail.com>2022-08-20 10:52:11 +0200
commit8818d091e85087766d7f493b7dfaf1aedc3a4ab0 (patch)
treea3bd60a9f533fc6fc11a094038d095510210cd23 /entities/bug/op_set_status.go
parent58df94d38d754bff4dcca11e2ae4b99326a9a87e (diff)
downloadgit-bug-8818d091e85087766d7f493b7dfaf1aedc3a4ab0.tar.gz
move bug.Status in entities/common for reuse
Diffstat (limited to 'entities/bug/op_set_status.go')
-rw-r--r--entities/bug/op_set_status.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/entities/bug/op_set_status.go b/entities/bug/op_set_status.go
index 5e73d982..cf17901a 100644
--- a/entities/bug/op_set_status.go
+++ b/entities/bug/op_set_status.go
@@ -3,6 +3,7 @@ package bug
import (
"github.com/pkg/errors"
+ "github.com/MichaelMure/git-bug/entities/common"
"github.com/MichaelMure/git-bug/entities/identity"
"github.com/MichaelMure/git-bug/entity"
"github.com/MichaelMure/git-bug/entity/dag"
@@ -14,7 +15,7 @@ var _ Operation = &SetStatusOperation{}
// SetStatusOperation will change the status of a bug
type SetStatusOperation struct {
dag.OpBase
- Status Status `json:"status"`
+ Status common.Status `json:"status"`
}
func (op *SetStatusOperation) Id() entity.Id {
@@ -47,7 +48,7 @@ func (op *SetStatusOperation) Validate() error {
return nil
}
-func NewSetStatusOp(author identity.Interface, unixTime int64, status Status) *SetStatusOperation {
+func NewSetStatusOp(author identity.Interface, unixTime int64, status common.Status) *SetStatusOperation {
return &SetStatusOperation{
OpBase: dag.NewOpBase(SetStatusOp, author, unixTime),
Status: status,
@@ -58,7 +59,7 @@ type SetStatusTimelineItem struct {
id entity.Id
Author identity.Interface
UnixTime timestamp.Timestamp
- Status Status
+ Status common.Status
}
func (s SetStatusTimelineItem) Id() entity.Id {
@@ -70,7 +71,7 @@ func (s SetStatusTimelineItem) IsAuthored() {}
// Open is a convenience function to change a bugs state to Open
func Open(b Interface, author identity.Interface, unixTime int64, metadata map[string]string) (*SetStatusOperation, error) {
- op := NewSetStatusOp(author, unixTime, OpenStatus)
+ op := NewSetStatusOp(author, unixTime, common.OpenStatus)
for key, value := range metadata {
op.SetMetadata(key, value)
}
@@ -83,7 +84,7 @@ func Open(b Interface, author identity.Interface, unixTime int64, metadata map[s
// Close is a convenience function to change a bugs state to Close
func Close(b Interface, author identity.Interface, unixTime int64, metadata map[string]string) (*SetStatusOperation, error) {
- op := NewSetStatusOp(author, unixTime, ClosedStatus)
+ op := NewSetStatusOp(author, unixTime, common.ClosedStatus)
for key, value := range metadata {
op.SetMetadata(key, value)
}