erp-construccion-backend/dist/modules/infonavit/entities/acta-vivienda.entity.js

128 lines
5.2 KiB
JavaScript

"use strict";
/**
* ActaVivienda Entity
* Viviendas incluidas en actas oficiales
*
* @module Infonavit
* @table infonavit.acta_viviendas
*/
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.ActaVivienda = 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 acta_entity_1 = require("./acta.entity");
const oferta_vivienda_entity_1 = require("./oferta-vivienda.entity");
let ActaVivienda = class ActaVivienda {
id;
tenantId;
actaId;
ofertaId;
sequenceNumber;
result;
observations;
inspectedAt;
inspectedById;
createdAt;
createdById;
updatedAt;
updatedById;
// Relations
tenant;
acta;
oferta;
createdBy;
inspectedBy;
};
exports.ActaVivienda = ActaVivienda;
__decorate([
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
__metadata("design:type", String)
], ActaVivienda.prototype, "id", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'tenant_id', type: 'uuid' }),
__metadata("design:type", String)
], ActaVivienda.prototype, "tenantId", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'acta_id', type: 'uuid' }),
__metadata("design:type", String)
], ActaVivienda.prototype, "actaId", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'oferta_id', type: 'uuid' }),
__metadata("design:type", String)
], ActaVivienda.prototype, "ofertaId", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'sequence_number', type: 'integer' }),
__metadata("design:type", Number)
], ActaVivienda.prototype, "sequenceNumber", void 0);
__decorate([
(0, typeorm_1.Column)({ type: 'varchar', length: 20, default: 'pending' }),
__metadata("design:type", String)
], ActaVivienda.prototype, "result", void 0);
__decorate([
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
__metadata("design:type", String)
], ActaVivienda.prototype, "observations", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'inspected_at', type: 'timestamptz', nullable: true }),
__metadata("design:type", Date)
], ActaVivienda.prototype, "inspectedAt", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'inspected_by', type: 'uuid', nullable: true }),
__metadata("design:type", String)
], ActaVivienda.prototype, "inspectedById", void 0);
__decorate([
(0, typeorm_1.CreateDateColumn)({ name: 'created_at', type: 'timestamptz' }),
__metadata("design:type", Date)
], ActaVivienda.prototype, "createdAt", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'created_by', type: 'uuid', nullable: true }),
__metadata("design:type", String)
], ActaVivienda.prototype, "createdById", void 0);
__decorate([
(0, typeorm_1.UpdateDateColumn)({ name: 'updated_at', type: 'timestamptz' }),
__metadata("design:type", Date)
], ActaVivienda.prototype, "updatedAt", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'updated_by', type: 'uuid', nullable: true }),
__metadata("design:type", String)
], ActaVivienda.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)
], ActaVivienda.prototype, "tenant", void 0);
__decorate([
(0, typeorm_1.ManyToOne)(() => acta_entity_1.Acta, (a) => a.viviendas, { onDelete: 'CASCADE' }),
(0, typeorm_1.JoinColumn)({ name: 'acta_id' }),
__metadata("design:type", acta_entity_1.Acta)
], ActaVivienda.prototype, "acta", void 0);
__decorate([
(0, typeorm_1.ManyToOne)(() => oferta_vivienda_entity_1.OfertaVivienda),
(0, typeorm_1.JoinColumn)({ name: 'oferta_id' }),
__metadata("design:type", oferta_vivienda_entity_1.OfertaVivienda)
], ActaVivienda.prototype, "oferta", 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)
], ActaVivienda.prototype, "createdBy", void 0);
__decorate([
(0, typeorm_1.ManyToOne)(() => user_entity_1.User),
(0, typeorm_1.JoinColumn)({ name: 'inspected_by' }),
__metadata("design:type", user_entity_1.User)
], ActaVivienda.prototype, "inspectedBy", void 0);
exports.ActaVivienda = ActaVivienda = __decorate([
(0, typeorm_1.Entity)({ schema: 'infonavit', name: 'acta_viviendas' }),
(0, typeorm_1.Index)(['tenantId', 'actaId', 'ofertaId'], { unique: true })
], ActaVivienda);
//# sourceMappingURL=acta-vivienda.entity.js.map