04b1fc3024
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>
201 lines
6.1 KiB
TypeScript
201 lines
6.1 KiB
TypeScript
import { CreateInventoryDto } from './dto/create-inventory.dto';
|
|
import { UpdateInventoryDto } from './dto/update-inventory.dto';
|
|
import { InventoryService } from './inventory.service';
|
|
import { ConsumeInventoryDto } from './dto/consume-inventory.dto';
|
|
export declare class InventoryController {
|
|
private readonly inventoryService;
|
|
constructor(inventoryService: InventoryService);
|
|
consume(id: number, body: ConsumeInventoryDto): Promise<{
|
|
product: {
|
|
name: string;
|
|
category: string | null;
|
|
status: string;
|
|
id: number;
|
|
categoryId: number | null;
|
|
normalizedName: string;
|
|
canonicalName: string | null;
|
|
isActive: boolean;
|
|
deletedAt: Date | null;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
ownerId: number;
|
|
isPrivate: boolean;
|
|
};
|
|
} & {
|
|
origin: string | null;
|
|
id: number;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
productId: number;
|
|
quantity: import("@prisma/client/runtime/library").Decimal;
|
|
unit: string;
|
|
brand: string | null;
|
|
receiptName: string | null;
|
|
location: string | null;
|
|
purchaseDate: Date | null;
|
|
opened: boolean | null;
|
|
suitableFor: string | null;
|
|
bestBeforeDate: Date | null;
|
|
comment: string | null;
|
|
}>;
|
|
findConsumptionHistory(id: number): Promise<{
|
|
inventoryItem: {
|
|
unit: string;
|
|
};
|
|
id: number;
|
|
createdAt: Date;
|
|
comment: string | null;
|
|
inventoryItemId: number;
|
|
amountUsed: import("@prisma/client/runtime/library").Decimal;
|
|
}[]>;
|
|
findAll(location?: string, sort?: string): Promise<({
|
|
product: {
|
|
name: string;
|
|
category: string | null;
|
|
status: string;
|
|
id: number;
|
|
categoryId: number | null;
|
|
normalizedName: string;
|
|
canonicalName: string | null;
|
|
isActive: boolean;
|
|
deletedAt: Date | null;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
ownerId: number;
|
|
isPrivate: boolean;
|
|
};
|
|
} & {
|
|
origin: string | null;
|
|
id: number;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
productId: number;
|
|
quantity: import("@prisma/client/runtime/library").Decimal;
|
|
unit: string;
|
|
brand: string | null;
|
|
receiptName: string | null;
|
|
location: string | null;
|
|
purchaseDate: Date | null;
|
|
opened: boolean | null;
|
|
suitableFor: string | null;
|
|
bestBeforeDate: Date | null;
|
|
comment: string | null;
|
|
})[]>;
|
|
findExpiring(): Promise<({
|
|
product: {
|
|
name: string;
|
|
category: string | null;
|
|
status: string;
|
|
id: number;
|
|
categoryId: number | null;
|
|
normalizedName: string;
|
|
canonicalName: string | null;
|
|
isActive: boolean;
|
|
deletedAt: Date | null;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
ownerId: number;
|
|
isPrivate: boolean;
|
|
};
|
|
} & {
|
|
origin: string | null;
|
|
id: number;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
productId: number;
|
|
quantity: import("@prisma/client/runtime/library").Decimal;
|
|
unit: string;
|
|
brand: string | null;
|
|
receiptName: string | null;
|
|
location: string | null;
|
|
purchaseDate: Date | null;
|
|
opened: boolean | null;
|
|
suitableFor: string | null;
|
|
bestBeforeDate: Date | null;
|
|
comment: string | null;
|
|
})[]>;
|
|
create(body: CreateInventoryDto): Promise<{
|
|
product: {
|
|
name: string;
|
|
category: string | null;
|
|
status: string;
|
|
id: number;
|
|
categoryId: number | null;
|
|
normalizedName: string;
|
|
canonicalName: string | null;
|
|
isActive: boolean;
|
|
deletedAt: Date | null;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
ownerId: number;
|
|
isPrivate: boolean;
|
|
};
|
|
} & {
|
|
origin: string | null;
|
|
id: number;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
productId: number;
|
|
quantity: import("@prisma/client/runtime/library").Decimal;
|
|
unit: string;
|
|
brand: string | null;
|
|
receiptName: string | null;
|
|
location: string | null;
|
|
purchaseDate: Date | null;
|
|
opened: boolean | null;
|
|
suitableFor: string | null;
|
|
bestBeforeDate: Date | null;
|
|
comment: string | null;
|
|
}>;
|
|
update(id: number, body: UpdateInventoryDto): Promise<{
|
|
product: {
|
|
name: string;
|
|
category: string | null;
|
|
status: string;
|
|
id: number;
|
|
categoryId: number | null;
|
|
normalizedName: string;
|
|
canonicalName: string | null;
|
|
isActive: boolean;
|
|
deletedAt: Date | null;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
ownerId: number;
|
|
isPrivate: boolean;
|
|
};
|
|
} & {
|
|
origin: string | null;
|
|
id: number;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
productId: number;
|
|
quantity: import("@prisma/client/runtime/library").Decimal;
|
|
unit: string;
|
|
brand: string | null;
|
|
receiptName: string | null;
|
|
location: string | null;
|
|
purchaseDate: Date | null;
|
|
opened: boolean | null;
|
|
suitableFor: string | null;
|
|
bestBeforeDate: Date | null;
|
|
comment: string | null;
|
|
}>;
|
|
remove(id: number): Promise<{
|
|
origin: string | null;
|
|
id: number;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
productId: number;
|
|
quantity: import("@prisma/client/runtime/library").Decimal;
|
|
unit: string;
|
|
brand: string | null;
|
|
receiptName: string | null;
|
|
location: string | null;
|
|
purchaseDate: Date | null;
|
|
opened: boolean | null;
|
|
suitableFor: string | null;
|
|
bestBeforeDate: Date | null;
|
|
comment: string | null;
|
|
}>;
|
|
}
|