"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);
};
var _a, _b, _c;
Object.defineProperty(exports, "__esModule", { value: true });
exports.RouteLabelSequenceCounter = void 0;
const typeorm_1 = require("typeorm");
const shell_1 = require("@things-factory/shell");
const auth_base_1 = require("@things-factory/auth-base");
let RouteLabelSequenceCounter = class RouteLabelSequenceCounter {
};
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], RouteLabelSequenceCounter.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
    __metadata("design:type", typeof (_a = typeof shell_1.Domain !== "undefined" && shell_1.Domain) === "function" ? _a : Object)
], RouteLabelSequenceCounter.prototype, "domain", void 0);
__decorate([
    (0, typeorm_1.RelationId)((c) => c.domain),
    __metadata("design:type", String)
], RouteLabelSequenceCounter.prototype, "domainId", void 0);
__decorate([
    (0, typeorm_1.Column)(),
    __metadata("design:type", String)
], RouteLabelSequenceCounter.prototype, "releaseGoodId", void 0);
__decorate([
    (0, typeorm_1.Column)(),
    __metadata("design:type", String)
], RouteLabelSequenceCounter.prototype, "field", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'int', default: 0 }),
    __metadata("design:type", Number)
], RouteLabelSequenceCounter.prototype, "lastSeq", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)(),
    __metadata("design:type", Date)
], RouteLabelSequenceCounter.prototype, "createdAt", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)(),
    __metadata("design:type", Date)
], RouteLabelSequenceCounter.prototype, "updatedAt", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
    __metadata("design:type", typeof (_b = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _b : Object)
], RouteLabelSequenceCounter.prototype, "creator", void 0);
__decorate([
    (0, typeorm_1.RelationId)((c) => c.creator),
    __metadata("design:type", String)
], RouteLabelSequenceCounter.prototype, "creatorId", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
    __metadata("design:type", typeof (_c = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _c : Object)
], RouteLabelSequenceCounter.prototype, "updater", void 0);
__decorate([
    (0, typeorm_1.RelationId)((c) => c.updater),
    __metadata("design:type", String)
], RouteLabelSequenceCounter.prototype, "updaterId", void 0);
RouteLabelSequenceCounter = __decorate([
    (0, typeorm_1.Entity)('route_label_sequence_counters'),
    (0, typeorm_1.Index)('ix_route_label_sequence_counters_0', (c) => [c.domain, c.releaseGoodId, c.field], {
        unique: true
    }),
    (0, typeorm_1.Index)('ix_route_label_sequence_counters_1', (c) => [c.domain, c.field])
], RouteLabelSequenceCounter);
exports.RouteLabelSequenceCounter = RouteLabelSequenceCounter;
//# sourceMappingURL=route-label-sequence-counter.js.map