<commit_before>import Model from 'ember-pouch/model';
import DS from 'ember-data';

const {
  attr,
  hasMany
} = DS;

export default Model.extend({
  type: attr("string", {defaultValue: 'Supplier'}),
  rev: attr("string"),
  name: attr("string"),
  tradingName: attr("string"),
  tradingAddress: attr("string"),
  returnsAddress: attr("string"),
  contactName: attr("string"),
  contactEmail: attr("string"),
  contactNumber: attr("string"),
  status: attr("string", {defaultValue: 'OK'}),
  stock: hasMany("item", {async: true, defaultValue: []}),
  terminated: attr("boolean", {defaultValue: false}),
  transactionHistory: hasMany("transaction", {async: true, defaultValue: []}),

  //Computed properties
  isOk: function(){
    if(this.get("status") === "OK"){
      return true;
    }else{
      return false;
    }
  }.property("status"),
  onHold: function(){
    if(this.get("status") === "ON HOLD"){
      return true;
    }else{
      return false;
    }
  }.property("status"),
  barred: function(){
    if(this.get("status") === "BARRED"){
      return true;
    }else{
      return false;
    }
  }.property("status"),
  canOrder: function(){
    if(this.get("status") === "BARD" || this.get("status") === "ON HOLD"){
      return false;
    }else{
      if(this.get("terminated")){
       return false;
      }else{
        return true;
      }
    }<commit_msg>- Fixes supplier canOrder property to match correctly spelled barred<commit_after>import Model from 'ember-pouch/model';
import DS from 'ember-data';

const {
  attr,
  hasMany
} = DS;

export default Model.extend({
  type: attr("string", {defaultValue: 'Supplier'}),
  rev: attr("string"),
  name: attr("string"),
  tradingName: attr("string"),
  tradingAddress: attr("string"),
  returnsAddress: attr("string"),
  contactName: attr("string"),
  contactEmail: attr("string"),
  contactNumber: attr("string"),
  status: attr("string", {defaultValue: 'OK'}),
  stock: hasMany("item", {async: true, defaultValue: []}),
  terminated: attr("boolean", {defaultValue: false}),
  transactionHistory: hasMany("transaction", {async: true, defaultValue: []}),

  //Computed properties
  isOk: function(){
    if(this.get("status") === "OK"){
      return true;
    }else{
      return false;
    }
  }.property("status"),
  onHold: function(){
    if(this.get("status") === "ON HOLD"){
      return true;
    }else{
      return false;
    }
  }.property("status"),
  barred: function(){
    if(this.get("status") === "BARRED"){
      return true;
    }else{
      return false;
    }
  }.property("status"),
  canOrder: function(){
    if(this.get("status") === "BARRED" || this.get("status") === "ON HOLD"){
      return false;
    }else{
      if(this.get("terminated")){
       return false;
      }else{
        return true;
      }
    }
{'fraction_non_alphanumeric': 0.18903524385902457, 'fraction_numerical': 0.0, 'mean_word_length': 3.5395799676898223, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6162972', 'n_tokens_mistral': 905, 'n_tokens_neox': 882, 'n_words': 213}