add getting company
This commit is contained in:
@@ -4,7 +4,6 @@ from uuid import UUID, uuid4
|
||||
|
||||
from api.domain import DomainValidationError
|
||||
from api.domain.entity import DomainEntity
|
||||
from api.domain.user.model import User
|
||||
from api.domain.value_obj import DomainValueObject
|
||||
|
||||
|
||||
@@ -41,13 +40,11 @@ class CompanyId(DomainValueObject):
|
||||
class Company(DomainEntity[CompanyId]):
|
||||
name: CompanyName
|
||||
email: CompanyEmail
|
||||
owner: User
|
||||
|
||||
@staticmethod
|
||||
def create(name: str, email: str, owner: User) -> "Company":
|
||||
def create(name: str, email: str) -> "Company":
|
||||
return Company(
|
||||
id=CompanyId(uuid4()),
|
||||
name=CompanyName(name),
|
||||
email=CompanyEmail(email),
|
||||
owner=owner,
|
||||
)
|
||||
|
@@ -1,15 +1,14 @@
|
||||
from typing import Protocol
|
||||
|
||||
from api.domain.company.model import Company
|
||||
from api.domain.user.model import User
|
||||
|
||||
|
||||
class CompanyRepository(Protocol):
|
||||
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]:
|
||||
raise NotImplementedError
|
||||
# async def create_company(self, company: Company) -> None:
|
||||
# raise NotImplementedError
|
||||
#
|
||||
# async def get_workes_list(self) -> list[User]:
|
||||
# raise NotImplementedError
|
||||
|
Reference in New Issue
Block a user