Migration and model for triggers.

Not tested.
This commit is contained in:
Tomas Bures 2018-08-03 21:37:46 +05:30
parent 7b46c4b4b0
commit ffc26a4836
11 changed files with 353 additions and 40 deletions

48
shared/triggers.js Normal file
View file

@ -0,0 +1,48 @@
'use strict';
const Entity = {
SUBSCRIPTION: 'subscription',
CAMPAIGN: 'campaign'
};
const Action = {
[Entity.SUBSCRIPTION]: {
CREATED: 'created',
LATEST_OPEN: 'latest_open',
LATEST_CLICK: 'latest_click'
},
[Entity.CAMPAIGN]: {
DELIVERED: 'delivered',
OPENED: 'opened',
CLICKED: 'clicked',
NOT_OPENED: 'not_opened',
NOT_CLICKED: 'not_clicked'
}
};
const EntityVals = {
subscription: 'SUBSCRIPTION',
campaign: 'CAMPAIGN'
};
const ActionVals = {
[Entity.SUBSCRIPTION]: {
created: 'CREATED',
latest_open: 'LATEST_OPEN',
latest_click: 'LATEST_CLICK'
},
[Entity.CAMPAIGN]: {
delivered: 'DELIVERED',
opened: 'OPENED',
clicked: 'CLICKED',
not_opened: 'NOT_OPENED',
not_clicked: 'NOT_CLICKED'
}
};
module.exports = {
Entity,
Action,
EntityVals,
ActionVals
};