michangarrito/apps/backend/dist/modules/messaging/entities/conversation.entity.js
rckrdmrd 48dea7a5d0 feat: Initial commit - michangarrito
Marketplace móvil para negocios locales mexicanos.

Estructura inicial:
- apps/backend (NestJS API)
- apps/frontend (React Web)
- apps/mobile (Expo/React Native)
- apps/mcp-server (Claude MCP Server)
- apps/whatsapp-service (WhatsApp Business API)
- database/ (PostgreSQL DDL)
- docs/ (Documentación)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 04:41:02 -06:00

73 lines
3.4 KiB
JavaScript

"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