@votemike/property
Version:
Property class and related classes
15 lines (14 loc) • 445 B
JavaScript
import { round } from './helpers';
export default class Rental {
constructor(monthlyRent, lettingFee) {
this.monthlyRent = monthlyRent;
this.lettingFee = lettingFee;
}
get monthlyIncome() {
return round(this.monthlyRent - (this.monthlyRent * this.lettingFee / 100));
}
static fromJson(json) {
const rental = Object.create(Rental.prototype);
return Object.assign(rental, json);
}
}