var util = require('util');

var Model = require('hmpo-model'),
    config = require('../config/default.json'),
    moment = require('moment');

var veteranEndDate = moment(config.veteranEndDate);

var Costs = function (attrs, options) {
    var self = this;
    Model.call(this, attrs, options);
    Object.defineProperty(this.attributes, 'cost', {
        enumerable: true,
        get: Costs.prototype.getCost.bind(self)
    });
    Object.defineProperty(this.attributes, 'veteran', {
        enumerable: true,
        get: function () {
            var dob = moment(this.get('date-of-birth'), 'YYYY-MM-DD');
            return dob.isBefore(veteranEndDate);
        }.bind(this)
    });
};

util.inherits(Costs, Model);

Costs.prototype.getCost = function () {
    var cost = 0;

    if (this.get('service-level') === 'Premium') {
        cost += config.costs['premium-service'];
    } else {
        cost += this.get('veteran') ? 0 : config.costs['standard-service'];
    }
    if (this.get('passport-options') == '48') {
        cost += this.largePassport();
    }
    if (this.get('passport-options-overseas') == '48') {
        cost += this.largePassport() + 25.36;
    }
    if (this.get('passport-options-overseas') == '32') {
        cost += 30.36;
    }
    if (this.get('secure-return')) {
        cost += this.delivery();
    }
    if (this.get('passport-options-dps') == '48') {
        cost += this.largePassport() + 51.5;
    }
    if (this.get('passport-options-dps') == '32') {
        cost += 55.5;
        console.log(cost);
    }
    return cost;
};

Costs.prototype.largePassport = function largePassport() {
    var cost = config.costs['large-passport'];

    if (this.get('veteran') && this.get('service-level') !== 'Premium') {
        cost += config.costs['standard-service'];
    }
    return cost;
};

Costs.prototype.delivery = function delivery() {
    var cost = 0;

    if (this.get('secure-return') && !this.get('veteran')) {
        cost += config.costs['secure-delivery'];
    }
    return cost;
};

module.exports = Costs;

@@ -1,30 +1,16 @@
-var util = require('util')
+'use strict'
 ;%0A%0Av
@@ -181,90 +181,84 @@
 );%0A%0A
-var
+class
  Costs 
-= function (attrs, options) %7B%0A    var self = this;%0A    Model.call(this, 
+extends Model %7B%0A    constructor(attrs, options) %7B%0A        super(
 attr
@@ -270,16 +270,20 @@
 tions);%0A
+    
     Obje
@@ -327,32 +327,36 @@
 ost', %7B%0A        
+  
+  
 enumerable: true
@@ -349,32 +349,36 @@
 umerable: true,%0A
+    
         get: Cos
@@ -407,22 +407,26 @@
 ind(
-self)%0A
+this)%0A    
     %7D);%0A
     
@@ -421,16 +421,20 @@
     %7D);%0A
+    
     Obje
@@ -481,32 +481,36 @@
 ran', %7B%0A        
+    
 enumerable: true
@@ -523,27 +523,29 @@
     
+    
 get: 
-function () %7B%0A
+() =%3E %7B%0A    
     
@@ -619,24 +619,28 @@
             
+    
 return dob.i
@@ -676,61 +676,33 @@
     
-%7D.bind(this)%0A    %7D);%0A%7D;%0A%0Autil.inherits(Costs, Model);
+    %7D%0A        %7D);%0A    %7D%0A%7D
 %0A%0ACo

Update Costs to ES6 class and pray it works