"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "PrinterMaintenanceLog", {
    enumerable: true,
    get: function() {
        return PrinterMaintenanceLog;
    }
});
const _typeorm = require("typeorm");
const _printerentity = require("./printer.entity");
const _userentity = require("./user.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 PrinterMaintenanceLog {
    id;
    createdAt;
    createdBy;
    createdByUser;
    createdByUserId;
    printer;
    printerId;
    printerName;
    printerUrl;
    metadata;
    completed;
    completedAt;
    completedByUser;
    completedByUserId;
    completedBy;
}
_ts_decorate([
    (0, _typeorm.PrimaryGeneratedColumn)(),
    _ts_metadata("design:type", Number)
], PrinterMaintenanceLog.prototype, "id", void 0);
_ts_decorate([
    (0, _typeorm.CreateDateColumn)(),
    _ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
], PrinterMaintenanceLog.prototype, "createdAt", void 0);
_ts_decorate([
    (0, _typeorm.Column)({
        nullable: false
    }),
    _ts_metadata("design:type", String)
], PrinterMaintenanceLog.prototype, "createdBy", void 0);
_ts_decorate([
    (0, _typeorm.ManyToOne)(()=>_userentity.User, {
        onDelete: "SET NULL",
        nullable: true
    }),
    _ts_metadata("design:type", Object)
], PrinterMaintenanceLog.prototype, "createdByUser", void 0);
_ts_decorate([
    (0, _typeorm.Column)({
        nullable: true
    }),
    _ts_metadata("design:type", Object)
], PrinterMaintenanceLog.prototype, "createdByUserId", void 0);
_ts_decorate([
    (0, _typeorm.ManyToOne)(()=>_printerentity.Printer, {
        onDelete: "SET NULL",
        nullable: true
    }),
    _ts_metadata("design:type", Object)
], PrinterMaintenanceLog.prototype, "printer", void 0);
_ts_decorate([
    (0, _typeorm.Column)({
        nullable: true
    }),
    _ts_metadata("design:type", Object)
], PrinterMaintenanceLog.prototype, "printerId", void 0);
_ts_decorate([
    (0, _typeorm.Column)({
        nullable: false
    }),
    _ts_metadata("design:type", String)
], PrinterMaintenanceLog.prototype, "printerName", void 0);
_ts_decorate([
    (0, _typeorm.Column)({
        nullable: false
    }),
    _ts_metadata("design:type", String)
], PrinterMaintenanceLog.prototype, "printerUrl", void 0);
_ts_decorate([
    (0, _typeorm.Column)({
        nullable: false,
        type: "json",
        default: "{}"
    }),
    _ts_metadata("design:type", Object)
], PrinterMaintenanceLog.prototype, "metadata", void 0);
_ts_decorate([
    (0, _typeorm.Column)({
        nullable: false,
        default: false
    }),
    _ts_metadata("design:type", Boolean)
], PrinterMaintenanceLog.prototype, "completed", void 0);
_ts_decorate([
    (0, _typeorm.Column)({
        nullable: true
    }),
    _ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
], PrinterMaintenanceLog.prototype, "completedAt", void 0);
_ts_decorate([
    (0, _typeorm.ManyToOne)(()=>_userentity.User, {
        onDelete: "SET NULL",
        nullable: true
    }),
    _ts_metadata("design:type", Object)
], PrinterMaintenanceLog.prototype, "completedByUser", void 0);
_ts_decorate([
    (0, _typeorm.Column)({
        nullable: true
    }),
    _ts_metadata("design:type", Object)
], PrinterMaintenanceLog.prototype, "completedByUserId", void 0);
_ts_decorate([
    (0, _typeorm.Column)({
        nullable: true
    }),
    _ts_metadata("design:type", String)
], PrinterMaintenanceLog.prototype, "completedBy", void 0);
PrinterMaintenanceLog = _ts_decorate([
    (0, _typeorm.Entity)(),
    (0, _typeorm.Index)([
        "printerId"
    ], {
        unique: true,
        where: "completed = 0"
    })
], PrinterMaintenanceLog);

//# sourceMappingURL=printer-maintenance-log.entity.js.map