"use strict";
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);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ClusterFirewallEntity = exports.ReconciliationStatus = void 0;
const typeorm_1 = require("typeorm");
const cluster_entity_1 = require("../../clusters/entities/cluster.entity");
const reconciliation_status_enum_1 = require("../../shared/enums/reconciliation-status.enum");
Object.defineProperty(exports, "ReconciliationStatus", { enumerable: true, get: function () { return reconciliation_status_enum_1.ReconciliationStatus; } });
let ClusterFirewallEntity = class ClusterFirewallEntity {
};
exports.ClusterFirewallEntity = ClusterFirewallEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], ClusterFirewallEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'uuid', unique: true }),
    __metadata("design:type", String)
], ClusterFirewallEntity.prototype, "clusterId", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => cluster_entity_1.ClusterEntity, { onDelete: 'CASCADE' }),
    (0, typeorm_1.JoinColumn)({ name: 'clusterId' }),
    __metadata("design:type", cluster_entity_1.ClusterEntity)
], ClusterFirewallEntity.prototype, "cluster", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', nullable: true }),
    __metadata("design:type", String)
], ClusterFirewallEntity.prototype, "providerFirewallId", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'jsonb', default: [] }),
    __metadata("design:type", Array)
], ClusterFirewallEntity.prototype, "desiredRules", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
    __metadata("design:type", Array)
], ClusterFirewallEntity.prototype, "lastAppliedRules", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 64, nullable: true }),
    __metadata("design:type", String)
], ClusterFirewallEntity.prototype, "desiredHash", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 64, nullable: true }),
    __metadata("design:type", String)
], ClusterFirewallEntity.prototype, "lastAppliedHash", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'enum',
        enum: reconciliation_status_enum_1.ReconciliationStatus,
        default: reconciliation_status_enum_1.ReconciliationStatus.PENDING,
    }),
    __metadata("design:type", String)
], ClusterFirewallEntity.prototype, "reconciliationStatus", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'timestamptz', nullable: true }),
    __metadata("design:type", Date)
], ClusterFirewallEntity.prototype, "lastReconciliationAt", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'text', nullable: true }),
    __metadata("design:type", String)
], ClusterFirewallEntity.prototype, "errorMessage", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
    __metadata("design:type", Object)
], ClusterFirewallEntity.prototype, "metadata", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ type: 'timestamptz' }),
    __metadata("design:type", Date)
], ClusterFirewallEntity.prototype, "createdAt", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)({ type: 'timestamptz' }),
    __metadata("design:type", Date)
], ClusterFirewallEntity.prototype, "updatedAt", void 0);
exports.ClusterFirewallEntity = ClusterFirewallEntity = __decorate([
    (0, typeorm_1.Entity)('cluster_firewalls')
], ClusterFirewallEntity);
