"use strict"; /** * ComparativoCotizaciones Entity * Cuadro comparativo de cotizaciones * * @module Purchase * @table purchase.comparativo_cotizaciones * @ddl schemas/07-purchase-ext-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.ComparativoCotizaciones = 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 requisicion_obra_entity_1 = require("../../inventory/entities/requisicion-obra.entity"); const comparativo_proveedor_entity_1 = require("./comparativo-proveedor.entity"); let ComparativoCotizaciones = class ComparativoCotizaciones { id; tenantId; requisicionId; code; name; comparisonDate; status; winnerSupplierId; approvedById; approvedAt; notes; createdAt; createdById; updatedAt; updatedById; deletedAt; deletedById; // Relations tenant; requisicion; approvedBy; createdBy; proveedores; }; exports.ComparativoCotizaciones = ComparativoCotizaciones; __decorate([ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'), __metadata("design:type", String) ], ComparativoCotizaciones.prototype, "id", void 0); __decorate([ (0, typeorm_1.Column)({ name: 'tenant_id', type: 'uuid' }), __metadata("design:type", String) ], ComparativoCotizaciones.prototype, "tenantId", void 0); __decorate([ (0, typeorm_1.Column)({ name: 'requisicion_id', type: 'uuid', nullable: true }), __metadata("design:type", String) ], ComparativoCotizaciones.prototype, "requisicionId", void 0); __decorate([ (0, typeorm_1.Column)({ type: 'varchar', length: 30 }), __metadata("design:type", String) ], ComparativoCotizaciones.prototype, "code", void 0); __decorate([ (0, typeorm_1.Column)({ type: 'varchar', length: 255 }), __metadata("design:type", String) ], ComparativoCotizaciones.prototype, "name", void 0); __decorate([ (0, typeorm_1.Column)({ name: 'comparison_date', type: 'date' }), __metadata("design:type", Date) ], ComparativoCotizaciones.prototype, "comparisonDate", void 0); __decorate([ (0, typeorm_1.Column)({ type: 'varchar', length: 20, default: 'draft' }), __metadata("design:type", String) ], ComparativoCotizaciones.prototype, "status", void 0); __decorate([ (0, typeorm_1.Column)({ name: 'winner_supplier_id', type: 'uuid', nullable: true }), __metadata("design:type", String) ], ComparativoCotizaciones.prototype, "winnerSupplierId", void 0); __decorate([ (0, typeorm_1.Column)({ name: 'approved_by', type: 'uuid', nullable: true }), __metadata("design:type", String) ], ComparativoCotizaciones.prototype, "approvedById", void 0); __decorate([ (0, typeorm_1.Column)({ name: 'approved_at', type: 'timestamptz', nullable: true }), __metadata("design:type", Date) ], ComparativoCotizaciones.prototype, "approvedAt", void 0); __decorate([ (0, typeorm_1.Column)({ type: 'text', nullable: true }), __metadata("design:type", String) ], ComparativoCotizaciones.prototype, "notes", void 0); __decorate([ (0, typeorm_1.CreateDateColumn)({ name: 'created_at', type: 'timestamptz' }), __metadata("design:type", Date) ], ComparativoCotizaciones.prototype, "createdAt", void 0); __decorate([ (0, typeorm_1.Column)({ name: 'created_by', type: 'uuid', nullable: true }), __metadata("design:type", String) ], ComparativoCotizaciones.prototype, "createdById", void 0); __decorate([ (0, typeorm_1.UpdateDateColumn)({ name: 'updated_at', type: 'timestamptz' }), __metadata("design:type", Date) ], ComparativoCotizaciones.prototype, "updatedAt", void 0); __decorate([ (0, typeorm_1.Column)({ name: 'updated_by', type: 'uuid', nullable: true }), __metadata("design:type", String) ], ComparativoCotizaciones.prototype, "updatedById", void 0); __decorate([ (0, typeorm_1.Column)({ name: 'deleted_at', type: 'timestamptz', nullable: true }), __metadata("design:type", Date) ], ComparativoCotizaciones.prototype, "deletedAt", void 0); __decorate([ (0, typeorm_1.Column)({ name: 'deleted_by', type: 'uuid', nullable: true }), __metadata("design:type", String) ], ComparativoCotizaciones.prototype, "deletedById", 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) ], ComparativoCotizaciones.prototype, "tenant", void 0); __decorate([ (0, typeorm_1.ManyToOne)(() => requisicion_obra_entity_1.RequisicionObra), (0, typeorm_1.JoinColumn)({ name: 'requisicion_id' }), __metadata("design:type", requisicion_obra_entity_1.RequisicionObra) ], ComparativoCotizaciones.prototype, "requisicion", void 0); __decorate([ (0, typeorm_1.ManyToOne)(() => user_entity_1.User), (0, typeorm_1.JoinColumn)({ name: 'approved_by' }), __metadata("design:type", user_entity_1.User) ], ComparativoCotizaciones.prototype, "approvedBy", 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) ], ComparativoCotizaciones.prototype, "createdBy", void 0); __decorate([ (0, typeorm_1.OneToMany)(() => comparativo_proveedor_entity_1.ComparativoProveedor, (cp) => cp.comparativo), __metadata("design:type", Array) ], ComparativoCotizaciones.prototype, "proveedores", void 0); exports.ComparativoCotizaciones = ComparativoCotizaciones = __decorate([ (0, typeorm_1.Entity)({ schema: 'purchase', name: 'comparativo_cotizaciones' }), (0, typeorm_1.Index)(['tenantId', 'code'], { unique: true }) ], ComparativoCotizaciones); //# sourceMappingURL=comparativo-cotizaciones.entity.js.map