"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ProcessGroup = void 0;
const tslib_1 = require("tslib");
const typeorm_1 = require("typeorm");
const type_graphql_1 = require("type-graphql");
const shell_1 = require("@things-factory/shell");
const auth_base_1 = require("@things-factory/auth-base");
const process_1 = require("../process/process");
let ProcessGroup = class ProcessGroup {
};
tslib_1.__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    (0, type_graphql_1.Field)(type => type_graphql_1.ID),
    tslib_1.__metadata("design:type", String)
], ProcessGroup.prototype, "id", void 0);
tslib_1.__decorate([
    (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
    (0, type_graphql_1.Field)({ nullable: true }),
    tslib_1.__metadata("design:type", shell_1.Domain)
], ProcessGroup.prototype, "domain", void 0);
tslib_1.__decorate([
    (0, typeorm_1.RelationId)((group) => group.domain),
    tslib_1.__metadata("design:type", String)
], ProcessGroup.prototype, "domainId", void 0);
tslib_1.__decorate([
    (0, typeorm_1.Column)(),
    (0, type_graphql_1.Field)(),
    tslib_1.__metadata("design:type", String)
], ProcessGroup.prototype, "name", void 0);
tslib_1.__decorate([
    (0, typeorm_1.Column)({
        nullable: true
    }),
    (0, type_graphql_1.Field)({ nullable: true }),
    tslib_1.__metadata("design:type", String)
], ProcessGroup.prototype, "description", void 0);
tslib_1.__decorate([
    (0, typeorm_1.OneToMany)(type => process_1.Process, process => process.group),
    (0, type_graphql_1.Field)(type => [process_1.Process], { nullable: true }),
    tslib_1.__metadata("design:type", Array)
], ProcessGroup.prototype, "processes", void 0);
tslib_1.__decorate([
    (0, typeorm_1.CreateDateColumn)(),
    (0, type_graphql_1.Field)({ nullable: true }),
    tslib_1.__metadata("design:type", Date)
], ProcessGroup.prototype, "createdAt", void 0);
tslib_1.__decorate([
    (0, typeorm_1.UpdateDateColumn)(),
    (0, type_graphql_1.Field)({ nullable: true }),
    tslib_1.__metadata("design:type", Date)
], ProcessGroup.prototype, "updatedAt", void 0);
tslib_1.__decorate([
    (0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
        nullable: true
    }),
    (0, type_graphql_1.Field)({ nullable: true }),
    tslib_1.__metadata("design:type", auth_base_1.User)
], ProcessGroup.prototype, "creator", void 0);
tslib_1.__decorate([
    (0, typeorm_1.RelationId)((group) => group.creator),
    tslib_1.__metadata("design:type", String)
], ProcessGroup.prototype, "creatorId", void 0);
tslib_1.__decorate([
    (0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
        nullable: true
    }),
    (0, type_graphql_1.Field)({ nullable: true }),
    tslib_1.__metadata("design:type", auth_base_1.User)
], ProcessGroup.prototype, "updater", void 0);
tslib_1.__decorate([
    (0, typeorm_1.RelationId)((group) => group.updater),
    tslib_1.__metadata("design:type", String)
], ProcessGroup.prototype, "updaterId", void 0);
ProcessGroup = tslib_1.__decorate([
    (0, typeorm_1.Entity)(),
    (0, typeorm_1.Index)('ix_process_group_0', (group) => [group.domain, group.name], { unique: true }),
    (0, type_graphql_1.ObjectType)({ description: 'Entity for Process Management ProcessGroup' })
], ProcessGroup);
exports.ProcessGroup = ProcessGroup;
//# sourceMappingURL=process-group.js.map