"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.CommonEntity = void 0;
const openapi = require("@nestjs/swagger");
const class_transformer_1 = require("class-transformer");
const local_date_time_transformer_1 = require("../transformers/typeorm/local-date-time-transformer");
const typeorm_1 = require("typeorm");
let CommonEntity = class CommonEntity {
    static _OPENAPI_METADATA_FACTORY() {
        return { id: { required: true, type: () => Number }, createdAt: { required: true, type: () => Date }, updatedAt: { required: true, type: () => Date }, deletedAt: { required: true, type: () => Date }, deletedTracker: { required: true, type: () => String }, publishedAt: { required: true, type: () => Date }, localeName: { required: true, type: () => String }, defaultEntityLocaleId: { required: true, type: () => Number }, createdBy: { required: true, type: () => Number }, updatedBy: { required: true, type: () => Number } };
    }
};
exports.CommonEntity = CommonEntity;
__decorate([
    (0, class_transformer_1.Expose)(),
    (0, typeorm_1.PrimaryGeneratedColumn)({ type: 'integer' }),
    __metadata("design:type", Number)
], CommonEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ name: "created_at", transformer: local_date_time_transformer_1.LocalDateTimeTransformer }),
    __metadata("design:type", Date)
], CommonEntity.prototype, "createdAt", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)({ name: "updated_at", transformer: local_date_time_transformer_1.LocalDateTimeTransformer }),
    __metadata("design:type", Date)
], CommonEntity.prototype, "updatedAt", void 0);
__decorate([
    (0, typeorm_1.DeleteDateColumn)({ name: "deleted_at", transformer: local_date_time_transformer_1.LocalDateTimeTransformer }),
    (0, typeorm_1.Index)(),
    __metadata("design:type", Date)
], CommonEntity.prototype, "deletedAt", void 0);
__decorate([
    (0, typeorm_1.Column)({ name: "deletedTracker", default: "not-deleted" }),
    __metadata("design:type", String)
], CommonEntity.prototype, "deletedTracker", void 0);
__decorate([
    (0, class_transformer_1.Expose)(),
    (0, typeorm_1.Column)({ name: 'published_at', default: null, nullable: true, transformer: local_date_time_transformer_1.LocalDateTimeTransformer }),
    __metadata("design:type", Date)
], CommonEntity.prototype, "publishedAt", void 0);
__decorate([
    (0, class_transformer_1.Expose)(),
    (0, typeorm_1.Column)({ type: "varchar", name: 'locale_name', default: null }),
    __metadata("design:type", String)
], CommonEntity.prototype, "localeName", void 0);
__decorate([
    (0, class_transformer_1.Expose)(),
    (0, typeorm_1.Column)({ type: "int", name: 'default_entity_locale_id', default: null }),
    __metadata("design:type", Number)
], CommonEntity.prototype, "defaultEntityLocaleId", void 0);
__decorate([
    (0, class_transformer_1.Expose)(),
    (0, typeorm_1.Column)({ name: `created_by_id`, nullable: true }),
    __metadata("design:type", Number)
], CommonEntity.prototype, "createdBy", void 0);
__decorate([
    (0, class_transformer_1.Expose)(),
    (0, typeorm_1.Column)({ name: `updated_by_id`, nullable: true }),
    __metadata("design:type", Number)
], CommonEntity.prototype, "updatedBy", void 0);
exports.CommonEntity = CommonEntity = __decorate([
    (0, class_transformer_1.Exclude)()
], CommonEntity);
//# sourceMappingURL=common.entity.js.map