generated from rochacbruno/python-project-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
17aa912
commit e5ae926
Showing
4 changed files
with
92 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from abc import ABC | ||
from typing import Generic, List | ||
|
||
from abstract_data_layer.base import ID, CRUD | ||
|
||
|
||
class KMI(Generic[ID]): | ||
def __init__(self, name: str, category_id: str, description: str = None): | ||
self.name = name | ||
self.category_id = category_id | ||
self.description = description | ||
|
||
class KitchenMenuItemRepository(CRUD[KMI[ID], ID], ABC): | ||
def __init__(self): | ||
pass | ||
|
||
def find_by_category_id(self, category_id: str) -> List[KMI]: | ||
""" | ||
Find all the saved KMI by categoryId | ||
Returns: list of all KMI | ||
""" | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
from abc import ABC | ||
from typing import Generic, List | ||
|
||
from abstract_data_layer.base import ID, CRUD | ||
from abstract_data_layer.stats import ItemStatus | ||
|
||
|
||
class PlateKitchenMenuItem(Generic[ID]): | ||
def __init__(self, plate_id: str, | ||
menu_item_id: str, | ||
order_number: str, | ||
status: ItemStatus = ItemStatus.TODO, | ||
table_num: str = None, | ||
client_name: str = None, | ||
notes: str = None, | ||
take_away: bool = False): | ||
self.plate_id = plate_id | ||
self.menu_item_id = menu_item_id | ||
self.order_number = order_number | ||
self.status = status | ||
self.table_num = table_num | ||
self.client_name = client_name | ||
self.notes = notes | ||
self.take_away = take_away | ||
|
||
|
||
class PlateKitchenMenuItemRepository(CRUD[PlateKitchenMenuItem[ID], ID], ABC): | ||
def __init__(self): | ||
pass | ||
|
||
def find_by_plate_id(self, plate_id: str) -> List[PlateKitchenMenuItem]: | ||
""" | ||
Find all the saved Item by plate id | ||
Returns: list of all PlateKitchenMenuItem | ||
""" | ||
pass | ||
|
||
def find_not_in_plate(self) -> List[PlateKitchenMenuItem]: | ||
""" | ||
Find all the saved Item with plate id None (not positioned yet) | ||
Returns: list of all PlateKitchenMenuItem | ||
""" | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,29 @@ | ||
from abc import ABC | ||
from enum import Enum | ||
from typing import Generic | ||
from typing import Generic, List | ||
from datetime import datetime | ||
|
||
from abstract_data_layer.base import ID | ||
from abstract_data_layer.base import ID, CRUD | ||
|
||
|
||
class ItemStatus(Enum): | ||
TODO, PROGRESS, DONE, CANCELLED = range(4) | ||
|
||
class Stats(Generic[ID]): | ||
def __init__(self, count: int = 0): | ||
self.count = count | ||
self.count = count | ||
|
||
class StatsRepository(CRUD[Stats[ID], ID], ABC): | ||
def __init__(self): | ||
pass | ||
|
||
def find_by_date_range(self, f: datetime, t: datetime) -> List[Stats]: | ||
""" | ||
Find all the saved stats in the input date range | ||
Args: | ||
f: from date | ||
t: to date | ||
Returns: list of all stats in range | ||
""" | ||
pass |