This repository has been archived by the owner on Jan 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Change name repository by notifier * Fix imports * Add documentation
- Loading branch information
Showing
12 changed files
with
79 additions
and
11 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
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
Binary file not shown.
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
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,18 +1,30 @@ | ||
import inject | ||
from thesheriff.domain.mail.mail import Mail | ||
from thesheriff.domain.mail.repository.mail_notification \ | ||
import MailNotification | ||
from thesheriff.domain.mail.notifier.mail_notifier import MailNotifier | ||
from thesheriff.domain.outlaw.outlaw import Outlaw | ||
from typing import NoReturn | ||
|
||
|
||
class InviteFriend: | ||
"""Class InviteFriend implements the invite a friend use case. | ||
:param mail_notifier: Repository managing the Gang domain entities. | ||
:type mail_notifier: MailNotifier | ||
""" | ||
|
||
@inject.autoparams() | ||
def __init__(self, mail_repository: MailNotification): | ||
self.mail_repository = mail_repository | ||
def __init__(self, mail_notifier: MailNotifier): | ||
self.__mail_notifier = mail_notifier | ||
|
||
def execute(self, receiver_mail_address): | ||
"""execute is the actual action of the Invite Friend use case. | ||
:param receiver_mail_address: The address to write on the TO field. | ||
:type receiver_mail_address: String | ||
:return: No value returned. | ||
:rtype: NoReturn | ||
""" | ||
sender = Outlaw.get_email() | ||
receiver = receiver_mail_address | ||
mail = Mail.mail_invite_friend(sender, receiver) | ||
self.mail_repository.send(mail) | ||
self.__mail_notifier.send(mail) |
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