@speakr/speakr-module-services
Version:
SPEAKR Shared Service Module
119 lines (116 loc) • 2.96 kB
JavaScript
'use strict';
let _ = require('underscore');
module.exports = function(sequelize, DataTypes) {
let initiatives = sequelize.define('initiatives', {
id_hash: {
type: DataTypes.STRING,
allowNull: true
},
name: {
type: DataTypes.STRING,
allowNull: true
},
media_type: {
type: DataTypes.TEXT,
allowNull: true,
field: "brand_provided_media_type"
},
disclosure_type: {
type: DataTypes.ENUM('Standard', 'Custom', 'Disabled'), allowNull: true
},
payment_type: {
type: DataTypes.ENUM('Regular', 'FlatRate', 'Special', 'Individual', 'Bonus'), allowNull: true
},
dynamic_disclosure: {
type: DataTypes.ENUM('#sponsored', '#ad'), allowNull: true
},
custom_disclosure: {
type: DataTypes.STRING, allowNull: true, field: "custom_disclosure_text"
},
video_link: DataTypes.STRING,
image_link: DataTypes.STRING,
video_thumbnail_link: DataTypes.STRING,
start_date: {
type: DataTypes.DATE,
allowNull: true
},
end_date: {
type: DataTypes.DATE,
allowNull: true
},
initiative_status_id: {
type: DataTypes.INTEGER
},
instructions: {
type: DataTypes.STRING,
allowNull: true
},
target_link: DataTypes.TEXT,
instructions_json: DataTypes.JSON,
budget: {
type: DataTypes.DECIMAL,
allowNull: true
},
user_created_media_type: {
type: DataTypes.STRING,
allowNull: true
},
posts_per_day: {
type: DataTypes.INTEGER,
allowNull: true,
field: "daily_creative_limit"
},
standard_disapproved_words: DataTypes.BOOLEAN,
required_words: {
type: DataTypes.ARRAY(DataTypes.STRING), isArray: true, allowNull: true, defaultValue: []
},
disapproved_words: {
type: DataTypes.ARRAY(DataTypes.STRING), isArray: true, allowNull: true, defaultValue: []
},
earnings_percentage_bonus: {
type: DataTypes.DECIMAL,
allowNull: true
},
earnings_flat_rate: {
type: DataTypes.DECIMAL,
allowNull: true
},
network_id: {
type: DataTypes.INTEGER
},
product: {
type: DataTypes.ENUM('Content Distribution', 'Content Creation', 'Brand in Hand', 'Idea Submission', 'Experiential'), allowNull: true
},
fb_sponsor_name: {
type: DataTypes.STRING,
allowNull: true
},
fb_sponsor_id: {
type: DataTypes.STRING,
allowNull: true
},
fb_sponsor_url: {
type: DataTypes.STRING,
allowNull: true
},
fb_sponsor_image: {
type: DataTypes.STRING,
allowNull: true
},
fb_sponsor_category: {
type: DataTypes.STRING,
allowNull: true
},
fb_is_verified: {
type: DataTypes.BOOLEAN,
defaultValue: false
},
youtube_tags: {
type: DataTypes.ARRAY(DataTypes.STRING), isArray: true, allowNull: true, defaultValue: []
},
}, {
paranoid: true,
underscored: true
});
return initiatives;
};