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>
112 lines
4.8 KiB
JavaScript
112 lines
4.8 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.Message = exports.MessageType = exports.MessageDirection = void 0;
|
|
const typeorm_1 = require("typeorm");
|
|
const conversation_entity_1 = require("./conversation.entity");
|
|
var MessageDirection;
|
|
(function (MessageDirection) {
|
|
MessageDirection["INBOUND"] = "inbound";
|
|
MessageDirection["OUTBOUND"] = "outbound";
|
|
})(MessageDirection || (exports.MessageDirection = MessageDirection = {}));
|
|
var MessageType;
|
|
(function (MessageType) {
|
|
MessageType["TEXT"] = "text";
|
|
MessageType["IMAGE"] = "image";
|
|
MessageType["AUDIO"] = "audio";
|
|
MessageType["DOCUMENT"] = "document";
|
|
MessageType["LOCATION"] = "location";
|
|
MessageType["INTERACTIVE"] = "interactive";
|
|
MessageType["TEMPLATE"] = "template";
|
|
})(MessageType || (exports.MessageType = MessageType = {}));
|
|
let Message = class Message {
|
|
};
|
|
exports.Message = Message;
|
|
__decorate([
|
|
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
__metadata("design:type", String)
|
|
], Message.prototype, "id", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'conversation_id' }),
|
|
__metadata("design:type", String)
|
|
], Message.prototype, "conversationId", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({
|
|
type: 'varchar',
|
|
length: 10,
|
|
}),
|
|
__metadata("design:type", String)
|
|
], Message.prototype, "direction", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({
|
|
name: 'message_type',
|
|
type: 'varchar',
|
|
length: 20,
|
|
}),
|
|
__metadata("design:type", String)
|
|
], Message.prototype, "messageType", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
__metadata("design:type", String)
|
|
], Message.prototype, "content", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'media_url', type: 'text', nullable: true }),
|
|
__metadata("design:type", String)
|
|
], Message.prototype, "mediaUrl", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'media_mime_type', length: 50, nullable: true }),
|
|
__metadata("design:type", String)
|
|
], Message.prototype, "mediaMimeType", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'processed_by_llm', default: false }),
|
|
__metadata("design:type", Boolean)
|
|
], Message.prototype, "processedByLlm", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'llm_response_id', nullable: true }),
|
|
__metadata("design:type", String)
|
|
], Message.prototype, "llmResponseId", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'tokens_used', nullable: true }),
|
|
__metadata("design:type", Number)
|
|
], Message.prototype, "tokensUsed", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'wa_message_id', length: 100, nullable: true }),
|
|
__metadata("design:type", String)
|
|
], Message.prototype, "waMessageId", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'wa_status', length: 20, nullable: true }),
|
|
__metadata("design:type", String)
|
|
], Message.prototype, "waStatus", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'wa_timestamp', type: 'timestamptz', nullable: true }),
|
|
__metadata("design:type", Date)
|
|
], Message.prototype, "waTimestamp", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'error_code', length: 20, nullable: true }),
|
|
__metadata("design:type", String)
|
|
], Message.prototype, "errorCode", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'error_message', type: 'text', nullable: true }),
|
|
__metadata("design:type", String)
|
|
], Message.prototype, "errorMessage", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.CreateDateColumn)({ name: 'created_at' }),
|
|
__metadata("design:type", Date)
|
|
], Message.prototype, "createdAt", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.ManyToOne)(() => conversation_entity_1.Conversation, (conv) => conv.messages, { onDelete: 'CASCADE' }),
|
|
(0, typeorm_1.JoinColumn)({ name: 'conversation_id' }),
|
|
__metadata("design:type", conversation_entity_1.Conversation)
|
|
], Message.prototype, "conversation", void 0);
|
|
exports.Message = Message = __decorate([
|
|
(0, typeorm_1.Entity)({ schema: 'messaging', name: 'messages' })
|
|
], Message);
|
|
//# sourceMappingURL=message.entity.js.map
|