{"size": 1404, "ext": "js", "max_stars_repo_path": "src/functions/model/failures.model.js", "max_stars_repo_name": "vzoran/failuremodes", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/functions/model/failures.model.js", "max_issues_repo_name": "vzoran/failuremodes", "max_issues_repo_issues_event_min_datetime": "2020-09-04T07:59:20.000Z", "max_issues_repo_issues_event_max_datetime": "2021-05-06T17:45:09.000Z", "max_forks_repo_path": "src/functions/model/failures.model.js", "max_forks_repo_name": "vzoran/failuremodes", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 2, "max_forks_count": null, "avg_line_length": 15.6, "max_line_length": 48, "alphanum_fraction": 0.5313390313}
'use strict';

/**
 * This is a model definition of a failure mode.
 */
var failureModeConstraint = {
  id: {
    presence: false
  },
  functional_state: {
    presence: true,
    inclusion: ['startup', 'running', 'finish']
  },
  service_effect:{
    presence: true,
    length: {
      minimum: 0,
      maximum: 1000
    }
  },
  platform_effect: {
    presence: true,
    length: {
      minimum: 0,
      maximum: 1000
    }
  },
  potential_cause: {
    presence: true,
    length: {
      minimum: 0,
      maximum: 1000
    }
  },
  probability: {
    presence: true,
    inclusion: [1, 2, 3, 4, 5]
  },
  detect_failures: {
    presence: true,
    length: {
      minimum: 0,
      maximum: 1000
    }
  },
  response_action: {
    presence: true,
    length: {
      minimum: 0,
      maximum: 1000
    }
  },
  mitigation: {
    presence: true,
    length: {
      minimum: 0,
      maximum: 1000
    }
  },
  detectability: {
    presence: true,
    inclusion: [1, 2, 3, 4, 5]
  },
  safety_concern: {
    presence: true,
    inclusion: ["true", "false", true, false]
  },
  creator: {
    presence: true,
    length: {
      minimum: 0,
      maximum: 1000
    }
  },
  version: {
    numericality: {
      strict: true,
      onlyInteger: true
    }
  },
  lastupdated: {
    numericality: {
      strict: true,
      onlyInteger: true
    }
  }
}

module.exports = failureModeConstraint;
