mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-22 14:49:40 +02:00
Refactor/conver to controllers (#923)
* add dependency injection for get_repositories * convert events api to controller * update generic typing * add abstract controllers * update test naming * migrate admin services to controllers * add additional admin route tests * remove print * add public shared dependencies * add types * fix typo * add static variables for recipe json keys * add coverage gutters config * update controller routers * add generic success response * add category/tag/tool tests * add token refresh test * add coverage utilities * covert comments to controller * add todo * add helper properties * delete old service * update test notes * add unit test for pretty_stats * remove dead code from post_webhooks * update group routes to use controllers * add additional group test coverage * abstract common permission checks * convert ingredient parser to controller * update recipe crud to use controller * remove dead-code * add class lifespan tracker for debugging * convert bulk export to controller * migrate tools router to controller * update recipe share to controller * move customer router to _base * ignore prints in flake8 * convert units and foods to new controllers * migrate user routes to controllers * centralize error handling * fix invalid ref * reorder fields * update routers to share common handling * update tests * remove prints * fix cookbooks delete * fix cookbook get * add controller for mealplanner * cover report routes to controller * remove __future__ imports * remove dead code * remove all base_http children and remove dead code
This commit is contained in:
parent
5823a32daf
commit
c4540f1395
164 changed files with 3111 additions and 3213 deletions
|
@ -1,7 +1,5 @@
|
|||
from uuid import UUID
|
||||
|
||||
from fastapi_camelcase import CamelModel
|
||||
from pydantic import validator
|
||||
from pydantic import UUID4, validator
|
||||
from slugify import slugify
|
||||
|
||||
from ..recipe.recipe_category import CategoryBase, RecipeCategoryResponse
|
||||
|
@ -25,16 +23,16 @@ class CreateCookBook(CamelModel):
|
|||
return slug
|
||||
|
||||
|
||||
class UpdateCookBook(CreateCookBook):
|
||||
class SaveCookBook(CreateCookBook):
|
||||
group_id: UUID4
|
||||
|
||||
|
||||
class UpdateCookBook(SaveCookBook):
|
||||
id: int
|
||||
|
||||
|
||||
class SaveCookBook(CreateCookBook):
|
||||
group_id: UUID
|
||||
|
||||
|
||||
class ReadCookBook(UpdateCookBook):
|
||||
group_id: UUID
|
||||
group_id: UUID4
|
||||
categories: list[CategoryBase] = []
|
||||
|
||||
class Config:
|
||||
|
@ -42,7 +40,7 @@ class ReadCookBook(UpdateCookBook):
|
|||
|
||||
|
||||
class RecipeCookBook(ReadCookBook):
|
||||
group_id: UUID
|
||||
group_id: UUID4
|
||||
categories: list[RecipeCategoryResponse]
|
||||
|
||||
class Config:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue