"use strict";
/**
 * ComparativoProveedor Entity
 * Proveedores participantes en comparativo
 *
 * @module Purchase
 * @table purchase.comparativo_proveedores
 * @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.ComparativoProveedor = 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 comparativo_cotizaciones_entity_1 = require("./comparativo-cotizaciones.entity");
const comparativo_producto_entity_1 = require("./comparativo-producto.entity");
let ComparativoProveedor = class ComparativoProveedor {
    id;
    tenantId;
    comparativoId;
    supplierId;
    quotationNumber;
    quotationDate;
    deliveryDays;
    paymentConditions;
    totalAmount;
    isSelected;
    evaluationNotes;
    createdAt;
    createdById;
    updatedAt;
    updatedById;
    // Relations
    tenant;
    comparativo;
    createdBy;
    productos;
};
exports.ComparativoProveedor = ComparativoProveedor;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], ComparativoProveedor.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.Column)({ name: 'tenant_id', type: 'uuid' }),
    __metadata("design:type", String)
], ComparativoProveedor.prototype, "tenantId", void 0);
__decorate([
    (0, typeorm_1.Column)({ name: 'comparativo_id', type: 'uuid' }),
    __metadata("design:type", String)
], ComparativoProveedor.prototype, "comparativoId", void 0);
__decorate([
    (0, typeorm_1.Column)({ name: 'supplier_id', type: 'uuid' }),
    __metadata("design:type", String)
], ComparativoProveedor.prototype, "supplierId", void 0);
__decorate([
    (0, typeorm_1.Column)({ name: 'quotation_number', type: 'varchar', length: 50, nullable: true }),
    __metadata("design:type", String)
], ComparativoProveedor.prototype, "quotationNumber", void 0);
__decorate([
    (0, typeorm_1.Column)({ name: 'quotation_date', type: 'date', nullable: true }),
    __metadata("design:type", Date)
], ComparativoProveedor.prototype, "quotationDate", void 0);
__decorate([
    (0, typeorm_1.Column)({ name: 'delivery_days', type: 'integer', nullable: true }),
    __metadata("design:type", Number)
], ComparativoProveedor.prototype, "deliveryDays", void 0);
__decorate([
    (0, typeorm_1.Column)({ name: 'payment_conditions', type: 'varchar', length: 100, nullable: true }),
    __metadata("design:type", String)
], ComparativoProveedor.prototype, "paymentConditions", void 0);
__decorate([
    (0, typeorm_1.Column)({ name: 'total_amount', type: 'decimal', precision: 16, scale: 2, nullable: true }),
    __metadata("design:type", Number)
], ComparativoProveedor.prototype, "totalAmount", void 0);
__decorate([
    (0, typeorm_1.Column)({ name: 'is_selected', type: 'boolean', default: false }),
    __metadata("design:type", Boolean)
], ComparativoProveedor.prototype, "isSelected", void 0);
__decorate([
    (0, typeorm_1.Column)({ name: 'evaluation_notes', type: 'text', nullable: true }),
    __metadata("design:type", String)
], ComparativoProveedor.prototype, "evaluationNotes", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ name: 'created_at', type: 'timestamptz' }),
    __metadata("design:type", Date)
], ComparativoProveedor.prototype, "createdAt", void 0);
__decorate([
    (0, typeorm_1.Column)({ name: 'created_by', type: 'uuid', nullable: true }),
    __metadata("design:type", String)
], ComparativoProveedor.prototype, "createdById", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)({ name: 'updated_at', type: 'timestamptz' }),
    __metadata("design:type", Date)
], ComparativoProveedor.prototype, "updatedAt", void 0);
__decorate([
    (0, typeorm_1.Column)({ name: 'updated_by', type: 'uuid', nullable: true }),
    __metadata("design:type", String)
], ComparativoProveedor.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)
], ComparativoProveedor.prototype, "tenant", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => comparativo_cotizaciones_entity_1.ComparativoCotizaciones, (c) => c.proveedores, { onDelete: 'CASCADE' }),
    (0, typeorm_1.JoinColumn)({ name: 'comparativo_id' }),
    __metadata("design:type", comparativo_cotizaciones_entity_1.ComparativoCotizaciones)
], ComparativoProveedor.prototype, "comparativo", 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)
], ComparativoProveedor.prototype, "createdBy", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => comparativo_producto_entity_1.ComparativoProducto, (cp) => cp.comparativoProveedor),
    __metadata("design:type", Array)
], ComparativoProveedor.prototype, "productos", void 0);
exports.ComparativoProveedor = ComparativoProveedor = __decorate([
    (0, typeorm_1.Entity)({ schema: 'purchase', name: 'comparativo_proveedores' })
], ComparativoProveedor);
//# sourceMappingURL=comparativo-proveedor.entity.js.map