Source: models/certificationproviderWithoutRequiredConstraint.js

/**
 * certificationprovider-without-required-constraint Model
 * Generated: 2025-04-01T19:44:53.346Z
 */

/**
 * certificationprovider-without-required-constraint model class
 */
export class CertificationproviderWithoutRequiredConstraint {
  /**
   * Create a new certificationprovider-without-required-constraint instance
   * @param {Object} data - Initial data
   */
  constructor(data = {}) {
    /**
     * Note Sails special attributes: autoIncrement
     * @type integer
     */
    this.id = data.id !== undefined ? data.id : undefined;
    /**
     * 
     * @type number
     */
    this.createdAt = data.createdAt !== undefined ? data.createdAt : undefined;
    /**
     * 
     * @type number
     */
    this.updatedAt = data.updatedAt !== undefined ? data.updatedAt : undefined;
    /**
     * The user who created this record JSON dictionary representing the **person** instance or FK when creating / updating / not populated
     * @type any
     */
    this.createdBy = data.createdBy !== undefined ? data.createdBy : undefined;
    /**
     * Unique identifier code for the certification provider
     * @type string
     */
    this.code = data.code !== undefined ? data.code : undefined;
    /**
     * Full name of the certification provider
     * @type string
     */
    this.name = data.name !== undefined ? data.name : undefined;
    /**
     * Detailed description of the certification provider
     * @type string
     */
    this.description = data.description !== undefined ? data.description : undefined;
    /**
     * Website URL of the certification provider
     * @type string
     */
    this.website = data.website !== undefined ? data.website : undefined;
    /**
     * Contact email for the certification provider
     * @type string
     */
    this.email = data.email !== undefined ? data.email : undefined;
    /**
     * Contact phone number for the certification provider
     * @type string
     */
    this.phone = data.phone !== undefined ? data.phone : undefined;
    /**
     * Address of the certification provider
     * @type string
     */
    this.address = data.address !== undefined ? data.address : undefined;
    /**
     * Array of certification types offered by this provider (e.g., ["SOA", "ISO"])
     * @type any[]
     */
    this.services = data.services !== undefined ? data.services : undefined;
    /**
     * Whether this provider is currently active
     * @type boolean
     */
    this.isActive = data.isActive !== undefined ? data.isActive : undefined;
    /**
     * Array of **certification**'s or array of FK's when creating / updating / not populated
     * @type certification[]
     */
    this.certifications = data.certifications !== undefined ? data.certifications : undefined;
  }

  /**
   * Validate the model
   * @returns {Object} - Validation result {valid: boolean, errors: Object}
   */
  validate() {
    const errors = {};


    return {
      valid: Object.keys(errors).length === 0,
      errors
    };
  }

  /**
   * Convert the model to a plain object
   * @returns {Object} - Plain object representation
   */
  toJSON() {
    const data = {};

    if (this.id !== undefined) {
      data.id = this.id;
    }
    if (this.createdAt !== undefined) {
      data.createdAt = this.createdAt;
    }
    if (this.updatedAt !== undefined) {
      data.updatedAt = this.updatedAt;
    }
    if (this.createdBy !== undefined) {
      data.createdBy = this.createdBy;
    }
    if (this.code !== undefined) {
      data.code = this.code;
    }
    if (this.name !== undefined) {
      data.name = this.name;
    }
    if (this.description !== undefined) {
      data.description = this.description;
    }
    if (this.website !== undefined) {
      data.website = this.website;
    }
    if (this.email !== undefined) {
      data.email = this.email;
    }
    if (this.phone !== undefined) {
      data.phone = this.phone;
    }
    if (this.address !== undefined) {
      data.address = this.address;
    }
    if (this.services !== undefined) {
      data.services = this.services;
    }
    if (this.isActive !== undefined) {
      data.isActive = this.isActive;
    }
    if (this.certifications !== undefined) {
      data.certifications = this.certifications;
    }

    return data;
  }

  /**
   * Create a certificationprovider-without-required-constraint instance from JSON data
   * @param {Object} data - JSON data
   * @returns CertificationproviderWithoutRequiredConstraint - New model instance
   */
  static fromJSON(data) {
    return new CertificationproviderWithoutRequiredConstraint(data);
  }
}

export default CertificationproviderWithoutRequiredConstraint;