erp-construccion-backend/dist/modules/construction/entities/etapa.entity.js

126 lines
4.9 KiB
JavaScript

"use strict";
/**
* Etapa Entity
* Etapas/Fases de un fraccionamiento
*
* @module Construction
*/
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.Etapa = void 0;
const typeorm_1 = require("typeorm");
const fraccionamiento_entity_1 = require("./fraccionamiento.entity");
const manzana_entity_1 = require("./manzana.entity");
let Etapa = class Etapa {
id;
tenantId;
fraccionamientoId;
code;
name;
description;
sequence;
totalLots;
status;
startDate;
expectedEndDate;
actualEndDate;
createdAt;
createdBy;
updatedAt;
updatedBy;
deletedAt;
// Relations
fraccionamiento;
manzanas;
};
exports.Etapa = Etapa;
__decorate([
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
__metadata("design:type", String)
], Etapa.prototype, "id", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'tenant_id', type: 'uuid' }),
__metadata("design:type", String)
], Etapa.prototype, "tenantId", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'fraccionamiento_id', type: 'uuid' }),
__metadata("design:type", String)
], Etapa.prototype, "fraccionamientoId", void 0);
__decorate([
(0, typeorm_1.Column)({ type: 'varchar', length: 20 }),
__metadata("design:type", String)
], Etapa.prototype, "code", void 0);
__decorate([
(0, typeorm_1.Column)({ type: 'varchar', length: 100 }),
__metadata("design:type", String)
], Etapa.prototype, "name", void 0);
__decorate([
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
__metadata("design:type", String)
], Etapa.prototype, "description", void 0);
__decorate([
(0, typeorm_1.Column)({ type: 'integer', default: 1 }),
__metadata("design:type", Number)
], Etapa.prototype, "sequence", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'total_lots', type: 'integer', default: 0 }),
__metadata("design:type", Number)
], Etapa.prototype, "totalLots", void 0);
__decorate([
(0, typeorm_1.Column)({ type: 'varchar', length: 50, default: 'draft' }),
__metadata("design:type", String)
], Etapa.prototype, "status", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'start_date', type: 'date', nullable: true }),
__metadata("design:type", Date)
], Etapa.prototype, "startDate", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'expected_end_date', type: 'date', nullable: true }),
__metadata("design:type", Date)
], Etapa.prototype, "expectedEndDate", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'actual_end_date', type: 'date', nullable: true }),
__metadata("design:type", Date)
], Etapa.prototype, "actualEndDate", void 0);
__decorate([
(0, typeorm_1.CreateDateColumn)({ name: 'created_at', type: 'timestamptz' }),
__metadata("design:type", Date)
], Etapa.prototype, "createdAt", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'created_by', type: 'uuid', nullable: true }),
__metadata("design:type", String)
], Etapa.prototype, "createdBy", void 0);
__decorate([
(0, typeorm_1.UpdateDateColumn)({ name: 'updated_at', type: 'timestamptz', nullable: true }),
__metadata("design:type", Date)
], Etapa.prototype, "updatedAt", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'updated_by', type: 'uuid', nullable: true }),
__metadata("design:type", String)
], Etapa.prototype, "updatedBy", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'deleted_at', type: 'timestamptz', nullable: true }),
__metadata("design:type", Date)
], Etapa.prototype, "deletedAt", void 0);
__decorate([
(0, typeorm_1.ManyToOne)(() => fraccionamiento_entity_1.Fraccionamiento, (f) => f.etapas, { onDelete: 'CASCADE' }),
(0, typeorm_1.JoinColumn)({ name: 'fraccionamiento_id' }),
__metadata("design:type", fraccionamiento_entity_1.Fraccionamiento)
], Etapa.prototype, "fraccionamiento", void 0);
__decorate([
(0, typeorm_1.OneToMany)(() => manzana_entity_1.Manzana, (m) => m.etapa),
__metadata("design:type", Array)
], Etapa.prototype, "manzanas", void 0);
exports.Etapa = Etapa = __decorate([
(0, typeorm_1.Entity)({ schema: 'construction', name: 'etapas' }),
(0, typeorm_1.Index)(['fraccionamientoId', 'code'], { unique: true })
], Etapa);
//# sourceMappingURL=etapa.entity.js.map