Skip to content

Add Foodbook templates: models, EF migration, service, UI and planner integration#106

Open
phoneuooyd wants to merge 1 commit intomainfrom
codex/add-foodbook-templates-feature
Open

Add Foodbook templates: models, EF migration, service, UI and planner integration#106
phoneuooyd wants to merge 1 commit intomainfrom
codex/add-foodbook-templates-feature

Conversation

@phoneuooyd
Copy link
Copy Markdown
Owner

Motivation

  • Provide reusable meal-plan templates so users can save a complete planner and re-apply it for new date ranges.
  • Persist templates and template meal positions to the app database so templates survive restarts and can be shared/marked public.
  • Expose template management (list / create / edit / delete / apply) in the UI and gate creation via the existing premium checks (IFeatureAccessService).
  • Ensure schema is explicit via an EF migration so on-device schema validation can detect the new tables.

Description

  • Added domain models FoodbookTemplate and TemplateMeal in FoodbookApp.App/Models/, representing templates and per-day/per-slot recipe positions.
  • Added DbSet<FoodbookTemplate> and DbSet<TemplateMeal> plus model configuration (relations, indexes) in Data/AppDbContext.cs and created EF migration Data/Migrations/20260307120000_AddFoodbookTemplates.cs to create FoodbookTemplates and TemplateMeals tables.
  • Introduced IFoodbookTemplateService and FoodbookTemplateService implementing template flows: Get, SaveTemplateFromPlanAsync, Update, Remove, and ApplyTemplateAsync which creates a Plan + PlannedMeal[] from a template.
  • Added UI and viewmodels: FoodbookTemplatesPage + FoodbookTemplatesViewModel and FoodbookTemplateFormPage + FoodbookTemplateFormViewModel for listing/creating/editing/applying templates.
  • Integrated planner actions in PlannerPage (three-dot toolbar): Save current plan as template (premium-gated via IFeatureAccessService) and Apply template (select template and start date to generate a Plan); added a Foodbooks tab in PlannerListsPage and support in PlannerListsViewModel.
  • Registered DI and routes in MauiProgram for the new service, viewmodels and pages and updated DatabaseService.RequiredTables to include the new tables.
  • Added localization keys for the Foodbooks tab / template form to Localization/PlannerListsPageResources*.resx and updated project docs (DOCS/*) to mention the new feature.

Testing

  • Ran a code-style check using git diff --check and fixed trailing whitespace issues (check passed).
  • Attempted to run a full build with dotnet build FoodbookApp.App/FoodbookApp.App.csproj but the dotnet CLI is not available in this environment so the build/migrations could not be executed here.
  • Attempted an automated UI screenshot with Playwright against a local endpoint, but there was no running app at the target address (result: ERR_EMPTY_RESPONSE), so visual verification was not produced.
  • Note: EF migration file 20260307120000_AddFoodbookTemplates was generated and included in the repo, but applying migrations and running integration tests should be executed in CI / a developer machine with the .NET SDK available (run dotnet ef database update or dotnet build + app startup to validate runtime schema).

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant