refactor: Extract IssueDetails to shared type (bd-6dnt)
Consolidated 5 duplicate IssueDetails struct definitions into a single types.IssueDetails in internal/types/types.go: - Removed 4 inline definitions from cmd/bd/show.go - Removed 1 inline definition from internal/rpc/server_issues_epics.go The shared type embeds types.Issue by value and includes: Labels, Dependencies, Dependents, Comments, and Parent fields. This improves maintainability and reduces risk of inconsistency.
This commit is contained in:
@@ -1305,16 +1305,8 @@ func (s *Server) handleShow(req *Request) Response {
|
||||
comments, _ := store.GetIssueComments(ctx, issue.ID)
|
||||
|
||||
// Create detailed response with related data
|
||||
type IssueDetails struct {
|
||||
*types.Issue
|
||||
Labels []string `json:"labels,omitempty"`
|
||||
Dependencies []*types.IssueWithDependencyMetadata `json:"dependencies,omitempty"`
|
||||
Dependents []*types.IssueWithDependencyMetadata `json:"dependents,omitempty"`
|
||||
Comments []*types.Comment `json:"comments,omitempty"`
|
||||
}
|
||||
|
||||
details := &IssueDetails{
|
||||
Issue: issue,
|
||||
details := &types.IssueDetails{
|
||||
Issue: *issue,
|
||||
Labels: labels,
|
||||
Dependencies: deps,
|
||||
Dependents: dependents,
|
||||
|
||||
Reference in New Issue
Block a user