"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); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.Conversation = void 0; const typeorm_1 = require("typeorm"); const message_entity_1 = require("./message.entity"); let Conversation = class Conversation { }; exports.Conversation = Conversation; __decorate([ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'), __metadata("design:type", String) ], Conversation.prototype, "id", void 0); __decorate([ (0, typeorm_1.Column)({ name: 'tenant_id' }), __metadata("design:type", String) ], Conversation.prototype, "tenantId", void 0); __decorate([ (0, typeorm_1.Column)({ name: 'phone_number', length: 20 }), __metadata("design:type", String) ], Conversation.prototype, "phoneNumber", void 0); __decorate([ (0, typeorm_1.Column)({ name: 'contact_name', length: 100, nullable: true }), __metadata("design:type", String) ], Conversation.prototype, "contactName", void 0); __decorate([ (0, typeorm_1.Column)({ name: 'conversation_type', length: 20 }), __metadata("design:type", String) ], Conversation.prototype, "conversationType", void 0); __decorate([ (0, typeorm_1.Column)({ length: 20, default: 'active' }), __metadata("design:type", String) ], Conversation.prototype, "status", void 0); __decorate([ (0, typeorm_1.Column)({ name: 'last_message_at', type: 'timestamptz', nullable: true }), __metadata("design:type", Date) ], Conversation.prototype, "lastMessageAt", void 0); __decorate([ (0, typeorm_1.Column)({ name: 'last_message_preview', type: 'text', nullable: true }), __metadata("design:type", String) ], Conversation.prototype, "lastMessagePreview", void 0); __decorate([ (0, typeorm_1.Column)({ name: 'unread_count', default: 0 }), __metadata("design:type", Number) ], Conversation.prototype, "unreadCount", void 0); __decorate([ (0, typeorm_1.Column)({ name: 'wa_conversation_id', length: 100, nullable: true }), __metadata("design:type", String) ], Conversation.prototype, "waConversationId", void 0); __decorate([ (0, typeorm_1.CreateDateColumn)({ name: 'created_at' }), __metadata("design:type", Date) ], Conversation.prototype, "createdAt", void 0); __decorate([ (0, typeorm_1.UpdateDateColumn)({ name: 'updated_at' }), __metadata("design:type", Date) ], Conversation.prototype, "updatedAt", void 0); __decorate([ (0, typeorm_1.OneToMany)(() => message_entity_1.Message, (message) => message.conversation), __metadata("design:type", Array) ], Conversation.prototype, "messages", void 0); exports.Conversation = Conversation = __decorate([ (0, typeorm_1.Entity)({ schema: 'messaging', name: 'conversations' }) ], Conversation); //# sourceMappingURL=conversation.entity.js.map