-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #244 from wmde/donation-mailer-interface-oop
Improve DonationNotifier implementation
- Loading branch information
Showing
19 changed files
with
259 additions
and
354 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ filter: | |
build: | ||
image: default-bionic | ||
environment: | ||
php: 8.1.4 | ||
php: 8.2 | ||
nodes: | ||
analysis: | ||
tests: | ||
|
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,12 @@ | ||
<?php | ||
|
||
declare( strict_types=1 ); | ||
|
||
namespace WMDE\Fundraising\DonationContext\Infrastructure; | ||
|
||
use WMDE\EmailAddress\EmailAddress; | ||
use WMDE\Fundraising\DonationContext\Infrastructure\DonationNotifier\TemplateArgumentsAdmin; | ||
|
||
interface AdminNotificationInterface { | ||
public function sendMail( EmailAddress $recipient, TemplateArgumentsAdmin $templateArguments ): void; | ||
} |
18 changes: 18 additions & 0 deletions
18
src/Infrastructure/DonationNotifier/TemplateArgumentsAdmin.php
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,18 @@ | ||
<?php | ||
declare( strict_types=1 ); | ||
|
||
namespace WMDE\Fundraising\DonationContext\Infrastructure\DonationNotifier; | ||
|
||
class TemplateArgumentsAdmin { | ||
/** | ||
* @param int $donationId | ||
* @param array<string,bool> $moderationFlags Name and state of {@see \WMDE\Fundraising\DonationContext\Domain\Model\ModerationIdentifier} | ||
* @param float $amount | ||
*/ | ||
public function __construct( | ||
public readonly int $donationId, | ||
public readonly array $moderationFlags, | ||
public readonly float $amount, | ||
) { | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
src/Infrastructure/DonationNotifier/TemplateArgumentsDonation.php
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,30 @@ | ||
<?php | ||
declare( strict_types=1 ); | ||
|
||
namespace WMDE\Fundraising\DonationContext\Infrastructure\DonationNotifier; | ||
|
||
class TemplateArgumentsDonation { | ||
/** | ||
* @param int $id | ||
* @param float $amount | ||
* @param int $amountInCents | ||
* @param int $interval | ||
* @param string $paymentType | ||
* @param bool $needsModeration | ||
* @param array<string,boolean> $moderationFlags Name and state of {@see \WMDE\Fundraising\DonationContext\Domain\Model\ModerationIdentifier} | ||
* @param string $bankTransferCode | ||
* @param bool $receiptOptIn | ||
*/ | ||
public function __construct( | ||
public readonly int $id, | ||
public readonly float $amount, | ||
public readonly int $amountInCents, | ||
public readonly int $interval, | ||
public readonly string $paymentType, | ||
public readonly bool $needsModeration, | ||
public readonly array $moderationFlags, | ||
public readonly string $bankTransferCode, | ||
public readonly bool $receiptOptIn, | ||
) { | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
src/Infrastructure/DonationNotifier/TemplateArgumentsDonationConfirmation.php
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,16 @@ | ||
<?php | ||
declare( strict_types=1 ); | ||
|
||
namespace WMDE\Fundraising\DonationContext\Infrastructure\DonationNotifier; | ||
|
||
class TemplateArgumentsDonationConfirmation { | ||
/** | ||
* @param array<string,string> $recipient Output of Name::toArray() | ||
* @param TemplateArgumentsDonation $donation | ||
*/ | ||
public function __construct( | ||
public readonly array $recipient, | ||
public readonly TemplateArgumentsDonation $donation | ||
) { | ||
} | ||
} |
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,13 @@ | ||
<?php | ||
|
||
declare( strict_types = 1 ); | ||
|
||
namespace WMDE\Fundraising\DonationContext\Infrastructure; | ||
|
||
use WMDE\EmailAddress\EmailAddress; | ||
use WMDE\Fundraising\DonationContext\Infrastructure\DonationNotifier\TemplateArgumentsDonationConfirmation; | ||
|
||
interface DonorNotificationInterface { | ||
|
||
public function sendMail( EmailAddress $recipient, TemplateArgumentsDonationConfirmation $templateArguments ): void; | ||
} |
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 was deleted.
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
Oops, something went wrong.