134 lines
5.4 KiB
JavaScript
134 lines
5.4 KiB
JavaScript
"use strict";
|
|
/**
|
|
* Fraccionamiento Entity
|
|
* Obras/fraccionamientos dentro de un proyecto
|
|
*
|
|
* @module Construction
|
|
* @table construction.fraccionamientos
|
|
* @ddl schemas/01-construction-schema-ddl.sql
|
|
*/
|
|
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.Fraccionamiento = 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 proyecto_entity_1 = require("./proyecto.entity");
|
|
const etapa_entity_1 = require("./etapa.entity");
|
|
let Fraccionamiento = class Fraccionamiento {
|
|
id;
|
|
tenantId;
|
|
proyectoId;
|
|
codigo;
|
|
nombre;
|
|
descripcion;
|
|
direccion;
|
|
// PostGIS geometry - stored as GeoJSON for TypeORM compatibility
|
|
ubicacionGeo;
|
|
fechaInicio;
|
|
fechaFinEstimada;
|
|
estado;
|
|
createdAt;
|
|
updatedAt;
|
|
createdById;
|
|
// Relations
|
|
tenant;
|
|
proyecto;
|
|
createdBy;
|
|
etapas;
|
|
};
|
|
exports.Fraccionamiento = Fraccionamiento;
|
|
__decorate([
|
|
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
__metadata("design:type", String)
|
|
], Fraccionamiento.prototype, "id", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'tenant_id', type: 'uuid' }),
|
|
__metadata("design:type", String)
|
|
], Fraccionamiento.prototype, "tenantId", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'proyecto_id', type: 'uuid' }),
|
|
__metadata("design:type", String)
|
|
], Fraccionamiento.prototype, "proyectoId", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ type: 'varchar', length: 20 }),
|
|
__metadata("design:type", String)
|
|
], Fraccionamiento.prototype, "codigo", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ type: 'varchar', length: 200 }),
|
|
__metadata("design:type", String)
|
|
], Fraccionamiento.prototype, "nombre", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
__metadata("design:type", String)
|
|
], Fraccionamiento.prototype, "descripcion", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
__metadata("design:type", String)
|
|
], Fraccionamiento.prototype, "direccion", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({
|
|
name: 'ubicacion_geo',
|
|
type: 'geometry',
|
|
spatialFeatureType: 'Point',
|
|
srid: 4326,
|
|
nullable: true
|
|
}),
|
|
__metadata("design:type", String)
|
|
], Fraccionamiento.prototype, "ubicacionGeo", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'fecha_inicio', type: 'date', nullable: true }),
|
|
__metadata("design:type", Date)
|
|
], Fraccionamiento.prototype, "fechaInicio", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'fecha_fin_estimada', type: 'date', nullable: true }),
|
|
__metadata("design:type", Date)
|
|
], Fraccionamiento.prototype, "fechaFinEstimada", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ type: 'varchar', length: 20, default: 'activo' }),
|
|
__metadata("design:type", String)
|
|
], Fraccionamiento.prototype, "estado", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.CreateDateColumn)({ name: 'created_at', type: 'timestamptz' }),
|
|
__metadata("design:type", Date)
|
|
], Fraccionamiento.prototype, "createdAt", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.UpdateDateColumn)({ name: 'updated_at', type: 'timestamptz' }),
|
|
__metadata("design:type", Date)
|
|
], Fraccionamiento.prototype, "updatedAt", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'created_by', type: 'uuid', nullable: true }),
|
|
__metadata("design:type", String)
|
|
], Fraccionamiento.prototype, "createdById", 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)
|
|
], Fraccionamiento.prototype, "tenant", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.ManyToOne)(() => proyecto_entity_1.Proyecto, (p) => p.fraccionamientos),
|
|
(0, typeorm_1.JoinColumn)({ name: 'proyecto_id' }),
|
|
__metadata("design:type", proyecto_entity_1.Proyecto)
|
|
], Fraccionamiento.prototype, "proyecto", 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)
|
|
], Fraccionamiento.prototype, "createdBy", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.OneToMany)(() => etapa_entity_1.Etapa, (e) => e.fraccionamiento),
|
|
__metadata("design:type", Array)
|
|
], Fraccionamiento.prototype, "etapas", void 0);
|
|
exports.Fraccionamiento = Fraccionamiento = __decorate([
|
|
(0, typeorm_1.Entity)({ schema: 'construction', name: 'fraccionamientos' }),
|
|
(0, typeorm_1.Index)(['tenantId', 'codigo'], { unique: true })
|
|
], Fraccionamiento);
|
|
//# sourceMappingURL=fraccionamiento.entity.js.map
|