Skip to content

Instantly share code, notes, and snippets.

@mohamed-gara
Last active April 10, 2019 20:19
Show Gist options
  • Save mohamed-gara/181104c17fad24df80ba049aea450b81 to your computer and use it in GitHub Desktop.
Save mohamed-gara/181104c17fad24df80ba049aea450b81 to your computer and use it in GitHub Desktop.
import {Customer} from './customer';
import {Order} from './order';
export class OrderDiscounter {
constructor(public customer: Customer, public order: Order) {}
discountedAmount() {
return (100 - this.customer.discount()) * this.order.amount;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment