"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "FloorPosition", {
    enumerable: true,
    get: function() {
        return FloorPosition;
    }
});
const _typeorm = require("typeorm");
const _floorentity = require("./floor.entity");
const _printerentity = require("./printer.entity");
function _ts_decorate(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;
}
function _ts_metadata(k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
}
class FloorPosition {
    id;
    x;
    y;
    floor;
    floorId;
    printer;
    printerId;
}
_ts_decorate([
    (0, _typeorm.PrimaryGeneratedColumn)(),
    _ts_metadata("design:type", Number)
], FloorPosition.prototype, "id", void 0);
_ts_decorate([
    (0, _typeorm.Column)(),
    _ts_metadata("design:type", Number)
], FloorPosition.prototype, "x", void 0);
_ts_decorate([
    (0, _typeorm.Column)(),
    _ts_metadata("design:type", Number)
], FloorPosition.prototype, "y", void 0);
_ts_decorate([
    (0, _typeorm.ManyToOne)(()=>_floorentity.Floor, {
        onDelete: "CASCADE",
        nullable: false
    }),
    _ts_metadata("design:type", typeof _typeorm.Relation === "undefined" ? Object : _typeorm.Relation)
], FloorPosition.prototype, "floor", void 0);
_ts_decorate([
    (0, _typeorm.Column)(),
    _ts_metadata("design:type", Number)
], FloorPosition.prototype, "floorId", void 0);
_ts_decorate([
    (0, _typeorm.OneToOne)(()=>_printerentity.Printer, {
        onDelete: "CASCADE",
        nullable: false
    }),
    (0, _typeorm.JoinColumn)({
        name: "printerId"
    }),
    _ts_metadata("design:type", typeof _typeorm.Relation === "undefined" ? Object : _typeorm.Relation)
], FloorPosition.prototype, "printer", void 0);
_ts_decorate([
    (0, _typeorm.Column)(),
    _ts_metadata("design:type", Number)
], FloorPosition.prototype, "printerId", void 0);
FloorPosition = _ts_decorate([
    (0, _typeorm.Entity)(),
    (0, _typeorm.Unique)([
        "x",
        "y",
        "floorId"
    ])
], FloorPosition);

//# sourceMappingURL=floor-position.entity.js.map