f9e34eef01a819af24639f16c87334948ad4a1dc
[motion2.git] / server / mysqldb / index.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0xa07f=['../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','SugarcrmConfiguration','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','DeskField','../api/intDeskField/intDeskField.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskField','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','FreshsalesAccount','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','JscriptyQuestionReport','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','../api/license/license.model','Campaign','../api/campaign/campaign.model','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','MailTransferReport','ChatTransferReport','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','../api/notification/notification.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','../api/whatsappInteraction/whatsappInteraction.model','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','hasOne','VoiceMail','UserId','hasMany','Recordings','VoiceQueuesRt','Extensions','cascade','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','MailInteraction','MailInteractions','WhatsappInteractions','Notification','belongsTo','userProfileId','belongsToMany','chat_group_has_users','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','WhatsappInteraction','user_has_whatsapp_interactions','VoiceQueues','UserVoiceQueue','MailQueues','UserMailQueue','ChatQueues','SmsQueue','SmsQueues','OpenchannelQueues','WhatsappQueues','VoicePrefixes','user_has_voice_prefixes','user_has_chat_websites','MailAccounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccount','user_has_sms_accounts','WhatsappAccount','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','VoiceChanSpy','ChanSpyId','Applications','VoiceMusicOnHold','Sounds','Members','VoiceQueueId','Hoppers','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','Interval','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Teams','team_has_voice_queues','BlackLists','voice_queues_has_cm_blacklists','ScreenRecording','Messages','mailboxuser','mailbox','VoiceQueueReport','QueueCalls','uniqueid','Contact','ContactId','MailAccountId','Imap','Smtp','Dispositions','Answers','Interactions','List','ListId','Agents','team_has_mail_queues','MailInteractionId','Tags','ThroughTags','Users','Attachments','Interaction','Account','restrict','IntervalId','TagId','FaxAccountId','mandatoryDispositionPause','FaxApplication','FaxInteractionId','Owner','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelApplication','openchannel_interaction_has_tags','user_has_openchannel_interactions','OpenchannelInteractionId','OpenchannelQueueId','team_has_openchannel_queues','ChatWebsite','ChatWebsiteId','ProactiveActions','Queue','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','CompanyId','Company','cm_contact_has_tags','Agent','CampaignId','OwnerId','All','OneAll','OneAny','Actions','AutomationId','ParentId','MailApplications','ChatApplications','FaxApplications','DefaultReportId','Sound','Mohs','moh_has_sounds','fax_interaction_has_tags','AllConditions','TriggerAllId','AnyConditions','AnyCondition','TriggerId','Fields','MetricId','AccountId','DescriptionId','FieldId','Subject','SubjectId','Description','Field','VariableId','SugarcrmField','Descriptions','DeskAccount','Subjects','int_desk_configuration_has_tags','Configurations','ZohoAccount','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskConfiguration','Dynamics365Field','ChatQueueReport','FromId','ToId','SessionId','ProjectId','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','FromChatWebsiteId','FromAccount','FromUserId','ToAccount','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','ToOpenchannelAccountId','ToSmsAccountId','CustomFields','Queues','UserProfileSection','UserProfileSections','WhatsappAccountId','WhatsappMessage','WhatsappInteractionId','whatsapp_interaction_has_tags','WhatsappQueueReport','ToQueueId','WhatsappQueueId','exports','path','../config/environment','sequelize','lodash','determine','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','database','username','options','password','User','import','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model','VoiceMailMessage','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','../api/mailServerIn/mailServerIn.model','MailServerOut','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','../api/faxApplication/faxApplication.model','FaxInteraction','FaxMessage','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','ChatMessage','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','CmContact','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','Disposition','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','../api/sound/sound.model','Tag','Template','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport'];(function(_0x2c2390,_0x37ef1c){var _0x478b7e=function(_0x2ea947){while(--_0x2ea947){_0x2c2390['push'](_0x2c2390['shift']());}};_0x478b7e(++_0x37ef1c);}(_0xa07f,0x141));var _0xfa07=function(_0x5650f5,_0x2f05e8){_0x5650f5=_0x5650f5-0x0;var _0x4af6b3=_0xa07f[_0x5650f5];return _0x4af6b3;};'use strict';var path=require(_0xfa07('0x0'));var config=require(_0xfa07('0x1'));var Sequelize=require(_0xfa07('0x2'));var _=require(_0xfa07('0x3'));var jstz=require('jstz');var timezone=jstz[_0xfa07('0x4')]();config['sequelize']=_[_0xfa07('0x5')](config[_0xfa07('0x2')],{'database':_0xfa07('0x6'),'username':_0xfa07('0x7'),'password':_0xfa07('0x8'),'options':{'host':_0xfa07('0x9'),'port':0xcea,'dialect':_0xfa07('0xa'),'dialectOptions':{'charset':_0xfa07('0xb')},'logging':![],'timezone':timezone[_0xfa07('0xc')](),'define':{'charset':_0xfa07('0xd'),'collate':_0xfa07('0xe')}}});config[_0xfa07('0xf')]=_[_0xfa07('0x5')](config[_0xfa07('0xf')],{'database':_0xfa07('0x6'),'username':'xcall','password':_0xfa07('0x8'),'options':{'host':_0xfa07('0x9'),'port':0xcea,'dialect':_0xfa07('0xa'),'dialectOptions':{'charset':_0xfa07('0xb')},'logging':![],'timezone':timezone[_0xfa07('0xc')](),'define':{'charset':_0xfa07('0xd'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xfa07('0x2')][_0xfa07('0x10')],config[_0xfa07('0x2')][_0xfa07('0x11')],config[_0xfa07('0x2')]['password'],config[_0xfa07('0x2')][_0xfa07('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xfa07('0xf')][_0xfa07('0x10')],config[_0xfa07('0xf')][_0xfa07('0x11')],config[_0xfa07('0xf')][_0xfa07('0x13')],config[_0xfa07('0xf')][_0xfa07('0x12')])};db[_0xfa07('0x14')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0x16'));db['VoiceChanSpy']=db[_0xfa07('0x2')]['import'](_0xfa07('0x17'));db[_0xfa07('0x18')]=db['sequelize'][_0xfa07('0x15')](_0xfa07('0x19'));db[_0xfa07('0x1a')]=db[_0xfa07('0x2')][_0xfa07('0x15')]('../api/voiceExtension/voiceExtension.model');db['VoiceMusicOnHold']=db['sequelize'][_0xfa07('0x15')](_0xfa07('0x1b'));db[_0xfa07('0x1c')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0x1d'));db[_0xfa07('0x1e')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0x1f'));db['ScreenRecording']=db[_0xfa07('0x2')]['import'](_0xfa07('0x20'));db['VoiceMail']=db[_0xfa07('0x2')][_0xfa07('0x15')]('../api/voiceMail/voiceMail.model');db[_0xfa07('0x21')]=db['sequelize']['import']('../api/voiceMailMessage/voiceMailMessage.model');db[_0xfa07('0x22')]=db['sequelize']['import'](_0xfa07('0x23'));db[_0xfa07('0x24')]=db['sequelize'][_0xfa07('0x15')](_0xfa07('0x25'));db[_0xfa07('0x26')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0x27'));db['VoiceQueueReport']=db[_0xfa07('0x2')]['import'](_0xfa07('0x28'));db[_0xfa07('0x29')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0x2a'));db[_0xfa07('0x2b')]=db['sequelize'][_0xfa07('0x15')]('../api/trunk/trunk.model');db[_0xfa07('0x2c')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0x2d'));db[_0xfa07('0x2e')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0x2f'));db['UserVoiceQueue']=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0x30'));db[_0xfa07('0x31')]=db[_0xfa07('0x2')][_0xfa07('0x15')]('../api/userChatQueue/userChatQueue.model');db['UserMailQueue']=db[_0xfa07('0x2')][_0xfa07('0x15')]('../api/userMailQueue/userMailQueue.model');db[_0xfa07('0x32')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0x33'));db['UserSmsQueue']=db[_0xfa07('0x2')][_0xfa07('0x15')]('../api/userSmsQueue/userSmsQueue.model');db[_0xfa07('0x34')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0x35'));db[_0xfa07('0x36')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0x37'));db['MailServerIn']=db[_0xfa07('0x2')]['import'](_0xfa07('0x38'));db[_0xfa07('0x39')]=db['sequelize'][_0xfa07('0x15')]('../api/mailServerOut/mailServerOut.model');db[_0xfa07('0x3a')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0x3b'));db[_0xfa07('0x3c')]=db['sequelize'][_0xfa07('0x15')]('../api/mailQueue/mailQueue.model');db[_0xfa07('0x3d')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0x3e'));db['MailInteraction']=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0x3f'));db[_0xfa07('0x40')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0x41'));db[_0xfa07('0x42')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0x43'));db[_0xfa07('0x44')]=db['sequelize'][_0xfa07('0x15')](_0xfa07('0x45'));db[_0xfa07('0x46')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0x47'));db[_0xfa07('0x48')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0x49'));db[_0xfa07('0x4a')]=db[_0xfa07('0x2')]['import'](_0xfa07('0x4b'));db['FaxApplication']=db['sequelize'][_0xfa07('0x15')](_0xfa07('0x4c'));db[_0xfa07('0x4d')]=db[_0xfa07('0x2')][_0xfa07('0x15')]('../api/faxInteraction/faxInteraction.model');db[_0xfa07('0x4e')]=db[_0xfa07('0x2')]['import']('../api/faxMessage/faxMessage.model');db[_0xfa07('0x4f')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0x50'));db[_0xfa07('0x51')]=db['sequelize']['import'](_0xfa07('0x52'));db['SmsAccount']=db[_0xfa07('0x2')]['import'](_0xfa07('0x53'));db[_0xfa07('0x54')]=db[_0xfa07('0x2')][_0xfa07('0x15')]('../api/smsApplication/smsApplication.model');db[_0xfa07('0x55')]=db[_0xfa07('0x2')]['import'](_0xfa07('0x56'));db[_0xfa07('0x57')]=db[_0xfa07('0x2')]['import'](_0xfa07('0x58'));db['SmsQueue']=db[_0xfa07('0x2')]['import']('../api/smsQueue/smsQueue.model');db[_0xfa07('0x59')]=db['sequelize'][_0xfa07('0x15')](_0xfa07('0x5a'));db['OpenchannelApplication']=db[_0xfa07('0x2')][_0xfa07('0x15')]('../api/openchannelApplication/openchannelApplication.model');db[_0xfa07('0x5b')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0x5c'));db[_0xfa07('0x5d')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0x5e'));db[_0xfa07('0x5f')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0x60'));db['ChatWebsite']=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0x61'));db[_0xfa07('0x62')]=db['sequelize'][_0xfa07('0x15')](_0xfa07('0x63'));db[_0xfa07('0x64')]=db['sequelize'][_0xfa07('0x15')](_0xfa07('0x65'));db[_0xfa07('0x66')]=db[_0xfa07('0x2')]['import']('../api/chatInteraction/chatInteraction.model');db[_0xfa07('0x67')]=db[_0xfa07('0x2')][_0xfa07('0x15')]('../api/chatMessage/chatMessage.model');db[_0xfa07('0x68')]=db['sequelize'][_0xfa07('0x15')](_0xfa07('0x69'));db[_0xfa07('0x6a')]=db[_0xfa07('0x2')]['import'](_0xfa07('0x6b'));db[_0xfa07('0x6c')]=db['sequelize'][_0xfa07('0x15')](_0xfa07('0x6d'));db[_0xfa07('0x6e')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0x6f'));db[_0xfa07('0x70')]=db[_0xfa07('0x2')][_0xfa07('0x15')]('../api/cmCompany/cmCompany.model');db[_0xfa07('0x71')]=db['sequelize'][_0xfa07('0x15')]('../api/cmContact/cmContact.model');db[_0xfa07('0x72')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0x73'));db[_0xfa07('0x74')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0x75'));db[_0xfa07('0x76')]=db[_0xfa07('0x2')][_0xfa07('0x15')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0xfa07('0x77')]=db[_0xfa07('0x2')]['import'](_0xfa07('0x78'));db[_0xfa07('0x79')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0x7a'));db[_0xfa07('0x7b')]=db[_0xfa07('0x2')]['import'](_0xfa07('0x7c'));db[_0xfa07('0x7d')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0x7e'));db[_0xfa07('0x7f')]=db[_0xfa07('0x2')]['import'](_0xfa07('0x80'));db[_0xfa07('0x81')]=db['sequelize'][_0xfa07('0x15')]('../api/cannedAnswer/cannedAnswer.model');db[_0xfa07('0x82')]=db[_0xfa07('0x2')][_0xfa07('0x15')]('../api/disposition/disposition.model');db[_0xfa07('0x83')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0x84'));db['Interval']=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0x85'));db[_0xfa07('0x86')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0x87'));db[_0xfa07('0x88')]=db[_0xfa07('0x2')]['import'](_0xfa07('0x89'));db[_0xfa07('0x8a')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0x8b'));db[_0xfa07('0x8c')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0x8d'));db['Sound']=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0x8e'));db[_0xfa07('0x8f')]=db[_0xfa07('0x2')][_0xfa07('0x15')]('../api/tag/tag.model');db[_0xfa07('0x90')]=db[_0xfa07('0x2')][_0xfa07('0x15')]('../api/template/template.model');db[_0xfa07('0x91')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0x92'));db[_0xfa07('0x93')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0x94'));db[_0xfa07('0x95')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0x96'));db['IntegrationReport']=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0x97'));db['AnalyticCustomReport']=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0x98'));db[_0xfa07('0x99')]=db['sequelize'][_0xfa07('0x15')](_0xfa07('0x9a'));db['AnalyticExtractedReport']=db[_0xfa07('0x2')][_0xfa07('0x15')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0xfa07('0x9b')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0x9c'));db[_0xfa07('0x9d')]=db[_0xfa07('0x2')][_0xfa07('0x15')]('../api/analyticFieldReport/analyticFieldReport.model');db[_0xfa07('0x9e')]=db[_0xfa07('0x2')]['import'](_0xfa07('0x9f'));db[_0xfa07('0xa0')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0xa1'));db[_0xfa07('0xa2')]=db['sequelize'][_0xfa07('0x15')](_0xfa07('0xa3'));db[_0xfa07('0xa4')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0xa5'));db[_0xfa07('0xa6')]=db[_0xfa07('0x2')][_0xfa07('0x15')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0xfa07('0xa7')]=db[_0xfa07('0x2')][_0xfa07('0x15')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db['SugarcrmField']=db[_0xfa07('0x2')]['import']('../api/intSugarcrmField/intSugarcrmField.model');db['DeskAccount']=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0xa8'));db[_0xfa07('0xa9')]=db['sequelize'][_0xfa07('0x15')]('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0xfa07('0xaa')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0xab'));db['ZohoAccount']=db[_0xfa07('0x2')][_0xfa07('0x15')]('../api/intZohoAccount/intZohoAccount.model');db[_0xfa07('0xac')]=db['sequelize'][_0xfa07('0x15')](_0xfa07('0xad'));db[_0xfa07('0xae')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0xaf'));db[_0xfa07('0xb0')]=db['sequelize'][_0xfa07('0x15')](_0xfa07('0xb1'));db['ZendeskConfiguration']=db[_0xfa07('0x2')][_0xfa07('0x15')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0xfa07('0xb2')]=db['sequelize'][_0xfa07('0x15')]('../api/intZendeskField/intZendeskField.model');db[_0xfa07('0xb3')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0xb4'));db['FreshdeskConfiguration']=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0xb5'));db[_0xfa07('0xb6')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0xb7'));db[_0xfa07('0xb8')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0xb9'));db[_0xfa07('0xba')]=db[_0xfa07('0x2')]['import'](_0xfa07('0xbb'));db[_0xfa07('0xbc')]=db[_0xfa07('0x2')][_0xfa07('0x15')]('../api/intVtigerField/intVtigerField.model');db[_0xfa07('0xbd')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0xbe'));db[_0xfa07('0xbf')]=db[_0xfa07('0x2')][_0xfa07('0x15')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0xfa07('0xc0')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0xc1'));db[_0xfa07('0xc2')]=db['sequelize'][_0xfa07('0x15')](_0xfa07('0xc3'));db[_0xfa07('0xc4')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0xc5'));db['Dynamics365Field']=db['sequelize']['import']('../api/intDynamics365Field/intDynamics365Field.model');db[_0xfa07('0xc6')]=db['sequelize']['import']('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0xfa07('0xc7')]=db['sequelize'][_0xfa07('0x15')](_0xfa07('0xc8'));db[_0xfa07('0xc9')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0xca'));db[_0xfa07('0x95')]=db[_0xfa07('0x2')][_0xfa07('0x15')]('../api/integration/integration.model');db[_0xfa07('0xcb')]=db['sequelize'][_0xfa07('0x15')](_0xfa07('0xcc'));db['ChatQueueReport']=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0xcd'));db[_0xfa07('0xce')]=db[_0xfa07('0x2')]['import'](_0xfa07('0xcf'));db[_0xfa07('0xd0')]=db[_0xfa07('0x2')][_0xfa07('0x15')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0xfa07('0xd1')]=db['sequelize'][_0xfa07('0x15')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0xfa07('0xd2')]=db['sequelize'][_0xfa07('0x15')](_0xfa07('0xd3'));db[_0xfa07('0xd4')]=db[_0xfa07('0x2')]['import'](_0xfa07('0xd5'));db[_0xfa07('0xd6')]=db['sequelize'][_0xfa07('0x15')]('../api/squareReport/squareReport.model');db[_0xfa07('0xd7')]=db['sequelize'][_0xfa07('0x15')](_0xfa07('0xd8'));db[_0xfa07('0xd9')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0xda'));db[_0xfa07('0xdb')]=db['sequelize']['import']('../api/setting/setting.model');db[_0xfa07('0xdc')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0xdd'));db[_0xfa07('0xde')]=db['sequelize'][_0xfa07('0x15')](_0xfa07('0xdf'));db[_0xfa07('0xe0')]=db[_0xfa07('0x2')]['import'](_0xfa07('0xe1'));db['SquareMessage']=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0xe2'));db[_0xfa07('0xe3')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0xe4'));db['License']=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0xe5'));db[_0xfa07('0xe6')]=db[_0xfa07('0x2')]['import'](_0xfa07('0xe7'));db['Migration']=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0xe8'));db[_0xfa07('0xe9')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0xea'));db[_0xfa07('0xeb')]=db[_0xfa07('0x2')][_0xfa07('0x15')]('../api/plugin/plugin.model');db[_0xfa07('0xec')]=db[_0xfa07('0x2')][_0xfa07('0x15')]('../api/mailTransferReport/mailTransferReport.model');db[_0xfa07('0xed')]=db[_0xfa07('0x2')][_0xfa07('0x15')]('../api/chatTransferReport/chatTransferReport.model');db[_0xfa07('0xee')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0xef'));db[_0xfa07('0xf0')]=db['sequelize'][_0xfa07('0x15')](_0xfa07('0xf1'));db[_0xfa07('0xf2')]=db[_0xfa07('0x2')][_0xfa07('0x15')]('../api/smsTransferReport/smsTransferReport.model');db[_0xfa07('0xf3')]=db['sequelize'][_0xfa07('0x15')](_0xfa07('0xf4'));db[_0xfa07('0xf5')]=db['sequelize'][_0xfa07('0x15')](_0xfa07('0xf6'));db[_0xfa07('0xf7')]=db[_0xfa07('0x2')][_0xfa07('0x15')]('../api/userProfile/userProfile.model');db['UserProfileSection']=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0xf8'));db[_0xfa07('0xf9')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0xfa'));db['Notification']=db[_0xfa07('0x2')]['import'](_0xfa07('0xfb'));db['WhatsappAccount']=db[_0xfa07('0x2')]['import']('../api/whatsappAccount/whatsappAccount.model');db[_0xfa07('0xfc')]=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0xfd'));db['WhatsappInteraction']=db[_0xfa07('0x2')]['import'](_0xfa07('0xfe'));db['WhatsappMessage']=db[_0xfa07('0x2')][_0xfa07('0x15')]('../api/whatsappMessage/whatsappMessage.model');db['WhatsappQueueReport']=db[_0xfa07('0x2')][_0xfa07('0x15')](_0xfa07('0xff'));db[_0xfa07('0x100')]=db['sequelize']['import'](_0xfa07('0x101'));db[_0xfa07('0x102')]=db[_0xfa07('0x2')]['import'](_0xfa07('0x103'));db['CloudProvider']=db[_0xfa07('0x2')]['import']('../api/cloudProvider/cloudProvider.model');db[_0xfa07('0x14')][_0xfa07('0x104')](db[_0xfa07('0x105')],{'as':_0xfa07('0x105'),'onDelete':'cascade','foreignKey':_0xfa07('0x106')});db['User'][_0xfa07('0x107')](db[_0xfa07('0x1e')],{'as':_0xfa07('0x108'),'foreignKey':_0xfa07('0x106')});db[_0xfa07('0x14')][_0xfa07('0x107')](db[_0xfa07('0x2e')],{'as':_0xfa07('0x109'),'foreignKey':_0xfa07('0x106')});db['User']['hasMany'](db[_0xfa07('0x1a')],{'as':_0xfa07('0x10a'),'onDelete':_0xfa07('0x10b'),'hooks':!![]});db[_0xfa07('0x14')][_0xfa07('0x107')](db[_0xfa07('0x76')],{'as':_0xfa07('0x10c'),'foreignKey':_0xfa07('0x106')});db[_0xfa07('0x14')]['hasMany'](db[_0xfa07('0x77')],{'as':_0xfa07('0x10d'),'foreignKey':_0xfa07('0x106')});db[_0xfa07('0x14')]['hasMany'](db[_0xfa07('0x79')],{'as':'ReportAgentPreview','foreignKey':'UserId'});db[_0xfa07('0x14')]['hasMany'](db['OpenchannelInteraction'],{'as':_0xfa07('0x10e'),'foreignKey':_0xfa07('0x106')});db[_0xfa07('0x14')][_0xfa07('0x107')](db[_0xfa07('0x66')],{'as':_0xfa07('0x10f'),'foreignKey':_0xfa07('0x106')});db['User'][_0xfa07('0x107')](db[_0xfa07('0x55')],{'as':_0xfa07('0x110'),'foreignKey':_0xfa07('0x106')});db[_0xfa07('0x14')][_0xfa07('0x107')](db[_0xfa07('0x4d')],{'as':_0xfa07('0x111'),'foreignKey':_0xfa07('0x106')});db['User'][_0xfa07('0x107')](db[_0xfa07('0x112')],{'as':_0xfa07('0x113'),'foreignKey':_0xfa07('0x106')});db[_0xfa07('0x14')][_0xfa07('0x107')](db['WhatsappInteraction'],{'as':_0xfa07('0x114'),'foreignKey':_0xfa07('0x106')});db['User'][_0xfa07('0x107')](db[_0xfa07('0x115')],{'as':'Notifications','foreignKey':'SenderId'});db['User'][_0xfa07('0x116')](db[_0xfa07('0xf7')],{'as':_0xfa07('0xf7'),'foreignKey':_0xfa07('0x117')});db['User'][_0xfa07('0x118')](db['ChatGroup'],{'as':'Groups','through':_0xfa07('0x119')});db[_0xfa07('0x14')]['belongsToMany'](db[_0xfa07('0x71')],{'as':_0xfa07('0x11a'),'through':_0xfa07('0x11b')});db['User'][_0xfa07('0x118')](db[_0xfa07('0xf3')],{'as':_0xfa07('0x11c'),'through':_0xfa07('0x11d')});db[_0xfa07('0x14')][_0xfa07('0x118')](db[_0xfa07('0xe3')],{'through':_0xfa07('0x11e')});db['User'][_0xfa07('0x118')](db[_0xfa07('0x112')],{'as':_0xfa07('0x113'),'through':_0xfa07('0x11f')});db['User'][_0xfa07('0x118')](db[_0xfa07('0x66')],{'as':'ChatInteractions','through':_0xfa07('0x120')});db[_0xfa07('0x14')]['belongsToMany'](db[_0xfa07('0x4d')],{'as':_0xfa07('0x111'),'through':_0xfa07('0x121')});db[_0xfa07('0x14')][_0xfa07('0x118')](db[_0xfa07('0x55')],{'as':_0xfa07('0x110'),'through':_0xfa07('0x122')});db[_0xfa07('0x14')]['belongsToMany'](db[_0xfa07('0x5b')],{'as':_0xfa07('0x10e'),'through':'user_has_openchannel_interactions'});db[_0xfa07('0x14')][_0xfa07('0x118')](db[_0xfa07('0x123')],{'as':_0xfa07('0x114'),'through':_0xfa07('0x124')});db['User'][_0xfa07('0x118')](db[_0xfa07('0x1c')],{'as':_0xfa07('0x125'),'through':_0xfa07('0x126'),'required':![]});db[_0xfa07('0x14')][_0xfa07('0x118')](db[_0xfa07('0x3c')],{'as':_0xfa07('0x127'),'through':_0xfa07('0x128'),'required':![]});db[_0xfa07('0x14')]['belongsToMany'](db[_0xfa07('0x6a')],{'as':_0xfa07('0x129'),'through':'UserChatQueue','required':![],'hooks':!![]});db['User'][_0xfa07('0x118')](db['FaxQueue'],{'as':'FaxQueues','through':_0xfa07('0x32'),'required':![]});db['User']['belongsToMany'](db[_0xfa07('0x12a')],{'as':_0xfa07('0x12b'),'through':'UserSmsQueue','required':![]});db[_0xfa07('0x14')][_0xfa07('0x118')](db[_0xfa07('0x5f')],{'as':_0xfa07('0x12c'),'through':_0xfa07('0x34'),'required':![]});db['User'][_0xfa07('0x118')](db[_0xfa07('0x102')],{'as':_0xfa07('0x12d'),'through':_0xfa07('0x36'),'required':![]});db['User'][_0xfa07('0x118')](db[_0xfa07('0xf3')],{'through':_0xfa07('0x11d')});db[_0xfa07('0x14')][_0xfa07('0x118')](db[_0xfa07('0xf5')],{'as':_0xfa07('0x12e'),'through':_0xfa07('0x12f'),'required':![]});db[_0xfa07('0x14')][_0xfa07('0x118')](db['ChatWebsite'],{'as':'ChatWebsites','through':_0xfa07('0x130')});db[_0xfa07('0x14')][_0xfa07('0x118')](db['FaxAccount'],{'as':'FaxAccounts','through':'user_has_fax_accounts'});db[_0xfa07('0x14')][_0xfa07('0x118')](db[_0xfa07('0x3a')],{'as':_0xfa07('0x131'),'through':'user_has_mail_accounts'});db['User'][_0xfa07('0x118')](db[_0xfa07('0x59')],{'as':_0xfa07('0x132'),'through':_0xfa07('0x133')});db[_0xfa07('0x14')][_0xfa07('0x118')](db[_0xfa07('0x134')],{'as':'SmsAccounts','through':_0xfa07('0x135')});db[_0xfa07('0x14')][_0xfa07('0x118')](db[_0xfa07('0x136')],{'as':_0xfa07('0x137'),'through':_0xfa07('0x138')});db['User'][_0xfa07('0x118')](db[_0xfa07('0xde')],{'as':_0xfa07('0x139'),'through':_0xfa07('0x13a')});db[_0xfa07('0x13b')]['hasMany'](db['VoiceExtension'],{'as':'SpiedAgents','onDelete':_0xfa07('0x10b'),'foreignKey':_0xfa07('0x13c')});db['VoiceContext'][_0xfa07('0x107')](db[_0xfa07('0x1a')],{'onDelete':_0xfa07('0x10b')});db[_0xfa07('0x1a')][_0xfa07('0x107')](db[_0xfa07('0x1a')],{'as':_0xfa07('0x13d'),'onDelete':_0xfa07('0x10b')});db[_0xfa07('0x13e')][_0xfa07('0x118')](db['Sound'],{'as':_0xfa07('0x13f'),'through':'moh_has_sounds'});db[_0xfa07('0x1c')][_0xfa07('0x107')](db[_0xfa07('0x2e')],{'as':_0xfa07('0x140'),'foreignKey':_0xfa07('0x141')});db['VoiceQueue'][_0xfa07('0x107')](db[_0xfa07('0x72')],{'as':_0xfa07('0x142'),'foreignKey':_0xfa07('0x141')});db[_0xfa07('0x1c')][_0xfa07('0x107')](db['CmHopperFinal'],{'as':_0xfa07('0x10c'),'foreignKey':'VoiceQueueId'});db[_0xfa07('0x1c')][_0xfa07('0x107')](db['CmHopperHistory'],{'as':_0xfa07('0x143'),'foreignKey':'VoiceQueueId'});db[_0xfa07('0x1c')][_0xfa07('0x107')](db[_0xfa07('0x79')],{'as':_0xfa07('0x79'),'foreignKey':_0xfa07('0x141')});db[_0xfa07('0x1c')][_0xfa07('0x107')](db[_0xfa07('0x74')],{'as':_0xfa07('0x144'),'foreignKey':'VoiceQueueId'});db[_0xfa07('0x1c')][_0xfa07('0x107')](db[_0xfa07('0xd2')],{'as':_0xfa07('0x145'),'foreignKey':'VoiceQueueId'});db[_0xfa07('0x1c')][_0xfa07('0x116')](db[_0xfa07('0x2b')],{'as':'Trunk','foreignKey':_0xfa07('0x146')});db[_0xfa07('0x1c')]['belongsTo'](db['Trunk'],{'as':_0xfa07('0x147'),'foreignKey':_0xfa07('0x148')});db[_0xfa07('0x1c')][_0xfa07('0x116')](db[_0xfa07('0x149')],{'as':_0xfa07('0x149'),'foreignKey':'IntervalId'});db[_0xfa07('0x1c')]['belongsTo'](db[_0xfa07('0x86')],{'as':'mandatoryDispositionPause','foreignKey':_0xfa07('0x14a')});db[_0xfa07('0x1c')][_0xfa07('0x118')](db[_0xfa07('0xf3')],{'as':'Lists','through':_0xfa07('0x14b')});db['VoiceQueue'][_0xfa07('0x118')](db[_0xfa07('0x14')],{'as':'Agents','through':_0xfa07('0x126')});db[_0xfa07('0x1c')][_0xfa07('0x118')](db[_0xfa07('0xe3')],{'as':_0xfa07('0x14c'),'through':_0xfa07('0x14d')});db['VoiceQueue'][_0xfa07('0x118')](db['CmList'],{'as':_0xfa07('0x14e'),'through':_0xfa07('0x14f')});db['VoiceRecording'][_0xfa07('0x116')](db[_0xfa07('0x14')],{'as':'User','foreignKey':'UserId'});db[_0xfa07('0x150')][_0xfa07('0x116')](db[_0xfa07('0x14')],{'as':'User','foreignKey':_0xfa07('0x106')});db[_0xfa07('0x105')]['hasMany'](db[_0xfa07('0x21')],{'as':_0xfa07('0x151'),'onDelete':'cascade','foreignKey':_0xfa07('0x152'),'sourceKey':_0xfa07('0x153')});db[_0xfa07('0x21')][_0xfa07('0x116')](db['VoiceMail'],{'foreignKey':_0xfa07('0x152'),'targetKey':_0xfa07('0x153')});db[_0xfa07('0x22')][_0xfa07('0x107')](db[_0xfa07('0x154')],{'as':_0xfa07('0x155'),'foreignKey':'uniqueid','constraints':![]});db['VoiceCallReport'][_0xfa07('0x107')](db[_0xfa07('0x26')],{'as':'AgentReports','foreignKey':_0xfa07('0x156'),'constraints':![]});db['VoiceCallReport'][_0xfa07('0x116')](db[_0xfa07('0x14')],{'as':_0xfa07('0x14'),'foreignKey':'UserId'});db[_0xfa07('0x22')][_0xfa07('0x116')](db[_0xfa07('0x71')],{'as':_0xfa07('0x157'),'foreignKey':_0xfa07('0x158')});db['MailServerIn']['belongsTo'](db['MailAccount'],{'as':_0xfa07('0x3a'),'foreignKey':_0xfa07('0x159')});db[_0xfa07('0x39')]['belongsTo'](db['MailAccount'],{'as':_0xfa07('0x3a'),'foreignKey':_0xfa07('0x159')});db[_0xfa07('0x3a')][_0xfa07('0x104')](db['MailServerIn'],{'as':_0xfa07('0x15a'),'onDelete':'cascade'});db[_0xfa07('0x3a')][_0xfa07('0x104')](db[_0xfa07('0x39')],{'as':_0xfa07('0x15b'),'onDelete':'cascade'});db[_0xfa07('0x3a')][_0xfa07('0x107')](db[_0xfa07('0x82')],{'as':_0xfa07('0x15c'),'foreignKey':'MailAccountId'});db[_0xfa07('0x3a')][_0xfa07('0x107')](db[_0xfa07('0x81')],{'as':_0xfa07('0x15d'),'foreignKey':_0xfa07('0x159')});db[_0xfa07('0x3a')]['hasMany'](db[_0xfa07('0x40')],{'as':'Messages','foreignKey':_0xfa07('0x159')});db['MailAccount'][_0xfa07('0x107')](db[_0xfa07('0x112')],{'as':_0xfa07('0x15e')});db['MailAccount'][_0xfa07('0x107')](db['MailApplication'],{'as':_0xfa07('0x13d')});db[_0xfa07('0x3a')][_0xfa07('0x116')](db[_0xfa07('0xf3')],{'as':_0xfa07('0x15f'),'foreignKey':_0xfa07('0x160')});db['MailAccount']['belongsTo'](db[_0xfa07('0x90')],{'as':_0xfa07('0x90'),'foreignKey':'TemplateId'});db[_0xfa07('0x3a')][_0xfa07('0x116')](db[_0xfa07('0x86')],{'as':'mandatoryDispositionPause','foreignKey':_0xfa07('0x14a')});db[_0xfa07('0x3a')][_0xfa07('0x118')](db[_0xfa07('0x14')],{'as':'Agents','through':'user_has_mail_accounts'});db[_0xfa07('0x3c')][_0xfa07('0x118')](db[_0xfa07('0x14')],{'as':_0xfa07('0x161'),'through':_0xfa07('0x128')});db[_0xfa07('0x3c')]['belongsToMany'](db[_0xfa07('0xe3')],{'through':_0xfa07('0x162'),'as':_0xfa07('0x14c')});db[_0xfa07('0x112')][_0xfa07('0x107')](db[_0xfa07('0x40')],{'as':_0xfa07('0x151'),'onDelete':'cascade','foreignKey':_0xfa07('0x163')});db['MailInteraction'][_0xfa07('0x116')](db['MailAccount'],{'as':'Account','foreignKey':_0xfa07('0x159')});db[_0xfa07('0x112')][_0xfa07('0x116')](db[_0xfa07('0x71')],{'as':_0xfa07('0x157'),'foreignKey':_0xfa07('0x158')});db[_0xfa07('0x112')][_0xfa07('0x116')](db[_0xfa07('0x14')],{'as':'Owner','foreignKey':_0xfa07('0x106')});db[_0xfa07('0x112')][_0xfa07('0x118')](db[_0xfa07('0x8f')],{'through':'mail_interaction_has_tags','as':_0xfa07('0x164')});db[_0xfa07('0x112')][_0xfa07('0x118')](db['Tag'],{'through':'mail_interaction_has_tags','as':_0xfa07('0x165')});db['MailInteraction'][_0xfa07('0x118')](db['User'],{'as':_0xfa07('0x166'),'through':_0xfa07('0x11f'),'foreignKey':_0xfa07('0x163')});db[_0xfa07('0x40')]['hasMany'](db['Attachment'],{'as':_0xfa07('0x167'),'onDelete':_0xfa07('0x10b')});db['MailMessage'][_0xfa07('0x116')](db[_0xfa07('0x14')],{'as':_0xfa07('0x14')});db[_0xfa07('0x40')][_0xfa07('0x116')](db[_0xfa07('0x71')],{'onDelete':_0xfa07('0x10b'),'as':_0xfa07('0x157')});db['MailMessage'][_0xfa07('0x116')](db['MailInteraction'],{'as':_0xfa07('0x168'),'foreignKey':'MailInteractionId'});db[_0xfa07('0x40')]['belongsTo'](db[_0xfa07('0x3a')],{'as':_0xfa07('0x169'),'foreignKey':_0xfa07('0x159')});db[_0xfa07('0x42')][_0xfa07('0x116')](db[_0xfa07('0x14')],{'onDelete':_0xfa07('0x16a')});db['MailApplication']['belongsTo'](db[_0xfa07('0x3c')],{'onDelete':_0xfa07('0x16a')});db[_0xfa07('0x42')][_0xfa07('0x116')](db[_0xfa07('0x3a')],{'onDelete':_0xfa07('0x16a')});db[_0xfa07('0x42')][_0xfa07('0x116')](db[_0xfa07('0x149')],{'onDelete':'restrict','foreignKey':_0xfa07('0x16b')});db['MailApplication'][_0xfa07('0x116')](db['Tag'],{'onDelete':_0xfa07('0x16a'),'foreignKey':_0xfa07('0x16c')});db[_0xfa07('0x44')][_0xfa07('0x116')](db[_0xfa07('0x3a')],{});db[_0xfa07('0x44')][_0xfa07('0x116')](db[_0xfa07('0xf3')],{'as':_0xfa07('0x15f'),'foreignKey':'ListId'});db['MailQueueReport']['belongsTo'](db[_0xfa07('0x71')],{'as':_0xfa07('0x157'),'foreignKey':_0xfa07('0x158')});db[_0xfa07('0x44')][_0xfa07('0x116')](db['MailInteraction'],{});db['MailQueueReport'][_0xfa07('0x116')](db['MailMessage'],{});db[_0xfa07('0x44')]['belongsTo'](db[_0xfa07('0x14')],{});db[_0xfa07('0x44')][_0xfa07('0x116')](db['MailQueue'],{});db[_0xfa07('0x46')][_0xfa07('0x107')](db['DashboardItem'],{'as':'Items','onDelete':_0xfa07('0x10b')});db[_0xfa07('0x4a')][_0xfa07('0x107')](db[_0xfa07('0x82')],{'as':'Dispositions','foreignKey':_0xfa07('0x16d')});db[_0xfa07('0x4a')][_0xfa07('0x107')](db[_0xfa07('0x81')],{'as':'Answers','foreignKey':_0xfa07('0x16d')});db['FaxAccount'][_0xfa07('0x107')](db[_0xfa07('0x4d')],{'as':_0xfa07('0x15e')});db[_0xfa07('0x4a')][_0xfa07('0x107')](db['FaxApplication'],{'as':_0xfa07('0x13d')});db[_0xfa07('0x4a')][_0xfa07('0x107')](db['VoiceExtension'],{'as':'Exntensions','onDelete':'cascade'});db['FaxAccount']['hasMany'](db[_0xfa07('0x4e')],{'as':_0xfa07('0x151')});db[_0xfa07('0x4a')][_0xfa07('0x116')](db[_0xfa07('0x2b')],{'as':'Trunk'});db['FaxAccount'][_0xfa07('0x116')](db[_0xfa07('0xf3')],{'as':_0xfa07('0x15f'),'foreignKey':_0xfa07('0x160')});db['FaxAccount'][_0xfa07('0x116')](db['Pause'],{'as':_0xfa07('0x16e'),'foreignKey':_0xfa07('0x14a')});db[_0xfa07('0x4a')]['belongsToMany'](db[_0xfa07('0x14')],{'as':_0xfa07('0x161'),'through':'user_has_fax_accounts'});db[_0xfa07('0x16f')]['belongsTo'](db['User'],{'onDelete':_0xfa07('0x16a')});db[_0xfa07('0x16f')][_0xfa07('0x116')](db['FaxQueue'],{'onDelete':_0xfa07('0x16a')});db[_0xfa07('0x16f')][_0xfa07('0x116')](db[_0xfa07('0x4a')],{'onDelete':'restrict'});db[_0xfa07('0x16f')]['belongsTo'](db['Tag'],{'onDelete':'restrict','foreignKey':'TagId'});db['FaxInteraction'][_0xfa07('0x107')](db[_0xfa07('0x4e')],{'as':_0xfa07('0x151'),'onDelete':_0xfa07('0x10b'),'foreignKey':_0xfa07('0x170')});db[_0xfa07('0x4d')][_0xfa07('0x116')](db[_0xfa07('0x4a')],{'as':_0xfa07('0x169'),'foreignKey':'FaxAccountId'});db['FaxInteraction']['belongsTo'](db[_0xfa07('0x71')],{'as':_0xfa07('0x157'),'foreignKey':_0xfa07('0x158')});db[_0xfa07('0x4d')][_0xfa07('0x116')](db[_0xfa07('0x14')],{'as':_0xfa07('0x171'),'foreignKey':_0xfa07('0x106')});db['FaxInteraction']['belongsToMany'](db['Tag'],{'through':'fax_interaction_has_tags','as':_0xfa07('0x164')});db[_0xfa07('0x4d')]['belongsToMany'](db[_0xfa07('0x8f')],{'through':'fax_interaction_has_tags','as':'ThroughTags'});db[_0xfa07('0x4d')][_0xfa07('0x118')](db[_0xfa07('0x14')],{'as':'Users','through':_0xfa07('0x121'),'foreignKey':_0xfa07('0x170')});db['FaxMessage'][_0xfa07('0x116')](db[_0xfa07('0x14')],{'onDelete':_0xfa07('0x10b'),'as':'User'});db[_0xfa07('0x4e')][_0xfa07('0x116')](db[_0xfa07('0x4d')],{'as':_0xfa07('0x168'),'foreignKey':'FaxInteractionId'});db[_0xfa07('0x4e')][_0xfa07('0x116')](db[_0xfa07('0x71')],{'onDelete':_0xfa07('0x10b'),'as':_0xfa07('0x157')});db[_0xfa07('0x4e')][_0xfa07('0x116')](db[_0xfa07('0xe9')],{'as':_0xfa07('0xe9'),'foreignKey':_0xfa07('0x172')});db['FaxMessage'][_0xfa07('0x116')](db[_0xfa07('0x4a')],{'as':_0xfa07('0x169'),'foreignKey':'FaxAccountId'});db['FaxQueue'][_0xfa07('0x118')](db[_0xfa07('0x14')],{'as':'Agents','through':_0xfa07('0x32')});db[_0xfa07('0x4f')][_0xfa07('0x118')](db[_0xfa07('0xe3')],{'through':_0xfa07('0x173'),'as':_0xfa07('0x14c')});db[_0xfa07('0x51')][_0xfa07('0x116')](db[_0xfa07('0x4a')],{});db['FaxQueueReport']['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0xfa07('0x160')});db[_0xfa07('0x51')][_0xfa07('0x116')](db['CmContact'],{'as':'Contact','foreignKey':_0xfa07('0x158')});db[_0xfa07('0x51')][_0xfa07('0x116')](db[_0xfa07('0x4d')],{});db[_0xfa07('0x51')][_0xfa07('0x116')](db[_0xfa07('0x4e')],{});db[_0xfa07('0x51')]['belongsTo'](db['User'],{});db['FaxQueueReport'][_0xfa07('0x116')](db[_0xfa07('0x4f')],{});db[_0xfa07('0x134')][_0xfa07('0x107')](db[_0xfa07('0x82')],{'as':'Dispositions','foreignKey':_0xfa07('0x174')});db[_0xfa07('0x134')]['hasMany'](db[_0xfa07('0x81')],{'as':_0xfa07('0x15d'),'foreignKey':_0xfa07('0x174')});db[_0xfa07('0x134')]['hasMany'](db[_0xfa07('0x57')],{'as':_0xfa07('0x151'),'foreignKey':_0xfa07('0x174')});db['SmsAccount']['hasMany'](db[_0xfa07('0x55')],{'as':_0xfa07('0x15e')});db[_0xfa07('0x134')]['hasMany'](db['SmsApplication'],{'as':_0xfa07('0x13d')});db[_0xfa07('0x134')][_0xfa07('0x116')](db[_0xfa07('0xf3')],{'as':'List','foreignKey':_0xfa07('0x160')});db[_0xfa07('0x134')][_0xfa07('0x116')](db['Pause'],{'as':_0xfa07('0x16e'),'foreignKey':_0xfa07('0x14a')});db['SmsAccount'][_0xfa07('0x118')](db[_0xfa07('0x14')],{'as':'Agents','through':'user_has_sms_accounts'});db['SmsApplication'][_0xfa07('0x116')](db[_0xfa07('0x14')],{'onDelete':_0xfa07('0x16a')});db[_0xfa07('0x54')][_0xfa07('0x116')](db[_0xfa07('0x12a')],{'onDelete':_0xfa07('0x16a')});db['SmsApplication'][_0xfa07('0x116')](db[_0xfa07('0x134')],{'onDelete':_0xfa07('0x16a')});db[_0xfa07('0x54')]['belongsTo'](db[_0xfa07('0x149')],{'onDelete':_0xfa07('0x16a'),'foreignKey':_0xfa07('0x16b')});db[_0xfa07('0x54')][_0xfa07('0x116')](db[_0xfa07('0x8f')],{'onDelete':_0xfa07('0x16a'),'foreignKey':_0xfa07('0x16c')});db[_0xfa07('0x55')][_0xfa07('0x107')](db[_0xfa07('0x57')],{'as':_0xfa07('0x151'),'onDelete':'cascade','foreignKey':_0xfa07('0x175')});db['SmsInteraction']['belongsTo'](db[_0xfa07('0x134')],{'as':_0xfa07('0x169'),'foreignKey':_0xfa07('0x174')});db['SmsInteraction'][_0xfa07('0x116')](db[_0xfa07('0x71')],{'as':_0xfa07('0x157'),'foreignKey':_0xfa07('0x158')});db[_0xfa07('0x55')][_0xfa07('0x116')](db[_0xfa07('0x14')],{'as':'Owner','foreignKey':_0xfa07('0x106')});db[_0xfa07('0x55')][_0xfa07('0x118')](db[_0xfa07('0x8f')],{'through':_0xfa07('0x176'),'as':_0xfa07('0x164')});db[_0xfa07('0x55')]['belongsToMany'](db[_0xfa07('0x8f')],{'through':_0xfa07('0x176'),'as':_0xfa07('0x165')});db['SmsInteraction'][_0xfa07('0x118')](db[_0xfa07('0x14')],{'as':_0xfa07('0x166'),'through':_0xfa07('0x122'),'foreignKey':'SmsInteractionId'});db['SmsMessage'][_0xfa07('0x116')](db[_0xfa07('0x14')],{'as':'User'});db[_0xfa07('0x57')][_0xfa07('0x116')](db[_0xfa07('0x71')],{'onDelete':'cascade','as':_0xfa07('0x157')});db[_0xfa07('0x57')][_0xfa07('0x116')](db['SmsInteraction'],{'onDelete':_0xfa07('0x10b'),'as':_0xfa07('0x168'),'foreignKey':_0xfa07('0x175')});db[_0xfa07('0x57')][_0xfa07('0x116')](db[_0xfa07('0x134')],{'as':_0xfa07('0x169'),'foreignKey':'SmsAccountId'});db[_0xfa07('0x12a')]['belongsToMany'](db['User'],{'as':_0xfa07('0x161'),'through':'UserSmsQueue','foreignKey':_0xfa07('0x177')});db['SmsQueue']['belongsToMany'](db[_0xfa07('0xe3')],{'through':_0xfa07('0x178'),'as':_0xfa07('0x14c')});db[_0xfa07('0x59')][_0xfa07('0x107')](db[_0xfa07('0x82')],{'as':_0xfa07('0x15c'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0xfa07('0x107')](db['CannedAnswer'],{'as':_0xfa07('0x15d'),'foreignKey':_0xfa07('0x179')});db['OpenchannelAccount'][_0xfa07('0x107')](db[_0xfa07('0x5b')],{'as':_0xfa07('0x15e'),'foreignKey':_0xfa07('0x179')});db[_0xfa07('0x59')][_0xfa07('0x107')](db['OpenchannelMessage'],{'as':_0xfa07('0x151'),'foreignKey':_0xfa07('0x179')});db[_0xfa07('0x59')][_0xfa07('0x107')](db['OpenchannelApplication'],{'as':_0xfa07('0x13d'),'foreignKey':_0xfa07('0x179')});db[_0xfa07('0x59')]['belongsTo'](db[_0xfa07('0xf3')],{'as':_0xfa07('0x15f'),'foreignKey':_0xfa07('0x160')});db['OpenchannelAccount'][_0xfa07('0x116')](db[_0xfa07('0x86')],{'as':'mandatoryDispositionPause','foreignKey':_0xfa07('0x14a')});db[_0xfa07('0x59')]['belongsToMany'](db[_0xfa07('0x14')],{'as':'Agents','through':'user_has_openchannel_accounts'});db['OpenchannelApplication'][_0xfa07('0x116')](db[_0xfa07('0x14')],{'onDelete':'restrict'});db['OpenchannelApplication'][_0xfa07('0x116')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':'OpenchannelQueueId'});db[_0xfa07('0x17a')][_0xfa07('0x116')](db[_0xfa07('0x59')],{'onDelete':'restrict','foreignKey':_0xfa07('0x179')});db[_0xfa07('0x17a')][_0xfa07('0x116')](db[_0xfa07('0x149')],{'onDelete':_0xfa07('0x16a'),'foreignKey':_0xfa07('0x16b')});db[_0xfa07('0x17a')]['belongsTo'](db[_0xfa07('0x8f')],{'onDelete':_0xfa07('0x16a'),'foreignKey':_0xfa07('0x16c')});db[_0xfa07('0x5b')][_0xfa07('0x107')](db[_0xfa07('0x5d')],{'as':_0xfa07('0x151'),'onDelete':_0xfa07('0x10b'),'foreignKey':'OpenchannelInteractionId'});db[_0xfa07('0x5b')][_0xfa07('0x116')](db[_0xfa07('0x59')],{'as':_0xfa07('0x169'),'foreignKey':_0xfa07('0x179')});db['OpenchannelInteraction'][_0xfa07('0x116')](db[_0xfa07('0x71')],{'as':_0xfa07('0x157'),'foreignKey':_0xfa07('0x158')});db[_0xfa07('0x5b')][_0xfa07('0x116')](db[_0xfa07('0x14')],{'as':'Owner','foreignKey':_0xfa07('0x106')});db['OpenchannelInteraction'][_0xfa07('0x118')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0xfa07('0x164')});db[_0xfa07('0x5b')]['belongsToMany'](db[_0xfa07('0x8f')],{'through':_0xfa07('0x17b'),'as':_0xfa07('0x165')});db[_0xfa07('0x5b')][_0xfa07('0x118')](db['User'],{'as':_0xfa07('0x166'),'through':_0xfa07('0x17c'),'foreignKey':_0xfa07('0x17d')});db[_0xfa07('0x5d')][_0xfa07('0x116')](db[_0xfa07('0x14')],{'onDelete':_0xfa07('0x10b'),'as':_0xfa07('0x14')});db[_0xfa07('0x5d')][_0xfa07('0x116')](db['CmContact'],{'onDelete':_0xfa07('0x10b'),'as':_0xfa07('0x157')});db[_0xfa07('0x5d')][_0xfa07('0x116')](db[_0xfa07('0x5b')],{'onDelete':_0xfa07('0x10b'),'as':_0xfa07('0x168'),'foreignKey':_0xfa07('0x17d')});db[_0xfa07('0x5d')]['belongsTo'](db[_0xfa07('0xe9')],{'as':_0xfa07('0xe9'),'foreignKey':'AttachmentId'});db[_0xfa07('0x5d')][_0xfa07('0x116')](db[_0xfa07('0x59')],{'as':_0xfa07('0x169'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelQueue'][_0xfa07('0x118')](db[_0xfa07('0x14')],{'as':_0xfa07('0x161'),'through':'UserOpenchannelQueue','foreignKey':_0xfa07('0x17e')});db[_0xfa07('0x5f')][_0xfa07('0x118')](db[_0xfa07('0xe3')],{'through':_0xfa07('0x17f'),'as':_0xfa07('0x14c')});db[_0xfa07('0x180')][_0xfa07('0x107')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xfa07('0x181')});db[_0xfa07('0x180')][_0xfa07('0x107')](db[_0xfa07('0x81')],{'as':_0xfa07('0x15d'),'foreignKey':_0xfa07('0x181')});db[_0xfa07('0x180')]['hasMany'](db[_0xfa07('0x6e')],{'as':_0xfa07('0x182')});db[_0xfa07('0x180')][_0xfa07('0x107')](db[_0xfa07('0x66')],{'as':_0xfa07('0x15e')});db[_0xfa07('0x180')]['hasMany'](db[_0xfa07('0x64')],{'as':_0xfa07('0x13d')});db[_0xfa07('0x180')]['hasMany'](db['ChatMessage'],{'as':_0xfa07('0x151')});db[_0xfa07('0x180')]['belongsTo'](db[_0xfa07('0xf3')],{'as':_0xfa07('0x15f'),'foreignKey':_0xfa07('0x160')});db[_0xfa07('0x180')][_0xfa07('0x116')](db[_0xfa07('0x149')],{'as':_0xfa07('0x149'),'foreignKey':_0xfa07('0x16b')});db[_0xfa07('0x180')][_0xfa07('0x116')](db['Pause'],{'as':_0xfa07('0x16e'),'foreignKey':_0xfa07('0x14a')});db[_0xfa07('0x180')]['belongsToMany'](db[_0xfa07('0x14')],{'as':_0xfa07('0x161'),'through':_0xfa07('0x130')});db['OpenchannelQueueReport'][_0xfa07('0x116')](db[_0xfa07('0x59')],{});db[_0xfa07('0x62')][_0xfa07('0x116')](db['CmList'],{'as':'List','foreignKey':_0xfa07('0x160')});db[_0xfa07('0x62')][_0xfa07('0x116')](db[_0xfa07('0x71')],{'as':_0xfa07('0x157'),'foreignKey':_0xfa07('0x158')});db[_0xfa07('0x62')][_0xfa07('0x116')](db['OpenchannelInteraction'],{});db[_0xfa07('0x62')][_0xfa07('0x116')](db['OpenchannelMessage'],{});db['OpenchannelQueueReport'][_0xfa07('0x116')](db[_0xfa07('0x14')],{});db[_0xfa07('0x62')]['belongsTo'](db['OpenchannelQueue'],{});db['ChatApplication']['belongsTo'](db[_0xfa07('0x14')],{'as':'Agent','foreignKey':_0xfa07('0x106'),'onDelete':'restrict'});db['ChatApplication'][_0xfa07('0x116')](db[_0xfa07('0x6a')],{'as':_0xfa07('0x183'),'foreignKey':'ChatQueueId','onDelete':'restrict'});db['ChatApplication']['belongsTo'](db[_0xfa07('0x180')],{'as':_0xfa07('0x184'),'foreignKey':'ChatWebsiteId','onDelete':_0xfa07('0x16a')});db[_0xfa07('0x64')][_0xfa07('0x116')](db[_0xfa07('0x8f')],{'onDelete':_0xfa07('0x16a'),'foreignKey':'TagId'});db['ChatInteraction']['hasMany'](db[_0xfa07('0x67')],{'as':_0xfa07('0x151'),'onDelete':_0xfa07('0x10b'),'foreignKey':_0xfa07('0x185')});db[_0xfa07('0x66')][_0xfa07('0x116')](db['ChatWebsite'],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0xfa07('0x66')]['belongsTo'](db[_0xfa07('0x71')],{'as':'Contact','foreignKey':_0xfa07('0x158')});db[_0xfa07('0x66')][_0xfa07('0x116')](db[_0xfa07('0x14')],{'as':_0xfa07('0x171'),'foreignKey':'UserId'});db[_0xfa07('0x66')]['belongsToMany'](db['Tag'],{'through':_0xfa07('0x186'),'as':_0xfa07('0x164')});db[_0xfa07('0x66')][_0xfa07('0x118')](db[_0xfa07('0x8f')],{'through':'chat_interaction_has_tags','as':_0xfa07('0x165')});db['ChatInteraction'][_0xfa07('0x118')](db[_0xfa07('0x14')],{'as':_0xfa07('0x166'),'through':'user_has_chat_interactions','foreignKey':_0xfa07('0x185')});db[_0xfa07('0x67')]['belongsTo'](db[_0xfa07('0x14')],{'onDelete':_0xfa07('0x10b'),'as':'User'});db[_0xfa07('0x67')][_0xfa07('0x116')](db['CmContact'],{'onDelete':_0xfa07('0x10b'),'as':_0xfa07('0x157'),'foreignKey':'ContactId'});db[_0xfa07('0x67')]['belongsTo'](db['ChatInteraction'],{'onDelete':_0xfa07('0x10b'),'as':'Interaction','foreignKey':_0xfa07('0x185')});db[_0xfa07('0x67')][_0xfa07('0x116')](db[_0xfa07('0xe9')],{'as':_0xfa07('0xe9'),'foreignKey':_0xfa07('0x172')});db[_0xfa07('0x67')][_0xfa07('0x116')](db['ChatWebsite'],{'as':'Account','foreignKey':_0xfa07('0x181')});db[_0xfa07('0x68')][_0xfa07('0x116')](db[_0xfa07('0x71')],{'onDelete':_0xfa07('0x10b'),'as':_0xfa07('0x157'),'foreignKey':_0xfa07('0x158')});db[_0xfa07('0x68')][_0xfa07('0x116')](db['ChatWebsite'],{'as':_0xfa07('0x169'),'foreignKey':_0xfa07('0x181')});db[_0xfa07('0x6a')]['belongsToMany'](db[_0xfa07('0x14')],{'as':_0xfa07('0x161'),'through':_0xfa07('0x31'),'hooks':!![]});db[_0xfa07('0x6a')][_0xfa07('0x118')](db[_0xfa07('0xe3')],{'through':_0xfa07('0x187'),'as':_0xfa07('0x14c')});db[_0xfa07('0x6c')][_0xfa07('0x107')](db['ChatInternalMessage'],{'as':_0xfa07('0x151'),'foreignKey':_0xfa07('0x188'),'onDelete':_0xfa07('0x10b')});db['ChatGroup'][_0xfa07('0x118')](db['User'],{'as':_0xfa07('0x140'),'through':_0xfa07('0x119')});db[_0xfa07('0x6e')]['belongsTo'](db[_0xfa07('0x180')],{'as':'Website','foreignKey':_0xfa07('0x181')});db[_0xfa07('0x70')][_0xfa07('0x107')](db['CmContact'],{'as':_0xfa07('0x11a'),'foreignKey':_0xfa07('0x189')});db[_0xfa07('0x71')][_0xfa07('0x107')](db[_0xfa07('0x72')],{'as':'Hoppers','foreignKey':_0xfa07('0x158')});db['CmContact']['hasMany'](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0xfa07('0x158')});db['CmContact']['hasMany'](db['CmHopperHistory'],{'as':_0xfa07('0x143'),'foreignKey':_0xfa07('0x158')});db[_0xfa07('0x71')][_0xfa07('0x107')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0xfa07('0x158')});db[_0xfa07('0x71')]['hasMany'](db[_0xfa07('0xd2')],{'as':_0xfa07('0x145'),'foreignKey':'ContactId'});db[_0xfa07('0x71')][_0xfa07('0x107')](db['OpenchannelInteraction'],{'as':_0xfa07('0x10e'),'foreignKey':_0xfa07('0x158'),'onDelete':_0xfa07('0x16a')});db[_0xfa07('0x71')][_0xfa07('0x107')](db[_0xfa07('0x66')],{'as':_0xfa07('0x10f'),'foreignKey':'ContactId','onDelete':_0xfa07('0x16a')});db[_0xfa07('0x71')][_0xfa07('0x107')](db[_0xfa07('0x55')],{'as':_0xfa07('0x110'),'foreignKey':_0xfa07('0x158'),'onDelete':'restrict'});db['CmContact'][_0xfa07('0x107')](db[_0xfa07('0x4d')],{'as':'FaxInteractions','foreignKey':'ContactId','onDelete':_0xfa07('0x16a')});db[_0xfa07('0x71')][_0xfa07('0x107')](db[_0xfa07('0x112')],{'as':'MailInteractions','foreignKey':'ContactId','onDelete':_0xfa07('0x16a')});db[_0xfa07('0x71')][_0xfa07('0x116')](db['CmCompany'],{'as':_0xfa07('0x18a'),'foreignKey':_0xfa07('0x189')});db[_0xfa07('0x71')][_0xfa07('0x116')](db[_0xfa07('0xf3')],{'as':_0xfa07('0x15f'),'foreignKey':_0xfa07('0x160'),'onDelete':_0xfa07('0x10b')});db[_0xfa07('0x71')][_0xfa07('0x118')](db[_0xfa07('0x14')],{'as':_0xfa07('0x166'),'through':_0xfa07('0x11b')});db[_0xfa07('0x71')][_0xfa07('0x118')](db[_0xfa07('0x8f')],{'as':_0xfa07('0x164'),'through':_0xfa07('0x18b')});db[_0xfa07('0x71')][_0xfa07('0x118')](db[_0xfa07('0x8f')],{'through':_0xfa07('0x18b'),'as':_0xfa07('0x165')});db['CmHopper']['belongsTo'](db[_0xfa07('0x71')],{'as':_0xfa07('0x157'),'foreignKey':'ContactId','onDelete':_0xfa07('0x10b')});db[_0xfa07('0x72')][_0xfa07('0x116')](db[_0xfa07('0xf3')],{'as':_0xfa07('0x15f'),'foreignKey':_0xfa07('0x160'),'onDelete':_0xfa07('0x10b')});db[_0xfa07('0x72')][_0xfa07('0x116')](db[_0xfa07('0x14')],{'as':_0xfa07('0x18c'),'foreignKey':'UserId'});db[_0xfa07('0x72')]['belongsTo'](db[_0xfa07('0x1c')],{'as':'Queue','foreignKey':_0xfa07('0x141'),'onDelete':'cascade'});db[_0xfa07('0x72')][_0xfa07('0x116')](db[_0xfa07('0xe6')],{'as':_0xfa07('0xe6'),'foreignKey':_0xfa07('0x18d'),'onDelete':_0xfa07('0x10b')});db[_0xfa07('0x72')][_0xfa07('0x116')](db[_0xfa07('0x14')],{'as':'Owner','foreignKey':_0xfa07('0x18e')});db[_0xfa07('0x74')][_0xfa07('0x116')](db['CmContact'],{'as':'Contact','foreignKey':_0xfa07('0x158'),'onDelete':_0xfa07('0x10b')});db['CmHopperBlack'][_0xfa07('0x116')](db['CmList'],{'as':'List','foreignKey':_0xfa07('0x160'),'onDelete':_0xfa07('0x10b')});db[_0xfa07('0x74')][_0xfa07('0x116')](db[_0xfa07('0x1c')],{'as':_0xfa07('0x183'),'foreignKey':_0xfa07('0x141'),'onDelete':_0xfa07('0x10b')});db['CmHopperBlack']['belongsTo'](db[_0xfa07('0xe6')],{'as':_0xfa07('0xe6'),'foreignKey':'CampaignId','onDelete':_0xfa07('0x10b')});db[_0xfa07('0x7f')]['hasMany'](db[_0xfa07('0x83')],{'as':{'plural':_0xfa07('0x18f'),'singular':_0xfa07('0x190')},'foreignKey':'AutomationAllId','onDelete':_0xfa07('0x10b'),'hooks':!![]});db[_0xfa07('0x7f')][_0xfa07('0x107')](db[_0xfa07('0x83')],{'as':{'plural':'Any','singular':_0xfa07('0x191')},'foreignKey':'AutomationAnyId','onDelete':_0xfa07('0x10b'),'hooks':!![]});db['Automation'][_0xfa07('0x107')](db[_0xfa07('0x7d')],{'as':_0xfa07('0x192'),'foreignKey':_0xfa07('0x193'),'onDelete':_0xfa07('0x10b'),'hooks':!![]});db[_0xfa07('0x82')]['hasMany'](db[_0xfa07('0x82')],{'as':_0xfa07('0x15c'),'foreignKey':_0xfa07('0x194'),'onDelete':_0xfa07('0x10b')});db[_0xfa07('0x149')][_0xfa07('0x107')](db[_0xfa07('0x149')],{'as':'Intervals','foreignKey':_0xfa07('0x16b'),'onDelete':_0xfa07('0x10b'),'hooks':!![],'required':![]});db['Interval']['hasMany'](db[_0xfa07('0x1a')],{'as':_0xfa07('0x10a'),'foreignKey':_0xfa07('0x16b'),'onDelete':_0xfa07('0x16a')});db[_0xfa07('0x149')][_0xfa07('0x107')](db['MailApplication'],{'as':_0xfa07('0x195'),'foreignKey':_0xfa07('0x16b')});db[_0xfa07('0x149')][_0xfa07('0x107')](db[_0xfa07('0x64')],{'as':_0xfa07('0x196'),'foreignKey':'IntervalId'});db[_0xfa07('0x149')]['hasMany'](db['FaxApplication'],{'as':_0xfa07('0x197'),'foreignKey':_0xfa07('0x16b')});db[_0xfa07('0x149')][_0xfa07('0x107')](db['SmsApplication'],{'as':'SmsApplications','foreignKey':'IntervalId'});db[_0xfa07('0x8c')]['belongsTo'](db[_0xfa07('0x3a')],{});db[_0xfa07('0x8c')]['belongsTo'](db[_0xfa07('0x99')],{'foreignKey':_0xfa07('0x198')});db['Schedule'][_0xfa07('0x116')](db['AnalyticCustomReport'],{'foreignKey':'CustomReportId'});db[_0xfa07('0x199')]['belongsToMany'](db[_0xfa07('0x13e')],{'as':_0xfa07('0x19a'),'through':_0xfa07('0x19b'),'onDelete':_0xfa07('0x16a')});db['Tag']['belongsToMany'](db['CmContact'],{'through':_0xfa07('0x18b')});db[_0xfa07('0x8f')]['belongsToMany'](db[_0xfa07('0x66')],{'through':_0xfa07('0x186')});db[_0xfa07('0x8f')]['belongsToMany'](db[_0xfa07('0x112')],{'through':'mail_interaction_has_tags'});db[_0xfa07('0x8f')][_0xfa07('0x118')](db[_0xfa07('0x55')],{'through':_0xfa07('0x176')});db[_0xfa07('0x8f')][_0xfa07('0x118')](db['FaxInteraction'],{'through':_0xfa07('0x19c')});db['Tag'][_0xfa07('0x118')](db[_0xfa07('0x5b')],{'through':'openchannel_interaction_has_tags'});db[_0xfa07('0x8f')]['belongsToMany'](db['WhatsappInteraction'],{'through':'whatsapp_interaction_has_tags'});db[_0xfa07('0x91')][_0xfa07('0x107')](db[_0xfa07('0x83')],{'as':{'plural':_0xfa07('0x19d'),'singular':'AllCondition'},'foreignKey':_0xfa07('0x19e'),'onDelete':_0xfa07('0x10b'),'hooks':!![]});db[_0xfa07('0x91')][_0xfa07('0x107')](db[_0xfa07('0x83')],{'as':{'plural':_0xfa07('0x19f'),'singular':_0xfa07('0x1a0')},'foreignKey':'TriggerAnyId','onDelete':_0xfa07('0x10b'),'hooks':!![]});db[_0xfa07('0x91')]['hasMany'](db[_0xfa07('0x7d')],{'as':_0xfa07('0x192'),'foreignKey':_0xfa07('0x1a1'),'onDelete':_0xfa07('0x10b'),'hooks':!![]});db['AnalyticCustomReport'][_0xfa07('0x107')](db[_0xfa07('0x9d')],{'as':_0xfa07('0x1a2'),'onDelete':_0xfa07('0x10b'),'foreignKey':'CustomReportId','hooks':!![]});db[_0xfa07('0x99')]['hasMany'](db[_0xfa07('0x9d')],{'as':_0xfa07('0x1a2'),'onDelete':_0xfa07('0x10b'),'foreignKey':_0xfa07('0x198')});db['AnalyticMetric'][_0xfa07('0x107')](db[_0xfa07('0x9d')],{'as':'Fields','onDelete':_0xfa07('0x10b'),'foreignKey':_0xfa07('0x1a3')});db[_0xfa07('0x9d')][_0xfa07('0x116')](db['AnalyticMetric'],{'foreignKey':'MetricId'});db[_0xfa07('0xa0')][_0xfa07('0x107')](db[_0xfa07('0xa2')],{'as':'Configurations','onDelete':_0xfa07('0x10b'),'foreignKey':_0xfa07('0x1a4')});db[_0xfa07('0xa2')][_0xfa07('0x107')](db[_0xfa07('0xa4')],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0xfa07('0xa2')][_0xfa07('0x107')](db[_0xfa07('0xa4')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0xfa07('0x1a5')});db[_0xfa07('0xa2')]['hasMany'](db['SalesforceField'],{'as':_0xfa07('0x1a2'),'onDelete':_0xfa07('0x10b'),'foreignKey':_0xfa07('0x1a6')});db[_0xfa07('0xa2')][_0xfa07('0x116')](db[_0xfa07('0xa0')],{'as':'Account','foreignKey':_0xfa07('0x1a4')});db[_0xfa07('0xa4')][_0xfa07('0x107')](db[_0xfa07('0xa4')],{'as':_0xfa07('0x1a7'),'foreignKey':_0xfa07('0x1a8')});db[_0xfa07('0xa4')][_0xfa07('0x107')](db[_0xfa07('0xa4')],{'as':_0xfa07('0x1a9'),'foreignKey':_0xfa07('0x1a5')});db['SalesforceField'][_0xfa07('0x107')](db['SalesforceField'],{'as':_0xfa07('0x1aa'),'foreignKey':'FieldId'});db[_0xfa07('0xa4')][_0xfa07('0x116')](db[_0xfa07('0x93')],{'as':_0xfa07('0x93'),'foreignKey':_0xfa07('0x1ab')});db['SugarcrmAccount'][_0xfa07('0x107')](db[_0xfa07('0xa7')],{'as':'Configurations','onDelete':_0xfa07('0x10b'),'foreignKey':_0xfa07('0x1a4')});db[_0xfa07('0xa7')][_0xfa07('0x107')](db[_0xfa07('0x1ac')],{'as':'Subjects','onDelete':_0xfa07('0x10b'),'foreignKey':_0xfa07('0x1a8')});db[_0xfa07('0xa7')][_0xfa07('0x107')](db[_0xfa07('0x1ac')],{'as':_0xfa07('0x1ad'),'onDelete':_0xfa07('0x10b'),'foreignKey':_0xfa07('0x1a5')});db[_0xfa07('0xa7')]['hasMany'](db[_0xfa07('0x1ac')],{'as':_0xfa07('0x1a2'),'onDelete':'cascade','foreignKey':_0xfa07('0x1a6')});db['SugarcrmConfiguration']['belongsTo'](db[_0xfa07('0xa6')],{'as':_0xfa07('0x169'),'foreignKey':_0xfa07('0x1a4')});db['SugarcrmField'][_0xfa07('0x107')](db['SugarcrmField'],{'as':_0xfa07('0x1a7'),'foreignKey':_0xfa07('0x1a8')});db[_0xfa07('0x1ac')][_0xfa07('0x107')](db[_0xfa07('0x1ac')],{'as':'Description','foreignKey':'DescriptionId'});db[_0xfa07('0x1ac')][_0xfa07('0x107')](db['SugarcrmField'],{'as':_0xfa07('0x1aa'),'foreignKey':_0xfa07('0x1a6')});db[_0xfa07('0x1ac')][_0xfa07('0x116')](db[_0xfa07('0x93')],{'as':'Variable','foreignKey':'VariableId'});db[_0xfa07('0x1ae')][_0xfa07('0x107')](db[_0xfa07('0xa9')],{'as':'Configurations','onDelete':_0xfa07('0x10b'),'foreignKey':'AccountId'});db[_0xfa07('0xa9')][_0xfa07('0x107')](db[_0xfa07('0xaa')],{'as':_0xfa07('0x1af'),'onDelete':_0xfa07('0x10b'),'foreignKey':_0xfa07('0x1a8')});db[_0xfa07('0xa9')][_0xfa07('0x107')](db[_0xfa07('0xaa')],{'as':_0xfa07('0x1ad'),'onDelete':_0xfa07('0x10b'),'foreignKey':_0xfa07('0x1a5')});db[_0xfa07('0xa9')][_0xfa07('0x107')](db[_0xfa07('0xaa')],{'as':_0xfa07('0x1a2'),'onDelete':_0xfa07('0x10b'),'foreignKey':_0xfa07('0x1a6')});db[_0xfa07('0xa9')][_0xfa07('0x116')](db['DeskAccount'],{'as':_0xfa07('0x169'),'foreignKey':_0xfa07('0x1a4')});db[_0xfa07('0xa9')][_0xfa07('0x118')](db[_0xfa07('0x8f')],{'through':_0xfa07('0x1b0')});db['DeskField'][_0xfa07('0x107')](db[_0xfa07('0xaa')],{'as':_0xfa07('0x1a7'),'foreignKey':_0xfa07('0x1a8')});db[_0xfa07('0xaa')]['hasMany'](db[_0xfa07('0xaa')],{'as':_0xfa07('0x1a9'),'foreignKey':_0xfa07('0x1a5')});db[_0xfa07('0xaa')][_0xfa07('0x107')](db['DeskField'],{'as':'Field','foreignKey':'FieldId'});db[_0xfa07('0xaa')][_0xfa07('0x116')](db['Variable'],{'as':_0xfa07('0x93'),'foreignKey':_0xfa07('0x1ab')});db['ZohoAccount'][_0xfa07('0x107')](db[_0xfa07('0xac')],{'as':_0xfa07('0x1b1'),'onDelete':_0xfa07('0x10b'),'foreignKey':_0xfa07('0x1a4')});db[_0xfa07('0xac')][_0xfa07('0x107')](db[_0xfa07('0xae')],{'as':_0xfa07('0x1af'),'onDelete':'cascade','foreignKey':_0xfa07('0x1a8')});db[_0xfa07('0xac')][_0xfa07('0x107')](db[_0xfa07('0xae')],{'as':_0xfa07('0x1ad'),'onDelete':'cascade','foreignKey':_0xfa07('0x1a5')});db[_0xfa07('0xac')][_0xfa07('0x107')](db[_0xfa07('0xae')],{'as':_0xfa07('0x1a2'),'onDelete':'cascade','foreignKey':_0xfa07('0x1a6')});db[_0xfa07('0xac')][_0xfa07('0x116')](db[_0xfa07('0x1b2')],{'as':'Account','foreignKey':_0xfa07('0x1a4')});db['ZohoField'][_0xfa07('0x107')](db['ZohoField'],{'as':_0xfa07('0x1a7'),'foreignKey':'SubjectId'});db[_0xfa07('0xae')][_0xfa07('0x107')](db[_0xfa07('0xae')],{'as':_0xfa07('0x1a9'),'foreignKey':'DescriptionId'});db[_0xfa07('0xae')][_0xfa07('0x107')](db[_0xfa07('0xae')],{'as':'Field','foreignKey':_0xfa07('0x1a6')});db[_0xfa07('0xae')][_0xfa07('0x116')](db['Variable'],{'as':'Variable','foreignKey':_0xfa07('0x1ab')});db['ZendeskAccount']['hasMany'](db[_0xfa07('0x1b3')],{'as':_0xfa07('0x1b1'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0xfa07('0x1b3')][_0xfa07('0x107')](db[_0xfa07('0xb2')],{'as':_0xfa07('0x1af'),'foreignKey':_0xfa07('0x1a8')});db['ZendeskConfiguration']['hasMany'](db[_0xfa07('0xb2')],{'as':_0xfa07('0x1ad'),'foreignKey':'DescriptionId'});db[_0xfa07('0x1b3')][_0xfa07('0x107')](db[_0xfa07('0xb2')],{'as':_0xfa07('0x1a2'),'foreignKey':'FieldId'});db[_0xfa07('0x1b3')][_0xfa07('0x116')](db[_0xfa07('0xb0')],{'as':'Account','foreignKey':_0xfa07('0x1a4')});db[_0xfa07('0x1b3')][_0xfa07('0x118')](db[_0xfa07('0x8f')],{'through':_0xfa07('0x1b4')});db['ZendeskField'][_0xfa07('0x107')](db[_0xfa07('0xb2')],{'as':_0xfa07('0x1a7'),'foreignKey':_0xfa07('0x1a8')});db[_0xfa07('0xb2')][_0xfa07('0x107')](db[_0xfa07('0xb2')],{'as':_0xfa07('0x1a9'),'foreignKey':'DescriptionId'});db['ZendeskField']['hasMany'](db[_0xfa07('0xb2')],{'as':_0xfa07('0x1aa'),'foreignKey':_0xfa07('0x1a6')});db[_0xfa07('0xb2')][_0xfa07('0x116')](db[_0xfa07('0x93')],{'as':_0xfa07('0x93'),'foreignKey':_0xfa07('0x1ab')});db['FreshdeskAccount'][_0xfa07('0x107')](db['FreshdeskConfiguration'],{'as':_0xfa07('0x1b1'),'onDelete':_0xfa07('0x10b'),'foreignKey':'AccountId'});db[_0xfa07('0x1b5')]['hasMany'](db[_0xfa07('0xb6')],{'as':_0xfa07('0x1af'),'onDelete':_0xfa07('0x10b'),'foreignKey':'SubjectId'});db[_0xfa07('0x1b5')][_0xfa07('0x107')](db['FreshdeskField'],{'as':_0xfa07('0x1ad'),'onDelete':_0xfa07('0x10b'),'foreignKey':'DescriptionId'});db[_0xfa07('0x1b5')][_0xfa07('0x107')](db[_0xfa07('0xb6')],{'as':_0xfa07('0x1a2'),'onDelete':_0xfa07('0x10b'),'foreignKey':_0xfa07('0x1a6')});db[_0xfa07('0x1b5')][_0xfa07('0x116')](db[_0xfa07('0xb3')],{'as':'Account','foreignKey':'AccountId'});db['FreshdeskConfiguration'][_0xfa07('0x118')](db[_0xfa07('0x8f')],{'through':'int_freshdesk_configuration_has_tags'});db[_0xfa07('0xb6')][_0xfa07('0x107')](db[_0xfa07('0xb6')],{'as':_0xfa07('0x1a7'),'foreignKey':_0xfa07('0x1a8')});db['FreshdeskField'][_0xfa07('0x107')](db[_0xfa07('0xb6')],{'as':'Description','foreignKey':'DescriptionId'});db[_0xfa07('0xb6')]['hasMany'](db[_0xfa07('0xb6')],{'as':'Field','foreignKey':_0xfa07('0x1a6')});db['FreshdeskField']['belongsTo'](db[_0xfa07('0x93')],{'as':_0xfa07('0x93'),'foreignKey':_0xfa07('0x1ab')});db['VtigerAccount'][_0xfa07('0x107')](db[_0xfa07('0xba')],{'as':_0xfa07('0x1b1'),'onDelete':_0xfa07('0x10b'),'foreignKey':_0xfa07('0x1a4')});db[_0xfa07('0xba')][_0xfa07('0x107')](db[_0xfa07('0xbc')],{'as':_0xfa07('0x1af'),'foreignKey':_0xfa07('0x1a8')});db[_0xfa07('0xba')][_0xfa07('0x107')](db[_0xfa07('0xbc')],{'as':_0xfa07('0x1ad'),'foreignKey':_0xfa07('0x1a5')});db[_0xfa07('0xba')][_0xfa07('0x107')](db['VtigerField'],{'as':'Fields','foreignKey':_0xfa07('0x1a6')});db['VtigerConfiguration'][_0xfa07('0x116')](db[_0xfa07('0xb8')],{'as':_0xfa07('0x169'),'foreignKey':'AccountId'});db[_0xfa07('0xbc')][_0xfa07('0x107')](db['VtigerField'],{'as':_0xfa07('0x1a7'),'foreignKey':_0xfa07('0x1a8')});db[_0xfa07('0xbc')][_0xfa07('0x107')](db['VtigerField'],{'as':_0xfa07('0x1a9'),'foreignKey':_0xfa07('0x1a5')});db['VtigerField'][_0xfa07('0x107')](db[_0xfa07('0xbc')],{'as':_0xfa07('0x1aa'),'foreignKey':_0xfa07('0x1a6')});db[_0xfa07('0xbc')][_0xfa07('0x116')](db[_0xfa07('0x93')],{'as':'Variable','foreignKey':_0xfa07('0x1ab')});db[_0xfa07('0xbd')]['hasMany'](db['ServicenowConfiguration'],{'as':_0xfa07('0x1b1'),'onDelete':_0xfa07('0x10b'),'foreignKey':_0xfa07('0x1a4')});db[_0xfa07('0xbf')][_0xfa07('0x107')](db['ServicenowField'],{'as':'Subjects','foreignKey':_0xfa07('0x1a8')});db[_0xfa07('0xbf')][_0xfa07('0x107')](db['ServicenowField'],{'as':_0xfa07('0x1ad'),'foreignKey':'DescriptionId'});db[_0xfa07('0xbf')][_0xfa07('0x107')](db['ServicenowField'],{'as':_0xfa07('0x1a2'),'foreignKey':'FieldId'});db[_0xfa07('0xbf')][_0xfa07('0x116')](db[_0xfa07('0xbd')],{'as':_0xfa07('0x169'),'foreignKey':'AccountId'});db[_0xfa07('0xc0')][_0xfa07('0x107')](db['ServicenowField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0xfa07('0xc0')][_0xfa07('0x107')](db[_0xfa07('0xc0')],{'as':_0xfa07('0x1a9'),'foreignKey':_0xfa07('0x1a5')});db[_0xfa07('0xc0')]['hasMany'](db[_0xfa07('0xc0')],{'as':'Field','foreignKey':'FieldId'});db[_0xfa07('0xc0')][_0xfa07('0x116')](db[_0xfa07('0x93')],{'as':_0xfa07('0x93'),'foreignKey':_0xfa07('0x1ab')});db[_0xfa07('0xc2')]['hasMany'](db['Dynamics365Configuration'],{'as':_0xfa07('0x1b1'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0xfa07('0xc4')][_0xfa07('0x107')](db['Dynamics365Field'],{'as':_0xfa07('0x1af'),'onDelete':_0xfa07('0x10b'),'foreignKey':'SubjectId'});db['Dynamics365Configuration'][_0xfa07('0x107')](db[_0xfa07('0x1b6')],{'as':_0xfa07('0x1ad'),'onDelete':_0xfa07('0x10b'),'foreignKey':_0xfa07('0x1a5')});db[_0xfa07('0xc4')]['hasMany'](db['Dynamics365Field'],{'as':'Fields','onDelete':_0xfa07('0x10b'),'foreignKey':'FieldId'});db[_0xfa07('0xc4')][_0xfa07('0x116')](db[_0xfa07('0xc2')],{'as':'Account','foreignKey':'AccountId'});db[_0xfa07('0x1b6')][_0xfa07('0x107')](db[_0xfa07('0x1b6')],{'as':_0xfa07('0x1a7'),'foreignKey':_0xfa07('0x1a8')});db[_0xfa07('0x1b6')]['hasMany'](db['Dynamics365Field'],{'as':_0xfa07('0x1a9'),'foreignKey':'DescriptionId'});db[_0xfa07('0x1b6')][_0xfa07('0x107')](db[_0xfa07('0x1b6')],{'as':'Field','foreignKey':_0xfa07('0x1a6')});db['Dynamics365Field']['belongsTo'](db[_0xfa07('0x93')],{'as':_0xfa07('0x93'),'foreignKey':_0xfa07('0x1ab')});db[_0xfa07('0xc6')][_0xfa07('0x107')](db[_0xfa07('0xc7')],{'as':_0xfa07('0x1b1'),'onDelete':_0xfa07('0x10b'),'foreignKey':_0xfa07('0x1a4')});db['FreshsalesConfiguration'][_0xfa07('0x107')](db[_0xfa07('0xc9')],{'as':_0xfa07('0x1af'),'foreignKey':'SubjectId'});db[_0xfa07('0xc7')]['hasMany'](db[_0xfa07('0xc9')],{'as':_0xfa07('0x1ad'),'foreignKey':'DescriptionId'});db[_0xfa07('0xc7')][_0xfa07('0x107')](db[_0xfa07('0xc9')],{'as':_0xfa07('0x1a2'),'foreignKey':_0xfa07('0x1a6')});db['FreshsalesConfiguration']['belongsTo'](db[_0xfa07('0xc6')],{'as':_0xfa07('0x169'),'foreignKey':_0xfa07('0x1a4')});db[_0xfa07('0xc9')][_0xfa07('0x107')](db[_0xfa07('0xc9')],{'as':_0xfa07('0x1a7'),'foreignKey':'SubjectId'});db[_0xfa07('0xc9')][_0xfa07('0x107')](db['FreshsalesField'],{'as':'Description','foreignKey':'DescriptionId'});db[_0xfa07('0xc9')][_0xfa07('0x107')](db[_0xfa07('0xc9')],{'as':_0xfa07('0x1aa'),'foreignKey':_0xfa07('0x1a6')});db[_0xfa07('0xc9')][_0xfa07('0x116')](db[_0xfa07('0x93')],{'as':'Variable','foreignKey':'VariableId'});db[_0xfa07('0x1b7')][_0xfa07('0x116')](db[_0xfa07('0x180')],{});db[_0xfa07('0x1b7')]['belongsTo'](db[_0xfa07('0xf3')],{'as':'List','foreignKey':_0xfa07('0x160')});db[_0xfa07('0x1b7')]['belongsTo'](db['CmContact'],{'as':_0xfa07('0x157'),'foreignKey':_0xfa07('0x158')});db['ChatQueueReport'][_0xfa07('0x116')](db[_0xfa07('0x66')],{});db[_0xfa07('0x1b7')][_0xfa07('0x116')](db[_0xfa07('0x67')],{});db[_0xfa07('0x1b7')][_0xfa07('0x116')](db['User'],{});db[_0xfa07('0x1b7')]['belongsTo'](db[_0xfa07('0x6a')],{});db[_0xfa07('0xce')][_0xfa07('0x116')](db[_0xfa07('0x14')],{'onDelete':_0xfa07('0x10b'),'foreignKey':_0xfa07('0x1b8')});db['ChatInternalMessage'][_0xfa07('0x116')](db[_0xfa07('0x14')],{'onDelete':'cascade','foreignKey':_0xfa07('0x1b9')});db[_0xfa07('0xd2')]['hasMany'](db[_0xfa07('0xd1')],{'foreignKey':_0xfa07('0x1ba'),'onDelete':_0xfa07('0x10b')});db[_0xfa07('0xd2')][_0xfa07('0x107')](db['JscriptyAnswerReport'],{'foreignKey':'SessionId','onDelete':_0xfa07('0x10b')});db['SmsQueueReport'][_0xfa07('0x116')](db['SmsAccount'],{});db['SmsQueueReport'][_0xfa07('0x116')](db[_0xfa07('0xf3')],{'as':_0xfa07('0x15f'),'foreignKey':_0xfa07('0x160')});db['SmsQueueReport']['belongsTo'](db[_0xfa07('0x71')],{'as':_0xfa07('0x157'),'foreignKey':_0xfa07('0x158')});db[_0xfa07('0xd4')]['belongsTo'](db[_0xfa07('0x55')],{});db[_0xfa07('0xd4')][_0xfa07('0x116')](db[_0xfa07('0x57')],{});db[_0xfa07('0xd4')][_0xfa07('0x116')](db[_0xfa07('0x14')],{});db[_0xfa07('0xd4')][_0xfa07('0x116')](db[_0xfa07('0x12a')],{});db[_0xfa07('0xd9')][_0xfa07('0x107')](db[_0xfa07('0xd2')],{'foreignKey':'ProjectId'});db['JscriptyProject']['hasMany'](db[_0xfa07('0xd1')],{'foreignKey':_0xfa07('0x1bb')});db[_0xfa07('0xd9')][_0xfa07('0x107')](db[_0xfa07('0xd0')],{'foreignKey':_0xfa07('0x1bb')});db[_0xfa07('0xde')][_0xfa07('0x118')](db['User'],{'as':_0xfa07('0x166'),'through':_0xfa07('0x13a')});db[_0xfa07('0xe3')][_0xfa07('0x118')](db[_0xfa07('0x14')],{'as':_0xfa07('0x161'),'through':_0xfa07('0x11e')});db[_0xfa07('0xe3')][_0xfa07('0x118')](db['VoiceQueue'],{'through':'team_has_voice_queues','as':_0xfa07('0x125')});db[_0xfa07('0xe3')][_0xfa07('0x118')](db[_0xfa07('0x3c')],{'through':_0xfa07('0x162'),'as':_0xfa07('0x127')});db['Team'][_0xfa07('0x118')](db[_0xfa07('0x6a')],{'through':_0xfa07('0x187'),'as':_0xfa07('0x129')});db[_0xfa07('0xe3')][_0xfa07('0x118')](db[_0xfa07('0x4f')],{'through':_0xfa07('0x173'),'as':'FaxQueues'});db['Team'][_0xfa07('0x118')](db[_0xfa07('0x12a')],{'through':_0xfa07('0x178'),'as':_0xfa07('0x12b')});db['Team'][_0xfa07('0x118')](db['OpenchannelQueue'],{'through':_0xfa07('0x17f'),'as':_0xfa07('0x12c')});db[_0xfa07('0xe3')]['belongsToMany'](db[_0xfa07('0x102')],{'through':_0xfa07('0x1bc'),'as':_0xfa07('0x12d')});db[_0xfa07('0xe6')][_0xfa07('0x107')](db[_0xfa07('0x72')],{'as':'Hoppers','foreignKey':'CampaignId'});db['Campaign'][_0xfa07('0x107')](db[_0xfa07('0x76')],{'as':'HopperFinals','foreignKey':'CampaignId'});db[_0xfa07('0xe6')][_0xfa07('0x107')](db[_0xfa07('0x77')],{'as':'HopperHistories','foreignKey':_0xfa07('0x18d')});db['Campaign'][_0xfa07('0x107')](db['CmHopperBlack'],{'as':'HopperBlacks','foreignKey':_0xfa07('0x18d')});db[_0xfa07('0xe6')][_0xfa07('0x116')](db[_0xfa07('0x2b')],{'as':'Trunk','foreignKey':_0xfa07('0x146')});db['Campaign'][_0xfa07('0x116')](db['Trunk'],{'as':'TrunkBackup','foreignKey':_0xfa07('0x148')});db[_0xfa07('0xe6')][_0xfa07('0x116')](db['Interval'],{'as':_0xfa07('0x149'),'foreignKey':_0xfa07('0x16b')});db[_0xfa07('0xe6')][_0xfa07('0x116')](db['SquareProject'],{'as':_0xfa07('0xde'),'foreignKey':_0xfa07('0x1bd')});db[_0xfa07('0xe6')]['belongsToMany'](db[_0xfa07('0xf3')],{'as':_0xfa07('0x11c'),'through':_0xfa07('0x1be')});db[_0xfa07('0xe6')]['belongsToMany'](db[_0xfa07('0xf3')],{'as':_0xfa07('0x14e'),'through':_0xfa07('0x1bf')});db['MailTransferReport'][_0xfa07('0x116')](db[_0xfa07('0x40')],{});db[_0xfa07('0xec')][_0xfa07('0x116')](db[_0xfa07('0x112')],{});db[_0xfa07('0xec')]['belongsTo'](db[_0xfa07('0x3a')],{'foreignKey':'FromMailAccountId','as':'FromAccount'});db[_0xfa07('0xec')]['belongsTo'](db[_0xfa07('0x14')],{'foreignKey':'FromUserId','as':_0xfa07('0x1c0')});db[_0xfa07('0xec')][_0xfa07('0x116')](db['User'],{'foreignKey':_0xfa07('0x1c1'),'as':_0xfa07('0x1c2')});db[_0xfa07('0xec')][_0xfa07('0x116')](db[_0xfa07('0x3c')],{'foreignKey':_0xfa07('0x1c3'),'as':_0xfa07('0x1c4')});db['MailTransferReport']['belongsTo'](db['MailAccount'],{'foreignKey':_0xfa07('0x1c5'),'as':'ToAccount'});db['ChatTransferReport'][_0xfa07('0x116')](db[_0xfa07('0x67')],{});db['ChatTransferReport'][_0xfa07('0x116')](db['ChatInteraction'],{});db[_0xfa07('0xed')][_0xfa07('0x116')](db[_0xfa07('0x180')],{'foreignKey':_0xfa07('0x1c6'),'as':_0xfa07('0x1c7')});db[_0xfa07('0xed')][_0xfa07('0x116')](db[_0xfa07('0x14')],{'foreignKey':_0xfa07('0x1c8'),'as':_0xfa07('0x1c0')});db[_0xfa07('0xed')][_0xfa07('0x116')](db['User'],{'foreignKey':_0xfa07('0x1c1'),'as':'ToAgent'});db['ChatTransferReport'][_0xfa07('0x116')](db[_0xfa07('0x6a')],{'foreignKey':'ToChatQueueId','as':_0xfa07('0x1c4')});db[_0xfa07('0xed')]['belongsTo'](db['ChatWebsite'],{'foreignKey':'ToChatWebsiteId','as':_0xfa07('0x1c9')});db[_0xfa07('0xee')][_0xfa07('0x116')](db['FaxMessage'],{});db[_0xfa07('0xee')]['belongsTo'](db[_0xfa07('0x4d')],{});db[_0xfa07('0xee')][_0xfa07('0x116')](db[_0xfa07('0x4a')],{'foreignKey':_0xfa07('0x1ca'),'as':'FromAccount'});db['FaxTransferReport'][_0xfa07('0x116')](db['User'],{'foreignKey':'FromUserId','as':_0xfa07('0x1c0')});db[_0xfa07('0xee')][_0xfa07('0x116')](db[_0xfa07('0x14')],{'foreignKey':_0xfa07('0x1c1'),'as':_0xfa07('0x1c2')});db[_0xfa07('0xee')][_0xfa07('0x116')](db[_0xfa07('0x4f')],{'foreignKey':_0xfa07('0x1cb'),'as':_0xfa07('0x1c4')});db['FaxTransferReport'][_0xfa07('0x116')](db[_0xfa07('0x4a')],{'foreignKey':_0xfa07('0x1cc'),'as':_0xfa07('0x1c9')});db[_0xfa07('0xf0')][_0xfa07('0x116')](db[_0xfa07('0x5d')],{});db[_0xfa07('0xf0')][_0xfa07('0x116')](db['OpenchannelInteraction'],{});db[_0xfa07('0xf0')][_0xfa07('0x116')](db[_0xfa07('0x59')],{'foreignKey':'FromOpenchannelAccountId','as':'FromAccount'});db[_0xfa07('0xf0')][_0xfa07('0x116')](db['User'],{'foreignKey':_0xfa07('0x1c8'),'as':_0xfa07('0x1c0')});db['OpenchannelTransferReport'][_0xfa07('0x116')](db['User'],{'foreignKey':_0xfa07('0x1c1'),'as':'ToAgent'});db[_0xfa07('0xf0')][_0xfa07('0x116')](db[_0xfa07('0x5f')],{'foreignKey':'ToOpenchannelQueueId','as':_0xfa07('0x1c4')});db[_0xfa07('0xf0')]['belongsTo'](db[_0xfa07('0x59')],{'foreignKey':_0xfa07('0x1cd'),'as':_0xfa07('0x1c9')});db[_0xfa07('0xf2')]['belongsTo'](db[_0xfa07('0x57')],{});db[_0xfa07('0xf2')][_0xfa07('0x116')](db[_0xfa07('0x55')],{});db[_0xfa07('0xf2')]['belongsTo'](db[_0xfa07('0x134')],{'foreignKey':'FromSmsAccountId','as':_0xfa07('0x1c7')});db[_0xfa07('0xf2')]['belongsTo'](db[_0xfa07('0x14')],{'foreignKey':_0xfa07('0x1c8'),'as':'FromAgent'});db['SmsTransferReport'][_0xfa07('0x116')](db[_0xfa07('0x14')],{'foreignKey':_0xfa07('0x1c1'),'as':'ToAgent'});db[_0xfa07('0xf2')]['belongsTo'](db[_0xfa07('0x12a')],{'foreignKey':'ToSmsQueueId','as':_0xfa07('0x1c4')});db[_0xfa07('0xf2')][_0xfa07('0x116')](db[_0xfa07('0x134')],{'foreignKey':_0xfa07('0x1ce'),'as':_0xfa07('0x1c9')});db[_0xfa07('0xf3')][_0xfa07('0x107')](db['Disposition'],{'as':_0xfa07('0x15c'),'foreignKey':'ListId'});db[_0xfa07('0xf3')][_0xfa07('0x107')](db[_0xfa07('0x7b')],{'as':_0xfa07('0x1cf'),'foreignKey':'ListId'});db['CmList'][_0xfa07('0x107')](db['CmContact'],{'as':'Contacts','onDelete':_0xfa07('0x10b'),'foreignKey':_0xfa07('0x160')});db[_0xfa07('0xf3')]['hasMany'](db[_0xfa07('0x76')],{'as':_0xfa07('0x10c'),'foreignKey':'ListId'});db['CmList'][_0xfa07('0x107')](db['CmHopperHistory'],{'as':_0xfa07('0x10d'),'foreignKey':_0xfa07('0x160')});db[_0xfa07('0xf3')]['hasMany'](db[_0xfa07('0x79')],{'as':'ReportAgentPreview','foreignKey':_0xfa07('0x160')});db['CmList'][_0xfa07('0x118')](db[_0xfa07('0x1c')],{'as':_0xfa07('0x1d0'),'through':_0xfa07('0x14b')});db[_0xfa07('0xf3')][_0xfa07('0x118')](db[_0xfa07('0x14')],{'as':_0xfa07('0x161'),'through':_0xfa07('0x11d')});db[_0xfa07('0xf5')][_0xfa07('0x107')](db[_0xfa07('0x1a')],{'as':_0xfa07('0x10a'),'onDelete':_0xfa07('0x10b')});db[_0xfa07('0xf5')][_0xfa07('0x118')](db[_0xfa07('0x14')],{'as':'Agents','through':_0xfa07('0x12f')});db[_0xfa07('0xf7')][_0xfa07('0x107')](db['User'],{'as':_0xfa07('0x166'),'foreignKey':_0xfa07('0x117')});db['UserProfile'][_0xfa07('0x107')](db[_0xfa07('0x1d1')],{'as':_0xfa07('0x1d2'),'foreignKey':'userProfileId','onDelete':_0xfa07('0x10b')});db['UserProfileSection'][_0xfa07('0x107')](db[_0xfa07('0xf9')],{'as':'Resources','foreignKey':'sectionId','onDelete':'cascade'});db[_0xfa07('0x136')][_0xfa07('0x107')](db[_0xfa07('0x82')],{'as':'Dispositions','foreignKey':_0xfa07('0x1d3')});db[_0xfa07('0x136')]['hasMany'](db['CannedAnswer'],{'as':_0xfa07('0x15d'),'foreignKey':_0xfa07('0x1d3')});db[_0xfa07('0x136')][_0xfa07('0x107')](db['WhatsappMessage'],{'as':'Messages','foreignKey':_0xfa07('0x1d3')});db['WhatsappAccount'][_0xfa07('0x107')](db['WhatsappInteraction'],{'as':_0xfa07('0x15e')});db[_0xfa07('0x136')][_0xfa07('0x107')](db['WhatsappApplication'],{'as':_0xfa07('0x13d')});db[_0xfa07('0x136')][_0xfa07('0x116')](db[_0xfa07('0xf3')],{'as':'List','foreignKey':'ListId'});db[_0xfa07('0x136')][_0xfa07('0x116')](db[_0xfa07('0x86')],{'as':_0xfa07('0x16e'),'foreignKey':_0xfa07('0x14a')});db[_0xfa07('0x136')]['belongsToMany'](db[_0xfa07('0x14')],{'as':_0xfa07('0x161'),'through':_0xfa07('0x138')});db[_0xfa07('0xfc')][_0xfa07('0x116')](db['User'],{'onDelete':_0xfa07('0x16a')});db[_0xfa07('0xfc')][_0xfa07('0x116')](db[_0xfa07('0x102')],{'onDelete':'restrict'});db[_0xfa07('0xfc')][_0xfa07('0x116')](db[_0xfa07('0x136')],{'onDelete':_0xfa07('0x16a')});db[_0xfa07('0xfc')][_0xfa07('0x116')](db['Interval'],{'onDelete':_0xfa07('0x16a'),'foreignKey':'IntervalId'});db[_0xfa07('0xfc')][_0xfa07('0x116')](db[_0xfa07('0x8f')],{'onDelete':_0xfa07('0x16a'),'foreignKey':_0xfa07('0x16c')});db[_0xfa07('0x123')][_0xfa07('0x107')](db[_0xfa07('0x1d4')],{'as':'Messages','onDelete':_0xfa07('0x10b'),'foreignKey':_0xfa07('0x1d5')});db['WhatsappInteraction'][_0xfa07('0x116')](db['WhatsappAccount'],{'as':'Account','foreignKey':_0xfa07('0x1d3')});db[_0xfa07('0x123')][_0xfa07('0x116')](db[_0xfa07('0x71')],{'as':_0xfa07('0x157'),'foreignKey':'ContactId'});db[_0xfa07('0x123')][_0xfa07('0x116')](db[_0xfa07('0x14')],{'as':_0xfa07('0x171'),'foreignKey':_0xfa07('0x106')});db['WhatsappInteraction'][_0xfa07('0x118')](db[_0xfa07('0x8f')],{'through':_0xfa07('0x1d6'),'as':_0xfa07('0x164')});db[_0xfa07('0x123')][_0xfa07('0x118')](db[_0xfa07('0x8f')],{'through':_0xfa07('0x1d6'),'as':_0xfa07('0x165')});db[_0xfa07('0x123')][_0xfa07('0x118')](db[_0xfa07('0x14')],{'as':_0xfa07('0x166'),'through':_0xfa07('0x124'),'foreignKey':_0xfa07('0x1d5')});db['WhatsappMessage'][_0xfa07('0x116')](db[_0xfa07('0x14')],{'as':'User'});db[_0xfa07('0x1d4')][_0xfa07('0x116')](db[_0xfa07('0x71')],{'onDelete':_0xfa07('0x10b'),'as':_0xfa07('0x157')});db['WhatsappMessage'][_0xfa07('0x116')](db['WhatsappInteraction'],{'onDelete':_0xfa07('0x10b'),'as':'Interaction','foreignKey':_0xfa07('0x1d5')});db['WhatsappMessage'][_0xfa07('0x116')](db[_0xfa07('0x136')],{'as':_0xfa07('0x169'),'foreignKey':_0xfa07('0x1d3')});db[_0xfa07('0x1d7')]['belongsTo'](db[_0xfa07('0x136')],{});db[_0xfa07('0x1d7')][_0xfa07('0x116')](db['CmList'],{'as':'List','foreignKey':_0xfa07('0x160')});db[_0xfa07('0x1d7')][_0xfa07('0x116')](db['CmContact'],{'as':_0xfa07('0x157'),'foreignKey':_0xfa07('0x158')});db[_0xfa07('0x1d7')]['belongsTo'](db[_0xfa07('0x123')],{});db[_0xfa07('0x1d7')][_0xfa07('0x116')](db[_0xfa07('0x102')],{});db['WhatsappQueueReport']['belongsTo'](db['WhatsappMessage'],{});db[_0xfa07('0x1d7')][_0xfa07('0x116')](db[_0xfa07('0x14')],{});db[_0xfa07('0x100')][_0xfa07('0x116')](db['WhatsappMessage'],{});db[_0xfa07('0x100')]['belongsTo'](db[_0xfa07('0x123')],{});db[_0xfa07('0x100')]['belongsTo'](db[_0xfa07('0x136')],{'foreignKey':'FromWhatsappAccountId','as':_0xfa07('0x1c7')});db[_0xfa07('0x100')][_0xfa07('0x116')](db[_0xfa07('0x136')],{'foreignKey':'ToWhatsappAccountId','as':'ToAccount'});db[_0xfa07('0x100')]['belongsTo'](db[_0xfa07('0x102')],{'foreignKey':_0xfa07('0x1d8'),'as':'ToQueue'});db[_0xfa07('0x100')]['belongsTo'](db[_0xfa07('0x14')],{'foreignKey':_0xfa07('0x1c8'),'as':'FromAgent'});db[_0xfa07('0x100')][_0xfa07('0x116')](db[_0xfa07('0x14')],{'foreignKey':_0xfa07('0x1c1'),'as':_0xfa07('0x1c2')});db[_0xfa07('0x102')][_0xfa07('0x118')](db[_0xfa07('0x14')],{'as':_0xfa07('0x161'),'through':_0xfa07('0x36'),'foreignKey':_0xfa07('0x1d9')});db['WhatsappQueue'][_0xfa07('0x118')](db['Team'],{'through':_0xfa07('0x1bc'),'as':_0xfa07('0x14c')});module[_0xfa07('0x1da')]={'db':db,'dbH':dbH};