Built motion from commit da617fac.|2.6.6
[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 _0x32f1=['moment','request-promise','path','rimraf','./chatInteraction.attributes','exports','closedAt','utf8mb4','lodash','../../config/logger','api'];(function(_0x1ef183,_0x341141){var _0x7fd9e2=function(_0x58d089){while(--_0x58d089){_0x1ef183['push'](_0x1ef183['shift']());}};_0x7fd9e2(++_0x341141);}(_0x32f1,0xd9));var _0x132f=function(_0x469739,_0x40eab1){_0x469739=_0x469739-0x0;var _0x3e23fb=_0x32f1[_0x469739];return _0x3e23fb;};'use strict';var _=require(_0x132f('0x0'));var util=require('util');var logger=require(_0x132f('0x1'))(_0x132f('0x2'));var moment=require(_0x132f('0x3'));var BPromise=require('bluebird');var rp=require(_0x132f('0x4'));var fs=require('fs');var path=require(_0x132f('0x5'));var rimraf=require(_0x132f('0x6'));var config=require('../../config/environment');var attributes=require(_0x132f('0x7'));module[_0x132f('0x8')]=function(_0x304b27,_0x1676ea){return _0x304b27['define']('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4b247a,_0xb03c2f,_0x4b2ec1){if(_0x4b247a['changed']('closed')){_0x4b247a[_0x132f('0x9')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x4b2ec1(null,_0x4b247a);}},'charset':_0x132f('0xa'),'collate':'utf8mb4_unicode_ci'});};