feat(recipes): add recipe visibility and sharing features

- Implemented functionality to set recipe visibility (public/private) with appropriate checks for user permissions.
- Added ability to share recipes with other users, including validation for existing users and permissions.
- Introduced new DTOs for setting visibility and sharing recipes.
- Updated RecipesController and RecipesService to handle new endpoints for visibility and sharing.
- Enhanced inventory preview to consider user permissions and shared recipes.
- Updated front-end to support new sharing and visibility features, including UI changes for recipe detail and admin user management.
This commit is contained in:
Nils-Johan Gynther
2026-05-02 09:19:59 +02:00
parent f67bf8baef
commit 41ae7d4d06
17 changed files with 742 additions and 124 deletions
@@ -7,6 +7,7 @@ class UserAdmin {
final String? lastName;
final String role;
final bool isPremium;
final bool canShareRecipes;
final DateTime? createdAt;
const UserAdmin({
@@ -17,6 +18,7 @@ class UserAdmin {
this.lastName,
required this.role,
required this.isPremium,
required this.canShareRecipes,
this.createdAt,
});
@@ -28,6 +30,7 @@ class UserAdmin {
lastName: json['lastName'] as String?,
role: json['role'] as String? ?? 'user',
isPremium: json['isPremium'] as bool? ?? false,
canShareRecipes: json['canShareRecipes'] as bool? ?? true,
createdAt: json['createdAt'] != null ? DateTime.tryParse(json['createdAt'] as String) : null,
);