-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add users interface, restructure the ports
- Loading branch information
1 parent
220af22
commit d4b7c03
Showing
16 changed files
with
72 additions
and
36 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
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
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import abc | ||
from typing import Union | ||
|
||
from src.jobboard.domain.ports.common.responses import ResponseFailure, ResponseSuccess | ||
from src.jobboard.domain.ports.unit_of_work import UserUnitOfWorkInterface | ||
from src.jobboard.domain.schemas.users import ( | ||
UserCreateInputDto, | ||
UserLoginInputDto, | ||
UserOutputDto, | ||
) | ||
|
||
|
||
class UsersServiceInterface(abc.ABC): | ||
@abc.abstractmethod | ||
def __init__(self, uow: UserUnitOfWorkInterface): | ||
self.uow = uow | ||
|
||
def create( | ||
self, user: UserCreateInputDto | ||
) -> Union[ResponseSuccess, ResponseFailure]: | ||
return self._create(user) | ||
|
||
def authenticate_user(self, user: UserLoginInputDto) -> Union[UserOutputDto, bool]: | ||
return self._authenticate_user(user) | ||
|
||
@abc.abstractmethod | ||
def _create( | ||
self, user: UserCreateInputDto | ||
) -> Union[ResponseSuccess, ResponseFailure]: | ||
raise NotImplementedError | ||
|
||
@abc.abstractmethod | ||
def _authenticate_user(self, user: UserLoginInputDto) -> Union[UserOutputDto, bool]: | ||
raise NotImplementedError |
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