Created
June 17, 2020 02:27
-
-
Save mariobittencourt/b5f512c6f420eea84751242cbeeef117 to your computer and use it in GitHub Desktop.
Decline projector
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
class DeclineProjector: | |
def __init__(self, projection: DeclineProjection): | |
self.projection = projection | |
@method_dispatch | |
def apply(self, event: DomainEvent): | |
pass | |
@apply.register(PaymentDeclined) | |
def _(self, event: PaymentDeclined): | |
self.projection.update_decline_code_count(decline_code=event.decline_code, bank_name=event.bank_name, date=event.occurred_at[0:10]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment