Skip to content

Commit

Permalink
Budget class
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusbalbi committed Aug 25, 2020
1 parent eaeefbe commit aa91ed2
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/chain-of-responsability/discounts-calculator/Budget.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import Product from "./Product";

export default class Budget {
private items: Array<Product>;

constructor() {
this.items = [];
}

add(product: Product): Budget {
this.items.push(product);
return this;
}

getItems(): Array<Product> {
const nItems: Array<Product> = [...this.items];

return nItems;
}
}

0 comments on commit aa91ed2

Please sign in to comment.