Created
March 22, 2025 11:24
-
-
Save trikitrok/bdb816b2bb4c0b962840eb43cd3da51b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// After changing the code, Invoice should look like: | |
export class Invoice { | |
private readonly shippingPricer: ShippingPricer; | |
// ... | |
constructor( | |
billingDate: OurDate, | |
openingDate: OurDate, | |
originator: Originator, | |
// ... | |
) { | |
// ... | |
this.shippingPricer = new ShippingPricer(billingDate, openingDate, originator); | |
} | |
// ... | |
public getValue(): Money { | |
const total = this.itemsSum(); | |
total.add(this.shippingPricer.getPrice()); | |
total.add(this.getTax()); | |
return total; | |
} | |
private itemsSum(): Money { | |
throw new Error("Not implemented"); | |
} | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment