"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.StockMovement = void 0;
const typeorm_1 = require("typeorm");
const stock_entity_1 = require("./stock.entity");
let StockMovement = class StockMovement {
    id;
    stock;
    movement_type;
    quantity;
    reference_type;
    reference_id;
    created_at;
};
exports.StockMovement = StockMovement;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)(),
    __metadata("design:type", Number)
], StockMovement.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => stock_entity_1.Stock, (stock) => stock.movements, {
        onDelete: "CASCADE",
    }),
    (0, typeorm_1.JoinColumn)({ name: "stock_id" }),
    __metadata("design:type", stock_entity_1.Stock)
], StockMovement.prototype, "stock", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: "enum", enum: ["NEW", "SALE", "RETURN"] }),
    __metadata("design:type", String)
], StockMovement.prototype, "movement_type", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: "int" }),
    __metadata("design:type", Number)
], StockMovement.prototype, "quantity", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: "varchar", length: 50, nullable: true }),
    __metadata("design:type", Object)
], StockMovement.prototype, "reference_type", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: "int", nullable: true }),
    __metadata("design:type", Object)
], StockMovement.prototype, "reference_id", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)(),
    __metadata("design:type", Date)
], StockMovement.prototype, "created_at", void 0);
exports.StockMovement = StockMovement = __decorate([
    (0, typeorm_1.Entity)("stock_movements")
], StockMovement);
//# sourceMappingURL=stock-movement.entity.js.map