Skip to content

Instantly share code, notes, and snippets.

@mariobittencourt
Created July 16, 2020 00:18
Show Gist options
  • Save mariobittencourt/5ed16063c87e899e3f3c1350a5300f3b to your computer and use it in GitHub Desktop.
Save mariobittencourt/5ed16063c87e899e3f3c1350a5300f3b to your computer and use it in GitHub Desktop.
Updated Domain Logic
class Order {
protected whenOrderCreated(event: OrderCreated): void {
// setting the other properies as before
// The event now contains the exchangeRate captured at the moment that the order was created
this._chargedAmount = event.amount * event.exchangeRate;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment