feat: add rematch functionality for recipe ingredients and enhance inventory management
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:
Nils-Johan Gynther
2026-05-06 09:20:31 +02:00
parent 9fe85a719c
commit 04b1fc3024
53 changed files with 1420 additions and 652 deletions
+22 -22
View File
@@ -15,13 +15,13 @@ export declare class InventoryService {
private ensureProductExists;
findAll(query?: InventoryQuery): Promise<({
product: {
name: string;
category: string | null;
status: string;
name: string;
categoryId: number | null;
canonicalName: string | null;
id: number;
categoryId: number | null;
normalizedName: string;
canonicalName: string | null;
isActive: boolean;
deletedAt: Date | null;
createdAt: Date;
@@ -30,6 +30,7 @@ export declare class InventoryService {
isPrivate: boolean;
};
} & {
origin: string | null;
id: number;
createdAt: Date;
updatedAt: Date;
@@ -37,7 +38,6 @@ export declare class InventoryService {
quantity: Prisma.Decimal;
unit: string;
brand: string | null;
origin: string | null;
receiptName: string | null;
location: string | null;
purchaseDate: Date | null;
@@ -48,13 +48,13 @@ export declare class InventoryService {
})[]>;
consume(id: number, data: ConsumeInventoryDto): Promise<{
product: {
name: string;
category: string | null;
status: string;
name: string;
categoryId: number | null;
canonicalName: string | null;
id: number;
categoryId: number | null;
normalizedName: string;
canonicalName: string | null;
isActive: boolean;
deletedAt: Date | null;
createdAt: Date;
@@ -63,6 +63,7 @@ export declare class InventoryService {
isPrivate: boolean;
};
} & {
origin: string | null;
id: number;
createdAt: Date;
updatedAt: Date;
@@ -70,7 +71,6 @@ export declare class InventoryService {
quantity: Prisma.Decimal;
unit: string;
brand: string | null;
origin: string | null;
receiptName: string | null;
location: string | null;
purchaseDate: Date | null;
@@ -86,18 +86,18 @@ export declare class InventoryService {
id: number;
createdAt: Date;
comment: string | null;
amountUsed: Prisma.Decimal;
inventoryItemId: number;
amountUsed: Prisma.Decimal;
}[]>;
findExpiring(): Promise<({
product: {
name: string;
category: string | null;
status: string;
name: string;
categoryId: number | null;
canonicalName: string | null;
id: number;
categoryId: number | null;
normalizedName: string;
canonicalName: string | null;
isActive: boolean;
deletedAt: Date | null;
createdAt: Date;
@@ -106,6 +106,7 @@ export declare class InventoryService {
isPrivate: boolean;
};
} & {
origin: string | null;
id: number;
createdAt: Date;
updatedAt: Date;
@@ -113,7 +114,6 @@ export declare class InventoryService {
quantity: Prisma.Decimal;
unit: string;
brand: string | null;
origin: string | null;
receiptName: string | null;
location: string | null;
purchaseDate: Date | null;
@@ -124,13 +124,13 @@ export declare class InventoryService {
})[]>;
create(data: CreateInventoryDto): Promise<{
product: {
name: string;
category: string | null;
status: string;
name: string;
categoryId: number | null;
canonicalName: string | null;
id: number;
categoryId: number | null;
normalizedName: string;
canonicalName: string | null;
isActive: boolean;
deletedAt: Date | null;
createdAt: Date;
@@ -139,6 +139,7 @@ export declare class InventoryService {
isPrivate: boolean;
};
} & {
origin: string | null;
id: number;
createdAt: Date;
updatedAt: Date;
@@ -146,7 +147,6 @@ export declare class InventoryService {
quantity: Prisma.Decimal;
unit: string;
brand: string | null;
origin: string | null;
receiptName: string | null;
location: string | null;
purchaseDate: Date | null;
@@ -157,13 +157,13 @@ export declare class InventoryService {
}>;
update(id: number, data: UpdateInventoryDto): Promise<{
product: {
name: string;
category: string | null;
status: string;
name: string;
categoryId: number | null;
canonicalName: string | null;
id: number;
categoryId: number | null;
normalizedName: string;
canonicalName: string | null;
isActive: boolean;
deletedAt: Date | null;
createdAt: Date;
@@ -172,6 +172,7 @@ export declare class InventoryService {
isPrivate: boolean;
};
} & {
origin: string | null;
id: number;
createdAt: Date;
updatedAt: Date;
@@ -179,7 +180,6 @@ export declare class InventoryService {
quantity: Prisma.Decimal;
unit: string;
brand: string | null;
origin: string | null;
receiptName: string | null;
location: string | null;
purchaseDate: Date | null;
@@ -189,6 +189,7 @@ export declare class InventoryService {
comment: string | null;
}>;
remove(id: number): Promise<{
origin: string | null;
id: number;
createdAt: Date;
updatedAt: Date;
@@ -196,7 +197,6 @@ export declare class InventoryService {
quantity: Prisma.Decimal;
unit: string;
brand: string | null;
origin: string | null;
receiptName: string | null;
location: string | null;
purchaseDate: Date | null;