add some in company and linters
This commit is contained in:
@@ -4,7 +4,7 @@ from uuid import UUID, uuid4
|
||||
|
||||
from api.domain import DomainValidationError
|
||||
from api.domain.entity import DomainEntity
|
||||
from api.domain.user.model import User, UserId
|
||||
from api.domain.user.model import User
|
||||
from api.domain.value_obj import DomainValueObject
|
||||
|
||||
|
||||
@@ -16,9 +16,7 @@ class CompanyEmail(DomainValueObject):
|
||||
pattern = r"^[\w\.-]+@[a-zA-Z\d\.-]+\.[a-zA-Z]{2,}$"
|
||||
|
||||
if not re.match(pattern, self.value):
|
||||
raise DomainValidationError(
|
||||
"Invalid email format. Email must be in the format 'example@example.com'."
|
||||
)
|
||||
raise DomainValidationError("Invalid email format. Email must be in the format 'example@example.com'.")
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
@@ -29,9 +27,7 @@ class CompanyName(DomainValueObject):
|
||||
if len(self.value) < 1:
|
||||
raise DomainValidationError("First name must be at least 1 character long.")
|
||||
if len(self.value) > 100:
|
||||
raise DomainValidationError(
|
||||
"First name must be at most 100 characters long."
|
||||
)
|
||||
raise DomainValidationError("First name must be at most 100 characters long.")
|
||||
if not self.value.isalpha():
|
||||
raise DomainValidationError("First name must only contain letters.")
|
||||
|
||||
|
@@ -5,11 +5,11 @@ from api.domain.user.model import User
|
||||
|
||||
|
||||
class CompanyRepository(Protocol):
|
||||
async def get_company(self, filter: dict) -> User | None:
|
||||
async def get_companies_by_owner_email(self, filter: dict) -> list[Company]:
|
||||
raise NotImplementedError
|
||||
|
||||
async def create_company(self, company: Company) -> None:
|
||||
raise NotImplementedError
|
||||
|
||||
async def get_workes_list(self) -> list[User] | None:
|
||||
async def get_workes_list(self) -> list[User]:
|
||||
raise NotImplementedError
|
||||
|
Reference in New Issue
Block a user