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);
};
import Project from "./Project";
import Incident from "./Incident";
import Alert from "./Alert";
import AlertEpisode from "./AlertEpisode";
import IncidentEpisode from "./IncidentEpisode";
import Monitor from "./Monitor";
import ScheduledMaintenance from "./ScheduledMaintenance";
import StatusPage from "./StatusPage";
import StatusPageAnnouncement from "./StatusPageAnnouncement";
import User from "./User";
import OnCallDutyPolicy from "./OnCallDutyPolicy";
import OnCallDutyPolicyEscalationRule from "./OnCallDutyPolicyEscalationRule";
import OnCallDutyPolicySchedule from "./OnCallDutyPolicySchedule";
import Team from "./Team";
import BaseModel from "./DatabaseBaseModel/DatabaseBaseModel";
import Route from "../../Types/API/Route";
import ColumnAccessControl from "../../Types/Database/AccessControl/ColumnAccessControl";
import TableAccessControl from "../../Types/Database/AccessControl/TableAccessControl";
import ColumnLength from "../../Types/Database/ColumnLength";
import ColumnType from "../../Types/Database/ColumnType";
import CrudApiEndpoint from "../../Types/Database/CrudApiEndpoint";
import EnableDocumentation from "../../Types/Database/EnableDocumentation";
import EnableWorkflow from "../../Types/Database/EnableWorkflow";
import TableColumn from "../../Types/Database/TableColumn";
import TableColumnType from "../../Types/Database/TableColumnType";
import TableMetadata from "../../Types/Database/TableMetadata";
import TenantColumn from "../../Types/Database/TenantColumn";
import IconProp from "../../Types/Icon/IconProp";
import ObjectID from "../../Types/ObjectID";
import Permission from "../../Types/Permission";
import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
import WorkspaceType from "../../Types/Workspace/WorkspaceType";
import WorkspaceNotificationStatus from "../../Types/Workspace/WorkspaceNotificationStatus";
import WorkspaceNotificationActionType from "../../Types/Workspace/WorkspaceNotificationActionType";
let WorkspaceNotificationLog = class WorkspaceNotificationLog extends BaseModel {
    constructor() {
        super(...arguments);
        this.project = undefined;
        this.projectId = undefined;
        this.workspaceType = undefined;
        this.channelId = undefined;
        this.channelName = undefined;
        this.threadId = undefined;
        this.message = undefined;
        this.statusMessage = undefined;
        this.status = undefined;
        this.actionType = undefined;
        // Relations to resources that triggered this message (nullable)
        this.incident = undefined;
        this.incidentId = undefined;
        this.user = undefined;
        this.userId = undefined;
        this.alert = undefined;
        this.alertId = undefined;
        this.monitor = undefined;
        this.monitorId = undefined;
        this.alertEpisode = undefined;
        this.alertEpisodeId = undefined;
        this.incidentEpisode = undefined;
        this.incidentEpisodeId = undefined;
        this.scheduledMaintenance = undefined;
        this.scheduledMaintenanceId = undefined;
        this.statusPage = undefined;
        this.statusPageId = undefined;
        this.statusPageAnnouncement = undefined;
        this.statusPageAnnouncementId = undefined;
        this.onCallDutyPolicy = undefined;
        this.onCallDutyPolicyId = undefined;
        this.onCallDutyPolicyEscalationRule = undefined;
        this.onCallDutyPolicyEscalationRuleId = undefined;
        this.onCallDutyPolicySchedule = undefined;
        this.onCallDutyPolicyScheduleId = undefined;
        this.team = undefined;
        this.teamId = undefined;
        this.deletedByUser = undefined;
        this.deletedByUserId = undefined;
    }
};
__decorate([
    ColumnAccessControl({
        create: [],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ReadWorkspaceNotificationLog,
        ],
        update: [],
    }),
    TableColumn({
        manyToOneRelationColumn: "projectId",
        type: TableColumnType.Entity,
        modelType: Project,
        title: "Project",
        description: "Relation to Project Resource in which this object belongs",
    }),
    ManyToOne(() => {
        return Project;
    }, {
        eager: false,
        nullable: true,
        onDelete: "CASCADE",
        orphanedRowAction: "nullify",
    }),
    JoinColumn({ name: "projectId" }),
    __metadata("design:type", Project)
], WorkspaceNotificationLog.prototype, "project", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ReadWorkspaceNotificationLog,
        ],
        update: [],
    }),
    Index(),
    TableColumn({
        type: TableColumnType.ObjectID,
        required: true,
        canReadOnRelationQuery: true,
        title: "Project ID",
        description: "ID of your OneUptime Project in which this object belongs",
    }),
    Column({
        type: ColumnType.ObjectID,
        nullable: false,
        transformer: ObjectID.getDatabaseTransformer(),
    }),
    __metadata("design:type", ObjectID)
], WorkspaceNotificationLog.prototype, "projectId", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ReadWorkspaceNotificationLog,
        ],
        update: [],
    }),
    TableColumn({
        required: true,
        type: TableColumnType.ShortText,
        title: "Workspace Type",
        description: "Type of Workspace - Slack, Microsoft Teams",
        canReadOnRelationQuery: false,
    }),
    Column({
        nullable: false,
        type: ColumnType.ShortText,
        length: ColumnLength.ShortText,
    }),
    __metadata("design:type", String)
], WorkspaceNotificationLog.prototype, "workspaceType", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ReadWorkspaceNotificationLog,
        ],
        update: [],
    }),
    TableColumn({
        required: false,
        type: TableColumnType.ShortText,
        title: "Channel ID",
        description: "Channel ID where the message was sent",
        canReadOnRelationQuery: false,
    }),
    Column({
        nullable: true,
        type: ColumnType.ShortText,
        length: ColumnLength.ShortText,
    }),
    __metadata("design:type", String)
], WorkspaceNotificationLog.prototype, "channelId", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ReadWorkspaceNotificationLog,
        ],
        update: [],
    }),
    TableColumn({
        required: false,
        type: TableColumnType.ShortText,
        title: "Channel Name",
        description: "Channel Name where the message was sent",
        canReadOnRelationQuery: false,
    }),
    Column({
        nullable: true,
        type: ColumnType.ShortText,
        length: ColumnLength.ShortText,
    }),
    __metadata("design:type", String)
], WorkspaceNotificationLog.prototype, "channelName", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ReadWorkspaceNotificationLog,
        ],
        update: [],
    }),
    TableColumn({
        required: false,
        type: TableColumnType.ShortText,
        title: "Thread ID",
        description: "Thread ID of the message in the channel (if any)",
        canReadOnRelationQuery: false,
    }),
    Column({
        nullable: true,
        type: ColumnType.ShortText,
        length: ColumnLength.ShortText,
    }),
    __metadata("design:type", String)
], WorkspaceNotificationLog.prototype, "threadId", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ReadWorkspaceNotificationLog,
        ],
        update: [],
    }),
    TableColumn({
        required: false,
        type: TableColumnType.VeryLongText,
        title: "Message",
        description: "Content of the message",
        canReadOnRelationQuery: false,
    }),
    Column({
        nullable: true,
        type: ColumnType.VeryLongText,
    }),
    __metadata("design:type", String)
], WorkspaceNotificationLog.prototype, "message", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ReadWorkspaceNotificationLog,
        ],
        update: [],
    }),
    TableColumn({
        required: false,
        type: TableColumnType.LongText,
        title: "Status Message",
        description: "Status Message (if any)",
        canReadOnRelationQuery: false,
    }),
    Column({
        nullable: true,
        type: ColumnType.LongText,
        length: ColumnLength.LongText,
    }),
    __metadata("design:type", String)
], WorkspaceNotificationLog.prototype, "statusMessage", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ReadWorkspaceNotificationLog,
        ],
        update: [],
    }),
    TableColumn({
        required: true,
        type: TableColumnType.ShortText,
        title: "Status",
        description: "Status of the message",
        canReadOnRelationQuery: false,
    }),
    Column({
        nullable: false,
        type: ColumnType.ShortText,
        length: ColumnLength.ShortText,
    }),
    __metadata("design:type", String)
], WorkspaceNotificationLog.prototype, "status", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ReadWorkspaceNotificationLog,
        ],
        update: [],
    }),
    TableColumn({
        required: true,
        type: TableColumnType.ShortText,
        title: "Action Type",
        description: "Type of workspace action performed",
        canReadOnRelationQuery: false,
        isDefaultValueColumn: true,
        defaultValue: WorkspaceNotificationActionType.SendMessage,
    }),
    Column({
        nullable: false,
        type: ColumnType.ShortText,
        length: ColumnLength.ShortText,
        default: WorkspaceNotificationActionType.SendMessage,
    }),
    __metadata("design:type", String)
], WorkspaceNotificationLog.prototype, "actionType", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ReadWorkspaceNotificationLog,
        ],
        update: [],
    }),
    TableColumn({
        manyToOneRelationColumn: "incidentId",
        type: TableColumnType.Entity,
        modelType: Incident,
        title: "Incident",
        description: "Incident associated with this message (if any)",
    }),
    ManyToOne(() => {
        return Incident;
    }, {
        eager: false,
        nullable: true,
        onDelete: "CASCADE",
        orphanedRowAction: "nullify",
    }),
    JoinColumn({ name: "incidentId" }),
    __metadata("design:type", Incident)
], WorkspaceNotificationLog.prototype, "incident", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ReadPushLog,
        ],
        update: [],
    }),
    Index(),
    TableColumn({
        type: TableColumnType.ObjectID,
        required: false,
        canReadOnRelationQuery: true,
        title: "Incident ID",
        description: "ID of Incident associated with this message (if any)",
    }),
    Column({
        type: ColumnType.ObjectID,
        nullable: true,
        transformer: ObjectID.getDatabaseTransformer(),
    }),
    __metadata("design:type", ObjectID)
], WorkspaceNotificationLog.prototype, "incidentId", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ReadWorkspaceNotificationLog,
        ],
        update: [],
    }),
    TableColumn({
        manyToOneRelationColumn: "userId",
        type: TableColumnType.Entity,
        modelType: User,
        title: "User",
        description: "User who initiated this workspace notification (if any)",
    }),
    ManyToOne(() => {
        return User;
    }, {
        eager: false,
        nullable: true,
        onDelete: "CASCADE",
        orphanedRowAction: "nullify",
    }),
    JoinColumn({ name: "userId" }),
    __metadata("design:type", User)
], WorkspaceNotificationLog.prototype, "user", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ReadWorkspaceNotificationLog,
        ],
        update: [],
    }),
    Index(),
    TableColumn({
        type: TableColumnType.ObjectID,
        required: false,
        canReadOnRelationQuery: true,
        title: "User ID",
        description: "ID of User who initiated this workspace notification (if any)",
    }),
    Column({
        type: ColumnType.ObjectID,
        nullable: true,
        transformer: ObjectID.getDatabaseTransformer(),
    }),
    __metadata("design:type", ObjectID)
], WorkspaceNotificationLog.prototype, "userId", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ReadPushLog,
        ],
        update: [],
    }),
    TableColumn({
        manyToOneRelationColumn: "alertId",
        type: TableColumnType.Entity,
        modelType: Alert,
        title: "Alert",
        description: "Alert associated with this message (if any)",
    }),
    ManyToOne(() => {
        return Alert;
    }, {
        eager: false,
        nullable: true,
        onDelete: "CASCADE",
        orphanedRowAction: "nullify",
    }),
    JoinColumn({ name: "alertId" }),
    __metadata("design:type", Alert)
], WorkspaceNotificationLog.prototype, "alert", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ReadPushLog,
        ],
        update: [],
    }),
    Index(),
    TableColumn({
        type: TableColumnType.ObjectID,
        required: false,
        canReadOnRelationQuery: true,
        title: "Alert ID",
        description: "ID of Alert associated with this message (if any)",
    }),
    Column({
        type: ColumnType.ObjectID,
        nullable: true,
        transformer: ObjectID.getDatabaseTransformer(),
    }),
    __metadata("design:type", ObjectID)
], WorkspaceNotificationLog.prototype, "alertId", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ReadWorkspaceNotificationLog,
        ],
        update: [],
    }),
    TableColumn({
        manyToOneRelationColumn: "monitorId",
        type: TableColumnType.Entity,
        modelType: Monitor,
        title: "Monitor",
        description: "Monitor associated with this message (if any)",
    }),
    ManyToOne(() => {
        return Monitor;
    }, {
        eager: false,
        nullable: true,
        onDelete: "CASCADE",
        orphanedRowAction: "nullify",
    }),
    JoinColumn({ name: "monitorId" }),
    __metadata("design:type", Monitor)
], WorkspaceNotificationLog.prototype, "monitor", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ReadWorkspaceNotificationLog,
        ],
        update: [],
    }),
    Index(),
    TableColumn({
        type: TableColumnType.ObjectID,
        required: false,
        canReadOnRelationQuery: true,
        title: "Monitor ID",
        description: "ID of Monitor associated with this message (if any)",
    }),
    Column({
        type: ColumnType.ObjectID,
        nullable: true,
        transformer: ObjectID.getDatabaseTransformer(),
    }),
    __metadata("design:type", ObjectID)
], WorkspaceNotificationLog.prototype, "monitorId", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ReadPushLog,
        ],
        update: [],
    }),
    TableColumn({
        manyToOneRelationColumn: "alertEpisodeId",
        type: TableColumnType.Entity,
        modelType: AlertEpisode,
        title: "Alert Episode",
        description: "Alert Episode associated with this message (if any)",
    }),
    ManyToOne(() => {
        return AlertEpisode;
    }, {
        eager: false,
        nullable: true,
        onDelete: "CASCADE",
        orphanedRowAction: "nullify",
    }),
    JoinColumn({ name: "alertEpisodeId" }),
    __metadata("design:type", AlertEpisode)
], WorkspaceNotificationLog.prototype, "alertEpisode", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ReadPushLog,
        ],
        update: [],
    }),
    Index(),
    TableColumn({
        type: TableColumnType.ObjectID,
        required: false,
        canReadOnRelationQuery: true,
        title: "Alert Episode ID",
        description: "ID of Alert Episode associated with this message (if any)",
    }),
    Column({
        type: ColumnType.ObjectID,
        nullable: true,
        transformer: ObjectID.getDatabaseTransformer(),
    }),
    __metadata("design:type", ObjectID)
], WorkspaceNotificationLog.prototype, "alertEpisodeId", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ReadPushLog,
        ],
        update: [],
    }),
    TableColumn({
        manyToOneRelationColumn: "incidentEpisodeId",
        type: TableColumnType.Entity,
        modelType: IncidentEpisode,
        title: "Incident Episode",
        description: "Incident Episode associated with this message (if any)",
    }),
    ManyToOne(() => {
        return IncidentEpisode;
    }, {
        eager: false,
        nullable: true,
        onDelete: "CASCADE",
        orphanedRowAction: "nullify",
    }),
    JoinColumn({ name: "incidentEpisodeId" }),
    __metadata("design:type", IncidentEpisode)
], WorkspaceNotificationLog.prototype, "incidentEpisode", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ReadPushLog,
        ],
        update: [],
    }),
    Index(),
    TableColumn({
        type: TableColumnType.ObjectID,
        required: false,
        canReadOnRelationQuery: true,
        title: "Incident Episode ID",
        description: "ID of Incident Episode associated with this message (if any)",
    }),
    Column({
        type: ColumnType.ObjectID,
        nullable: true,
        transformer: ObjectID.getDatabaseTransformer(),
    }),
    __metadata("design:type", ObjectID)
], WorkspaceNotificationLog.prototype, "incidentEpisodeId", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ReadPushLog,
        ],
        update: [],
    }),
    TableColumn({
        manyToOneRelationColumn: "scheduledMaintenanceId",
        type: TableColumnType.Entity,
        modelType: ScheduledMaintenance,
        title: "Scheduled Maintenance",
        description: "Scheduled Maintenance associated with this message (if any)",
    }),
    ManyToOne(() => {
        return ScheduledMaintenance;
    }, {
        eager: false,
        nullable: true,
        onDelete: "CASCADE",
        orphanedRowAction: "nullify",
    }),
    JoinColumn({ name: "scheduledMaintenanceId" }),
    __metadata("design:type", ScheduledMaintenance)
], WorkspaceNotificationLog.prototype, "scheduledMaintenance", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ReadPushLog,
        ],
        update: [],
    }),
    Index(),
    TableColumn({
        type: TableColumnType.ObjectID,
        required: false,
        canReadOnRelationQuery: true,
        title: "Scheduled Maintenance ID",
        description: "ID of Scheduled Maintenance associated with this message (if any)",
    }),
    Column({
        type: ColumnType.ObjectID,
        nullable: true,
        transformer: ObjectID.getDatabaseTransformer(),
    }),
    __metadata("design:type", ObjectID)
], WorkspaceNotificationLog.prototype, "scheduledMaintenanceId", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ReadPushLog,
        ],
        update: [],
    }),
    TableColumn({
        manyToOneRelationColumn: "statusPageId",
        type: TableColumnType.Entity,
        modelType: StatusPage,
        title: "Status Page",
        description: "Status Page associated with this message (if any)",
    }),
    ManyToOne(() => {
        return StatusPage;
    }, {
        eager: false,
        nullable: true,
        onDelete: "CASCADE",
        orphanedRowAction: "nullify",
    }),
    JoinColumn({ name: "statusPageId" }),
    __metadata("design:type", StatusPage)
], WorkspaceNotificationLog.prototype, "statusPage", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ReadPushLog,
        ],
        update: [],
    }),
    Index(),
    TableColumn({
        type: TableColumnType.ObjectID,
        required: false,
        canReadOnRelationQuery: true,
        title: "Status Page ID",
        description: "ID of Status Page associated with this message (if any)",
    }),
    Column({
        type: ColumnType.ObjectID,
        nullable: true,
        transformer: ObjectID.getDatabaseTransformer(),
    }),
    __metadata("design:type", ObjectID)
], WorkspaceNotificationLog.prototype, "statusPageId", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ReadPushLog,
        ],
        update: [],
    }),
    TableColumn({
        manyToOneRelationColumn: "statusPageAnnouncementId",
        type: TableColumnType.Entity,
        modelType: StatusPageAnnouncement,
        title: "Status Page Announcement",
        description: "Status Page Announcement associated with this message (if any)",
    }),
    ManyToOne(() => {
        return StatusPageAnnouncement;
    }, {
        eager: false,
        nullable: true,
        onDelete: "CASCADE",
        orphanedRowAction: "nullify",
    }),
    JoinColumn({ name: "statusPageAnnouncementId" }),
    __metadata("design:type", StatusPageAnnouncement)
], WorkspaceNotificationLog.prototype, "statusPageAnnouncement", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ReadPushLog,
        ],
        update: [],
    }),
    Index(),
    TableColumn({
        type: TableColumnType.ObjectID,
        required: false,
        canReadOnRelationQuery: true,
        title: "Status Page Announcement ID",
        description: "ID of Status Page Announcement associated with this message (if any)",
    }),
    Column({
        type: ColumnType.ObjectID,
        nullable: true,
        transformer: ObjectID.getDatabaseTransformer(),
    }),
    __metadata("design:type", ObjectID)
], WorkspaceNotificationLog.prototype, "statusPageAnnouncementId", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ReadWorkspaceNotificationLog,
        ],
        update: [],
    }),
    TableColumn({
        manyToOneRelationColumn: "onCallDutyPolicyId",
        type: TableColumnType.Entity,
        modelType: OnCallDutyPolicy,
        title: "On-Call Duty Policy",
        description: "On-Call Duty Policy associated with this message (if any)",
    }),
    ManyToOne(() => {
        return OnCallDutyPolicy;
    }, {
        eager: false,
        nullable: true,
        onDelete: "CASCADE",
        orphanedRowAction: "nullify",
    }),
    JoinColumn({ name: "onCallDutyPolicyId" }),
    __metadata("design:type", OnCallDutyPolicy)
], WorkspaceNotificationLog.prototype, "onCallDutyPolicy", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ReadWorkspaceNotificationLog,
        ],
        update: [],
    }),
    Index(),
    TableColumn({
        type: TableColumnType.ObjectID,
        required: false,
        canReadOnRelationQuery: true,
        title: "On-Call Duty Policy ID",
        description: "ID of On-Call Duty Policy associated with this message (if any)",
    }),
    Column({
        type: ColumnType.ObjectID,
        nullable: true,
        transformer: ObjectID.getDatabaseTransformer(),
    }),
    __metadata("design:type", ObjectID)
], WorkspaceNotificationLog.prototype, "onCallDutyPolicyId", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ReadWorkspaceNotificationLog,
        ],
        update: [],
    }),
    TableColumn({
        manyToOneRelationColumn: "onCallDutyPolicyEscalationRuleId",
        type: TableColumnType.Entity,
        modelType: OnCallDutyPolicyEscalationRule,
        title: "On-Call Duty Policy Escalation Rule",
        description: "On-Call Duty Policy Escalation Rule associated with this message (if any)",
    }),
    ManyToOne(() => {
        return OnCallDutyPolicyEscalationRule;
    }, {
        eager: false,
        nullable: true,
        onDelete: "CASCADE",
        orphanedRowAction: "nullify",
    }),
    JoinColumn({ name: "onCallDutyPolicyEscalationRuleId" }),
    __metadata("design:type", OnCallDutyPolicyEscalationRule)
], WorkspaceNotificationLog.prototype, "onCallDutyPolicyEscalationRule", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ReadWorkspaceNotificationLog,
        ],
        update: [],
    }),
    Index(),
    TableColumn({
        type: TableColumnType.ObjectID,
        required: false,
        canReadOnRelationQuery: true,
        title: "On-Call Duty Policy Escalation Rule ID",
        description: "ID of On-Call Duty Policy Escalation Rule associated with this message (if any)",
    }),
    Column({
        type: ColumnType.ObjectID,
        nullable: true,
        transformer: ObjectID.getDatabaseTransformer(),
    }),
    __metadata("design:type", ObjectID)
], WorkspaceNotificationLog.prototype, "onCallDutyPolicyEscalationRuleId", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ReadWorkspaceNotificationLog,
        ],
        update: [],
    }),
    TableColumn({
        manyToOneRelationColumn: "onCallDutyPolicyScheduleId",
        type: TableColumnType.Entity,
        modelType: OnCallDutyPolicySchedule,
        title: "On-Call Duty Policy Schedule",
        description: "On-Call Duty Policy Schedule associated with this message (if any)",
    }),
    ManyToOne(() => {
        return OnCallDutyPolicySchedule;
    }, {
        eager: false,
        nullable: true,
        onDelete: "CASCADE",
        orphanedRowAction: "nullify",
    }),
    JoinColumn({ name: "onCallDutyPolicyScheduleId" }),
    __metadata("design:type", OnCallDutyPolicySchedule)
], WorkspaceNotificationLog.prototype, "onCallDutyPolicySchedule", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ReadWorkspaceNotificationLog,
        ],
        update: [],
    }),
    Index(),
    TableColumn({
        type: TableColumnType.ObjectID,
        required: false,
        canReadOnRelationQuery: true,
        title: "On-Call Duty Policy Schedule ID",
        description: "ID of On-Call Duty Policy Schedule associated with this message (if any)",
    }),
    Column({
        type: ColumnType.ObjectID,
        nullable: true,
        transformer: ObjectID.getDatabaseTransformer(),
    }),
    __metadata("design:type", ObjectID)
], WorkspaceNotificationLog.prototype, "onCallDutyPolicyScheduleId", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ReadWorkspaceNotificationLog,
        ],
        update: [],
    }),
    TableColumn({
        manyToOneRelationColumn: "teamId",
        type: TableColumnType.Entity,
        modelType: Team,
        title: "Team",
        description: "Team associated with this message (if any)",
    }),
    ManyToOne(() => {
        return Team;
    }, {
        eager: false,
        nullable: true,
        onDelete: "CASCADE",
        orphanedRowAction: "nullify",
    }),
    JoinColumn({ name: "teamId" }),
    __metadata("design:type", Team)
], WorkspaceNotificationLog.prototype, "team", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ReadWorkspaceNotificationLog,
        ],
        update: [],
    }),
    Index(),
    TableColumn({
        type: TableColumnType.ObjectID,
        required: false,
        canReadOnRelationQuery: true,
        title: "Team ID",
        description: "ID of Team associated with this message (if any)",
    }),
    Column({
        type: ColumnType.ObjectID,
        nullable: true,
        transformer: ObjectID.getDatabaseTransformer(),
    }),
    __metadata("design:type", ObjectID)
], WorkspaceNotificationLog.prototype, "teamId", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        manyToOneRelationColumn: "deletedByUserId",
        type: TableColumnType.Entity,
        title: "Deleted by User",
        modelType: User,
        description: "Relation to User who deleted this object (if this object was deleted by a User)",
    }),
    ManyToOne(() => {
        return User;
    }, {
        cascade: false,
        eager: false,
        nullable: true,
        onDelete: "SET NULL",
        orphanedRowAction: "nullify",
    }),
    JoinColumn({ name: "deletedByUserId" }),
    __metadata("design:type", User)
], WorkspaceNotificationLog.prototype, "deletedByUser", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        type: TableColumnType.ObjectID,
        title: "Deleted by User ID",
        description: "User ID who deleted this object (if this object was deleted by a User)",
    }),
    Column({
        type: ColumnType.ObjectID,
        nullable: true,
        transformer: ObjectID.getDatabaseTransformer(),
    }),
    __metadata("design:type", ObjectID)
], WorkspaceNotificationLog.prototype, "deletedByUserId", void 0);
WorkspaceNotificationLog = __decorate([
    EnableDocumentation(),
    TenantColumn("projectId"),
    TableAccessControl({
        create: [],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ReadWorkspaceNotificationLog,
        ],
        delete: [],
        update: [],
    }),
    CrudApiEndpoint(new Route("/workspace-notification-log")),
    Entity({
        name: "WorkspaceNotificationLog",
    }),
    EnableWorkflow({
        create: true,
        delete: false,
        update: false,
    }),
    TableMetadata({
        tableName: "WorkspaceNotificationLog",
        singularName: "Workspace Notification Log",
        pluralName: "Workspace Notification Logs",
        icon: IconProp.Chat,
        tableDescription: "Logs of all workspace activities including messages, channel creation, user invitations, and button interactions for Slack and Microsoft Teams.",
    })
], WorkspaceNotificationLog);
export default WorkspaceNotificationLog;
//# sourceMappingURL=WorkspaceNotificationLog.js.map