-
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.
fix: getir menu processor logical error fixes.
- Loading branch information
Showing
5 changed files
with
98 additions
and
7 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
from .price import Price | ||
from .menu import MenuValue | ||
from .menu_stack import MenuStack | ||
from .request_value import RequestValue |
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
19 changes: 19 additions & 0 deletions
19
src/recommendation_engine/app/domain/menu/values/menu_stack.py
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,19 @@ | ||
from dataclasses import dataclass | ||
from .menu import MenuValue | ||
|
||
|
||
@dataclass(frozen=True) | ||
class MenuStack: | ||
_menu_list = [] | ||
|
||
def retrieve_menu_list(self) -> list[MenuValue]: | ||
return self._menu_list | ||
|
||
def add_menu(self, menu_value: MenuValue): | ||
self._menu_list.append(menu_value) | ||
|
||
def __len__(self) -> int: | ||
return len(self._menu_list) | ||
|
||
def clean_menu_list(self): | ||
self._menu_list.clear() |
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