feat: implement meal planning feature with CRUD operations and UI integration

This commit is contained in:
Nils-Johan Gynther
2026-04-16 19:37:09 +02:00
parent 8b12df4aa4
commit 1b82b02021
13 changed files with 468 additions and 1 deletions
@@ -0,0 +1,28 @@
import { Body, Controller, Delete, Get, Param, Post, Query } from '@nestjs/common';
import { MealPlanService } from './meal-plan.service';
import { CreateMealPlanEntryDto } from './dto/create-meal-plan-entry.dto';
@Controller('meal-plan')
export class MealPlanController {
constructor(private readonly mealPlanService: MealPlanService) {}
@Get()
findByRange(@Query('from') from: string, @Query('to') to: string) {
return this.mealPlanService.findByRange(from, to);
}
@Get('shopping-list')
shoppingList(@Query('from') from: string, @Query('to') to: string) {
return this.mealPlanService.shoppingList(from, to);
}
@Post()
upsert(@Body() dto: CreateMealPlanEntryDto) {
return this.mealPlanService.upsert(dto);
}
@Delete(':date')
removeByDate(@Param('date') date: string) {
return this.mealPlanService.removeByDate(date);
}
}