michangarrito/apps/backend/dist/modules/referrals/entities/referral.entity.js
rckrdmrd 97f407c661 [MIGRATION-V2] feat: Migrar michangarrito a estructura v2
- Prefijo v2: MCH
- TRACEABILITY-MASTER.yml creado
- Listo para integracion como submodulo

Workspace: v2.0.0 | SIMCO: v4.0.0
2026-01-10 11:28:54 -06:00

79 lines
3.5 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.Referral = exports.ReferralStatus = void 0;
const typeorm_1 = require("typeorm");
var ReferralStatus;
(function (ReferralStatus) {
ReferralStatus["PENDING"] = "pending";
ReferralStatus["CONVERTED"] = "converted";
ReferralStatus["REWARDED"] = "rewarded";
ReferralStatus["EXPIRED"] = "expired";
})(ReferralStatus || (exports.ReferralStatus = ReferralStatus = {}));
let Referral = class Referral {
};
exports.Referral = Referral;
__decorate([
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
__metadata("design:type", String)
], Referral.prototype, "id", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'referrer_tenant_id' }),
__metadata("design:type", String)
], Referral.prototype, "referrerTenantId", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'referred_tenant_id', unique: true }),
__metadata("design:type", String)
], Referral.prototype, "referredTenantId", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'code_used', length: 20 }),
__metadata("design:type", String)
], Referral.prototype, "codeUsed", void 0);
__decorate([
(0, typeorm_1.Column)({
type: 'varchar',
length: 20,
default: ReferralStatus.PENDING,
}),
__metadata("design:type", String)
], Referral.prototype, "status", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'referred_discount_applied', default: false }),
__metadata("design:type", Boolean)
], Referral.prototype, "referredDiscountApplied", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'referrer_reward_applied', default: false }),
__metadata("design:type", Boolean)
], Referral.prototype, "referrerRewardApplied", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'converted_at', type: 'timestamptz', nullable: true }),
__metadata("design:type", Date)
], Referral.prototype, "convertedAt", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'reward_applied_at', type: 'timestamptz', nullable: true }),
__metadata("design:type", Date)
], Referral.prototype, "rewardAppliedAt", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'expires_at', type: 'timestamptz', nullable: true }),
__metadata("design:type", Date)
], Referral.prototype, "expiresAt", void 0);
__decorate([
(0, typeorm_1.CreateDateColumn)({ name: 'created_at' }),
__metadata("design:type", Date)
], Referral.prototype, "createdAt", void 0);
__decorate([
(0, typeorm_1.UpdateDateColumn)({ name: 'updated_at' }),
__metadata("design:type", Date)
], Referral.prototype, "updatedAt", void 0);
exports.Referral = Referral = __decorate([
(0, typeorm_1.Entity)({ schema: 'subscriptions', name: 'referrals' })
], Referral);
//# sourceMappingURL=referral.entity.js.map