Skip to content

Commit

Permalink
refactor: start extract common constants
Browse files Browse the repository at this point in the history
  • Loading branch information
lykmapipo committed Jun 15, 2019
1 parent 9978954 commit fa62688
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 11 deletions.
19 changes: 8 additions & 11 deletions lib/campaign.model.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,14 @@ const actions = require('mongoose-rest-actions');

/* constants */
const MODEL_NAME = getString('CAMPAIGN_MODEL_NAME', 'Campaign');


const FORM_ALERT = 'Alert';
const FORM_INFORMATION = 'Information';
const FORM_WARNING = 'Warning';
const FORM_ANNOUNCEMENT = 'Announcement';
const FORM_REMINDER = 'Reminder';
const FORMS = [
FORM_ALERT, FORM_INFORMATION, FORM_WARNING,
FORM_ANNOUNCEMENT, FORM_REMINDER
];
const {
FORM_ALERT,
FORM_INFORMATION,
FORM_WARNING,
FORM_ANNOUNCEMENT,
FORM_REMINDER,
FORMS
} = require('./common');


/**
Expand Down
47 changes: 47 additions & 0 deletions lib/common.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
'use strict';

/**
* @description campaign and message form
* @author lally elias <lallyelias87@gmail.com>
* @since 0.1.0
* @version 0.1.0
* @private
*/
exports.FORM_ALERT = 'Alert';
exports.FORM_INFORMATION = 'Information';
exports.FORM_WARNING = 'Warning';
exports.FORM_ANNOUNCEMENT = 'Announcement';
exports.FORM_REMINDER = 'Reminder';
exports.FORMS = [
exports.FORM_ALERT, exports.FORM_INFORMATION,
exports.FORM_WARNING, exports.FORM_ANNOUNCEMENT,
exports.FORM_REMINDER
];

/**
* @description campaign and message types
* @author lally elias <lallyelias87@gmail.com>
* @since 0.1.0
* @version 0.1.0
* @private
*/
exports.TYPE_SMS = 'SMS';
exports.TYPE_EMAIL = 'EMAIL';
exports.TYPE_PUSH = 'PUSH';
exports.TYPES = [
exports.TYPE_SMS, exports.TYPE_EMAIL, exports.TYPE_PUSH
];

/**
* @description campaign and message send channel(i.e transports or methods)
* @author lally elias <lallyelias87@gmail.com>
* @since 0.1.0
* @version 0.1.0
* @private
*/
exports.CHANNEL_SMS = 'SMS';
exports.CHANNEL_EMAIL = 'EMAIL';
exports.CHANNEL_PUSH = 'PUSH';
exports.CHANNELS = [
exports.CHANNEL_SMS, exports.CHANNEL_EMAIL, exports.CHANNEL_PUSH
];

0 comments on commit fa62688

Please sign in to comment.