generated from spatie/package-skeleton-laravel
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add event dispatching for credit transactions
- Loading branch information
1 parent
a4739e7
commit eff2d7f
Showing
4 changed files
with
91 additions
and
7 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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
namespace Climactic\Credits\Events; | ||
|
||
class CreditsAdded | ||
{ | ||
public function __construct( | ||
public $creditable, | ||
public float $amount, | ||
public float $newBalance, | ||
public ?string $description, | ||
public array $metadata | ||
) {} | ||
} |
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,14 @@ | ||
<?php | ||
|
||
namespace Climactic\Credits\Events; | ||
|
||
class CreditsDeducted | ||
{ | ||
public function __construct( | ||
public $creditable, | ||
public float $amount, | ||
public float $newBalance, | ||
public ?string $description, | ||
public array $metadata | ||
) {} | ||
} |
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 | ||
|
||
namespace Climactic\Credits\Events; | ||
|
||
class CreditsTransferred | ||
{ | ||
public function __construct( | ||
public $sender, | ||
public $recipient, | ||
public float $amount, | ||
public float $senderNewBalance, | ||
public float $recipientNewBalance, | ||
public ?string $description, | ||
public array $metadata | ||
) {} | ||
} |
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