/*****************************************************************************\
|                                               ( )_  _                       |
|    _ _    _ __   _ _    __    ___ ___     _ _ | ,_)(_)  ___   ___     _     |
|   ( '_`\ ( '__)/'_` ) /'_ `\/' _ ` _ `\ /'_` )| |  | |/',__)/' v `\ /'_`\   |
|   | (_) )| |  ( (_| |( (_) || ( ) ( ) |( (_| || |_ | |\__, \| (˅) |( (_) )  |
|   | ,__/'(_)  `\__,_)`\__  |(_) (_) (_)`\__,_)`\__)(_)(____/(_) (_)`\___/'  |
|   | |                ( )_) |                                                |
|   (_)                 \___/'                                                |
|                                                                             |
| General Bots Copyright (c) Pragmatismo.io. All rights reserved.             |
| Licensed under the AGPL-3.0.                                                |
|                                                                             |
| According to our dual licensing model, this program can be used either      |
| under the terms of the GNU Affero General Public License, version 3,        |
| or under a proprietary license.                                             |
|                                                                             |
| The texts of the GNU Affero General Public License with an additional       |
| permission and of our proprietary license can be found at and               |
| in the LICENSE file you have received along with this program.              |
|                                                                             |
| This program is distributed in the hope that it will be useful,             |
| but WITHOUT ANY WARRANTY, without even the implied warranty of              |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the                |
| GNU Affero General Public License for more details.                         |
|                                                                             |
| "General Bots" is a registered trademark of Pragmatismo.io.                 |
| The licensing of the program under the AGPLv3 does not imply a              |
| trademark license. Therefore any rights, title and interest in              |
| our trademarks remain entirely with us.                                     |
|                                                                             |
\*****************************************************************************/
/**
 * @fileoverview General Bots server core.
 */
'use strict';
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
import { AutoIncrement, BelongsTo, Column, CreatedAt, DataType, ForeignKey, Model, PrimaryKey, Table, UpdatedAt } from 'sequelize-typescript';
import { GuaribasChannel, GuaribasInstance } from '../../core.gbapp/models/GBModel.js';
import { GuaribasSubject } from '../../kb.gbapp/models/index.js';
import { GuaribasUser } from '../../security.gbapp/models/index.js';
/**
 * A conversation that groups many messages.
 */
let GuaribasConversation = class GuaribasConversation extends Model {
};
__decorate([
    PrimaryKey,
    AutoIncrement,
    Column(DataType.INTEGER),
    __metadata("design:type", Number)
], GuaribasConversation.prototype, "conversationId", void 0);
__decorate([
    ForeignKey(() => GuaribasInstance),
    Column(DataType.INTEGER),
    __metadata("design:type", Number)
], GuaribasConversation.prototype, "instanceId", void 0);
__decorate([
    ForeignKey(() => GuaribasSubject),
    Column(DataType.INTEGER),
    __metadata("design:type", Number)
], GuaribasConversation.prototype, "startSubjectId", void 0);
__decorate([
    BelongsTo(() => GuaribasSubject),
    __metadata("design:type", GuaribasSubject)
], GuaribasConversation.prototype, "startSubject", void 0);
__decorate([
    ForeignKey(() => GuaribasChannel),
    Column(DataType.INTEGER),
    __metadata("design:type", String)
], GuaribasConversation.prototype, "channelId", void 0);
__decorate([
    Column(DataType.DATE),
    __metadata("design:type", Date)
], GuaribasConversation.prototype, "rateDate", void 0);
__decorate([
    Column(DataType.FLOAT),
    __metadata("design:type", Number)
], GuaribasConversation.prototype, "rate", void 0);
__decorate([
    Column(DataType.STRING(512)),
    __metadata("design:type", String)
], GuaribasConversation.prototype, "feedback", void 0);
__decorate([
    CreatedAt,
    Column(DataType.DATE),
    __metadata("design:type", Date)
], GuaribasConversation.prototype, "createdAt", void 0);
__decorate([
    Column(DataType.STRING(255)),
    __metadata("design:type", String)
], GuaribasConversation.prototype, "text", void 0);
__decorate([
    ForeignKey(() => GuaribasUser),
    Column(DataType.INTEGER),
    __metadata("design:type", Number)
], GuaribasConversation.prototype, "startedByUserId", void 0);
__decorate([
    BelongsTo(() => GuaribasUser),
    __metadata("design:type", GuaribasUser)
], GuaribasConversation.prototype, "startedBy", void 0);
GuaribasConversation = __decorate([
    Table
], GuaribasConversation);
export { GuaribasConversation };
/**
 * A single message in a conversation.
 */
let GuaribasConversationMessage = class GuaribasConversationMessage extends Model {
};
__decorate([
    PrimaryKey,
    AutoIncrement,
    Column(DataType.INTEGER),
    __metadata("design:type", Number)
], GuaribasConversationMessage.prototype, "conversationMessageId", void 0);
__decorate([
    ForeignKey(() => GuaribasSubject),
    Column(DataType.INTEGER),
    __metadata("design:type", Number)
], GuaribasConversationMessage.prototype, "subjectId", void 0);
__decorate([
    Column(DataType.TEXT),
    __metadata("design:type", String)
], GuaribasConversationMessage.prototype, "content", void 0);
__decorate([
    Column(DataType.DATE),
    CreatedAt,
    __metadata("design:type", Date)
], GuaribasConversationMessage.prototype, "createdAt", void 0);
__decorate([
    Column(DataType.DATE),
    UpdatedAt,
    __metadata("design:type", Date)
], GuaribasConversationMessage.prototype, "updatedAt", void 0);
__decorate([
    ForeignKey(() => GuaribasConversation),
    Column(DataType.INTEGER),
    __metadata("design:type", Number)
], GuaribasConversationMessage.prototype, "conversationId", void 0);
__decorate([
    BelongsTo(() => GuaribasConversation),
    __metadata("design:type", GuaribasConversation)
], GuaribasConversationMessage.prototype, "conversation", void 0);
__decorate([
    ForeignKey(() => GuaribasInstance),
    Column(DataType.INTEGER),
    __metadata("design:type", Number)
], GuaribasConversationMessage.prototype, "instanceId", void 0);
__decorate([
    ForeignKey(() => GuaribasUser),
    Column(DataType.INTEGER),
    __metadata("design:type", Number)
], GuaribasConversationMessage.prototype, "userId", void 0);
__decorate([
    BelongsTo(() => GuaribasUser),
    __metadata("design:type", GuaribasUser)
], GuaribasConversationMessage.prototype, "user", void 0);
GuaribasConversationMessage = __decorate([
    Table
], GuaribasConversationMessage);
export { GuaribasConversationMessage };
//# sourceMappingURL=index.js.map