Last active
August 31, 2019 17:09
-
-
Save chrisharrison/296c1b7b7d316c51cab7487b2d5023dc to your computer and use it in GitHub Desktop.
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
final class ProduceStatementOfAccountHandler | |
{ | |
private $pdfGenerator; | |
private $dataProvider; | |
public function __construct( | |
PdfGenerator $pdfGenerator, | |
DefaultDataProvider $dataProvider | |
) { | |
$this->pdfGenerator = $pdfGenerator; | |
$this->dataProvider = $dataProvider; | |
} | |
public function invoke(Command $command): PdfId | |
{ | |
$data = $this->dataProvider->provide($command->accountId()); | |
$id = $this->pdfGenerator->generate(PDFTemplate::STATEMENT_OF_ACCOUNT, $data); | |
return $id; | |
} | |
} | |
final class ProducePaymentOverdueNoticeHandler | |
{ | |
private $pdfGenerator; | |
private $dataProvider; | |
public function __construct( | |
PdfGenerator $pdfGenerator, | |
DefaultDataProvider $dataProvider | |
) { | |
$this->pdfGenerator = $pdfGenerator; | |
$this->dataProvider = $dataProvider; | |
} | |
public function invoke(Command $command): PdfId | |
{ | |
$data = $this->dataProvider->provide($command->accountId()); | |
$id = $this->pdfGenerator->generate(PDFTemplate::PAYMENT_OVERDUE, $data); | |
return $id; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment