michangarrito/apps/backend/dist/modules/auth/entities/tenant.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

145 lines
6.0 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.Tenant = exports.TenantStatus = exports.SubscriptionStatus = void 0;
const typeorm_1 = require("typeorm");
const user_entity_1 = require("./user.entity");
var SubscriptionStatus;
(function (SubscriptionStatus) {
SubscriptionStatus["TRIAL"] = "trial";
SubscriptionStatus["ACTIVE"] = "active";
SubscriptionStatus["SUSPENDED"] = "suspended";
SubscriptionStatus["CANCELLED"] = "cancelled";
})(SubscriptionStatus || (exports.SubscriptionStatus = SubscriptionStatus = {}));
var TenantStatus;
(function (TenantStatus) {
TenantStatus["ACTIVE"] = "active";
TenantStatus["INACTIVE"] = "inactive";
TenantStatus["SUSPENDED"] = "suspended";
})(TenantStatus || (exports.TenantStatus = TenantStatus = {}));
let Tenant = class Tenant {
};
exports.Tenant = Tenant;
__decorate([
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
__metadata("design:type", String)
], Tenant.prototype, "id", void 0);
__decorate([
(0, typeorm_1.Column)({ length: 100 }),
__metadata("design:type", String)
], Tenant.prototype, "name", void 0);
__decorate([
(0, typeorm_1.Column)({ length: 50, unique: true }),
__metadata("design:type", String)
], Tenant.prototype, "slug", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'business_type', length: 50 }),
__metadata("design:type", String)
], Tenant.prototype, "businessType", void 0);
__decorate([
(0, typeorm_1.Column)({ length: 20 }),
__metadata("design:type", String)
], Tenant.prototype, "phone", void 0);
__decorate([
(0, typeorm_1.Column)({ length: 100, nullable: true }),
__metadata("design:type", String)
], Tenant.prototype, "email", void 0);
__decorate([
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
__metadata("design:type", String)
], Tenant.prototype, "address", void 0);
__decorate([
(0, typeorm_1.Column)({ length: 50, nullable: true }),
__metadata("design:type", String)
], Tenant.prototype, "city", void 0);
__decorate([
(0, typeorm_1.Column)({ length: 50, nullable: true }),
__metadata("design:type", String)
], Tenant.prototype, "state", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'zip_code', length: 10, nullable: true }),
__metadata("design:type", String)
], Tenant.prototype, "zipCode", void 0);
__decorate([
(0, typeorm_1.Column)({ length: 50, default: 'America/Mexico_City' }),
__metadata("design:type", String)
], Tenant.prototype, "timezone", void 0);
__decorate([
(0, typeorm_1.Column)({ length: 3, default: 'MXN' }),
__metadata("design:type", String)
], Tenant.prototype, "currency", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'tax_rate', type: 'decimal', precision: 5, scale: 2, default: 16.0 }),
__metadata("design:type", Number)
], Tenant.prototype, "taxRate", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'tax_included', default: true }),
__metadata("design:type", Boolean)
], Tenant.prototype, "taxIncluded", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'whatsapp_number', length: 20, nullable: true }),
__metadata("design:type", String)
], Tenant.prototype, "whatsappNumber", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'whatsapp_verified', default: false }),
__metadata("design:type", Boolean)
], Tenant.prototype, "whatsappVerified", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'uses_platform_number', default: true }),
__metadata("design:type", Boolean)
], Tenant.prototype, "usesPlatformNumber", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'preferred_llm_provider', length: 20, default: 'openai' }),
__metadata("design:type", String)
], Tenant.prototype, "preferredLlmProvider", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'preferred_payment_provider', length: 20, default: 'stripe' }),
__metadata("design:type", String)
], Tenant.prototype, "preferredPaymentProvider", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'current_plan_id', type: 'uuid', nullable: true }),
__metadata("design:type", String)
], Tenant.prototype, "currentPlanId", void 0);
__decorate([
(0, typeorm_1.Column)({
name: 'subscription_status',
length: 20,
default: 'trial',
}),
__metadata("design:type", String)
], Tenant.prototype, "subscriptionStatus", void 0);
__decorate([
(0, typeorm_1.Column)({
length: 20,
default: 'active',
}),
__metadata("design:type", String)
], Tenant.prototype, "status", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'onboarding_completed', default: false }),
__metadata("design:type", Boolean)
], Tenant.prototype, "onboardingCompleted", void 0);
__decorate([
(0, typeorm_1.CreateDateColumn)({ name: 'created_at' }),
__metadata("design:type", Date)
], Tenant.prototype, "createdAt", void 0);
__decorate([
(0, typeorm_1.UpdateDateColumn)({ name: 'updated_at' }),
__metadata("design:type", Date)
], Tenant.prototype, "updatedAt", void 0);
__decorate([
(0, typeorm_1.OneToMany)(() => user_entity_1.User, (user) => user.tenant),
__metadata("design:type", Array)
], Tenant.prototype, "users", void 0);
exports.Tenant = Tenant = __decorate([
(0, typeorm_1.Entity)({ schema: 'public', name: 'tenants' })
], Tenant);
//# sourceMappingURL=tenant.entity.js.map