UNPKG

data-validator-js

Version:
24 lines (23 loc) 823 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Product = /** @class */ (function () { function Product(id, name, code, units, unitMrp, discount) { this.id = id; this.name = name; this.code = code; this.units = units; this.unitMrp = unitMrp; this.discount = discount; } Product.prototype.getTotalWithoutDiscount = function (quantity) { return quantity * this.unitMrp; }; Product.prototype.getTotalWithDiscount = function (quantity) { return quantity * (this.unitMrp - this.discount); }; Product.prototype.getSavingAmount = function (quantity) { return this.getTotalWithoutDiscount(quantity) - this.getTotalWithDiscount(quantity); }; return Product; }()); exports.default = Product;