feat: add rematch functionality for recipe ingredients and enhance inventory management
Test Suite / test (24.15.0) (push) Has been cancelled
Test Suite / test (24.15.0) (push) Has been cancelled
- Added a new API path for rematching recipe ingredients in `api_paths.dart`. - Implemented a manual product creation dialog in `inventory_screen.dart` to allow users to create new products directly. - Integrated the rematch functionality in `recipe_repository.dart` to handle rematching of recipe ingredients. - Updated the recipe detail screen to include a button for triggering the rematch process. - Introduced a new `RecipeMatchingService` in the backend to handle ingredient matching logic. - Added database migration to include `aiEngineEnabled` column in the User table. Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
+19
@@ -36,6 +36,12 @@ __decorate([
|
||||
(0, class_validator_1.IsBoolean)(),
|
||||
__metadata("design:type", Boolean)
|
||||
], SetRecipeSharingDto.prototype, "canShareRecipes", void 0);
|
||||
class SetAiEngineEnabledDto {
|
||||
}
|
||||
__decorate([
|
||||
(0, class_validator_1.IsBoolean)(),
|
||||
__metadata("design:type", Boolean)
|
||||
], SetAiEngineEnabledDto.prototype, "aiEngineEnabled", void 0);
|
||||
class AdminCreateUserDto {
|
||||
}
|
||||
__decorate([
|
||||
@@ -125,6 +131,10 @@ let UsersController = class UsersController {
|
||||
const updated = await this.usersService.setRecipeSharing(id, dto.canShareRecipes);
|
||||
return { id: updated.id, username: updated.username, canShareRecipes: updated.canShareRecipes };
|
||||
}
|
||||
async setAiEngineEnabled(id, dto) {
|
||||
const updated = await this.usersService.setAiEngineEnabled(id, dto.aiEngineEnabled);
|
||||
return { id: updated.id, username: updated.username, aiEngineEnabled: updated.aiEngineEnabled };
|
||||
}
|
||||
async adminCreateUser(dto) {
|
||||
const user = await this.usersService.adminCreate(dto);
|
||||
return { id: user.id, username: user.username, email: user.email, role: user.role, createdAt: user.createdAt };
|
||||
@@ -209,6 +219,15 @@ __decorate([
|
||||
__metadata("design:paramtypes", [Number, SetRecipeSharingDto]),
|
||||
__metadata("design:returntype", Promise)
|
||||
], UsersController.prototype, "setRecipeSharing", null);
|
||||
__decorate([
|
||||
(0, roles_decorator_1.Roles)('admin'),
|
||||
(0, common_1.Patch)(':id/ai-engine'),
|
||||
__param(0, (0, common_1.Param)('id', common_1.ParseIntPipe)),
|
||||
__param(1, (0, common_1.Body)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [Number, SetAiEngineEnabledDto]),
|
||||
__metadata("design:returntype", Promise)
|
||||
], UsersController.prototype, "setAiEngineEnabled", null);
|
||||
__decorate([
|
||||
(0, roles_decorator_1.Roles)('admin'),
|
||||
(0, common_1.Post)(),
|
||||
|
||||
Reference in New Issue
Block a user