Skip to content

Instantly share code, notes, and snippets.

@mariobittencourt
Created June 17, 2020 02:27
Show Gist options
  • Save mariobittencourt/b5f512c6f420eea84751242cbeeef117 to your computer and use it in GitHub Desktop.
Save mariobittencourt/b5f512c6f420eea84751242cbeeef117 to your computer and use it in GitHub Desktop.
Decline projector
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