Skip to content

Extend Recipe schema: add optional metadata fields (description, tags, prep_time_minutes, servings, versioning) #1449

@marcuscastelo

Description

@marcuscastelo

reportedBy: github-copilot.v1

Extend Recipe schema: add optional metadata fields (description, tags, prep_time_minutes, servings, versioning)

Summary

  • Propose adding optional metadata fields to the Recipe schema to support richer editing and display: description, tags, prep_time_minutes, servings, and optional version/history metadata.

Motivation

  • Improve UX by allowing richer recipe metadata.
  • Decouple schema extension from immediate UI editing work so the core edit flow can be delivered quickly.

Proposed changes

  • Schema additions (all optional):
    • description?: string
    • tags?: string[]
    • prep_time_minutes?: number (non-negative integer)
    • servings?: number (positive integer)
    • version?: { number: number, updatedAt: string, updatedBy: string } (optional history metadata)

Acceptance criteria

  • Schema updated with optional fields and Zod validation added.
  • Migration plan documented if DB persistence requires migration for existing recipes.
  • Application layer updated to tolerate missing fields (backward compatible).
  • UI changes planned separately to surface new fields (this issue tracks schema + infra only).
  • Tests added for new validation rules and backward compatibility.

Implementation notes

  • Add fields to src/modules/diet/recipe/domain/recipe.ts and export types.
  • Update repository DAO converters to map new fields to/from Supabase DAO shapes.
  • Provide migration scripts or carefully handle undefined fields in persistence layer.
  • Do not change UI in this task; create a follow-up issue for UI work.

Labels: improvement, complexity-medium, backend
Assignee: marcuscastelo

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendBackend-specific issue or changecomplexity-mediumMedium implementation complexityimprovementTechnical debt or general improvement

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions