Source: job-template-dto.js

import FieldDTO from './field-dto.js'

/**
 *
 */
class JobTemplateDTO {
  constructor (json) {
    /** @private */
    this.json = json
  }

  /**
   * @type {string}
   */
  get name () {
    return this.json.name
  }

  /**
   * @type {FieldDTO[]}
   */
  get fields () {
    return this.json.fields.map(o => new FieldDTO(o))
  }

  /**
   * @returns {FieldDTO[]}
   */
  globalFields () {
    return this.fields.filter(f => f.global)
  }
}

export default JobTemplateDTO