Files
recipe-app/flutter/lib/core/api/api_paths.dart
T
Nils-Johan Gynther 8ea2b97c27 feat: enhance profile screen with tab navigation and admin panels
- Added tab navigation for profile, database, users, suggestions, and AI sections.
- Implemented database management with inventory, pantry, and products tabs.
- Created Admin AI panel to display AI model information.
- Introduced Admin Pending Products panel for managing product approvals.
- Developed Admin Users panel for user management, including role changes and password resets.
- Added data models for AI models and pending products.
2026-04-25 08:22:14 +02:00

60 lines
2.0 KiB
Dart

class AuthApiPaths {
static const login = '/auth/login';
}
class ProductApiPaths {
static const list = '/products';
static const pending = '/products/pending';
static String setStatus(int id) => '/products/$id/status';
}
class AiApiPaths {
static const models = '/ai/models';
}
class RecipeApiPaths {
static const list = '/recipes';
static String detail(int id) => '/recipes/$id';
static String update(int id) => '/recipes/$id';
static String remove(int id) => '/recipes/$id';
static String inventoryPreview(int id) => '/recipes/$id/inventory-preview';
static const parseMarkdown = '/recipes/parse-markdown';
}
class InventoryApiPaths {
static const list = '/inventory';
static String update(int id) => '/inventory/$id';
static String remove(int id) => '/inventory/$id';
static String consume(int id) => '/inventory/$id/consume';
static String consumptionHistory(int id) => '/inventory/$id/consumption-history';
}
class PantryApiPaths {
static const list = '/pantry';
static String remove(int id) => '/pantry/$id';
}
class UserApiPaths {
static const me = '/users/me';
static const list = '/users';
static String setRole(int id) => '/users/$id/role';
static String setPremium(int id) => '/users/$id/premium';
static String delete(int id) => '/users/$id';
static String resetPassword(int id) => '/users/$id/reset-password';
}
class MealPlanApiPaths {
static const list = '/meal-plan';
static String listByRange(String from, String to) =>
'$list?from=${Uri.encodeQueryComponent(from)}&to=${Uri.encodeQueryComponent(to)}';
static String shoppingList(String from, String to) =>
'$list/shopping-list?from=${Uri.encodeQueryComponent(from)}&to=${Uri.encodeQueryComponent(to)}';
static String inventoryCompare(String from, String to) =>
'$list/inventory-compare?from=${Uri.encodeQueryComponent(from)}&to=${Uri.encodeQueryComponent(to)}';
static String removeByDate(String date) =>
'$list/${Uri.encodeComponent(date)}';
}