Skip to content

Roadmap Item: Release 0.1 — Core Platform

Status

IN_PROGRESS

Date: 2026-02-07

Changelog

Date Revision Description Author
2026-02-07 1.0 Initial version (extracted from implementation) @souperk

Context

Release 0.1 is the foundational release for loryth-grocery, delivering the core domain model that all future features build upon. It covers the complete food management loop: maintaining an ingredient and product catalog, creating recipes with cookability checks, tracking inventory in location-aware batches with expiry dates, and managing shopping trips through their full lifecycle with automatic inventory creation on checkout.

Feature implementation is complete. The remaining work is closing test coverage gaps to ensure the platform is stable before shipping.

Proposal

Overview

Core Platform delivering ingredient/product catalog, recipe management, batch-based inventory, shopping trips, and cross-domain flows (trip completion, cook recipe, add recipe to trip).

Goals

  • Full ingredient/product catalog with 20 categories, barcode support, and shelf-life metadata
  • Recipe management with ingredients, quantities, tags, servings, and cookability checks
  • Batch-based inventory with 5 storage locations, 3 statuses, expiry tracking, and FIFO consumption
  • Shopping trips with 8 retailer types, 4 trip statuses, 5 item statuses, and full lifecycle
  • Cross-domain flows: trip completion creates inventory, cook recipe consumes inventory, add recipe items to trip
  • Activity logging across 8 activity types for full audit trail
  • Comprehensive test coverage for all endpoints, error cases, and cross-domain flows

Non-Goals

  • Prepared foods / leftovers tracking (v0.2)
  • Quick meal templates or one-tap consumption (v0.2)
  • Smart shopping suggestions or staple items (v0.3)
  • Retailer-aware trip planning (v0.4)
  • Nutrition facts or dietary constraints (v0.5)

Technical Details

Approach

  • Domain-driven design with aggregate roots per bounded context
  • SQLAlchemy 2.0 with selectin loading for parent-child relationships
  • FastAPI routers with Pydantic schemas for request/response validation
  • @transactional decorator for service-layer transaction management
  • DI container from loryth-common for dependency wiring

What's Built

  • Catalog: Ingredient and Product aggregates with IngredientCategory (20 values), barcode uniqueness, shelf-life fields
  • Recipe: Recipe aggregate with RecipeIngredient children, cookability check against inventory
  • Inventory: InventoryBatch aggregate with StorageLocation (5 values), BatchStatus (3 values), FIFO consumption; InventoryActivity for audit trail with ActivityType (8 values)
  • Shopping: ShoppingTrip aggregate with ShoppingTripItem children, RetailerType (8 values), TripStatus (4 values), ItemStatus (5 values), trip completion flow creating inventory batches
  • Migrations: v00–v06 covering all tables, enums, and constraints
  • Tests: 33 integration tests covering 25/35 endpoints

Dependencies

  • loryth-common: DI framework
  • loryth-domain: BaseAggregate, AuditMixin
  • loryth-persistence: DbContext, BaseRepository, @transactional
  • loryth-fastapi: SuccessResponse, middleware
  • PostgreSQL 17.4 via testcontainers for integration tests

Backwards Compatibility

  • Initial release; no migration requirements

Implementation Plan

Phase 1: Feature Implementation ✅

All domain entities, services, repositories, routers, and migrations are complete.

Phase 2: Test Stabilization 🚧

Untested endpoints (10):

  • GET /product/{id} — Get single product
  • GET /product — List products
  • PATCH /product/{id} — Update product
  • DELETE /product/{id} — Delete product
  • GET /recipe/ — List recipes
  • PATCH /recipe/{id}/ingredient/{ing_id} — Update recipe ingredient
  • GET /inventory/batch/{id} — Get single batch
  • GET /inventory/expiring-soon — Expiring-soon endpoint
  • GET /trip/ — List trips
  • PATCH /trip/{id} — Update trip

Error/edge case tests:

  • Duplicate barcode prevention (DuplicateBarcodeError)
  • Consume from depleted/expired batch (BatchNotActiveError)
  • Insufficient quantity in single batch (InsufficientQuantityError)
  • Insufficient inventory for recipe cooking
  • Cookability happy-path (sufficient inventory)
  • Optional ingredients not affecting cookability
  • Trip update on non-editable trip (TripNotEditableError)
  • Invalid trip status transitions (e.g., COMPLETED→START)
  • Item status transitions: PENDING→NOT_FOUND, PENDING→SKIPPED
  • IN_PROGRESS trip cancellation
  • Zero/negative quantity validation

Cross-domain flow validation:

  • FIFO consumption order verification (oldest batch consumed first)
  • Add-recipe-items filters already-stocked ingredients
  • Cookability with sufficient inventory (happy path)

Open Questions

  • Should consume events be tied to a specific location?

References