This commit is contained in:
despiegk 2025-05-09 12:56:03 +03:00
parent 99bc97b104
commit 04ee493cd9
6 changed files with 302 additions and 0 deletions

View File

@ -0,0 +1,53 @@
module projects
import base
// Priority represents the priority level of a project item
pub enum Priority {
critical
high
medium
low
none
}
// Status represents the current status of a project item
pub enum Status {
todo
in_progress
review
done
archived
}
// ItemType represents the type of a project item
pub enum ItemType {
epic
story
task
bug
improvement
feature
}
// Project represents a project in the system
pub struct Project {
base.Base
pub mut:
name string
description string
owner_id u32 // ID of the user who owns this project
member_ids []u32 // IDs of the users who are members of this project
board_ids []u32 // IDs of the kanban boards in this project
sprint_ids []u32 // IDs of the sprints in this project
epic_ids []u32 // IDs of the epics in this project
tags []string
}
// Label represents a label that can be applied to project items
pub struct Label {
base.Base
pub mut:
name string
color string // Hex color code
}

View File

@ -0,0 +1,37 @@
module projects
import base
// Epic represents a large body of work that can be broken down into stories
pub struct Epic {
base.Base
pub mut:
title string
description string
project_id u32 // ID of the project this epic belongs to
owner_id u32 // ID of the user who owns this epic
assignee_id u32 // ID of the user assigned to this epic
status Status
priority Priority
story_ids []u32 // IDs of the stories in this epic
issue_ids []u32 // IDs of the issues in this epic
label_ids []u32 // IDs of the labels applied to this epic
start_date string // Start date in ISO format
due_date string // Due date in ISO format
progress f32 // Progress as a percentage (0-100)
dependencies []u32 // IDs of epics that this epic depends on
blockers []string // List of blockers preventing progress
tags []string
}
// EpicProgress represents the progress of an epic
pub struct EpicProgress {
base.Base
pub mut:
epic_id u32
total_stories u32 // Total number of stories in the epic
completed_stories u32 // Number of completed stories
total_points f32 // Total number of story points
completed_points f32 // Number of completed story points
progress f32 // Progress as a percentage (0-100)
}

View File

@ -0,0 +1,60 @@
module projects
import base
// IssueType represents the type of an issue
pub enum IssueType {
bug
feature_request
improvement
task
question
documentation
}
// IssueSeverity represents the severity of an issue
pub enum IssueSeverity {
blocker
critical
major
minor
trivial
}
// Issue represents a problem, task, or feature request in the project
pub struct Issue {
base.Base
pub mut:
title string
description string
project_id u32 // ID of the project this issue belongs to
reporter_id u32 // ID of the user who reported this issue
assignee_id u32 // ID of the user assigned to this issue
status Status
priority Priority
issue_type IssueType
severity IssueSeverity
epic_id u32 // ID of the epic this issue belongs to (if any)
story_id u32 // ID of the story this issue belongs to (if any)
sprint_id u32 // ID of the sprint this issue is scheduled for (if any)
label_ids []u32 // IDs of the labels applied to this issue
due_date string // Due date in ISO format
estimated_hours f32 // Estimated hours to complete
actual_hours f32 // Actual hours spent
dependencies []u32 // IDs of issues that this issue depends on
blockers []string // List of blockers preventing progress
steps_to_reproduce []string // Steps to reproduce (for bugs)
environment string // Environment where the issue occurs (for bugs)
attachments []string // Paths or references to attachments
tags []string
}
// IssueComment represents a comment on an issue
pub struct IssueComment {
base.Base
pub mut:
issue_id u32
author_id u32
content string
attachments []string // Paths or references to attachments
}

View File

@ -0,0 +1,44 @@
module projects
import base
// KanbanBoard represents a kanban board in the project management system
pub struct KanbanBoard {
base.Base
pub mut:
name string
description string
project_id u32 // ID of the project this board belongs to
columns []Column // Columns in this kanban board
}
// Column represents a column in a kanban board
pub struct Column {
base.Base
pub mut:
name string
description string
position u32 // Position of the column in the board (for ordering)
item_ids []u32 // IDs of the items in this column
wip_limit u32 // Work in progress limit (0 means no limit)
}
// KanbanItem represents an item on a kanban board
// This can be linked to an Epic, Story, or Issue
pub struct KanbanItem {
base.Base
pub mut:
title string
description string
column_id u32 // ID of the column this item belongs to
position u32 // Position of the item in the column (for ordering)
assignee_id u32 // ID of the user assigned to this item
priority Priority
status Status
item_type ItemType
epic_id u32 // ID of the epic this item belongs to (if any)
story_id u32 // ID of the story this item belongs to (if any)
issue_id u32 // ID of the issue this item is linked to (if any)
label_ids []u32 // IDs of the labels applied to this item
due_date string // Due date in ISO format
}

View File

@ -0,0 +1,45 @@
module projects
import base
// SprintStatus represents the status of a sprint
pub enum SprintStatus {
planning
active
review
completed
cancelled
}
// Sprint represents a time-boxed period in which specific work has to be completed
pub struct Sprint {
base.Base
pub mut:
name string
description string
project_id u32 // ID of the project this sprint belongs to
status SprintStatus
start_date string // Start date in ISO format
end_date string // End date in ISO format
goal string // The goal of this sprint
story_ids []u32 // IDs of the stories in this sprint
issue_ids []u32 // IDs of the issues in this sprint
epic_ids []u32 // IDs of the epics this sprint contributes to
velocity f32 // Planned velocity for this sprint
actual_points f32 // Actual story points completed
retrospective string // Notes from the sprint retrospective
}
// SprintReport represents a report generated at the end of a sprint
pub struct SprintReport {
base.Base
pub mut:
sprint_id u32
completed_items u32 // Number of items completed
total_items u32 // Total number of items
completed_points f32 // Number of story points completed
total_points f32 // Total number of story points
blockers []string // List of blockers encountered
achievements []string // List of achievements
lessons []string // Lessons learned
}

View File

@ -0,0 +1,63 @@
module projects
import base
// StorySize represents the size/complexity of a user story
pub enum StorySize {
xs // 1 point
s // 2 points
m // 3 points
l // 5 points
xl // 8 points
xxl // 13 points
}
// AcceptanceCriteria represents a single acceptance criterion for a story
pub struct AcceptanceCriteria {
pub mut:
description string
satisfied bool
}
// Story represents a user story in the project management system
pub struct Story {
base.Base
pub mut:
title string
description string
project_id u32 // ID of the project this story belongs to
epic_id u32 // ID of the epic this story belongs to (if any)
sprint_id u32 // ID of the sprint this story is scheduled for (if any)
owner_id u32 // ID of the user who owns this story
assignee_id u32 // ID of the user assigned to this story
status Status
priority Priority
size StorySize
points f32 // Story points (if not using standard sizes)
acceptance_criteria []AcceptanceCriteria // List of acceptance criteria
issue_ids []u32 // IDs of the issues related to this story
label_ids []u32 // IDs of the labels applied to this story
dependencies []u32 // IDs of stories that this story depends on
blockers []string // List of blockers preventing progress
business_value u32 // Business value (1-10)
user_persona string // User persona this story relates to
start_date string // Start date in ISO format
due_date string // Due date in ISO format
estimated_hours f32 // Estimated hours to complete
actual_hours f32 // Actual hours spent
tags []string
}
// StoryTask represents a task that needs to be completed for a story
pub struct StoryTask {
base.Base
pub mut:
story_id u32
title string
description string
assignee_id u32 // ID of the user assigned to this task
status Status
estimated_hours f32 // Estimated hours to complete
actual_hours f32 // Actual hours spent
order u32 // Order of the task in the story
}