-
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.
Merge pull request #66 from AndrewSergienko/2.x/develop
2.x/develop
- Loading branch information
Showing
31 changed files
with
1,537 additions
and
85 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<p align="center"> | ||
<a href="https://ibb.co/KyLXkwW"><img src="https://i.ibb.co/9YVNLtW/full-logo.png" alt="full-logo" border="0"></a> | ||
</p> | ||
|
||
<p align="center"> | ||
<a href="https://codecov.io/gh/AndrewSergienko/costy" > | ||
<img src="https://codecov.io/gh/AndrewSergienko/costy/graph/badge.svg?token=YQLTZLXL56"/> | ||
</a> | ||
<a href="https://github.com/AndrewSergienko/costy/actions/workflows/tests.yaml" > | ||
<img src="https://github.com/AndrewSergienko/costy/actions/workflows/tests.yaml/badge.svg?branch=2.x%2Fmain"/> | ||
</a> | ||
<img src="https://img.shields.io/badge/python-3.10-blue" alt="Python Version"> | ||
</p> | ||
|
||
## About | ||
|
||
An adaptive service for classifying and monitoring personal expenses. | ||
It has the ability to synchronize with banks (Monobank) to receive expenses in real time. |
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
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
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
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
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,2 +1,9 @@ | ||
from typing import TypeAlias, TypeVar | ||
|
||
|
||
class Sentinel: | ||
pass | ||
|
||
|
||
ParamT = TypeVar("ParamT", contravariant=True) | ||
SentinelOptional: TypeAlias = ParamT | None | type[Sentinel] |
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,10 +1,25 @@ | ||
from costy.domain.models.category import Category, CategoryType | ||
from costy.domain.models.user import UserId | ||
from costy.domain.sentinel import Sentinel, SentinelOptional | ||
|
||
|
||
class CategoryService: | ||
def create(self, name: str, kind: CategoryType, user_id: UserId) -> Category: | ||
return Category(id=None, name=name, kind=kind.value, user_id=user_id) | ||
def create( | ||
self, | ||
name: str, | ||
kind: CategoryType, | ||
user_id: UserId, | ||
view: dict | None | ||
) -> Category: | ||
return Category(id=None, name=name, kind=kind.value, user_id=user_id, view=view) | ||
|
||
def update(self, category: Category, name: str) -> None: | ||
category.name = name | ||
def update( | ||
self, | ||
category: Category, | ||
name: str | None, | ||
view: SentinelOptional[dict] | ||
) -> None: | ||
if name: | ||
category.name = name | ||
if view is not Sentinel: | ||
category.view = view # type: ignore |
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
Oops, something went wrong.