Skip to content

Commit

Permalink
feat: add campaign sender
Browse files Browse the repository at this point in the history
  • Loading branch information
lykmapipo committed Jun 15, 2019
1 parent 3bc9f1c commit 92d01f4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/campaign.model.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const actions = require('mongoose-rest-actions');
/* constants */
const MODEL_NAME = getString('CAMPAIGN_MODEL_NAME', 'Campaign');
const {
Contact,
FORM_ALERT,
FORM_INFORMATION,
FORM_WARNING,
Expand Down Expand Up @@ -97,6 +98,17 @@ const CampaignSchema = new Schema({
fake: { generator: 'lorem', type: 'sentence' }
},

/**
* @name sender
* @description sender of the campaign messages i.e e-mail sender, sms sender
* etc.
* @type {Contact}
* @since 0.1.0
* @version 1.0.0
* @instance
*/
sender: Contact,

/**
* @name subject
* @description subject of the campaign i.e email title etc
Expand Down
7 changes: 7 additions & 0 deletions test/unit/campaign.schema.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ describe('Campaign Schema', () => {
expect(title.options.fake).to.exist;
});

it('should have sender field', () => {
const sender = Campaign.path('sender');

expect(sender).to.exist;
expect(sender.instance).to.be.equal('Embedded');
});

it('should have subject field', () => {
const subject = Campaign.path('subject');

Expand Down

0 comments on commit 92d01f4

Please sign in to comment.