"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.ModelSequence = void 0;
const openapi = require("@nestjs/swagger");
const common_entity_1 = require("./common.entity");
const typeorm_1 = require("typeorm");
const module_metadata_entity_1 = require("./module-metadata.entity");
const model_metadata_entity_1 = require("./model-metadata.entity");
const field_metadata_entity_1 = require("./field-metadata.entity");
let ModelSequence = class ModelSequence extends common_entity_1.CommonEntity {
    static _OPENAPI_METADATA_FACTORY() {
        return { module: { required: true, type: () => require("./module-metadata.entity").ModuleMetadata }, model: { required: true, type: () => require("./model-metadata.entity").ModelMetadata }, field: { required: true, type: () => require("./field-metadata.entity").FieldMetadata }, sequenceName: { required: true, type: () => String }, currentValue: { required: true, type: () => Number }, prefix: { required: true, type: () => String }, padding: { required: true, type: () => Number }, separator: { required: true, type: () => String } };
    }
};
exports.ModelSequence = ModelSequence;
__decorate([
    (0, typeorm_1.Index)(),
    (0, typeorm_1.ManyToOne)(() => module_metadata_entity_1.ModuleMetadata, { nullable: false }),
    (0, typeorm_1.JoinColumn)(),
    __metadata("design:type", module_metadata_entity_1.ModuleMetadata)
], ModelSequence.prototype, "module", void 0);
__decorate([
    (0, typeorm_1.Index)(),
    (0, typeorm_1.ManyToOne)(() => model_metadata_entity_1.ModelMetadata, { nullable: false }),
    (0, typeorm_1.JoinColumn)(),
    __metadata("design:type", model_metadata_entity_1.ModelMetadata)
], ModelSequence.prototype, "model", void 0);
__decorate([
    (0, typeorm_1.Index)(),
    (0, typeorm_1.ManyToOne)(() => field_metadata_entity_1.FieldMetadata, { nullable: false }),
    (0, typeorm_1.JoinColumn)(),
    __metadata("design:type", field_metadata_entity_1.FieldMetadata)
], ModelSequence.prototype, "field", void 0);
__decorate([
    (0, typeorm_1.Index)({ unique: true }),
    (0, typeorm_1.Column)({ type: "varchar" }),
    __metadata("design:type", String)
], ModelSequence.prototype, "sequenceName", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: "integer", default: 1 }),
    __metadata("design:type", Number)
], ModelSequence.prototype, "currentValue", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: "varchar", nullable: true }),
    __metadata("design:type", String)
], ModelSequence.prototype, "prefix", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: "integer", default: 5 }),
    __metadata("design:type", Number)
], ModelSequence.prototype, "padding", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: "varchar", default: "" }),
    __metadata("design:type", String)
], ModelSequence.prototype, "separator", void 0);
exports.ModelSequence = ModelSequence = __decorate([
    (0, typeorm_1.Entity)('ss_model_sequence')
], ModelSequence);
//# sourceMappingURL=model-sequence.entity.js.map