src/models/agreement/AgreementSignature.js
/**
* Model representing an Agreement Signature.
*
*/
class AgreementSignatureModel {
/**
* @param {Object} response - JSON formatted response of an agreement signature
* @param {Number} response.id - The id of the agreement signature
* @param {String} response.role - Role for the signature
* @param {String} response.status - The agreement signature status
* @param {String} response.sign_url - The agreement signature sign url
* @param {String} response.signed_at - The date when the agreement was signed
* @param {String} response.signed_by_email - Email address of the signer
*/
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
/** @type {Number} */
this.id = attributes.id;
/** @type {String} */
this.role = attributes.role;
/** @type {String} */
this.status = attributes.status;
/** @type {String} */
this.signUrl = attributes.sign_url;
/** @type {String} */
this.signedAt = attributes.signed_at;
/** @type {String} */
this.signedByEmail = attributes.signed_by_email;
}
}
export default AgreementSignatureModel;