diff --git a/src/chain-of-responsability/discounts-calculator/Budget.ts b/src/chain-of-responsability/discounts-calculator/Budget.ts new file mode 100644 index 0000000..6ac23ca --- /dev/null +++ b/src/chain-of-responsability/discounts-calculator/Budget.ts @@ -0,0 +1,20 @@ +import Product from "./Product"; + +export default class Budget { + private items: Array; + + constructor() { + this.items = []; + } + + add(product: Product): Budget { + this.items.push(product); + return this; + } + + getItems(): Array { + const nItems: Array = [...this.items]; + + return nItems; + } +}