141 lines
5.9 KiB
JavaScript
141 lines
5.9 KiB
JavaScript
"use strict";
|
|
/**
|
|
* OfertaVivienda Entity
|
|
* Ofertas de vivienda registradas ante INFONAVIT
|
|
*
|
|
* @module Infonavit
|
|
* @table infonavit.ofertas_vivienda
|
|
*/
|
|
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.OfertaVivienda = void 0;
|
|
const typeorm_1 = require("typeorm");
|
|
const tenant_entity_1 = require("../../core/entities/tenant.entity");
|
|
const user_entity_1 = require("../../core/entities/user.entity");
|
|
const registro_infonavit_entity_1 = require("./registro-infonavit.entity");
|
|
const asignacion_vivienda_entity_1 = require("./asignacion-vivienda.entity");
|
|
let OfertaVivienda = class OfertaVivienda {
|
|
id;
|
|
tenantId;
|
|
registroId;
|
|
loteId;
|
|
infonavitCode;
|
|
offerDate;
|
|
salePrice;
|
|
infonavitValue;
|
|
housingType;
|
|
constructionArea;
|
|
landArea;
|
|
status;
|
|
notes;
|
|
createdAt;
|
|
createdById;
|
|
updatedAt;
|
|
updatedById;
|
|
// Relations
|
|
tenant;
|
|
registro;
|
|
createdBy;
|
|
asignaciones;
|
|
};
|
|
exports.OfertaVivienda = OfertaVivienda;
|
|
__decorate([
|
|
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
__metadata("design:type", String)
|
|
], OfertaVivienda.prototype, "id", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'tenant_id', type: 'uuid' }),
|
|
__metadata("design:type", String)
|
|
], OfertaVivienda.prototype, "tenantId", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'registro_id', type: 'uuid' }),
|
|
__metadata("design:type", String)
|
|
], OfertaVivienda.prototype, "registroId", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'lote_id', type: 'uuid' }),
|
|
__metadata("design:type", String)
|
|
], OfertaVivienda.prototype, "loteId", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'infonavit_code', type: 'varchar', length: 50 }),
|
|
__metadata("design:type", String)
|
|
], OfertaVivienda.prototype, "infonavitCode", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'offer_date', type: 'date' }),
|
|
__metadata("design:type", Date)
|
|
], OfertaVivienda.prototype, "offerDate", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'sale_price', type: 'decimal', precision: 14, scale: 2 }),
|
|
__metadata("design:type", Number)
|
|
], OfertaVivienda.prototype, "salePrice", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'infonavit_value', type: 'decimal', precision: 14, scale: 2 }),
|
|
__metadata("design:type", Number)
|
|
], OfertaVivienda.prototype, "infonavitValue", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'housing_type', type: 'varchar', length: 50 }),
|
|
__metadata("design:type", String)
|
|
], OfertaVivienda.prototype, "housingType", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'construction_area', type: 'decimal', precision: 10, scale: 2 }),
|
|
__metadata("design:type", Number)
|
|
], OfertaVivienda.prototype, "constructionArea", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'land_area', type: 'decimal', precision: 10, scale: 2 }),
|
|
__metadata("design:type", Number)
|
|
], OfertaVivienda.prototype, "landArea", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ type: 'varchar', length: 20, default: 'available' }),
|
|
__metadata("design:type", String)
|
|
], OfertaVivienda.prototype, "status", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
__metadata("design:type", String)
|
|
], OfertaVivienda.prototype, "notes", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.CreateDateColumn)({ name: 'created_at', type: 'timestamptz' }),
|
|
__metadata("design:type", Date)
|
|
], OfertaVivienda.prototype, "createdAt", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'created_by', type: 'uuid', nullable: true }),
|
|
__metadata("design:type", String)
|
|
], OfertaVivienda.prototype, "createdById", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.UpdateDateColumn)({ name: 'updated_at', type: 'timestamptz' }),
|
|
__metadata("design:type", Date)
|
|
], OfertaVivienda.prototype, "updatedAt", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'updated_by', type: 'uuid', nullable: true }),
|
|
__metadata("design:type", String)
|
|
], OfertaVivienda.prototype, "updatedById", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.ManyToOne)(() => tenant_entity_1.Tenant),
|
|
(0, typeorm_1.JoinColumn)({ name: 'tenant_id' }),
|
|
__metadata("design:type", tenant_entity_1.Tenant)
|
|
], OfertaVivienda.prototype, "tenant", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.ManyToOne)(() => registro_infonavit_entity_1.RegistroInfonavit, (r) => r.ofertas, { onDelete: 'CASCADE' }),
|
|
(0, typeorm_1.JoinColumn)({ name: 'registro_id' }),
|
|
__metadata("design:type", registro_infonavit_entity_1.RegistroInfonavit)
|
|
], OfertaVivienda.prototype, "registro", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.ManyToOne)(() => user_entity_1.User),
|
|
(0, typeorm_1.JoinColumn)({ name: 'created_by' }),
|
|
__metadata("design:type", user_entity_1.User)
|
|
], OfertaVivienda.prototype, "createdBy", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.OneToMany)(() => asignacion_vivienda_entity_1.AsignacionVivienda, (a) => a.oferta),
|
|
__metadata("design:type", Array)
|
|
], OfertaVivienda.prototype, "asignaciones", void 0);
|
|
exports.OfertaVivienda = OfertaVivienda = __decorate([
|
|
(0, typeorm_1.Entity)({ schema: 'infonavit', name: 'ofertas_vivienda' }),
|
|
(0, typeorm_1.Index)(['tenantId', 'infonavitCode'], { unique: true })
|
|
], OfertaVivienda);
|
|
//# sourceMappingURL=oferta-vivienda.entity.js.map
|