Manual Reference Source Test

src/models/consent/ConsentFormVersion.js

/**
 * Model representing a consent form version.
 */
class ConsentFormVersionModel {
/**
       * @param {Object}  response                        - JSON formatted response of a consent form version.
       * @param {Number}  response.id                     - The consent form version ID value
       * @param {String}  response.archived_at            - Archived at date of the consent form version
       */
  constructor(response = {}) {
    const _response = response.data || response; // if json api is passed in directly
    const attributes = _response.attributes || _response; // if json api is passed in directly

    if (_response.id) {
      /** @type {Number} */
      this.id = parseInt(_response.id, 10);
    }

    if (attributes.archived_at) {
      /** @type {String} */
      this.archivedAt = attributes.archived_at;
    }
  }
}

export default ConsentFormVersionModel;