feat: task system
All checks were successful
Build and Push App Image / build-and-push (push) Successful in 1m55s
All checks were successful
Build and Push App Image / build-and-push (push) Successful in 1m55s
This commit is contained in:
37
backend/internal/domain/entities/task.go
Normal file
37
backend/internal/domain/entities/task.go
Normal file
@@ -0,0 +1,37 @@
|
||||
package entities
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"go.mongodb.org/mongo-driver/v2/bson"
|
||||
)
|
||||
|
||||
const MaxTaskDepth = 2
|
||||
|
||||
// Task represents a task and supports up to 3 nesting levels (0,1,2).
|
||||
type Task struct {
|
||||
ID bson.ObjectID `bson:"_id,omitempty"`
|
||||
SpaceID bson.ObjectID `bson:"space_id"`
|
||||
Title string `bson:"title"`
|
||||
Description string `bson:"description"`
|
||||
CategoryID *bson.ObjectID `bson:"category_id,omitempty"`
|
||||
StatusID bson.ObjectID `bson:"status_id"`
|
||||
ParentTaskID *bson.ObjectID `bson:"parent_task_id,omitempty"`
|
||||
Depth int `bson:"depth"`
|
||||
NoteLinks []bson.ObjectID `bson:"note_links"`
|
||||
CreatedBy bson.ObjectID `bson:"created_by"`
|
||||
UpdatedBy bson.ObjectID `bson:"updated_by"`
|
||||
CreatedAt time.Time `bson:"created_at"`
|
||||
UpdatedAt time.Time `bson:"updated_at"`
|
||||
}
|
||||
|
||||
// TaskStatus defines the ordered linear status progression for a space.
|
||||
type TaskStatus struct {
|
||||
ID bson.ObjectID `bson:"_id,omitempty"`
|
||||
SpaceID bson.ObjectID `bson:"space_id"`
|
||||
Name string `bson:"name"`
|
||||
Color string `bson:"color,omitempty"`
|
||||
Order int `bson:"order"`
|
||||
CreatedAt time.Time `bson:"created_at"`
|
||||
UpdatedAt time.Time `bson:"updated_at"`
|
||||
}
|
||||
Reference in New Issue
Block a user