Skip to content

Refactor: Consolidate Repository and RepositoryFull types #4

@rbansal42

Description

@rbansal42

Description

The API package has two repository types that have significant overlap:

  • Repository in internal/api/repositories.go
  • RepositoryFull in internal/api/repositories.go

This creates confusion about which type to use and leads to unnecessary type conversions.

Current State

  • Repository is used for list responses
  • RepositoryFull is used for single repository responses
  • Many fields are duplicated between the two types

Proposed Solution

  1. Use a single Repository type with all fields
  2. Document which fields are populated in different API responses
  3. Consider using pointers for optional fields to distinguish between "not set" and "empty"

Files Affected

  • internal/api/repositories.go
  • All code that uses these types

Labels

  • refactor
  • tech-debt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions