feat: (WIP) base-shoppinglist infra (#911)

* feat:  base-shoppinglist infra (WIP)

* add type checker

* implement controllers

* apply router fixes

* add checked section hide/animation

* add label support

* formatting

* fix overflow images

* add experimental banner

* fix #912 word break issue

* remove any type errors

* bump dependencies

* remove templates

* fix build errors

* bump node version

* fix template literal
This commit is contained in:
Hayden
2022-01-08 22:24:34 -09:00
committed by GitHub
parent 86c99b10a2
commit 6db1357064
66 changed files with 3455 additions and 1311 deletions

View File

@@ -1 +1,2 @@
from .group_shopping_list import *
from .webhook import *

View File

@@ -0,0 +1,65 @@
from typing import Optional
from fastapi_camelcase import CamelModel
from pydantic import UUID4
from mealie.schema.recipe.recipe_ingredient import IngredientFood, IngredientUnit
class ShoppingListItemCreate(CamelModel):
shopping_list_id: UUID4
checked: bool = False
position: int = 0
is_food: bool = False
note: Optional[str] = ""
quantity: float = 1
unit_id: int = None
unit: IngredientUnit = None
food_id: int = None
food: IngredientFood = None
recipe_id: Optional[int] = None
label_id: Optional[UUID4] = None
class ShoppingListItemOut(ShoppingListItemCreate):
id: UUID4
label: "Optional[MultiPurposeLabelSummary]" = None
class Config:
orm_mode = True
class ShoppingListCreate(CamelModel):
"""
Create Shopping List
"""
name: str = None
class ShoppingListSave(ShoppingListCreate):
group_id: UUID4
class ShoppingListSummary(ShoppingListSave):
id: UUID4
class Config:
orm_mode = True
class ShoppingListUpdate(ShoppingListSummary):
list_items: list[ShoppingListItemOut] = []
class ShoppingListOut(ShoppingListUpdate):
class Config:
orm_mode = True
from mealie.schema.labels import MultiPurposeLabelSummary
ShoppingListItemOut.update_forward_refs()