41184dad575ac1589eec05d29e50b4c6df29f84e
[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 _0x20f8=['utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./chatInteraction.attributes','exports','ChatInteraction','chat_interactions','changed','closedAt','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x52b0d3,_0x1383de){var _0x50f899=function(_0x4a71a7){while(--_0x4a71a7){_0x52b0d3['push'](_0x52b0d3['shift']());}};_0x50f899(++_0x1383de);}(_0x20f8,0x9b));var _0x820f=function(_0x43ae37,_0x3fb6a8){_0x43ae37=_0x43ae37-0x0;var _0x4c355a=_0x20f8[_0x43ae37];return _0x4c355a;};'use strict';var _=require(_0x820f('0x0'));var util=require(_0x820f('0x1'));var logger=require('../../config/logger')(_0x820f('0x2'));var moment=require(_0x820f('0x3'));var BPromise=require(_0x820f('0x4'));var rp=require(_0x820f('0x5'));var fs=require('fs');var path=require(_0x820f('0x6'));var rimraf=require(_0x820f('0x7'));var config=require('../../config/environment');var attributes=require(_0x820f('0x8'));module[_0x820f('0x9')]=function(_0x53bd56,_0x4f79d0){return _0x53bd56['define'](_0x820f('0xa'),attributes,{'tableName':_0x820f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x19d813,_0x14653e,_0x78fbc7){if(_0x19d813[_0x820f('0xc')]('closed')){_0x19d813[_0x820f('0xd')]=moment()['format'](_0x820f('0xe'));}_0x78fbc7(null,_0x19d813);}},'charset':_0x820f('0xf'),'collate':_0x820f('0x10')});};