Refactor code structure for improved readability and maintainability
Test Suite / test (24.15.0) (push) Has been cancelled

This commit is contained in:
Nils-Johan Gynther
2026-05-06 07:37:59 +02:00
parent e4f201ea36
commit 969dafdbc6
273 changed files with 11357 additions and 39 deletions
+83
View File
@@ -0,0 +1,83 @@
import { PrismaService } from '../prisma/prisma.service';
import { CreateMealPlanEntryDto } from './dto/create-meal-plan-entry.dto';
export declare class MealPlanService {
private readonly prisma;
constructor(prisma: PrismaService);
findByRange(userId: number, from: string, to: string): Promise<({
recipe: {
name: string;
id: number;
imageUrl: string | null;
servings: number | null;
ingredients: {
product: {
name: string;
canonicalName: string | null;
id: number;
} | null;
quantity: import("@prisma/client/runtime/library").Decimal | null;
unit: string | null;
note: string | null;
}[];
};
} & {
id: number;
createdAt: Date;
updatedAt: Date;
servings: number | null;
userId: number;
recipeId: number;
date: Date;
})[]>;
upsert(userId: number, dto: CreateMealPlanEntryDto): Promise<{
recipe: {
name: string;
id: number;
imageUrl: string | null;
servings: number | null;
ingredients: {
product: {
name: string;
canonicalName: string | null;
id: number;
} | null;
quantity: import("@prisma/client/runtime/library").Decimal | null;
unit: string | null;
note: string | null;
}[];
};
} & {
id: number;
createdAt: Date;
updatedAt: Date;
servings: number | null;
userId: number;
recipeId: number;
date: Date;
}>;
removeByDate(userId: number, date: string): Promise<{
id: number;
createdAt: Date;
updatedAt: Date;
servings: number | null;
userId: number;
recipeId: number;
date: Date;
}>;
private aggregateIngredients;
shoppingList(userId: number, from: string, to: string): Promise<{
productId: number;
name: string;
quantity: number;
unit: string;
}[]>;
inventoryCompare(userId: number, from: string, to: string): Promise<{
productId: number;
name: string;
required: number;
unit: string;
available: number;
missing: number;
status: "enough" | "missing" | "pantry";
}[]>;
}