Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Provider {
- constructor(name) {
- this.name = name;
- this.money = 2000;
- this.profit = 0;
- }
- byGoods(good, quantity) {
- //kupuva stoka i si vzima 20%
- // sklada harchi pari
- // profita mu se uvelichava
- // uvelichavat se stokite vsklada
- }
- }
- class Distributor {
- constructor(name) {
- this.name = name;
- this.profit = 0;
- }
- daliverGoods(good, quantity) {
- //dostavq stoka i si vzima 20% komisionna
- // profota mu se uvelichava
- // sklada pacheli pari
- // namalqvat stokite v sklada
- }
- }
- class Worker {
- constructor(name, salary) {
- this.name = name;
- this.salary =salary;
- this.acceptedGoods = [];
- this.signedOffGoods = [];
- }
- arrangeGoods(good) {
- //ako e priemane: dobavq v prietite stoki i dobavq v stokite v sklada
- //ako e otpisvane: dobavq v otpisanite stoki i izvajda ot stokite v sklada
- }
- }
- class Good {
- constructor(name, price, quantity) {
- this.name = name;
- this.price = price;
- this.quantity = quantity;
- }
- }
- class Storage {
- constructor(name, adress) {
- this.name = name;
- this.adress = adress;
- this.providers = [];
- this.workers = [];
- this.distributors = [];
- this.goods = [];
- this.oborot = 10000;
- }
- availability(good) {
- if (this.goods.indexOf(good) !== -1) {
- if (good.quantity > 0) {
- console.log(good.quantity + ' left');
- } else {
- console.log('the storage run out of: ' + good.name);
- }
- } else {
- console.log('the storage run out of: ' + good.name);
- }
- }
- loadTheStorage(ListOfGoods) {
- if (Math.random() > 0.5) {
- this.providers[0].name
- }
- }
- }
- // var sklad1 = new Storage('sklad', 'bul. afsadf');
- // var vafli = new Good('vafli', 0.20, 0);
- // var shokolad = new Good('shokolad', 1.60, 6);
- // sklad1.goods.push(vafli);
- // sklad1.availability(shokolad);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement