This commit is contained in:
2024-04-22 04:00:23 +03:00
commit b25f89e777
30 changed files with 1699 additions and 0 deletions

View File

View File

@@ -0,0 +1,19 @@
from dataclasses import dataclass
from enum import Enum
class Gender(Enum):
MALE = "Male"
FEMALE = "Female"
@dataclass(frozen=True)
class PeopleRequest:
id: int | str
name: str
@dataclass(frozen=True)
class GenderResponse:
id: int | str
gender: Gender

View File

@@ -0,0 +1,10 @@
from abc import abstractmethod
from typing import Protocol
from flask_demo_api.protocols.models import GenderResponse, PeopleRequest
class RepositoryGateway(Protocol):
@abstractmethod
def get_gender(self, people: PeopleRequest) -> GenderResponse | None:
raise NotImplementedError