"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Notification = exports.NotificationStatus = 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");
var NotificationStatus;
(function (NotificationStatus) {
    NotificationStatus["NOTREAD"] = "UNREAD";
    NotificationStatus["READ"] = "READ";
})(NotificationStatus || (exports.NotificationStatus = NotificationStatus = {}));
(0, type_graphql_1.registerEnumType)(NotificationStatus, {
    name: 'NotificationStatus',
    description: 'state enumeration of a notification'
});
let Notification = class Notification {
};
exports.Notification = Notification;
tslib_1.__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    (0, type_graphql_1.Field)(type => type_graphql_1.ID),
    tslib_1.__metadata("design:type", String)
], Notification.prototype, "id", void 0);
tslib_1.__decorate([
    (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
    (0, type_graphql_1.Field)(type => shell_1.Domain),
    tslib_1.__metadata("design:type", shell_1.Domain)
], Notification.prototype, "domain", void 0);
tslib_1.__decorate([
    (0, typeorm_1.RelationId)((notification) => notification.domain),
    tslib_1.__metadata("design:type", String)
], Notification.prototype, "domainId", void 0);
tslib_1.__decorate([
    (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
    (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
    tslib_1.__metadata("design:type", auth_base_1.User)
], Notification.prototype, "owner", void 0);
tslib_1.__decorate([
    (0, typeorm_1.RelationId)((notification) => notification.owner),
    tslib_1.__metadata("design:type", String)
], Notification.prototype, "ownerId", void 0);
tslib_1.__decorate([
    (0, typeorm_1.Column)({ nullable: true }),
    (0, type_graphql_1.Field)({ nullable: true }),
    tslib_1.__metadata("design:type", String)
], Notification.prototype, "type", void 0);
tslib_1.__decorate([
    (0, typeorm_1.Column)({ nullable: true }),
    (0, type_graphql_1.Field)({ nullable: true }),
    tslib_1.__metadata("design:type", String)
], Notification.prototype, "subject", void 0);
tslib_1.__decorate([
    (0, typeorm_1.Column)({ nullable: true }),
    (0, type_graphql_1.Field)({ nullable: true }),
    tslib_1.__metadata("design:type", String)
], Notification.prototype, "title", void 0);
tslib_1.__decorate([
    (0, typeorm_1.Column)({ nullable: true }),
    (0, type_graphql_1.Field)({ nullable: true }),
    tslib_1.__metadata("design:type", String)
], Notification.prototype, "body", void 0);
tslib_1.__decorate([
    (0, typeorm_1.Column)({ nullable: true }),
    (0, type_graphql_1.Field)({ nullable: true }),
    tslib_1.__metadata("design:type", String)
], Notification.prototype, "url", void 0);
tslib_1.__decorate([
    (0, typeorm_1.Column)({ nullable: true }),
    (0, type_graphql_1.Field)({ nullable: true }),
    tslib_1.__metadata("design:type", String)
], Notification.prototype, "image", void 0);
tslib_1.__decorate([
    (0, typeorm_1.Column)({ nullable: true }),
    (0, type_graphql_1.Field)({ nullable: true }),
    tslib_1.__metadata("design:type", String)
], Notification.prototype, "state", void 0);
tslib_1.__decorate([
    (0, typeorm_1.Column)('simple-json', { nullable: true }),
    (0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true }),
    tslib_1.__metadata("design:type", Object)
], Notification.prototype, "property", void 0);
tslib_1.__decorate([
    (0, typeorm_1.Column)('date', { nullable: true }),
    (0, type_graphql_1.Field)(type => shell_1.ScalarDate, { nullable: true }),
    tslib_1.__metadata("design:type", Date)
], Notification.prototype, "timestamp", void 0);
tslib_1.__decorate([
    (0, typeorm_1.CreateDateColumn)(),
    (0, type_graphql_1.Field)({ nullable: true }),
    tslib_1.__metadata("design:type", Date)
], Notification.prototype, "createdAt", void 0);
tslib_1.__decorate([
    (0, typeorm_1.UpdateDateColumn)(),
    (0, type_graphql_1.Field)({ nullable: true }),
    tslib_1.__metadata("design:type", Date)
], Notification.prototype, "updatedAt", void 0);
tslib_1.__decorate([
    (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
    (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
    tslib_1.__metadata("design:type", auth_base_1.User)
], Notification.prototype, "creator", void 0);
tslib_1.__decorate([
    (0, typeorm_1.RelationId)((notification) => notification.creator),
    tslib_1.__metadata("design:type", String)
], Notification.prototype, "creatorId", void 0);
tslib_1.__decorate([
    (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
    (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
    tslib_1.__metadata("design:type", auth_base_1.User)
], Notification.prototype, "updater", void 0);
tslib_1.__decorate([
    (0, typeorm_1.RelationId)((notification) => notification.updater),
    tslib_1.__metadata("design:type", String)
], Notification.prototype, "updaterId", void 0);
exports.Notification = Notification = tslib_1.__decorate([
    (0, typeorm_1.Entity)(),
    (0, typeorm_1.Index)('ix_notification_0', (notification) => [notification.domain, notification.type], { unique: false }),
    (0, type_graphql_1.ObjectType)({ description: 'Entity for Notification' })
], Notification);
//# sourceMappingURL=notification.js.map