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)
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., acreateSupabaseItemMapper()/createSupabaseMacroMapper()factory module that is the only export).Originally posted by @Copilot in #1471 (comment)