services
Orchestrate recipe and authentication operations.
AuthService
AuthService(
google_verifier: GoogleTokenVerifierPort,
jwt_token: JwtTokenPort,
user_repository: UserRepositoryPort,
)
RecipeExportService
RecipeExportService(
repository: RecipeRepositoryPort,
word_exporter: WordExporterPort,
markdown_exporter: MarkdownExporterPort,
)
Service for exporting recipes to different formats.
RecipeImportService
RecipeImportService(instagram_parser: InstagramParserPort)
Service for importing recipes from external sources.
parse_instagram
parse_instagram(data: InstagramResponse) -> list[ParsedRecipe]
Parse Instagram data using the injected parser adapter.
RecipeManagementService
RecipeManagementService(
repository: RecipeRepositoryPort,
image_storage: ImageStoragePort,
share_repo: RecipeShareRepositoryPort | None = None,
)
Service for recipe creation, retrieval, and search operations.
add_recipe_image
Add an image to a recipe. Requires owner or editor role.
create_recipe
create_recipe(data: RecipeCreate, owner_id: UUID) -> RecipeEntity
Create a new recipe with ingredients, images, and sources.
create_recipes
create_recipes(data: list[RecipeCreate], owner_id: UUID) -> list[RecipeEntity]
Create multiple recipes in a single atomic transaction.
delete_recipe_image
Delete an image from storage and database.
get_recipe_by_id
Retrieve a recipe by ID, scoped to the given user.
get_recipe_image
Retrieve image bytes from storage by image ID, only if owned by user.
search_recipes
search_recipes(
user_id: UUID,
recipe_id: UUID | None = None,
title: str | None = None,
category: str | None = None,
is_veggie: bool | None = None,
season: str | None = None,
limit: int | None = None,
offset: int = 0,
ownership: str | None = None,
) -> PaginatedResult
Search/filter recipes via the repository abstraction, visible to user.
RecipeShareService
RecipeShareService(
share_repo: RecipeShareRepositoryPort,
user_repo: UserRepositoryPort,
recipe_repo: RecipeRepositoryPort,
)
Service for sharing recipes between users.
get_recipe_shares
get_recipe_shares(recipe_id: UUID, user_id: UUID) -> list[RecipeShareEntity]
Only the owner can view all collaborators.
leave_recipe
Remove yourself from a shared recipe by recipe ID.
share_recipe
share_recipe(
recipe_id: UUID, email: str, role: ShareRole, user_id: UUID
) -> RecipeShareEntity
Share a recipe with another user. Only the owner can share.