5 var crypto = require('crypto');
7 module.exports = function(sequelize, DataTypes) {
9 var ChatWebsite = sequelize.define('ChatWebsite', {
10 name: DataTypes.STRING,
12 type: DataTypes.STRING,
15 description: DataTypes.STRING,
17 type: DataTypes.STRING,
18 defaultValue: '#000080'
21 type: DataTypes.STRING,
22 defaultValue: '#000080'
25 type: DataTypes.STRING,
26 defaultValue: '#000080'
28 remote: DataTypes.STRING,
30 type: DataTypes.BOOLEAN,
34 type: DataTypes.ENUM('rounded', 'squared'),
35 defaultValue: 'rounded'
38 type: DataTypes.STRING,
39 defaultValue: 'We are here!'
42 type: DataTypes.STRING,
43 defaultValue: '<strong>Questions?<\/strong><br \/>Insert your name and email address to start a live-chat with our support team.'
45 username_placeholder: {
46 type: DataTypes.STRING,
47 defaultValue: 'Your name'
50 type: DataTypes.STRING,
51 defaultValue: 'Your e-mail address'
54 type: DataTypes.STRING,
58 type: DataTypes.STRING,
59 defaultValue: 'Contact us'
62 type: DataTypes.STRING,
63 defaultValue: '<strong>We\'re not online.<\/strong><br \/>It doesn\'t mean we\'re not there to help - leave your message below and we\'ll be in touch as soon as possible.'
65 enquiry_message_placeholder: {
66 type: DataTypes.STRING,
67 defaultValue: 'Your message...'
70 type: DataTypes.STRING,
71 defaultValue: 'Leave message'
73 download_transcript: {
74 type: DataTypes.BOOLEAN,
78 type: DataTypes.BOOLEAN,
81 enquiry_forwarding_address: {
82 type: DataTypes.STRING
85 type: DataTypes.BOOLEAN,
89 type: DataTypes.BOOLEAN,
93 type: DataTypes.STRING,
94 defaultValue: 'Would you like rate this chat?'
97 type: DataTypes.STRING,
101 type: DataTypes.STRING,
105 type: DataTypes.BOOLEAN,
109 type: DataTypes.STRING
112 type: DataTypes.BOOLEAN,
116 type: DataTypes.INTEGER,
120 type: DataTypes.STRING,
121 defaultValue: 'In this moment all agents are busy. Try again!'
124 type: DataTypes.STRING,
128 type: DataTypes.STRING,
129 defaultValue: 'Email Address'
132 type: DataTypes.STRING,
133 defaultValue: 'Message'
136 type: DataTypes.STRING
139 type: DataTypes.BOOLEAN,
143 type: DataTypes.STRING,
144 defaultValue: 'Powered by xCALLY'
147 type: DataTypes.BOOLEAN,
151 type: DataTypes.STRING
154 type: DataTypes.STRING
157 type: DataTypes.ENUM('GET', 'POST')
160 type: DataTypes.ENUM('GET', 'POST')
163 type: DataTypes.STRING,
165 return this.getDataValue('actions') ? JSON.parse(this.getDataValue('actions')) : [];
168 return this.setDataValue('actions', JSON.stringify(val));
172 tableName: 'chat_websites',
173 associate: function(models) {
175 ChatWebsite.belongsTo(models.Template, {
176 as: 'OfflineTemplate'
178 ChatWebsite.hasMany(models.ChatRoom);
179 ChatWebsite.hasMany(models.ChatApplication);
180 ChatWebsite.belongsTo(models.List);
181 ChatWebsite.hasMany(models.ChatWebsitesField, {
183 foreignKey: 'OnlineId'
185 ChatWebsite.hasMany(models.ChatWebsitesField, {
187 foreignKey: 'OfflineId'
189 ChatWebsite.hasMany(models.ChatProactiveAction);
190 ChatWebsite.hasMany(models.ChatDisposition);