"use strict";
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.SupplierProductSize = void 0;
const typeorm_1 = require("typeorm");
const supplier_product_entity_1 = require("./supplier-product.entity");
const size_entity_1 = require("./size.entity");
const color_entity_1 = require("./color.entity");
let SupplierProductSize = class SupplierProductSize {
    id;
    supplier_product_id;
    size_id;
    quantity;
    color_id;
    color;
    supplierProduct;
    size;
};
exports.SupplierProductSize = SupplierProductSize;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)(),
    __metadata("design:type", Number)
], SupplierProductSize.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.Column)(),
    __metadata("design:type", Number)
], SupplierProductSize.prototype, "supplier_product_id", void 0);
__decorate([
    (0, typeorm_1.Column)(),
    __metadata("design:type", Number)
], SupplierProductSize.prototype, "size_id", void 0);
__decorate([
    (0, typeorm_1.Column)(),
    __metadata("design:type", Number)
], SupplierProductSize.prototype, "quantity", void 0);
__decorate([
    (0, typeorm_1.Column)({ name: "color_id", nullable: true }),
    __metadata("design:type", Object)
], SupplierProductSize.prototype, "color_id", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => color_entity_1.Color, (color) => color.supplierProductSizes, {
        onDelete: "RESTRICT",
        nullable: true,
    }),
    (0, typeorm_1.JoinColumn)({ name: "color_id" }),
    __metadata("design:type", Object)
], SupplierProductSize.prototype, "color", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => supplier_product_entity_1.SupplierProduct, (supplierProduct) => supplierProduct.sizes, { onDelete: "CASCADE" }),
    (0, typeorm_1.JoinColumn)({ name: "supplier_product_id" }),
    __metadata("design:type", supplier_product_entity_1.SupplierProduct)
], SupplierProductSize.prototype, "supplierProduct", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => size_entity_1.Size, (size) => size.supplierProductSizes, {
        onDelete: "RESTRICT",
    }),
    (0, typeorm_1.JoinColumn)({ name: "size_id" }),
    __metadata("design:type", size_entity_1.Size)
], SupplierProductSize.prototype, "size", void 0);
exports.SupplierProductSize = SupplierProductSize = __decorate([
    (0, typeorm_1.Entity)("supplier_product_sizes")
], SupplierProductSize);
//# sourceMappingURL=supplier-product-size.entity.js.map