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

98 lines
4.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.Subscription = exports.SubscriptionStatus = void 0;
const typeorm_1 = require("typeorm");
const plan_entity_1 = require("./plan.entity");
var SubscriptionStatus;
(function (SubscriptionStatus) {
SubscriptionStatus["TRIAL"] = "trial";
SubscriptionStatus["ACTIVE"] = "active";
SubscriptionStatus["PAST_DUE"] = "past_due";
SubscriptionStatus["CANCELLED"] = "cancelled";
SubscriptionStatus["EXPIRED"] = "expired";
})(SubscriptionStatus || (exports.SubscriptionStatus = SubscriptionStatus = {}));
let Subscription = class Subscription {
};
exports.Subscription = Subscription;
__decorate([
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
__metadata("design:type", String)
], Subscription.prototype, "id", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'tenant_id' }),
__metadata("design:type", String)
], Subscription.prototype, "tenantId", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'plan_id' }),
__metadata("design:type", String)
], Subscription.prototype, "planId", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'billing_cycle', length: 10, default: 'monthly' }),
__metadata("design:type", String)
], Subscription.prototype, "billingCycle", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'current_period_start', type: 'timestamptz' }),
__metadata("design:type", Date)
], Subscription.prototype, "currentPeriodStart", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'current_period_end', type: 'timestamptz' }),
__metadata("design:type", Date)
], Subscription.prototype, "currentPeriodEnd", void 0);
__decorate([
(0, typeorm_1.Column)({
type: 'varchar',
length: 20,
default: SubscriptionStatus.TRIAL,
}),
__metadata("design:type", String)
], Subscription.prototype, "status", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'cancel_at_period_end', default: false }),
__metadata("design:type", Boolean)
], Subscription.prototype, "cancelAtPeriodEnd", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'cancelled_at', type: 'timestamptz', nullable: true }),
__metadata("design:type", Date)
], Subscription.prototype, "cancelledAt", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'payment_method', length: 20, nullable: true }),
__metadata("design:type", String)
], Subscription.prototype, "paymentMethod", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'stripe_subscription_id', length: 100, nullable: true }),
__metadata("design:type", String)
], Subscription.prototype, "stripeSubscriptionId", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'stripe_customer_id', length: 100, nullable: true }),
__metadata("design:type", String)
], Subscription.prototype, "stripeCustomerId", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'trial_ends_at', type: 'timestamptz', nullable: true }),
__metadata("design:type", Date)
], Subscription.prototype, "trialEndsAt", void 0);
__decorate([
(0, typeorm_1.CreateDateColumn)({ name: 'created_at' }),
__metadata("design:type", Date)
], Subscription.prototype, "createdAt", void 0);
__decorate([
(0, typeorm_1.UpdateDateColumn)({ name: 'updated_at' }),
__metadata("design:type", Date)
], Subscription.prototype, "updatedAt", void 0);
__decorate([
(0, typeorm_1.ManyToOne)(() => plan_entity_1.Plan),
(0, typeorm_1.JoinColumn)({ name: 'plan_id' }),
__metadata("design:type", plan_entity_1.Plan)
], Subscription.prototype, "plan", void 0);
exports.Subscription = Subscription = __decorate([
(0, typeorm_1.Entity)({ schema: 'subscriptions', name: 'subscriptions' })
], Subscription);
//# sourceMappingURL=subscription.entity.js.map