var Port_1;
import { TaonBaseEntity, CustomColumn, NumberColumn, String500Column, TaonEntity, } from 'taon/lib-prod';
import { PrimaryColumn } from 'taon-typeorm/lib-prod';
import { chalk, ___NS__merge } from 'tnp-core/lib-prod';
export const PortStatusArr = [
    'unassigned',
    'assigned',
    'assigned-not-registered',
    'assigned-taken-by-os',
];
let Port = Port_1 = class Port extends TaonBaseEntity {
    static from(opt) {
        return ___NS__merge(new Port_1(), opt);
    }
    static getTitleForFreePort(port) {
        return `free port ${port}`;
    }
    get titleOnList() {
        //#region @backendFunc
        return `- ${this.port} <${chalk.gray(this.serviceId)}>`;
        //#endregion
    }
    //#region port entity / columns / port
    //#region @websql
    //#endregion
    port;
    //#endregion
    //#region port entity / columns /  serviceId
    //#region @websql
    //#endregion
    serviceId;
    //#endregion
    //#region port entity / columns / status
    /**
     * Port status
     */
    //#region @websql
    //#endregion
    status;
    //#endregion
    //#region port entity / columns / when assigned timestamp
    /**
     * When port was assigned as registered service
     */
    //#region @websql
    //#endregion
    whenAssignedTimestamp;
};
__decorate([
    PrimaryColumn({
        type: 'int',
        unique: true,
    })
    //#endregion
    ,
    __metadata("design:type", Number)
], Port.prototype, "port", void 0);
__decorate([
    CustomColumn({
        type: 'varchar',
        length: 1000,
        unique: true,
    })
    //#endregion
    ,
    __metadata("design:type", String)
], Port.prototype, "serviceId", void 0);
__decorate([
    String500Column('unassigned')
    //#endregion
    ,
    __metadata("design:type", String)
], Port.prototype, "status", void 0);
__decorate([
    NumberColumn()
    //#endregion
    ,
    __metadata("design:type", Number)
], Port.prototype, "whenAssignedTimestamp", void 0);
Port = Port_1 = __decorate([
    TaonEntity({
        className: 'Port',
        uniqueKeyProp: 'port',
    })
], Port);
export { Port };
//# sourceMappingURL=c:/Users/darek/projects/npm/taon-dev/tnp-helpers/dist-nocutsrc-prod/lib/base/tcp-udp-ports/ports.entity.js.map