feat: add notify system to tg

This commit is contained in:
2026-06-10 12:03:20 +03:00
parent e6ca15e8e7
commit 9615869710
15 changed files with 478 additions and 3 deletions

View File

@@ -1 +1,2 @@
from src.application.contracts.i_logger import ILogger
from src.application.contracts.i_logger import ILogger
from src.application.contracts.i_sender_bot import ISenderBot

View File

@@ -0,0 +1,11 @@
from abc import ABC, abstractmethod
class ISenderBot(ABC):
@abstractmethod
async def send(
self,
text: str,
) -> None:
raise NotImplementedError

View File

@@ -1,2 +1,3 @@
from src.application.domain.enums.log_level import LogLevel
from src.application.domain.enums.log_format import LogFormat
from src.application.domain.enums.log_format import LogFormat
from src.application.domain.enums.notify_type import NotifyType

View File

@@ -0,0 +1,50 @@
from enum import Enum
class NotifyType(Enum):
DOCS = 10
PURCHASE = 20
def __str__(self) -> str:
return self.name
def __repr__(self) -> str:
return f"[{self.value}, '{self.name}']"
def __eq__(self, other: object) -> bool:
if isinstance(other, NotifyType):
return self.value == other.value
if isinstance(other, int):
return self.value == other
return NotImplemented
def __ne__(self, other: object) -> bool:
return not self.__eq__(other)
def __lt__(self, other: object) -> bool:
if isinstance(other, NotifyType):
return self.value < other.value
if isinstance(other, int):
return self.value < other
return NotImplemented
def __le__(self, other: object) -> bool:
if isinstance(other, NotifyType):
return self.value <= other.value
if isinstance(other, int):
return self.value <= other
return NotImplemented
def __gt__(self, other: object) -> bool:
if isinstance(other, NotifyType):
return self.value > other.value
if isinstance(other, int):
return self.value > other
return NotImplemented
def __ge__(self, other: object) -> bool:
if isinstance(other, NotifyType):
return self.value >= other.value
if isinstance(other, int):
return self.value >= other
return NotImplemented