Skip to content
Open
9 changes: 7 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{
"presets": ["@babel/preset-env"]
}
"presets": [
"@babel/preset-env"
],
"plugins": [
"@babel/plugin-proposal-class-properties"
]
}
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ANALISYS_DAYS_INTERVAL=30
29 changes: 5 additions & 24 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,7 @@
import { Drug, Pharmacy } from "./pharmacy";
import fs from "fs";
"use strict";

const drugs = [
new Drug("Doliprane", 20, 30),
new Drug("Herbal Tea", 10, 5),
new Drug("Fervex", 5, 40),
new Drug("Magic Pill", 15, 40)
];
const trial = new Pharmacy(drugs);
import { items } from "./src/data";
import { Manage } from "./src/services/manage";

const log = [];

for (let elapsedDays = 0; elapsedDays < 30; elapsedDays++) {
log.push(JSON.stringify(trial.updateBenefitValue()));
}

/* eslint-disable no-console */
fs.writeFile("output.txt", log.toString(), err => {
if (err) {
console.log("error");
} else {
console.log("success");
}
});
/* eslint-enable no-console */
const manage = new Manage(items);
manage.process();
171 changes: 123 additions & 48 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"@babel/cli": "^7.1.0",
"@babel/core": "^7.1.0",
"@babel/node": "^7.0.0",
"@babel/plugin-proposal-class-properties": "^7.16.7",
"@babel/preset-env": "^7.1.0",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^9.0.0",
Expand Down
Loading