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

@marcuscastelo

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)

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