Built motion from commit 56a37f2a.|2.6.21
[motion2.git] / server / api / chatInteraction / chatInteraction.model.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 _0x3934=['chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','ChatInteraction'];(function(_0x57486e,_0x32283b){var _0x5f110b=function(_0xa18fc3){while(--_0xa18fc3){_0x57486e['push'](_0x57486e['shift']());}};_0x5f110b(++_0x32283b);}(_0x3934,0x139));var _0x4393=function(_0x3ed70a,_0x18c849){_0x3ed70a=_0x3ed70a-0x0;var _0x2add57=_0x3934[_0x3ed70a];return _0x2add57;};'use strict';var _=require(_0x4393('0x0'));var util=require('util');var logger=require(_0x4393('0x1'))(_0x4393('0x2'));var moment=require(_0x4393('0x3'));var BPromise=require(_0x4393('0x4'));var rp=require(_0x4393('0x5'));var fs=require('fs');var path=require(_0x4393('0x6'));var rimraf=require(_0x4393('0x7'));var config=require('../../config/environment');var attributes=require('./chatInteraction.attributes');module[_0x4393('0x8')]=function(_0x7eb028,_0x579335){return _0x7eb028[_0x4393('0x9')](_0x4393('0xa'),attributes,{'tableName':_0x4393('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x48694c,_0x4fceb6,_0x150870){if(_0x48694c[_0x4393('0xc')](_0x4393('0xd'))){_0x48694c[_0x4393('0xe')]=moment()[_0x4393('0xf')](_0x4393('0x10'));}_0x150870(null,_0x48694c);}},'charset':'utf8mb4','collate':_0x4393('0x11')});};