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 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 TableColumn from "../../Types/Database/TableColumn";
import TableColumnType from "../../Types/Database/TableColumnType";
import TableMetadata from "../../Types/Database/TableMetadata";
import IconProp from "../../Types/Icon/IconProp";
import { Column, Entity, Index } from "typeorm";
let EnterpriseLicense = class EnterpriseLicense extends BaseModel {
    constructor() {
        super(...arguments);
        this.companyName = undefined;
        this.licenseKey = undefined;
        this.expiresAt = undefined;
        this.annualContractValue = undefined;
        this.userLimit = undefined;
        this.currentUserCount = undefined;
        this.userCountUpdatedAt = undefined;
    }
};
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        required: true,
        type: TableColumnType.ShortText,
        title: "Company Name",
        description: "Company name associated with this license.",
    }),
    Column({
        nullable: false,
        type: ColumnType.ShortText,
        length: ColumnLength.ShortText,
    }),
    __metadata("design:type", String)
], EnterpriseLicense.prototype, "companyName", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        required: true,
        type: TableColumnType.ShortText,
        title: "License Key",
        description: "Enterprise license key.",
        unique: true,
    }),
    Index({ unique: true }),
    Column({
        nullable: false,
        type: ColumnType.ShortText,
        length: ColumnLength.ShortText,
        unique: true,
    }),
    __metadata("design:type", String)
], EnterpriseLicense.prototype, "licenseKey", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        required: true,
        type: TableColumnType.Date,
        title: "Expires At",
        description: "Expiration date of this license.",
    }),
    Column({
        nullable: false,
        type: ColumnType.Date,
    }),
    __metadata("design:type", Date)
], EnterpriseLicense.prototype, "expiresAt", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        required: false,
        type: TableColumnType.Number,
        title: "Annual Contract Value",
        description: "Annual contract value (in USD) for this license.",
    }),
    Column({
        nullable: true,
        type: ColumnType.Number,
    }),
    __metadata("design:type", Number)
], EnterpriseLicense.prototype, "annualContractValue", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        required: false,
        type: TableColumnType.Number,
        title: "User Limit",
        description: "Maximum number of users allowed under this enterprise license.",
    }),
    Column({
        nullable: true,
        type: ColumnType.Number,
    }),
    __metadata("design:type", Number)
], EnterpriseLicense.prototype, "userLimit", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        required: false,
        type: TableColumnType.Number,
        title: "Current User Count",
        description: "Most recent user count reported by the customer's self-hosted installation.",
    }),
    Column({
        nullable: true,
        type: ColumnType.Number,
    }),
    __metadata("design:type", Number)
], EnterpriseLicense.prototype, "currentUserCount", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        required: false,
        type: TableColumnType.Date,
        title: "User Count Updated At",
        description: "Timestamp of the most recent user count report from the customer's self-hosted installation.",
    }),
    Column({
        nullable: true,
        type: ColumnType.Date,
    }),
    __metadata("design:type", Date)
], EnterpriseLicense.prototype, "userCountUpdatedAt", void 0);
EnterpriseLicense = __decorate([
    TableAccessControl({
        create: [],
        read: [],
        update: [],
        delete: [],
    }),
    CrudApiEndpoint(new Route("/enterprise-license")),
    TableMetadata({
        tableName: "EnterpriseLicense",
        singularName: "Enterprise License",
        pluralName: "Enterprise Licenses",
        icon: IconProp.Lock,
        tableDescription: "Enterprise license keys issued by OneUptime.",
    }),
    Entity({
        name: "EnterpriseLicense",
    })
], EnterpriseLicense);
export default EnterpriseLicense;
//# sourceMappingURL=EnterpriseLicense.js.map