5 module.exports = function(sequelize, DataTypes) {
7 var ChatWebsite = sequelize.define('ChatWebsite', {
8 name: DataTypes.STRING,
10 type: DataTypes.STRING,
13 description: DataTypes.STRING,
15 type: DataTypes.STRING,
16 defaultValue: '#000080'
19 type: DataTypes.STRING,
20 defaultValue: '#000080'
23 type: DataTypes.STRING,
24 defaultValue: '#000080'
26 remote: DataTypes.STRING,
28 type: DataTypes.BOOLEAN,
32 type: DataTypes.ENUM('rounded', 'squared'),
33 defaultValue: 'rounded'
36 type: DataTypes.STRING,
37 defaultValue: 'We are here!'
40 type: DataTypes.STRING,
41 defaultValue: '<strong>Questions?<\/strong><br \/>Insert your name and email address to start a live-chat with our support team.'
43 username_placeholder: {
44 type: DataTypes.STRING,
45 defaultValue: 'Your name'
48 type: DataTypes.STRING,
49 defaultValue: 'Your e-mail address'
52 type: DataTypes.STRING,
56 type: DataTypes.STRING,
57 defaultValue: 'Contact us'
60 type: DataTypes.STRING,
61 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.'
63 enquiry_message_placeholder: {
64 type: DataTypes.STRING,
65 defaultValue: 'Your message...'
68 type: DataTypes.STRING,
69 defaultValue: 'Leave message'
71 download_transcript: {
72 type: DataTypes.BOOLEAN,
76 type: DataTypes.BOOLEAN,
79 enquiry_forwarding_address: {
80 type: DataTypes.STRING
83 type: DataTypes.BOOLEAN,
87 type: DataTypes.BOOLEAN,
91 type: DataTypes.STRING,
92 defaultValue: 'Would you like rate this chat?'
95 type: DataTypes.STRING,
99 type: DataTypes.STRING,
103 type: DataTypes.BOOLEAN,
107 type: DataTypes.STRING
110 type: DataTypes.BOOLEAN,
114 type: DataTypes.INTEGER,
118 type: DataTypes.STRING,
119 defaultValue: 'In this moment all agents are busy. Try again!'
122 type: DataTypes.STRING,
126 type: DataTypes.STRING,
127 defaultValue: 'Email Address'
130 type: DataTypes.STRING,
131 defaultValue: 'Message'
134 type: DataTypes.STRING
137 type: DataTypes.BOOLEAN,
141 type: DataTypes.STRING,
142 defaultValue: 'Powered by xCALLY'
145 type: DataTypes.BOOLEAN,
149 type: DataTypes.STRING
152 type: DataTypes.STRING
155 type: DataTypes.STRING
158 type: DataTypes.ENUM('GET', 'POST')
161 type: DataTypes.ENUM('GET', 'POST')
164 type: DataTypes.ENUM('GET', 'POST')
167 type: DataTypes.STRING,
169 return this.getDataValue('actions') ? JSON.parse(this.getDataValue('actions')) : [];
172 return this.setDataValue('actions', JSON.stringify(val));
176 tableName: 'chat_websites',
177 associate: function(models) {
179 ChatWebsite.belongsTo(models.Template, {
180 as: 'OfflineTemplate'
182 ChatWebsite.hasMany(models.ChatRoom);
183 ChatWebsite.hasMany(models.ChatApplication);
184 ChatWebsite.belongsTo(models.List);
185 ChatWebsite.hasMany(models.ChatWebsitesField, {
187 foreignKey: 'OnlineId'
189 ChatWebsite.hasMany(models.ChatWebsitesField, {
191 foreignKey: 'OfflineId'
193 ChatWebsite.hasMany(models.ChatProactiveAction);
194 ChatWebsite.hasMany(models.ChatDisposition);