File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change
1
+ from abc import ABC , abstractmethod
2
+
1
3
from sponsors import notifications
2
4
from sponsors .models import Sponsorship , Contract , SponsorContact , SponsorEmailNotificationTemplate
3
5
from sponsors .pdf import render_contract_to_pdf_file , render_contract_to_docx_file
4
6
5
7
6
- class BaseUseCaseWithNotifications :
8
+ class BaseUseCaseWithNotifications ( ABC ) :
7
9
notifications = []
8
10
11
+ @classmethod
12
+ def build (cls ):
13
+ return cls (cls .notifications )
14
+
15
+ @abstractmethod
16
+ def execute (self , * args , ** kwargs ):
17
+ pass
18
+
9
19
def __init__ (self , notifications ):
10
20
self .notifications = notifications
11
21
12
22
def notify (self , ** kwargs ):
13
23
for notification in self .notifications :
14
24
notification .notify (** kwargs )
15
25
16
- @classmethod
17
- def build (cls ):
18
- return cls (cls .notifications )
19
-
20
26
21
27
class CreateSponsorshipApplicationUseCase (BaseUseCaseWithNotifications ):
22
28
notifications = [
You can’t perform that action at this time.
0 commit comments