Skip to content

Commit

Permalink
feat: add list of recipirnts to campaign
Browse files Browse the repository at this point in the history
  • Loading branch information
lykmapipo committed Jun 15, 2019
1 parent 92d01f4 commit 71debab
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/campaign.model.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,21 @@ const CampaignSchema = new Schema({
*/
sender: Contact,

/**
* @name to
* @description receiver(s) of the campaign message i.e e-mail receiver,
* sms receiver etc.
*
* Used for campaign with receiver(s) less than 100. For larger receiver list
* use criteria and supply `fetchContacts` to postman.
*
* @type {Contact[]}
* @since 0.1.0
* @version 1.0.0
* @instance
*/
to: [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 @@ -49,6 +49,13 @@ describe('Campaign Schema', () => {
expect(sender.instance).to.be.equal('Embedded');
});

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

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

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

Expand Down

0 comments on commit 71debab

Please sign in to comment.