imports/vx/both/code/vxapp.js
/**
     * Template method to perform DB updates necessary to update subsystem status and return event data
     * based on subsystem.
     *
     * @param {string} subsystem Subsystem (e.g., "MAILGUN", "TWILIO").
     * @param {string} record Record with status to be set.
     * @param {object} modifier Modifier for MongoDB.
     * @return {object} Event data object.
     */
Template method to perform DB updates necessary to update subsystem status and return event data
based on subsystem.

@param {string} subsystem Subsystem .
@param {string} record Record with status to be set.
@param {object} modifier Modifier for MongoDB.
@return {object} Event data object.
Template method to perform DB updates necessary to update subsystem status and return event data based on subsystem . @param { string } subsystem Subsystem . @param { string } record Record with status to be set . @param { object } modifier Modifier for MongoDB . @return { object } Event data object .
onSubsystemStatusChange(subsystem, record, modifier) {
        OLog.debug("vxapp.js onSubsystemStatusChange subsystem=" + subsystem + " modifier=" + OLog.debugString(modifier))
        let eventData = {}
        eventData.subsystem = subsystem
        switch (subsystem) {
        case "TEMPLATE" : {
            eventData.recordIdentifier = record.name
            eventData.templateId = record._id
            eventData.domainId = record.domain
            Templates.update(record._id, modifier)
            break
        }
        case "MAILGUN" : {
            eventData.domainId = record._id
            Domains.update(record._id, modifier)
            break
        }
        case "TWILIO" : {
            eventData.domainId = record._id
            Domains.update(record._id, modifier)
            break
        }
        default : {
            eventData = {}
            OLog.error("vxapp.js onSubsystemStatusChange unrecognized subsystem=" + subsystem)
            break
        }
        }
        return eventData
    }
onSubsystemStatusChange ( subsystem , record , modifier ) { OLog . debug ( "vxapp.js onSubsystemStatusChange subsystem=" + subsystem + " modifier=" + OLog . debugString ( modifier ) ) let eventData = { } eventData . subsystem = subsystem switch ( subsystem ) { case "TEMPLATE" : { eventData . recordIdentifier = record . name eventData . templateId = record . _id eventData . domainId = record . domain Templates . update ( record . _id , modifier ) break } case "MAILGUN" : { eventData . domainId = record . _id Domains . update ( record . _id , modifier ) break } case "TWILIO" : { eventData . domainId = record . _id Domains . update ( record . _id , modifier ) break } default : { eventData = { } OLog . error ( "vxapp.js onSubsystemStatusChange unrecognized subsystem=" + subsystem ) break } } return eventData }
Template method to perform DB updates necessary to update subsystem status and return event data
 based on subsystem.
Template method to perform DB updates necessary to update subsystem status and return event data based on subsystem .