Skip to content

Add RecipeFavorite entity and endpoints #1143

Open

Description

@dgee2

Goal

Allow users to favourite recipes and track favourite counts via outbox events.

Spec reference

docs/specs/recipe-creation-target-architecture.md — §"Related recipe usage capabilities – Favourites"

Implementation notes

  • New RecipeFavorite entity: UserId + RecipeId (composite PK), CreatedAtUtc
  • EF config and migration
  • PUT /api/recipe/{recipeId}/favorite — adds favourite; emits RecipeFavorited outbox event
  • DELETE /api/recipe/{recipeId}/favorite — removes favourite; emits RecipeUnfavorited outbox event
  • Access check: caller must be able to see the recipe (respects access rules from Epic 6)
  • Idempotent: PUT on already-favourited recipe is a no-op (200 OK)

Acceptance criteria

  • Favourite added and removed correctly
  • Outbox events emitted for both actions
  • 404 if recipe not visible to caller

Testing

  • Integration tests: add, remove, idempotent add, invisible recipe returns 404

Part of#1105

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

    .NETPull requests that update .net codeenhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions