Skip to content

There is substantial duplicated DTO <-> domain mapping logic here (e.g., macrosToDomain/macrosToDTO, itemToDomain/itemToDTO) that now appears in multiple Supabase gateways/repositories. This increases the chance of subtle drift/bugs if one copy is updated and others aren’t. Consider extracting these into a shared helper that still preserves encapsulation (e.g., a createSupabaseItemMapper() / createSupabaseMacroMapper() factory module that is the only export). #1474

Description

@marcuscastelo

There is substantial duplicated DTO <-> domain mapping logic here (e.g., macrosToDomain/macrosToDTO, itemToDomain/itemToDTO) that now appears in multiple Supabase gateways/repositories. This increases the chance of subtle drift/bugs if one copy is updated and others aren’t. Consider extracting these into a shared helper that still preserves encapsulation (e.g., a createSupabaseItemMapper() / createSupabaseMacroMapper() factory module that is the only export).

Originally posted by @Copilot in #1471 (comment)

Activity

  1. added this to the v0.16.0 milestone on Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    refactorCode refactoring requiredrefinementNeeds further refinement or polish

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions