Skip to content

Issue: Standardize and Document Repository Interfaces and Error Types #656

Open

Description

@marcuscastelo

Priority: Urgent — Should be resolved as soon as possible to prevent integration and error handling issues.

Area: Domain Layer (all modules)

Background

The audit (audit_domain.md) found inconsistent repository interfaces and error handling across modules. Nullable returns and lack of custom error types make error handling and integration harder, and violate DDD best practices.

Task

  • Standardize repository interfaces for all domain modules (avoid nullable returns; use explicit error types or results).
  • Document repository contracts and error types in code and JSDoc.
  • Introduce or update custom error classes for domain invariants and business rules.
  • Update or remove related tests as necessary.

Acceptance Criteria

  • All repository interfaces are consistent and documented.
  • Nullable returns are replaced with explicit error/result types.
  • Custom error classes are used for domain errors.
  • JSDoc for all affected exported types/functions is updated.
  • All checks pass (npm run check).

References


Small, incremental step. Should not exceed 1K lines of change.

Activity

  1. modified the milestones: v0.12.0, DDD on Jun 7, 2025
  2. added
    domainDomain logic or business rules
    error-handlingError handling or propagation
    documentationDocumentation improvements or additions
    on Jun 11, 2025
  3. moved this to Critical in macroflowson Jun 18, 2025
  4. moved this from Critical to Planned in macroflowson Jun 18, 2025
  5. moved this from Planned to Critical in macroflowson Jun 18, 2025
  6. moved this from Critical to Planned in macroflowson Jun 18, 2025
  7. modified the milestones: DDD, v0.14.0 on Jun 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

documentationDocumentation improvements or additionsdomainDomain logic or business ruleserror-handlingError handling or propagation

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions