src/models/consent/ConsentAdditionalSigner.js
/**
* Model representing a additional signers
*/
class ConsentAdditionalSignerModel {
/**
* @param {Object} response - JSON formatted response of additional signers as they relate to a consent form.
* @param {Number} response.id - The additional signer ID value
* @param {String} response.name - The additional signer name value
* @param {String} response.deleted_at - The url of the signing document
* @param {String} response.created_at - Date when the record for the additional signer was created
* @param {String} response.updated_at - Date when the record for the additional signer was last updated
*/
constructor(response = {}) {
const _response = response.data || response;
const attributes = _response.attributes || _response;
if (_response.id) {
/** @type {Number} */
this.id = parseInt(_response.id, 10);
}
/** @type {String} */
this.name = attributes.name;
/** @type {String} */
this.deletedAt = attributes.deleted_at;
/** @type {String} */
this.createdAt = attributes.created_at;
/** @type {String} */
this.updatedAt = attributes.updated_at;
}
}
export default ConsentAdditionalSignerModel;