"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.EventEntity = exports.HiringSourceEntity = exports.EmployementTypeEntity = exports.LocationEntity = exports.DesignationEntity = exports.DepartmentEntity = exports.LeavePolicyEntity = exports.QrAttendancePointEntity = exports.AttendanceSettingsEntity = exports.IpWhitelistEntity = exports.WorkDayScheduleEntity = exports.WorkingScheduleEntity = exports.CompanyEntity = exports.OwnerEntity = exports.SettlementStatusEnum = exports.ExitQuestionTypeEnum = exports.OffboardingReasonEnum = exports.OffboardingCaseStatusEnum = exports.ProbationOutcomeEnum = exports.ProbationStatusEnum = exports.ProvisioningStatusEnum = exports.DocumentSigningStatusEnum = exports.TaskStatusEnum = exports.TaskOwnerTypeEnum = exports.OnboardingCaseStatusEnum = exports.NotificationTargetTypeEnum = exports.TenantApiKeyStatusEnum = exports.RecruitmentTaskStatusEnum = exports.JobApplicationSourceEnum = exports.JobApplicationStatusEnum = exports.JobPostingStatusEnum = exports.NotificationTypeEnum = exports.EventTypeEnum = exports.HolidayTypeEnum = exports.AttendanceRequestStatusEnum = exports.AttendanceRequestTypeEnum = exports.LeaveTypeEnum = exports.LeaveStatusEnum = exports.DeviceChangeRequestStatusEnum = exports.BreakTypeEnum = exports.AttendanceTypeEnum = exports.AttendanceStatusEnum = exports.PriorityEnum = exports.GenderEnum = exports.MaritalStatusEnum = exports.MemberStatusEnum = exports.RoleEnum = exports.NoticeStatusEnum = exports.GeneralStatusEnum = exports.StatusEnum = void 0;
exports.FinalSettlementItemEntity = exports.FinalSettlementEntity = exports.ExitInterviewEntity = exports.ExitInterviewTemplateEntity = exports.EquipmentReturnEntity = exports.OffboardingTaskEntity = exports.OffboardingCaseEntity = exports.OffboardingTemplateTaskEntity = exports.OffboardingTemplateEntity = exports.ProbationReviewEntity = exports.ProbationEntity = exports.OnboardingSurveyEntity = exports.BuddyAssignmentEntity = exports.ProvisioningItemEntity = exports.OnboardingDocumentEntity = exports.OnboardingTaskEntity = exports.OnboardingCaseEntity = exports.OnboardingTemplateTaskEntity = exports.OnboardingTemplateEntity = exports.TenantApiKeyEntity = exports.RecruitmentTaskEntity = exports.JobApplicationEntity = exports.JobPostingEntity = exports.RolePermissionEntity = exports.AccessRoleEntity = exports.NotificationReceiverEntity = exports.NotificationTargetEntity = exports.NotificationEntity = exports.HolidayEntity = exports.LeaveEntity = exports.DeviceChangeRequestEntity = exports.TeacherDeviceEntity = exports.AttendanceEntity = exports.EducationEntity = exports.WorkExperienceEntity = exports.MemberEntity = exports.NoticeEntity = void 0;
const typeorm_1 = require("typeorm");
var StatusEnum;
(function (StatusEnum) {
    StatusEnum["active"] = "active";
    StatusEnum["inactive"] = "inactive";
    StatusEnum["unverified"] = "unverified";
})(StatusEnum || (exports.StatusEnum = StatusEnum = {}));
var GeneralStatusEnum;
(function (GeneralStatusEnum) {
    GeneralStatusEnum["active"] = "active";
    GeneralStatusEnum["inactive"] = "inactive";
    GeneralStatusEnum["deleted"] = "deleted";
})(GeneralStatusEnum || (exports.GeneralStatusEnum = GeneralStatusEnum = {}));
var NoticeStatusEnum;
(function (NoticeStatusEnum) {
    NoticeStatusEnum["draft"] = "draft";
    NoticeStatusEnum["published"] = "published";
    NoticeStatusEnum["archived"] = "archived";
})(NoticeStatusEnum || (exports.NoticeStatusEnum = NoticeStatusEnum = {}));
var RoleEnum;
(function (RoleEnum) {
    RoleEnum["owner"] = "owner";
    RoleEnum["admin"] = "admin";
    RoleEnum["member"] = "member";
})(RoleEnum || (exports.RoleEnum = RoleEnum = {}));
var MemberStatusEnum;
(function (MemberStatusEnum) {
    MemberStatusEnum["active"] = "active";
    MemberStatusEnum["deactivated"] = "deactivated";
    MemberStatusEnum["terminated"] = "terminated";
    MemberStatusEnum["deceased"] = "deceased";
    MemberStatusEnum["resigned"] = "resigned";
    MemberStatusEnum["deleted"] = "deleted";
})(MemberStatusEnum || (exports.MemberStatusEnum = MemberStatusEnum = {}));
var MaritalStatusEnum;
(function (MaritalStatusEnum) {
    MaritalStatusEnum["single"] = "single";
    MaritalStatusEnum["married"] = "married";
    MaritalStatusEnum["divorced"] = "divorced";
    MaritalStatusEnum["widowed"] = "widowed";
})(MaritalStatusEnum || (exports.MaritalStatusEnum = MaritalStatusEnum = {}));
var GenderEnum;
(function (GenderEnum) {
    GenderEnum["male"] = "male";
    GenderEnum["female"] = "female";
    GenderEnum["others"] = "others";
})(GenderEnum || (exports.GenderEnum = GenderEnum = {}));
var PriorityEnum;
(function (PriorityEnum) {
    PriorityEnum["low"] = "low";
    PriorityEnum["medium"] = "medium";
    PriorityEnum["high"] = "high";
    PriorityEnum["critical"] = "critical";
})(PriorityEnum || (exports.PriorityEnum = PriorityEnum = {}));
var AttendanceStatusEnum;
(function (AttendanceStatusEnum) {
    AttendanceStatusEnum["present"] = "present";
    AttendanceStatusEnum["absent"] = "absent";
    AttendanceStatusEnum["late"] = "late";
    AttendanceStatusEnum["half_day"] = "half_day";
    AttendanceStatusEnum["on_leave"] = "on_leave";
    AttendanceStatusEnum["remote"] = "remote";
    AttendanceStatusEnum["check_in"] = "check_in";
    AttendanceStatusEnum["on_break"] = "on_break";
    AttendanceStatusEnum["holiday"] = "holiday";
    AttendanceStatusEnum["weekend"] = "weekend";
})(AttendanceStatusEnum || (exports.AttendanceStatusEnum = AttendanceStatusEnum = {}));
var AttendanceTypeEnum;
(function (AttendanceTypeEnum) {
    AttendanceTypeEnum["in_office"] = "in_office";
    AttendanceTypeEnum["flexible"] = "flexible";
    AttendanceTypeEnum["on_leave"] = "on_leave";
})(AttendanceTypeEnum || (exports.AttendanceTypeEnum = AttendanceTypeEnum = {}));
var BreakTypeEnum;
(function (BreakTypeEnum) {
    BreakTypeEnum["lunch"] = "lunch";
    BreakTypeEnum["time_break"] = "time_break";
})(BreakTypeEnum || (exports.BreakTypeEnum = BreakTypeEnum = {}));
var DeviceChangeRequestStatusEnum;
(function (DeviceChangeRequestStatusEnum) {
    DeviceChangeRequestStatusEnum["pending"] = "pending";
    DeviceChangeRequestStatusEnum["approved"] = "approved";
    DeviceChangeRequestStatusEnum["rejected"] = "rejected";
})(DeviceChangeRequestStatusEnum || (exports.DeviceChangeRequestStatusEnum = DeviceChangeRequestStatusEnum = {}));
var LeaveStatusEnum;
(function (LeaveStatusEnum) {
    LeaveStatusEnum["pending"] = "pending";
    LeaveStatusEnum["approved"] = "approved";
    LeaveStatusEnum["rejected"] = "rejected";
    LeaveStatusEnum["cancelled"] = "cancelled";
})(LeaveStatusEnum || (exports.LeaveStatusEnum = LeaveStatusEnum = {}));
var LeaveTypeEnum;
(function (LeaveTypeEnum) {
    LeaveTypeEnum["annual"] = "annual";
    LeaveTypeEnum["sick"] = "sick";
    LeaveTypeEnum["casual"] = "casual";
    LeaveTypeEnum["maternity"] = "maternity";
    LeaveTypeEnum["paternity"] = "paternity";
    LeaveTypeEnum["personal"] = "personal";
    LeaveTypeEnum["compensatory"] = "compensatory";
    LeaveTypeEnum["unpaid"] = "unpaid";
    LeaveTypeEnum["day_off"] = "day_off";
})(LeaveTypeEnum || (exports.LeaveTypeEnum = LeaveTypeEnum = {}));
var AttendanceRequestTypeEnum;
(function (AttendanceRequestTypeEnum) {
    AttendanceRequestTypeEnum["off_day_work"] = "off_day_work";
    AttendanceRequestTypeEnum["correction"] = "correction";
})(AttendanceRequestTypeEnum || (exports.AttendanceRequestTypeEnum = AttendanceRequestTypeEnum = {}));
var AttendanceRequestStatusEnum;
(function (AttendanceRequestStatusEnum) {
    AttendanceRequestStatusEnum["pending"] = "pending";
    AttendanceRequestStatusEnum["approved"] = "approved";
    AttendanceRequestStatusEnum["rejected"] = "rejected";
    AttendanceRequestStatusEnum["cancelled"] = "cancelled";
})(AttendanceRequestStatusEnum || (exports.AttendanceRequestStatusEnum = AttendanceRequestStatusEnum = {}));
var HolidayTypeEnum;
(function (HolidayTypeEnum) {
    HolidayTypeEnum["public"] = "public";
    HolidayTypeEnum["company"] = "company";
    HolidayTypeEnum["optional"] = "optional";
    HolidayTypeEnum["religious"] = "religious";
    HolidayTypeEnum["regional"] = "regional";
    HolidayTypeEnum["observance"] = "observance";
    HolidayTypeEnum["other"] = "other";
})(HolidayTypeEnum || (exports.HolidayTypeEnum = HolidayTypeEnum = {}));
var EventTypeEnum;
(function (EventTypeEnum) {
    EventTypeEnum["meeting"] = "meeting";
    EventTypeEnum["celebration"] = "celebration";
    EventTypeEnum["training"] = "training";
    EventTypeEnum["workshop"] = "workshop";
    EventTypeEnum["other"] = "other";
})(EventTypeEnum || (exports.EventTypeEnum = EventTypeEnum = {}));
var NotificationTypeEnum;
(function (NotificationTypeEnum) {
    NotificationTypeEnum["holiday"] = "HOLIDAY";
    NotificationTypeEnum["notice"] = "NOTICE";
    NotificationTypeEnum["leave"] = "LEAVE";
    NotificationTypeEnum["attendance"] = "ATTENDANCE";
    NotificationTypeEnum["recruitment"] = "RECRUITMENT";
})(NotificationTypeEnum || (exports.NotificationTypeEnum = NotificationTypeEnum = {}));
var JobPostingStatusEnum;
(function (JobPostingStatusEnum) {
    JobPostingStatusEnum["draft"] = "draft";
    JobPostingStatusEnum["published"] = "published";
    JobPostingStatusEnum["closed"] = "closed";
})(JobPostingStatusEnum || (exports.JobPostingStatusEnum = JobPostingStatusEnum = {}));
var JobApplicationStatusEnum;
(function (JobApplicationStatusEnum) {
    JobApplicationStatusEnum["applied"] = "applied";
    JobApplicationStatusEnum["screening"] = "screening";
    JobApplicationStatusEnum["interview"] = "interview";
    JobApplicationStatusEnum["offer"] = "offer";
    JobApplicationStatusEnum["rejected"] = "rejected";
    JobApplicationStatusEnum["hired"] = "hired";
    JobApplicationStatusEnum["archived"] = "archived";
})(JobApplicationStatusEnum || (exports.JobApplicationStatusEnum = JobApplicationStatusEnum = {}));
var JobApplicationSourceEnum;
(function (JobApplicationSourceEnum) {
    JobApplicationSourceEnum["public_form"] = "public_form";
    JobApplicationSourceEnum["public_api"] = "public_api";
    JobApplicationSourceEnum["manual"] = "manual";
})(JobApplicationSourceEnum || (exports.JobApplicationSourceEnum = JobApplicationSourceEnum = {}));
var RecruitmentTaskStatusEnum;
(function (RecruitmentTaskStatusEnum) {
    RecruitmentTaskStatusEnum["pending"] = "pending";
    RecruitmentTaskStatusEnum["submitted"] = "submitted";
    RecruitmentTaskStatusEnum["reviewed"] = "reviewed";
})(RecruitmentTaskStatusEnum || (exports.RecruitmentTaskStatusEnum = RecruitmentTaskStatusEnum = {}));
var TenantApiKeyStatusEnum;
(function (TenantApiKeyStatusEnum) {
    TenantApiKeyStatusEnum["active"] = "active";
    TenantApiKeyStatusEnum["revoked"] = "revoked";
})(TenantApiKeyStatusEnum || (exports.TenantApiKeyStatusEnum = TenantApiKeyStatusEnum = {}));
var NotificationTargetTypeEnum;
(function (NotificationTargetTypeEnum) {
    NotificationTargetTypeEnum["member"] = "MEMBER";
    NotificationTargetTypeEnum["department"] = "DEPARTMENT";
    NotificationTargetTypeEnum["role"] = "ROLE";
    NotificationTargetTypeEnum["all"] = "ALL";
})(NotificationTargetTypeEnum || (exports.NotificationTargetTypeEnum = NotificationTargetTypeEnum = {}));
var OnboardingCaseStatusEnum;
(function (OnboardingCaseStatusEnum) {
    OnboardingCaseStatusEnum["pending"] = "pending";
    OnboardingCaseStatusEnum["in_progress"] = "in_progress";
    OnboardingCaseStatusEnum["completed"] = "completed";
    OnboardingCaseStatusEnum["cancelled"] = "cancelled";
})(OnboardingCaseStatusEnum || (exports.OnboardingCaseStatusEnum = OnboardingCaseStatusEnum = {}));
var TaskOwnerTypeEnum;
(function (TaskOwnerTypeEnum) {
    TaskOwnerTypeEnum["hr"] = "hr";
    TaskOwnerTypeEnum["it"] = "it";
    TaskOwnerTypeEnum["manager"] = "manager";
    TaskOwnerTypeEnum["employee"] = "employee";
    TaskOwnerTypeEnum["finance"] = "finance";
})(TaskOwnerTypeEnum || (exports.TaskOwnerTypeEnum = TaskOwnerTypeEnum = {}));
var TaskStatusEnum;
(function (TaskStatusEnum) {
    TaskStatusEnum["pending"] = "pending";
    TaskStatusEnum["in_progress"] = "in_progress";
    TaskStatusEnum["completed"] = "completed";
    TaskStatusEnum["skipped"] = "skipped";
})(TaskStatusEnum || (exports.TaskStatusEnum = TaskStatusEnum = {}));
var DocumentSigningStatusEnum;
(function (DocumentSigningStatusEnum) {
    DocumentSigningStatusEnum["pending"] = "pending";
    DocumentSigningStatusEnum["signed"] = "signed";
    DocumentSigningStatusEnum["rejected"] = "rejected";
})(DocumentSigningStatusEnum || (exports.DocumentSigningStatusEnum = DocumentSigningStatusEnum = {}));
var ProvisioningStatusEnum;
(function (ProvisioningStatusEnum) {
    ProvisioningStatusEnum["pending"] = "pending";
    ProvisioningStatusEnum["requested"] = "requested";
    ProvisioningStatusEnum["assigned"] = "assigned";
    ProvisioningStatusEnum["provisioned"] = "provisioned";
    ProvisioningStatusEnum["confirmed"] = "confirmed";
    ProvisioningStatusEnum["rejected"] = "rejected";
})(ProvisioningStatusEnum || (exports.ProvisioningStatusEnum = ProvisioningStatusEnum = {}));
var ProbationStatusEnum;
(function (ProbationStatusEnum) {
    ProbationStatusEnum["pending"] = "pending";
    ProbationStatusEnum["under_review"] = "under_review";
    ProbationStatusEnum["passed"] = "passed";
    ProbationStatusEnum["extended"] = "extended";
    ProbationStatusEnum["failed"] = "failed";
})(ProbationStatusEnum || (exports.ProbationStatusEnum = ProbationStatusEnum = {}));
var ProbationOutcomeEnum;
(function (ProbationOutcomeEnum) {
    ProbationOutcomeEnum["pass"] = "pass";
    ProbationOutcomeEnum["extend"] = "extend";
    ProbationOutcomeEnum["fail"] = "fail";
})(ProbationOutcomeEnum || (exports.ProbationOutcomeEnum = ProbationOutcomeEnum = {}));
var OffboardingCaseStatusEnum;
(function (OffboardingCaseStatusEnum) {
    OffboardingCaseStatusEnum["initiated"] = "initiated";
    OffboardingCaseStatusEnum["in_progress"] = "in_progress";
    OffboardingCaseStatusEnum["pending_clearance"] = "pending_clearance";
    OffboardingCaseStatusEnum["pending_settlement"] = "pending_settlement";
    OffboardingCaseStatusEnum["ready_to_close"] = "ready_to_close";
    OffboardingCaseStatusEnum["completed"] = "completed";
    OffboardingCaseStatusEnum["cancelled"] = "cancelled";
})(OffboardingCaseStatusEnum || (exports.OffboardingCaseStatusEnum = OffboardingCaseStatusEnum = {}));
var OffboardingReasonEnum;
(function (OffboardingReasonEnum) {
    OffboardingReasonEnum["resignation"] = "resignation";
    OffboardingReasonEnum["termination"] = "termination";
    OffboardingReasonEnum["retirement"] = "retirement";
    OffboardingReasonEnum["contract_end"] = "contract_end";
    OffboardingReasonEnum["other"] = "other";
})(OffboardingReasonEnum || (exports.OffboardingReasonEnum = OffboardingReasonEnum = {}));
var ExitQuestionTypeEnum;
(function (ExitQuestionTypeEnum) {
    ExitQuestionTypeEnum["text"] = "text";
    ExitQuestionTypeEnum["long_text"] = "long_text";
    ExitQuestionTypeEnum["single_choice"] = "single_choice";
    ExitQuestionTypeEnum["multiple_choice"] = "multiple_choice";
    ExitQuestionTypeEnum["rating"] = "rating";
})(ExitQuestionTypeEnum || (exports.ExitQuestionTypeEnum = ExitQuestionTypeEnum = {}));
var SettlementStatusEnum;
(function (SettlementStatusEnum) {
    SettlementStatusEnum["draft"] = "draft";
    SettlementStatusEnum["calculated"] = "calculated";
    SettlementStatusEnum["under_review"] = "under_review";
    SettlementStatusEnum["approved"] = "approved";
    SettlementStatusEnum["included_in_payroll"] = "included_in_payroll";
    SettlementStatusEnum["paid"] = "paid";
    SettlementStatusEnum["cancelled"] = "cancelled";
})(SettlementStatusEnum || (exports.SettlementStatusEnum = SettlementStatusEnum = {}));
let OwnerEntity = class OwnerEntity {
};
exports.OwnerEntity = OwnerEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], OwnerEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191 }),
    __metadata("design:type", String)
], OwnerEntity.prototype, "name", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191 }),
    __metadata("design:type", String)
], OwnerEntity.prototype, "email", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191 }),
    __metadata("design:type", String)
], OwnerEntity.prototype, "username", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191, nullable: true }),
    __metadata("design:type", String)
], OwnerEntity.prototype, "slug", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191 }),
    __metadata("design:type", String)
], OwnerEntity.prototype, "password", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191, default: 'NT/APL' }),
    __metadata("design:type", String)
], OwnerEntity.prototype, "address", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191, default: 'NT/APL' }),
    __metadata("design:type", String)
], OwnerEntity.prototype, "phone", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'json' }),
    __metadata("design:type", Object)
], OwnerEntity.prototype, "image", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'enum', enum: RoleEnum, default: RoleEnum.owner }),
    __metadata("design:type", String)
], OwnerEntity.prototype, "role", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191, nullable: true }),
    __metadata("design:type", String)
], OwnerEntity.prototype, "otp", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'enum', enum: StatusEnum, default: StatusEnum.unverified }),
    __metadata("design:type", String)
], OwnerEntity.prototype, "status", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ type: 'datetime', name: 'created_at', precision: 3 }),
    __metadata("design:type", Date)
], OwnerEntity.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)({ type: 'datetime', name: 'updated_at', precision: 3 }),
    __metadata("design:type", Date)
], OwnerEntity.prototype, "updated_at", void 0);
__decorate([
    (0, typeorm_1.OneToOne)(() => CompanyEntity, (company) => company.owner),
    __metadata("design:type", Object)
], OwnerEntity.prototype, "company", void 0);
__decorate([
    (0, typeorm_1.OneToOne)(() => WorkingScheduleEntity, (schedule) => schedule.owner),
    __metadata("design:type", Object)
], OwnerEntity.prototype, "workingSchedule", void 0);
__decorate([
    (0, typeorm_1.OneToOne)(() => LeavePolicyEntity, (policy) => policy.owner),
    __metadata("design:type", Object)
], OwnerEntity.prototype, "leavePolicy", void 0);
__decorate([
    (0, typeorm_1.OneToOne)(() => AttendanceSettingsEntity, (settings) => settings.owner),
    __metadata("design:type", Object)
], OwnerEntity.prototype, "attendanceSettings", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => MemberEntity, (member) => member.owner),
    __metadata("design:type", Array)
], OwnerEntity.prototype, "members", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => AttendanceEntity, (attendance) => attendance.owner),
    __metadata("design:type", Array)
], OwnerEntity.prototype, "attendances", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => WorkDayScheduleEntity, (schedule) => schedule.owner),
    __metadata("design:type", Array)
], OwnerEntity.prototype, "workDaySchedules", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => IpWhitelistEntity, (ip) => ip.owner),
    __metadata("design:type", Array)
], OwnerEntity.prototype, "ipWhitelists", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => QrAttendancePointEntity, (qr) => qr.owner),
    __metadata("design:type", Array)
], OwnerEntity.prototype, "qrAttendancePoints", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => TeacherDeviceEntity, (device) => device.owner),
    __metadata("design:type", Array)
], OwnerEntity.prototype, "teacherDevices", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => DeviceChangeRequestEntity, (req) => req.owner),
    __metadata("design:type", Array)
], OwnerEntity.prototype, "deviceChangeRequests", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => LeaveEntity, (leave) => leave.owner),
    __metadata("design:type", Array)
], OwnerEntity.prototype, "leaves", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => LeaveEntity, (leave) => leave.approver_owner),
    __metadata("design:type", Array)
], OwnerEntity.prototype, "approvedLeaves", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => HolidayEntity, (holiday) => holiday.owner),
    __metadata("design:type", Array)
], OwnerEntity.prototype, "holidays", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => EventEntity, (event) => event.owner),
    __metadata("design:type", Array)
], OwnerEntity.prototype, "events", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => WorkExperienceEntity, (workExperience) => workExperience.owner),
    __metadata("design:type", Array)
], OwnerEntity.prototype, "workExperiences", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => EducationEntity, (education) => education.owner),
    __metadata("design:type", Array)
], OwnerEntity.prototype, "educations", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => DepartmentEntity, (department) => department.owner),
    __metadata("design:type", Array)
], OwnerEntity.prototype, "departments", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => DesignationEntity, (designation) => designation.owner),
    __metadata("design:type", Array)
], OwnerEntity.prototype, "designations", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => LocationEntity, (location) => location.owner),
    __metadata("design:type", Array)
], OwnerEntity.prototype, "locations", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => EmployementTypeEntity, (employmentType) => employmentType.owner),
    __metadata("design:type", Array)
], OwnerEntity.prototype, "employementTypes", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => HiringSourceEntity, (hiringSource) => hiringSource.owner),
    __metadata("design:type", Array)
], OwnerEntity.prototype, "hiringSources", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => NoticeEntity, (notice) => notice.owner),
    __metadata("design:type", Array)
], OwnerEntity.prototype, "notices", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => JobPostingEntity, (jobPosting) => jobPosting.owner),
    __metadata("design:type", Array)
], OwnerEntity.prototype, "jobPostings", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => JobApplicationEntity, (application) => application.owner),
    __metadata("design:type", Array)
], OwnerEntity.prototype, "jobApplications", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => TenantApiKeyEntity, (apiKey) => apiKey.owner),
    __metadata("design:type", Array)
], OwnerEntity.prototype, "tenantApiKeys", void 0);
exports.OwnerEntity = OwnerEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'owner' }),
    (0, typeorm_1.Index)(['email'], { unique: true }),
    (0, typeorm_1.Index)(['username'], { unique: true })
], OwnerEntity);
let CompanyEntity = class CompanyEntity {
};
exports.CompanyEntity = CompanyEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], CompanyEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191 }),
    __metadata("design:type", String)
], CompanyEntity.prototype, "name", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'company_code', length: 191 }),
    __metadata("design:type", String)
], CompanyEntity.prototype, "company_code", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191 }),
    __metadata("design:type", String)
], CompanyEntity.prototype, "email", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191, default: 'NT/APL' }),
    __metadata("design:type", String)
], CompanyEntity.prototype, "phone", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191, default: 'NT/APL' }),
    __metadata("design:type", String)
], CompanyEntity.prototype, "address", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191, default: 'NT/APL' }),
    __metadata("design:type", String)
], CompanyEntity.prototype, "website", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'json' }),
    __metadata("design:type", Object)
], CompanyEntity.prototype, "logo", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191, default: 'NT/APL' }),
    __metadata("design:type", String)
], CompanyEntity.prototype, "description", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'datetime',
        name: 'founded_at',
        default: () => 'CURRENT_TIMESTAMP',
    }),
    __metadata("design:type", Date)
], CompanyEntity.prototype, "founded_at", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191, default: 'NT/APL' }),
    __metadata("design:type", String)
], CompanyEntity.prototype, "industry", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'enum',
        enum: GeneralStatusEnum,
        default: GeneralStatusEnum.active,
    }),
    __metadata("design:type", String)
], CompanyEntity.prototype, "status", void 0);
__decorate([
    (0, typeorm_1.OneToOne)(() => OwnerEntity, (owner) => owner.company, {
        onDelete: 'RESTRICT',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'owner_id' }),
    __metadata("design:type", OwnerEntity)
], CompanyEntity.prototype, "owner", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'owner_id', length: 191 }),
    __metadata("design:type", String)
], CompanyEntity.prototype, "owner_id", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ type: 'datetime', name: 'created_at', precision: 3 }),
    __metadata("design:type", Date)
], CompanyEntity.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)({ type: 'datetime', name: 'updated_at', precision: 3 }),
    __metadata("design:type", Date)
], CompanyEntity.prototype, "updated_at", void 0);
exports.CompanyEntity = CompanyEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'company' }),
    (0, typeorm_1.Index)(['owner_id'], { unique: true })
], CompanyEntity);
let WorkingScheduleEntity = class WorkingScheduleEntity {
};
exports.WorkingScheduleEntity = WorkingScheduleEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], WorkingScheduleEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'json', name: 'working_days', nullable: true }),
    __metadata("design:type", Object)
], WorkingScheduleEntity.prototype, "working_days", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'int', name: 'working_days_per_week', default: 5 }),
    __metadata("design:type", Number)
], WorkingScheduleEntity.prototype, "working_days_per_week", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'float', name: 'working_hours_per_day', default: 8 }),
    __metadata("design:type", Number)
], WorkingScheduleEntity.prototype, "working_hours_per_day", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'datetime',
        name: 'office_start_time',
        default: () => 'CURRENT_TIMESTAMP',
    }),
    __metadata("design:type", Date)
], WorkingScheduleEntity.prototype, "office_start_time", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'datetime',
        name: 'office_end_time',
        default: () => 'CURRENT_TIMESTAMP',
    }),
    __metadata("design:type", Date)
], WorkingScheduleEntity.prototype, "office_end_time", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'int', name: 'half_day_min_time', default: 4 }),
    __metadata("design:type", Number)
], WorkingScheduleEntity.prototype, "half_day_min_time", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'int', name: 'half_day_max_time', default: 6 }),
    __metadata("design:type", Number)
], WorkingScheduleEntity.prototype, "half_day_max_time", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'timezone',
        length: 64,
        default: 'Asia/Dhaka',
    }),
    __metadata("design:type", String)
], WorkingScheduleEntity.prototype, "timezone", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'int', name: 'monthly_correction_limit', default: 2 }),
    __metadata("design:type", Number)
], WorkingScheduleEntity.prototype, "monthly_correction_limit", void 0);
__decorate([
    (0, typeorm_1.OneToOne)(() => OwnerEntity, (owner) => owner.workingSchedule, {
        onDelete: 'RESTRICT',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'owner_id' }),
    __metadata("design:type", OwnerEntity)
], WorkingScheduleEntity.prototype, "owner", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'owner_id', length: 191 }),
    __metadata("design:type", String)
], WorkingScheduleEntity.prototype, "owner_id", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'enum',
        enum: GeneralStatusEnum,
        default: GeneralStatusEnum.active,
    }),
    __metadata("design:type", String)
], WorkingScheduleEntity.prototype, "status", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ type: 'datetime', name: 'created_at', precision: 3 }),
    __metadata("design:type", Date)
], WorkingScheduleEntity.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)({ type: 'datetime', name: 'updated_at', precision: 3 }),
    __metadata("design:type", Date)
], WorkingScheduleEntity.prototype, "updated_at", void 0);
exports.WorkingScheduleEntity = WorkingScheduleEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'working_schedule' }),
    (0, typeorm_1.Index)(['owner_id'], { unique: true })
], WorkingScheduleEntity);
let WorkDayScheduleEntity = class WorkDayScheduleEntity {
};
exports.WorkDayScheduleEntity = WorkDayScheduleEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], WorkDayScheduleEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => OwnerEntity, (owner) => owner.workDaySchedules, {
        onDelete: 'CASCADE',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'owner_id' }),
    __metadata("design:type", OwnerEntity)
], WorkDayScheduleEntity.prototype, "owner", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'owner_id', length: 191 }),
    __metadata("design:type", String)
], WorkDayScheduleEntity.prototype, "owner_id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'int' }),
    __metadata("design:type", Number)
], WorkDayScheduleEntity.prototype, "day_of_week", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'boolean', default: true }),
    __metadata("design:type", Boolean)
], WorkDayScheduleEntity.prototype, "is_active", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 5, default: '09:00' }),
    __metadata("design:type", String)
], WorkDayScheduleEntity.prototype, "start_time", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 5, default: '17:00' }),
    __metadata("design:type", String)
], WorkDayScheduleEntity.prototype, "end_time", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 5, nullable: true }),
    __metadata("design:type", String)
], WorkDayScheduleEntity.prototype, "break_start", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 5, nullable: true }),
    __metadata("design:type", String)
], WorkDayScheduleEntity.prototype, "break_end", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'int', default: 15 }),
    __metadata("design:type", Number)
], WorkDayScheduleEntity.prototype, "grace_period_minutes", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ type: 'datetime', name: 'created_at', precision: 3 }),
    __metadata("design:type", Date)
], WorkDayScheduleEntity.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)({ type: 'datetime', name: 'updated_at', precision: 3 }),
    __metadata("design:type", Date)
], WorkDayScheduleEntity.prototype, "updated_at", void 0);
exports.WorkDayScheduleEntity = WorkDayScheduleEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'work_day_schedules' }),
    (0, typeorm_1.Index)(['owner_id', 'day_of_week'], { unique: true }),
    (0, typeorm_1.Index)(['owner_id'])
], WorkDayScheduleEntity);
let IpWhitelistEntity = class IpWhitelistEntity {
};
exports.IpWhitelistEntity = IpWhitelistEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], IpWhitelistEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => OwnerEntity, (owner) => owner.ipWhitelists, {
        onDelete: 'CASCADE',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'owner_id' }),
    __metadata("design:type", OwnerEntity)
], IpWhitelistEntity.prototype, "owner", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'owner_id', length: 191 }),
    __metadata("design:type", String)
], IpWhitelistEntity.prototype, "owner_id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191 }),
    __metadata("design:type", String)
], IpWhitelistEntity.prototype, "label", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191 }),
    __metadata("design:type", String)
], IpWhitelistEntity.prototype, "ip_or_cidr", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'boolean', default: true }),
    __metadata("design:type", Boolean)
], IpWhitelistEntity.prototype, "is_active", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ type: 'datetime', name: 'created_at', precision: 3 }),
    __metadata("design:type", Date)
], IpWhitelistEntity.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)({ type: 'datetime', name: 'updated_at', precision: 3 }),
    __metadata("design:type", Date)
], IpWhitelistEntity.prototype, "updated_at", void 0);
exports.IpWhitelistEntity = IpWhitelistEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'ip_whitelists' }),
    (0, typeorm_1.Index)(['owner_id'])
], IpWhitelistEntity);
let AttendanceSettingsEntity = class AttendanceSettingsEntity {
};
exports.AttendanceSettingsEntity = AttendanceSettingsEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], AttendanceSettingsEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.OneToOne)(() => OwnerEntity, (owner) => owner.attendanceSettings, {
        onDelete: 'CASCADE',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'owner_id' }),
    __metadata("design:type", OwnerEntity)
], AttendanceSettingsEntity.prototype, "owner", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'owner_id', length: 191 }),
    __metadata("design:type", String)
], AttendanceSettingsEntity.prototype, "owner_id", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'boolean',
        name: 'enforce_ip_whitelist',
        default: false,
    }),
    __metadata("design:type", Boolean)
], AttendanceSettingsEntity.prototype, "enforce_ip_whitelist", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'boolean',
        name: 'enforce_location',
        default: false,
    }),
    __metadata("design:type", Boolean)
], AttendanceSettingsEntity.prototype, "enforce_location", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'location_name',
        length: 191,
        default: 'Main Campus',
    }),
    __metadata("design:type", String)
], AttendanceSettingsEntity.prototype, "location_name", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'decimal',
        name: 'latitude',
        precision: 10,
        scale: 7,
        nullable: true,
    }),
    __metadata("design:type", Number)
], AttendanceSettingsEntity.prototype, "latitude", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'decimal',
        name: 'longitude',
        precision: 10,
        scale: 7,
        nullable: true,
    }),
    __metadata("design:type", Number)
], AttendanceSettingsEntity.prototype, "longitude", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'int',
        name: 'radius_meters',
        default: 100,
    }),
    __metadata("design:type", Number)
], AttendanceSettingsEntity.prototype, "radius_meters", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ type: 'datetime', name: 'created_at', precision: 3 }),
    __metadata("design:type", Date)
], AttendanceSettingsEntity.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)({ type: 'datetime', name: 'updated_at', precision: 3 }),
    __metadata("design:type", Date)
], AttendanceSettingsEntity.prototype, "updated_at", void 0);
exports.AttendanceSettingsEntity = AttendanceSettingsEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'attendance_settings' }),
    (0, typeorm_1.Index)(['owner_id'], { unique: true })
], AttendanceSettingsEntity);
let QrAttendancePointEntity = class QrAttendancePointEntity {
};
exports.QrAttendancePointEntity = QrAttendancePointEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], QrAttendancePointEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => OwnerEntity, (owner) => owner.qrAttendancePoints, {
        onDelete: 'CASCADE',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'owner_id' }),
    __metadata("design:type", OwnerEntity)
], QrAttendancePointEntity.prototype, "owner", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'owner_id', length: 191 }),
    __metadata("design:type", String)
], QrAttendancePointEntity.prototype, "owner_id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191 }),
    __metadata("design:type", String)
], QrAttendancePointEntity.prototype, "label", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 255, unique: true }),
    __metadata("design:type", String)
], QrAttendancePointEntity.prototype, "code", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'boolean', default: true }),
    __metadata("design:type", Boolean)
], QrAttendancePointEntity.prototype, "is_active", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ type: 'datetime', name: 'created_at', precision: 3 }),
    __metadata("design:type", Date)
], QrAttendancePointEntity.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)({ type: 'datetime', name: 'updated_at', precision: 3 }),
    __metadata("design:type", Date)
], QrAttendancePointEntity.prototype, "updated_at", void 0);
exports.QrAttendancePointEntity = QrAttendancePointEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'qr_attendance_points' }),
    (0, typeorm_1.Index)(['owner_id']),
    (0, typeorm_1.Index)(['code'], { unique: true })
], QrAttendancePointEntity);
let LeavePolicyEntity = class LeavePolicyEntity {
};
exports.LeavePolicyEntity = LeavePolicyEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], LeavePolicyEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'int', name: 'annual_leave_days', default: 0 }),
    __metadata("design:type", Number)
], LeavePolicyEntity.prototype, "annual_leave_days", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'int', name: 'sick_leave_days', default: 0 }),
    __metadata("design:type", Number)
], LeavePolicyEntity.prototype, "sick_leave_days", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'int', name: 'casual_leave_days', default: 0 }),
    __metadata("design:type", Number)
], LeavePolicyEntity.prototype, "casual_leave_days", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'int', name: 'maternity_leave_days', default: 0 }),
    __metadata("design:type", Number)
], LeavePolicyEntity.prototype, "maternity_leave_days", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'int', name: 'paternity_leave_days', default: 0 }),
    __metadata("design:type", Number)
], LeavePolicyEntity.prototype, "paternity_leave_days", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'int', name: 'personal_leave_days', default: 0 }),
    __metadata("design:type", Number)
], LeavePolicyEntity.prototype, "personal_leave_days", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'int', name: 'compensatory_leave_days', default: 0 }),
    __metadata("design:type", Number)
], LeavePolicyEntity.prototype, "compensatory_leave_days", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'int', name: 'unpaid_leave_days', default: 0 }),
    __metadata("design:type", Number)
], LeavePolicyEntity.prototype, "unpaid_leave_days", void 0);
__decorate([
    (0, typeorm_1.OneToOne)(() => OwnerEntity, (owner) => owner.leavePolicy, {
        onDelete: 'RESTRICT',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'owner_id' }),
    __metadata("design:type", OwnerEntity)
], LeavePolicyEntity.prototype, "owner", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'owner_id', length: 191 }),
    __metadata("design:type", String)
], LeavePolicyEntity.prototype, "owner_id", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ type: 'datetime', name: 'created_at', precision: 3 }),
    __metadata("design:type", Date)
], LeavePolicyEntity.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)({ type: 'datetime', name: 'updated_at', precision: 3 }),
    __metadata("design:type", Date)
], LeavePolicyEntity.prototype, "updated_at", void 0);
exports.LeavePolicyEntity = LeavePolicyEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'leave_policy' }),
    (0, typeorm_1.Index)(['owner_id'], { unique: true })
], LeavePolicyEntity);
let DepartmentEntity = class DepartmentEntity {
};
exports.DepartmentEntity = DepartmentEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], DepartmentEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191 }),
    __metadata("design:type", String)
], DepartmentEntity.prototype, "name", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'department_code', length: 191 }),
    __metadata("design:type", String)
], DepartmentEntity.prototype, "department_code", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191, default: 'NT/APL' }),
    __metadata("design:type", String)
], DepartmentEntity.prototype, "description", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => MemberEntity, (member) => member.department),
    __metadata("design:type", Array)
], DepartmentEntity.prototype, "members", void 0);
__decorate([
    (0, typeorm_1.OneToOne)(() => MemberEntity, (member) => member.headed_by, {
        nullable: true,
        onDelete: 'SET NULL',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'department_head_id' }),
    __metadata("design:type", Object)
], DepartmentEntity.prototype, "department_head", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'department_head_id',
        length: 191,
        nullable: true,
    }),
    __metadata("design:type", String)
], DepartmentEntity.prototype, "department_head_id", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'enum',
        enum: GeneralStatusEnum,
        default: GeneralStatusEnum.active,
    }),
    __metadata("design:type", String)
], DepartmentEntity.prototype, "status", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ type: 'datetime', name: 'created_at', precision: 3 }),
    __metadata("design:type", Date)
], DepartmentEntity.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)({ type: 'datetime', name: 'updated_at', precision: 3 }),
    __metadata("design:type", Date)
], DepartmentEntity.prototype, "updated_at", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => OwnerEntity, (owner) => owner.departments, {
        onDelete: 'RESTRICT',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'owner_id' }),
    __metadata("design:type", OwnerEntity)
], DepartmentEntity.prototype, "owner", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'owner_id', length: 191 }),
    __metadata("design:type", String)
], DepartmentEntity.prototype, "owner_id", void 0);
__decorate([
    (0, typeorm_1.ManyToMany)(() => HolidayEntity, (holiday) => holiday.departments),
    __metadata("design:type", Array)
], DepartmentEntity.prototype, "holidays", void 0);
__decorate([
    (0, typeorm_1.ManyToMany)(() => NoticeEntity, (notice) => notice.departments),
    __metadata("design:type", Array)
], DepartmentEntity.prototype, "notices", void 0);
exports.DepartmentEntity = DepartmentEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'departments' }),
    (0, typeorm_1.Index)(['owner_id', 'department_code'], { unique: true }),
    (0, typeorm_1.Index)(['department_head_id'], { unique: true })
], DepartmentEntity);
let DesignationEntity = class DesignationEntity {
};
exports.DesignationEntity = DesignationEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], DesignationEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191 }),
    __metadata("design:type", String)
], DesignationEntity.prototype, "name", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'designation_code', length: 191 }),
    __metadata("design:type", String)
], DesignationEntity.prototype, "designation_code", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191, default: 'NT/APL' }),
    __metadata("design:type", String)
], DesignationEntity.prototype, "description", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'enum',
        enum: GeneralStatusEnum,
        default: GeneralStatusEnum.active,
    }),
    __metadata("design:type", String)
], DesignationEntity.prototype, "status", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => OwnerEntity, (owner) => owner.designations, {
        onDelete: 'RESTRICT',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'owner_id' }),
    __metadata("design:type", OwnerEntity)
], DesignationEntity.prototype, "owner", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'owner_id', length: 191 }),
    __metadata("design:type", String)
], DesignationEntity.prototype, "owner_id", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ type: 'datetime', name: 'created_at', precision: 3 }),
    __metadata("design:type", Date)
], DesignationEntity.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)({ type: 'datetime', name: 'updated_at', precision: 3 }),
    __metadata("design:type", Date)
], DesignationEntity.prototype, "updated_at", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => MemberEntity, (member) => member.designation),
    __metadata("design:type", Array)
], DesignationEntity.prototype, "members", void 0);
exports.DesignationEntity = DesignationEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'designations' }),
    (0, typeorm_1.Index)(['owner_id', 'designation_code'], { unique: true })
], DesignationEntity);
let LocationEntity = class LocationEntity {
};
exports.LocationEntity = LocationEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], LocationEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191 }),
    __metadata("design:type", String)
], LocationEntity.prototype, "name", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'location_code', length: 191 }),
    __metadata("design:type", String)
], LocationEntity.prototype, "location_code", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191, default: 'NT/APL' }),
    __metadata("design:type", String)
], LocationEntity.prototype, "description", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'enum',
        enum: GeneralStatusEnum,
        default: GeneralStatusEnum.active,
    }),
    __metadata("design:type", String)
], LocationEntity.prototype, "status", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => OwnerEntity, (owner) => owner.locations, {
        onDelete: 'RESTRICT',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'owner_id' }),
    __metadata("design:type", OwnerEntity)
], LocationEntity.prototype, "owner", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'owner_id', length: 191 }),
    __metadata("design:type", String)
], LocationEntity.prototype, "owner_id", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ type: 'datetime', name: 'created_at', precision: 3 }),
    __metadata("design:type", Date)
], LocationEntity.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)({ type: 'datetime', name: 'updated_at', precision: 3 }),
    __metadata("design:type", Date)
], LocationEntity.prototype, "updated_at", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => MemberEntity, (member) => member.location),
    __metadata("design:type", Array)
], LocationEntity.prototype, "members", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => AttendanceEntity, (attendance) => attendance.location),
    __metadata("design:type", Array)
], LocationEntity.prototype, "attendances", void 0);
exports.LocationEntity = LocationEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'locations' }),
    (0, typeorm_1.Index)(['owner_id', 'location_code'], { unique: true })
], LocationEntity);
let EmployementTypeEntity = class EmployementTypeEntity {
};
exports.EmployementTypeEntity = EmployementTypeEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], EmployementTypeEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191 }),
    __metadata("design:type", String)
], EmployementTypeEntity.prototype, "name", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191, default: 'NT/APL' }),
    __metadata("design:type", String)
], EmployementTypeEntity.prototype, "description", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'enum',
        enum: GeneralStatusEnum,
        default: GeneralStatusEnum.active,
    }),
    __metadata("design:type", String)
], EmployementTypeEntity.prototype, "status", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => OwnerEntity, (owner) => owner.employementTypes, {
        onDelete: 'RESTRICT',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'owner_id' }),
    __metadata("design:type", OwnerEntity)
], EmployementTypeEntity.prototype, "owner", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'owner_id', length: 191 }),
    __metadata("design:type", String)
], EmployementTypeEntity.prototype, "owner_id", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ type: 'datetime', name: 'created_at', precision: 3 }),
    __metadata("design:type", Date)
], EmployementTypeEntity.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)({ type: 'datetime', name: 'updated_at', precision: 3 }),
    __metadata("design:type", Date)
], EmployementTypeEntity.prototype, "updated_at", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => MemberEntity, (member) => member.employment_type),
    __metadata("design:type", Array)
], EmployementTypeEntity.prototype, "members", void 0);
exports.EmployementTypeEntity = EmployementTypeEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'employement_types' })
], EmployementTypeEntity);
let HiringSourceEntity = class HiringSourceEntity {
};
exports.HiringSourceEntity = HiringSourceEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], HiringSourceEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191 }),
    __metadata("design:type", String)
], HiringSourceEntity.prototype, "name", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191, default: 'NT/APL' }),
    __metadata("design:type", String)
], HiringSourceEntity.prototype, "description", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'enum',
        enum: GeneralStatusEnum,
        default: GeneralStatusEnum.active,
    }),
    __metadata("design:type", String)
], HiringSourceEntity.prototype, "status", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => OwnerEntity, (owner) => owner.hiringSources, {
        onDelete: 'RESTRICT',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'owner_id' }),
    __metadata("design:type", OwnerEntity)
], HiringSourceEntity.prototype, "owner", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'owner_id', length: 191 }),
    __metadata("design:type", String)
], HiringSourceEntity.prototype, "owner_id", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ type: 'datetime', name: 'created_at', precision: 3 }),
    __metadata("design:type", Date)
], HiringSourceEntity.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)({ type: 'datetime', name: 'updated_at', precision: 3 }),
    __metadata("design:type", Date)
], HiringSourceEntity.prototype, "updated_at", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => MemberEntity, (member) => member.hiring_source),
    __metadata("design:type", Array)
], HiringSourceEntity.prototype, "members", void 0);
exports.HiringSourceEntity = HiringSourceEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'hiring_sources' }),
    (0, typeorm_1.Index)(['owner_id', 'name'], { unique: true })
], HiringSourceEntity);
let EventEntity = class EventEntity {
};
exports.EventEntity = EventEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], EventEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191 }),
    __metadata("design:type", String)
], EventEntity.prototype, "title", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'json' }),
    __metadata("design:type", Object)
], EventEntity.prototype, "image", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'enum', enum: EventTypeEnum, default: EventTypeEnum.meeting }),
    __metadata("design:type", String)
], EventEntity.prototype, "category", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'datetime', default: () => 'CURRENT_TIMESTAMP' }),
    __metadata("design:type", Date)
], EventEntity.prototype, "date", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'datetime',
        name: 'start_time',
        default: () => 'CURRENT_TIMESTAMP',
    }),
    __metadata("design:type", Date)
], EventEntity.prototype, "start_time", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'datetime',
        name: 'end_time',
        default: () => 'CURRENT_TIMESTAMP',
    }),
    __metadata("design:type", Date)
], EventEntity.prototype, "end_time", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191, default: 'NT/APL' }),
    __metadata("design:type", String)
], EventEntity.prototype, "location", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'int', default: 0 }),
    __metadata("design:type", Number)
], EventEntity.prototype, "attendees", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'event_owner',
        length: 191,
        default: 'NT/APL',
    }),
    __metadata("design:type", String)
], EventEntity.prototype, "event_owner", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191, default: 'NT/APL' }),
    __metadata("design:type", String)
], EventEntity.prototype, "description", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => OwnerEntity, (owner) => owner.events, {
        onDelete: 'RESTRICT',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'owner_id' }),
    __metadata("design:type", OwnerEntity)
], EventEntity.prototype, "owner", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'owner_id', length: 191 }),
    __metadata("design:type", String)
], EventEntity.prototype, "owner_id", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ type: 'datetime', name: 'created_at', precision: 3 }),
    __metadata("design:type", Date)
], EventEntity.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)({ type: 'datetime', name: 'updated_at', precision: 3 }),
    __metadata("design:type", Date)
], EventEntity.prototype, "updated_at", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => MemberEntity, (member) => member.events),
    __metadata("design:type", Array)
], EventEntity.prototype, "members", void 0);
exports.EventEntity = EventEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'events' }),
    (0, typeorm_1.Index)(['owner_id'])
], EventEntity);
let NoticeEntity = class NoticeEntity {
};
exports.NoticeEntity = NoticeEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], NoticeEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191 }),
    __metadata("design:type", String)
], NoticeEntity.prototype, "title", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191, default: 'NT/APL' }),
    __metadata("design:type", String)
], NoticeEntity.prototype, "content", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'json' }),
    __metadata("design:type", Object)
], NoticeEntity.prototype, "document", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'enum',
        enum: NoticeStatusEnum,
        default: NoticeStatusEnum.published,
    }),
    __metadata("design:type", String)
], NoticeEntity.prototype, "status", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'enum', enum: PriorityEnum, default: PriorityEnum.medium }),
    __metadata("design:type", String)
], NoticeEntity.prototype, "priority", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'created_by',
        length: 191,
        default: 'NT/APL',
    }),
    __metadata("design:type", String)
], NoticeEntity.prototype, "created_by", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'datetime', name: 'published_at', nullable: true }),
    __metadata("design:type", Date)
], NoticeEntity.prototype, "published_at", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'datetime', name: 'expire_at', nullable: true }),
    __metadata("design:type", Date)
], NoticeEntity.prototype, "expire_at", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'boolean', name: 'is_pinned', default: false }),
    __metadata("design:type", Boolean)
], NoticeEntity.prototype, "is_pinned", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'boolean', name: 'required_acknowledgment', default: false }),
    __metadata("design:type", Boolean)
], NoticeEntity.prototype, "required_acknowledgment", void 0);
__decorate([
    (0, typeorm_1.ManyToMany)(() => MemberEntity, (member) => member.up_notices),
    (0, typeorm_1.JoinTable)({
        name: '_noticeupacknowledgment',
        joinColumn: { name: 'B', referencedColumnName: 'id' },
        inverseJoinColumn: { name: 'A', referencedColumnName: 'id' },
    }),
    __metadata("design:type", Array)
], NoticeEntity.prototype, "up_acknowledgment", void 0);
__decorate([
    (0, typeorm_1.ManyToMany)(() => MemberEntity, (member) => member.down_notices),
    (0, typeorm_1.JoinTable)({
        name: '_noticedownacknowledgment',
        joinColumn: { name: 'B', referencedColumnName: 'id' },
        inverseJoinColumn: { name: 'A', referencedColumnName: 'id' },
    }),
    __metadata("design:type", Array)
], NoticeEntity.prototype, "down_acknowledgment", void 0);
__decorate([
    (0, typeorm_1.ManyToMany)(() => DepartmentEntity, (department) => department.notices),
    (0, typeorm_1.JoinTable)({
        name: '_noticedepartments',
        joinColumn: { name: 'B', referencedColumnName: 'id' },
        inverseJoinColumn: { name: 'A', referencedColumnName: 'id' },
    }),
    __metadata("design:type", Array)
], NoticeEntity.prototype, "departments", void 0);
__decorate([
    (0, typeorm_1.ManyToMany)(() => MemberEntity, (member) => member.notice_recipients),
    (0, typeorm_1.JoinTable)({
        name: '_noticemembers',
        joinColumn: { name: 'B', referencedColumnName: 'id' },
        inverseJoinColumn: { name: 'A', referencedColumnName: 'id' },
    }),
    __metadata("design:type", Array)
], NoticeEntity.prototype, "recipients", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => OwnerEntity, (owner) => owner.notices, {
        onDelete: 'RESTRICT',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'owner_id' }),
    __metadata("design:type", OwnerEntity)
], NoticeEntity.prototype, "owner", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'owner_id', length: 191 }),
    __metadata("design:type", String)
], NoticeEntity.prototype, "owner_id", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ type: 'datetime', name: 'created_at', precision: 3 }),
    __metadata("design:type", Date)
], NoticeEntity.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)({ type: 'datetime', name: 'updated_at', precision: 3 }),
    __metadata("design:type", Date)
], NoticeEntity.prototype, "updated_at", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => MemberEntity, (member) => member.notices),
    __metadata("design:type", Array)
], NoticeEntity.prototype, "members", void 0);
exports.NoticeEntity = NoticeEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'notices' }),
    (0, typeorm_1.Index)(['owner_id'])
], NoticeEntity);
let MemberEntity = class MemberEntity {
};
exports.MemberEntity = MemberEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], MemberEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191 }),
    __metadata("design:type", String)
], MemberEntity.prototype, "email", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'work_email',
        length: 191,
        default: 'NT/APL',
    }),
    __metadata("design:type", String)
], MemberEntity.prototype, "work_email", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'employee_id', length: 191 }),
    __metadata("design:type", String)
], MemberEntity.prototype, "employee_id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'json' }),
    __metadata("design:type", Object)
], MemberEntity.prototype, "image", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191, default: 'NT/APL' }),
    __metadata("design:type", String)
], MemberEntity.prototype, "nickname", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'first_name', length: 191 }),
    __metadata("design:type", String)
], MemberEntity.prototype, "first_name", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'last_name',
        length: 191,
        default: 'NT/APL',
    }),
    __metadata("design:type", String)
], MemberEntity.prototype, "last_name", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191 }),
    __metadata("design:type", String)
], MemberEntity.prototype, "password", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191, default: 'NT/APL' }),
    __metadata("design:type", String)
], MemberEntity.prototype, "about", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191, default: 'NT/APL' }),
    __metadata("design:type", String)
], MemberEntity.prototype, "expertise", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'work_phone',
        length: 191,
        default: 'NT/APL',
    }),
    __metadata("design:type", String)
], MemberEntity.prototype, "work_phone", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191, default: 'NT/APL' }),
    __metadata("design:type", String)
], MemberEntity.prototype, "phone", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191, default: 'NT/APL' }),
    __metadata("design:type", String)
], MemberEntity.prototype, "father_name", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191, default: 'NT/APL' }),
    __metadata("design:type", String)
], MemberEntity.prototype, "mother_name", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191, default: 'NT/APL' }),
    __metadata("design:type", String)
], MemberEntity.prototype, "emergency_contact_name", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191, default: 'NT/APL' }),
    __metadata("design:type", String)
], MemberEntity.prototype, "emergency_contact_phone", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191, default: 'NT/APL' }),
    __metadata("design:type", String)
], MemberEntity.prototype, "emergency_contact_relationship", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'enum', enum: RoleEnum, default: RoleEnum.member }),
    __metadata("design:type", String)
], MemberEntity.prototype, "role", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'access_role_id',
        length: 36,
        nullable: true,
    }),
    __metadata("design:type", String)
], MemberEntity.prototype, "access_role_id", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'enum',
        enum: MaritalStatusEnum,
        name: 'marital_status',
        default: MaritalStatusEnum.single,
    }),
    __metadata("design:type", String)
], MemberEntity.prototype, "marital_status", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'present_address_line_one',
        length: 191,
        default: 'NT/APL',
    }),
    __metadata("design:type", String)
], MemberEntity.prototype, "present_address_line_one", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'present_address_line_two',
        length: 191,
        default: 'NT/APL',
    }),
    __metadata("design:type", String)
], MemberEntity.prototype, "present_address_line_two", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'present_address_city',
        length: 191,
        default: 'NT/APL',
    }),
    __metadata("design:type", String)
], MemberEntity.prototype, "present_address_city", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'present_address_country',
        length: 191,
        default: 'NT/APL',
    }),
    __metadata("design:type", String)
], MemberEntity.prototype, "present_address_country", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'present_address_state',
        length: 191,
        default: 'NT/APL',
    }),
    __metadata("design:type", String)
], MemberEntity.prototype, "present_address_state", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'present_address_zip_code',
        length: 191,
        default: 'NT/APL',
    }),
    __metadata("design:type", String)
], MemberEntity.prototype, "present_address_zip_code", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'permanent_address_line_one',
        length: 191,
        default: 'NT/APL',
    }),
    __metadata("design:type", String)
], MemberEntity.prototype, "permanent_address_line_one", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'permanent_address_line_two',
        length: 191,
        default: 'NT/APL',
    }),
    __metadata("design:type", String)
], MemberEntity.prototype, "permanent_address_line_two", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'permanent_address_city',
        length: 191,
        default: 'NT/APL',
    }),
    __metadata("design:type", String)
], MemberEntity.prototype, "permanent_address_city", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'permanent_address_country',
        length: 191,
        default: 'NT/APL',
    }),
    __metadata("design:type", String)
], MemberEntity.prototype, "permanent_address_country", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'permanent_address_state',
        length: 191,
        default: 'NT/APL',
    }),
    __metadata("design:type", String)
], MemberEntity.prototype, "permanent_address_state", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'permanent_address_zip_code',
        length: 191,
        default: 'NT/APL',
    }),
    __metadata("design:type", String)
], MemberEntity.prototype, "permanent_address_zip_code", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'enum', enum: GenderEnum, default: GenderEnum.male }),
    __metadata("design:type", String)
], MemberEntity.prototype, "gender", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'datetime', name: 'date_of_birth', nullable: true }),
    __metadata("design:type", Date)
], MemberEntity.prototype, "date_of_birth", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'datetime',
        name: 'date_of_joining',
        nullable: true,
        default: () => 'CURRENT_TIMESTAMP',
    }),
    __metadata("design:type", Date)
], MemberEntity.prototype, "date_of_joining", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => DepartmentEntity, (department) => department.members, {
        nullable: true,
        onDelete: 'SET NULL',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'department_id' }),
    __metadata("design:type", DepartmentEntity)
], MemberEntity.prototype, "department", void 0);
__decorate([
    (0, typeorm_1.OneToOne)(() => DepartmentEntity, (department) => department.department_head),
    __metadata("design:type", DepartmentEntity)
], MemberEntity.prototype, "headed_by", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => MemberEntity, (member) => member.reportees, {
        nullable: true,
        onDelete: 'SET NULL',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'reporting_manager_id' }),
    __metadata("design:type", MemberEntity)
], MemberEntity.prototype, "reporting_manager", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => MemberEntity, (member) => member.reporting_manager),
    __metadata("design:type", Array)
], MemberEntity.prototype, "reportees", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'department_id',
        length: 191,
        nullable: true,
    }),
    __metadata("design:type", String)
], MemberEntity.prototype, "department_id", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => DesignationEntity, (designation) => designation.members, {
        nullable: true,
        onDelete: 'SET NULL',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'designation_id' }),
    __metadata("design:type", DesignationEntity)
], MemberEntity.prototype, "designation", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'designation_id',
        length: 191,
        nullable: true,
    }),
    __metadata("design:type", String)
], MemberEntity.prototype, "designation_id", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => LocationEntity, (location) => location.members, {
        nullable: true,
        onDelete: 'SET NULL',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'location_id' }),
    __metadata("design:type", LocationEntity)
], MemberEntity.prototype, "location", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'location_id', length: 191, nullable: true }),
    __metadata("design:type", String)
], MemberEntity.prototype, "location_id", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => EmployementTypeEntity, (employmentType) => employmentType.members, { nullable: true, onDelete: 'SET NULL' }),
    (0, typeorm_1.JoinColumn)({ name: 'employment_type_id' }),
    __metadata("design:type", EmployementTypeEntity)
], MemberEntity.prototype, "employment_type", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'employment_type_id',
        length: 191,
        nullable: true,
    }),
    __metadata("design:type", String)
], MemberEntity.prototype, "employment_type_id", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => HiringSourceEntity, (hiringSource) => hiringSource.members, {
        nullable: true,
        onDelete: 'SET NULL',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'hiring_source_id' }),
    __metadata("design:type", HiringSourceEntity)
], MemberEntity.prototype, "hiring_source", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'hiring_source_id',
        length: 191,
        nullable: true,
    }),
    __metadata("design:type", String)
], MemberEntity.prototype, "hiring_source_id", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'reporting_manager_id',
        length: 191,
        nullable: true,
    }),
    __metadata("design:type", String)
], MemberEntity.prototype, "reporting_manager_id", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'enum',
        enum: MemberStatusEnum,
        default: MemberStatusEnum.active,
    }),
    __metadata("design:type", String)
], MemberEntity.prototype, "status", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ type: 'datetime', name: 'created_at', precision: 3 }),
    __metadata("design:type", Date)
], MemberEntity.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)({ type: 'datetime', name: 'updated_at', precision: 3 }),
    __metadata("design:type", Date)
], MemberEntity.prototype, "updated_at", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => WorkExperienceEntity, (workExperience) => workExperience.member),
    __metadata("design:type", Array)
], MemberEntity.prototype, "work_experiences", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => EducationEntity, (education) => education.member),
    __metadata("design:type", Array)
], MemberEntity.prototype, "educations", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => AttendanceEntity, (attendance) => attendance.member),
    __metadata("design:type", Array)
], MemberEntity.prototype, "attendances", void 0);
__decorate([
    (0, typeorm_1.OneToOne)(() => TeacherDeviceEntity, (device) => device.member),
    __metadata("design:type", Object)
], MemberEntity.prototype, "teacher_device", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => DeviceChangeRequestEntity, (req) => req.member),
    __metadata("design:type", Array)
], MemberEntity.prototype, "device_change_requests", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => LeaveEntity, (leave) => leave.member),
    __metadata("design:type", Array)
], MemberEntity.prototype, "leaves", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => LeaveEntity, (leave) => leave.approver_member),
    __metadata("design:type", Array)
], MemberEntity.prototype, "approved_leaves", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => EventEntity, (event) => event.members, {
        nullable: true,
        onDelete: 'SET NULL',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'eventsId' }),
    __metadata("design:type", EventEntity)
], MemberEntity.prototype, "events", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'eventsId', length: 191, nullable: true }),
    __metadata("design:type", String)
], MemberEntity.prototype, "eventsId", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => OwnerEntity, (owner) => owner.members, {
        onDelete: 'RESTRICT',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'owner_id' }),
    __metadata("design:type", OwnerEntity)
], MemberEntity.prototype, "owner", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'owner_id', length: 191 }),
    __metadata("design:type", String)
], MemberEntity.prototype, "owner_id", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => NoticeEntity, (notice) => notice.members),
    __metadata("design:type", Array)
], MemberEntity.prototype, "notice_entries", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => NoticeEntity, (notice) => notice.members, {
        nullable: true,
        onDelete: 'SET NULL',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'noticesId' }),
    __metadata("design:type", NoticeEntity)
], MemberEntity.prototype, "notices", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'noticesId', length: 191, nullable: true }),
    __metadata("design:type", String)
], MemberEntity.prototype, "noticesId", void 0);
__decorate([
    (0, typeorm_1.ManyToMany)(() => NoticeEntity, (notice) => notice.up_acknowledgment),
    __metadata("design:type", Array)
], MemberEntity.prototype, "up_notices", void 0);
__decorate([
    (0, typeorm_1.ManyToMany)(() => NoticeEntity, (notice) => notice.down_acknowledgment),
    __metadata("design:type", Array)
], MemberEntity.prototype, "down_notices", void 0);
__decorate([
    (0, typeorm_1.ManyToMany)(() => NoticeEntity, (notice) => notice.recipients),
    __metadata("design:type", Array)
], MemberEntity.prototype, "notice_recipients", void 0);
exports.MemberEntity = MemberEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'members' }),
    (0, typeorm_1.Index)(['department_id']),
    (0, typeorm_1.Index)(['designation_id']),
    (0, typeorm_1.Index)(['location_id']),
    (0, typeorm_1.Index)(['employment_type_id']),
    (0, typeorm_1.Index)(['hiring_source_id']),
    (0, typeorm_1.Index)(['reporting_manager_id']),
    (0, typeorm_1.Index)(['status']),
    (0, typeorm_1.Index)(['owner_id'])
], MemberEntity);
let WorkExperienceEntity = class WorkExperienceEntity {
};
exports.WorkExperienceEntity = WorkExperienceEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], WorkExperienceEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => MemberEntity, (member) => member.work_experiences, {
        onDelete: 'RESTRICT',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'member_id' }),
    __metadata("design:type", MemberEntity)
], WorkExperienceEntity.prototype, "member", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'member_id', length: 191 }),
    __metadata("design:type", String)
], WorkExperienceEntity.prototype, "member_id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191 }),
    __metadata("design:type", String)
], WorkExperienceEntity.prototype, "company", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191 }),
    __metadata("design:type", String)
], WorkExperienceEntity.prototype, "position", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'datetime', name: 'start_date' }),
    __metadata("design:type", Date)
], WorkExperienceEntity.prototype, "start_date", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'datetime', name: 'end_date', nullable: true }),
    __metadata("design:type", Date)
], WorkExperienceEntity.prototype, "end_date", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191, default: 'NT/APL' }),
    __metadata("design:type", String)
], WorkExperienceEntity.prototype, "description", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'boolean', default: false }),
    __metadata("design:type", Boolean)
], WorkExperienceEntity.prototype, "relevant", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => OwnerEntity, (owner) => owner.workExperiences, {
        onDelete: 'RESTRICT',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'owner_id' }),
    __metadata("design:type", OwnerEntity)
], WorkExperienceEntity.prototype, "owner", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'owner_id', length: 191 }),
    __metadata("design:type", String)
], WorkExperienceEntity.prototype, "owner_id", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ type: 'datetime', name: 'created_at', precision: 3 }),
    __metadata("design:type", Date)
], WorkExperienceEntity.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)({ type: 'datetime', name: 'updated_at', precision: 3 }),
    __metadata("design:type", Date)
], WorkExperienceEntity.prototype, "updated_at", void 0);
exports.WorkExperienceEntity = WorkExperienceEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'work_experiences' }),
    (0, typeorm_1.Index)(['member_id']),
    (0, typeorm_1.Index)(['owner_id'])
], WorkExperienceEntity);
let EducationEntity = class EducationEntity {
};
exports.EducationEntity = EducationEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], EducationEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => MemberEntity, (member) => member.educations, {
        onDelete: 'RESTRICT',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'member_id' }),
    __metadata("design:type", MemberEntity)
], EducationEntity.prototype, "member", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'member_id', length: 191 }),
    __metadata("design:type", String)
], EducationEntity.prototype, "member_id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191 }),
    __metadata("design:type", String)
], EducationEntity.prototype, "institution", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191 }),
    __metadata("design:type", String)
], EducationEntity.prototype, "degree", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191 }),
    __metadata("design:type", String)
], EducationEntity.prototype, "field", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'datetime', name: 'start_date' }),
    __metadata("design:type", Date)
], EducationEntity.prototype, "start_date", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'datetime', name: 'end_date', nullable: true }),
    __metadata("design:type", Date)
], EducationEntity.prototype, "end_date", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191, default: 'NT/APL' }),
    __metadata("design:type", String)
], EducationEntity.prototype, "description", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'boolean', default: false }),
    __metadata("design:type", Boolean)
], EducationEntity.prototype, "relevant", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => OwnerEntity, (owner) => owner.educations, {
        onDelete: 'RESTRICT',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'owner_id' }),
    __metadata("design:type", OwnerEntity)
], EducationEntity.prototype, "owner", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'owner_id', length: 191 }),
    __metadata("design:type", String)
], EducationEntity.prototype, "owner_id", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ type: 'datetime', name: 'created_at', precision: 3 }),
    __metadata("design:type", Date)
], EducationEntity.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)({ type: 'datetime', name: 'updated_at', precision: 3 }),
    __metadata("design:type", Date)
], EducationEntity.prototype, "updated_at", void 0);
exports.EducationEntity = EducationEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'educations' }),
    (0, typeorm_1.Index)(['member_id']),
    (0, typeorm_1.Index)(['owner_id'])
], EducationEntity);
let AttendanceEntity = class AttendanceEntity {
};
exports.AttendanceEntity = AttendanceEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], AttendanceEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => MemberEntity, (member) => member.attendances, {
        onDelete: 'CASCADE',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'member_id' }),
    __metadata("design:type", MemberEntity)
], AttendanceEntity.prototype, "member", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'member_id', length: 191 }),
    __metadata("design:type", String)
], AttendanceEntity.prototype, "member_id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'date' }),
    __metadata("design:type", Object)
], AttendanceEntity.prototype, "date", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'enum',
        enum: AttendanceTypeEnum,
        default: AttendanceTypeEnum.in_office,
    }),
    __metadata("design:type", String)
], AttendanceEntity.prototype, "type", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'datetime', name: 'check_in', nullable: true }),
    __metadata("design:type", Date)
], AttendanceEntity.prototype, "check_in", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'datetime', name: 'check_out', nullable: true }),
    __metadata("design:type", Date)
], AttendanceEntity.prototype, "check_out", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'float', name: 'work_hours', default: 0 }),
    __metadata("design:type", Number)
], AttendanceEntity.prototype, "work_hours", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'float', name: 'break_hours', default: 0 }),
    __metadata("design:type", Number)
], AttendanceEntity.prototype, "break_hours", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'float', name: 'net_hours', default: 0 }),
    __metadata("design:type", Number)
], AttendanceEntity.prototype, "net_hours", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'float', name: 'overtime_hours', default: 0 }),
    __metadata("design:type", Number)
], AttendanceEntity.prototype, "overtime_hours", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => LocationEntity, (location) => location.attendances, {
        nullable: true,
        onDelete: 'SET NULL',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'location_id' }),
    __metadata("design:type", LocationEntity)
], AttendanceEntity.prototype, "location", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'location_id', length: 191, nullable: true }),
    __metadata("design:type", String)
], AttendanceEntity.prototype, "location_id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191, default: 'NT/APL' }),
    __metadata("design:type", String)
], AttendanceEntity.prototype, "note", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'enum',
        enum: AttendanceStatusEnum,
        default: AttendanceStatusEnum.present,
    }),
    __metadata("design:type", String)
], AttendanceEntity.prototype, "status", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'check_in_ip', length: 191, nullable: true }),
    __metadata("design:type", String)
], AttendanceEntity.prototype, "check_in_ip", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'check_out_ip', length: 191, nullable: true }),
    __metadata("design:type", String)
], AttendanceEntity.prototype, "check_out_ip", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'device_id', length: 255, nullable: true }),
    __metadata("design:type", String)
], AttendanceEntity.prototype, "device_id", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'attendance_method',
        length: 32,
        default: 'manual',
    }),
    __metadata("design:type", String)
], AttendanceEntity.prototype, "attendance_method", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'qr_point_id', length: 191, nullable: true }),
    __metadata("design:type", String)
], AttendanceEntity.prototype, "qr_point_id", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'boolean',
        name: 'checkout_reminder_sent',
        default: false,
    }),
    __metadata("design:type", Boolean)
], AttendanceEntity.prototype, "checkout_reminder_sent", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'datetime',
        name: 'checkout_reminder_sent_at',
        nullable: true,
    }),
    __metadata("design:type", Date)
], AttendanceEntity.prototype, "checkout_reminder_sent_at", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'decimal',
        name: 'check_in_latitude',
        precision: 10,
        scale: 7,
        nullable: true,
    }),
    __metadata("design:type", Number)
], AttendanceEntity.prototype, "check_in_latitude", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'decimal',
        name: 'check_in_longitude',
        precision: 10,
        scale: 7,
        nullable: true,
    }),
    __metadata("design:type", Number)
], AttendanceEntity.prototype, "check_in_longitude", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'int',
        name: 'check_in_distance_meters',
        nullable: true,
    }),
    __metadata("design:type", Number)
], AttendanceEntity.prototype, "check_in_distance_meters", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'decimal',
        name: 'check_out_latitude',
        precision: 10,
        scale: 7,
        nullable: true,
    }),
    __metadata("design:type", Number)
], AttendanceEntity.prototype, "check_out_latitude", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'decimal',
        name: 'check_out_longitude',
        precision: 10,
        scale: 7,
        nullable: true,
    }),
    __metadata("design:type", Number)
], AttendanceEntity.prototype, "check_out_longitude", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'int',
        name: 'check_out_distance_meters',
        nullable: true,
    }),
    __metadata("design:type", Number)
], AttendanceEntity.prototype, "check_out_distance_meters", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => OwnerEntity, (owner) => owner.attendances, {
        onDelete: 'RESTRICT',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'owner_id' }),
    __metadata("design:type", OwnerEntity)
], AttendanceEntity.prototype, "owner", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'owner_id', length: 191 }),
    __metadata("design:type", String)
], AttendanceEntity.prototype, "owner_id", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ type: 'datetime', name: 'created_at', precision: 3 }),
    __metadata("design:type", Date)
], AttendanceEntity.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)({ type: 'datetime', name: 'updated_at', precision: 3 }),
    __metadata("design:type", Date)
], AttendanceEntity.prototype, "updated_at", void 0);
exports.AttendanceEntity = AttendanceEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'attendances' }),
    (0, typeorm_1.Index)(['member_id', 'date'], { unique: true }),
    (0, typeorm_1.Index)(['member_id']),
    (0, typeorm_1.Index)(['location_id']),
    (0, typeorm_1.Index)(['owner_id'])
], AttendanceEntity);
let TeacherDeviceEntity = class TeacherDeviceEntity {
};
exports.TeacherDeviceEntity = TeacherDeviceEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], TeacherDeviceEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.OneToOne)(() => MemberEntity, (member) => member.teacher_device, {
        onDelete: 'CASCADE',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'member_id' }),
    __metadata("design:type", MemberEntity)
], TeacherDeviceEntity.prototype, "member", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'member_id', length: 191 }),
    __metadata("design:type", String)
], TeacherDeviceEntity.prototype, "member_id", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => OwnerEntity, (owner) => owner.teacherDevices, {
        onDelete: 'CASCADE',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'owner_id' }),
    __metadata("design:type", OwnerEntity)
], TeacherDeviceEntity.prototype, "owner", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'owner_id', length: 191 }),
    __metadata("design:type", String)
], TeacherDeviceEntity.prototype, "owner_id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'device_id', length: 255 }),
    __metadata("design:type", String)
], TeacherDeviceEntity.prototype, "device_id", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'device_name',
        length: 255,
        nullable: true,
    }),
    __metadata("design:type", String)
], TeacherDeviceEntity.prototype, "device_name", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'last_ip', length: 191, nullable: true }),
    __metadata("design:type", String)
], TeacherDeviceEntity.prototype, "last_ip", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'datetime',
        name: 'bound_at',
        default: () => 'CURRENT_TIMESTAMP',
    }),
    __metadata("design:type", Date)
], TeacherDeviceEntity.prototype, "bound_at", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'datetime', name: 'last_active_at', nullable: true }),
    __metadata("design:type", Date)
], TeacherDeviceEntity.prototype, "last_active_at", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ type: 'datetime', name: 'created_at', precision: 3 }),
    __metadata("design:type", Date)
], TeacherDeviceEntity.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)({ type: 'datetime', name: 'updated_at', precision: 3 }),
    __metadata("design:type", Date)
], TeacherDeviceEntity.prototype, "updated_at", void 0);
exports.TeacherDeviceEntity = TeacherDeviceEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'teacher_devices' }),
    (0, typeorm_1.Index)(['member_id'], { unique: true }),
    (0, typeorm_1.Index)(['device_id']),
    (0, typeorm_1.Index)(['owner_id'])
], TeacherDeviceEntity);
let DeviceChangeRequestEntity = class DeviceChangeRequestEntity {
};
exports.DeviceChangeRequestEntity = DeviceChangeRequestEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], DeviceChangeRequestEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => MemberEntity, (member) => member.device_change_requests, {
        onDelete: 'CASCADE',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'member_id' }),
    __metadata("design:type", MemberEntity)
], DeviceChangeRequestEntity.prototype, "member", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'member_id', length: 191 }),
    __metadata("design:type", String)
], DeviceChangeRequestEntity.prototype, "member_id", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => OwnerEntity, (owner) => owner.deviceChangeRequests, {
        onDelete: 'CASCADE',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'owner_id' }),
    __metadata("design:type", OwnerEntity)
], DeviceChangeRequestEntity.prototype, "owner", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'owner_id', length: 191 }),
    __metadata("design:type", String)
], DeviceChangeRequestEntity.prototype, "owner_id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'old_device_id', length: 255 }),
    __metadata("design:type", String)
], DeviceChangeRequestEntity.prototype, "old_device_id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'new_device_id', length: 255 }),
    __metadata("design:type", String)
], DeviceChangeRequestEntity.prototype, "new_device_id", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'new_device_name',
        length: 255,
        nullable: true,
    }),
    __metadata("design:type", String)
], DeviceChangeRequestEntity.prototype, "new_device_name", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'text', nullable: true }),
    __metadata("design:type", String)
], DeviceChangeRequestEntity.prototype, "reason", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'enum',
        enum: DeviceChangeRequestStatusEnum,
        default: DeviceChangeRequestStatusEnum.pending,
    }),
    __metadata("design:type", String)
], DeviceChangeRequestEntity.prototype, "status", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'reviewed_by_id',
        length: 191,
        nullable: true,
    }),
    __metadata("design:type", String)
], DeviceChangeRequestEntity.prototype, "reviewed_by_id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'datetime', name: 'reviewed_at', nullable: true }),
    __metadata("design:type", Date)
], DeviceChangeRequestEntity.prototype, "reviewed_at", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'text', name: 'admin_note', nullable: true }),
    __metadata("design:type", String)
], DeviceChangeRequestEntity.prototype, "admin_note", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ type: 'datetime', name: 'created_at', precision: 3 }),
    __metadata("design:type", Date)
], DeviceChangeRequestEntity.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)({ type: 'datetime', name: 'updated_at', precision: 3 }),
    __metadata("design:type", Date)
], DeviceChangeRequestEntity.prototype, "updated_at", void 0);
exports.DeviceChangeRequestEntity = DeviceChangeRequestEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'device_change_requests' }),
    (0, typeorm_1.Index)(['member_id']),
    (0, typeorm_1.Index)(['owner_id', 'status'])
], DeviceChangeRequestEntity);
let LeaveEntity = class LeaveEntity {
};
exports.LeaveEntity = LeaveEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], LeaveEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => MemberEntity, (member) => member.leaves, {
        onDelete: 'RESTRICT',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'member_id' }),
    __metadata("design:type", MemberEntity)
], LeaveEntity.prototype, "member", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'member_id', length: 191 }),
    __metadata("design:type", String)
], LeaveEntity.prototype, "member_id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'datetime', name: 'start_date' }),
    __metadata("design:type", Date)
], LeaveEntity.prototype, "start_date", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'datetime', name: 'end_date' }),
    __metadata("design:type", Date)
], LeaveEntity.prototype, "end_date", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'enum',
        enum: LeaveTypeEnum,
        name: 'leave_type',
        default: LeaveTypeEnum.annual,
    }),
    __metadata("design:type", String)
], LeaveEntity.prototype, "leave_type", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191, default: 'NT/APL' }),
    __metadata("design:type", String)
], LeaveEntity.prototype, "reason", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'json', nullable: true }),
    __metadata("design:type", Object)
], LeaveEntity.prototype, "document", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => OwnerEntity, (owner) => owner.leaves, {
        onDelete: 'RESTRICT',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'owner_id' }),
    __metadata("design:type", OwnerEntity)
], LeaveEntity.prototype, "owner", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'owner_id', length: 191 }),
    __metadata("design:type", String)
], LeaveEntity.prototype, "owner_id", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'enum',
        enum: LeaveStatusEnum,
        default: LeaveStatusEnum.pending,
    }),
    __metadata("design:type", String)
], LeaveEntity.prototype, "status", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'approver_type',
        length: 191,
        nullable: true,
    }),
    __metadata("design:type", String)
], LeaveEntity.prototype, "approver_type", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => OwnerEntity, (owner) => owner.approvedLeaves, {
        nullable: true,
        onDelete: 'SET NULL',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'approver_owner_id' }),
    __metadata("design:type", OwnerEntity)
], LeaveEntity.prototype, "approver_owner", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'approver_owner_id',
        length: 191,
        nullable: true,
    }),
    __metadata("design:type", String)
], LeaveEntity.prototype, "approver_owner_id", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => MemberEntity, (member) => member.approved_leaves, {
        nullable: true,
        onDelete: 'SET NULL',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'approver_member_id' }),
    __metadata("design:type", MemberEntity)
], LeaveEntity.prototype, "approver_member", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'approver_member_id',
        length: 191,
        nullable: true,
    }),
    __metadata("design:type", String)
], LeaveEntity.prototype, "approver_member_id", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'datetime',
        name: 'approved_at',
        default: () => 'CURRENT_TIMESTAMP',
    }),
    __metadata("design:type", Date)
], LeaveEntity.prototype, "approved_at", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ type: 'datetime', name: 'created_at', precision: 3 }),
    __metadata("design:type", Date)
], LeaveEntity.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)({ type: 'datetime', name: 'updated_at', precision: 3 }),
    __metadata("design:type", Date)
], LeaveEntity.prototype, "updated_at", void 0);
exports.LeaveEntity = LeaveEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'leaves' }),
    (0, typeorm_1.Index)(['member_id']),
    (0, typeorm_1.Index)(['owner_id']),
    (0, typeorm_1.Index)(['approver_owner_id']),
    (0, typeorm_1.Index)(['approver_member_id'])
], LeaveEntity);
let HolidayEntity = class HolidayEntity {
};
exports.HolidayEntity = HolidayEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], HolidayEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191 }),
    __metadata("design:type", String)
], HolidayEntity.prototype, "name", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'enum',
        enum: HolidayTypeEnum,
        name: 'holiday_type',
        default: HolidayTypeEnum.public,
    }),
    __metadata("design:type", String)
], HolidayEntity.prototype, "holiday_type", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'datetime',
        name: 'start_date',
        default: () => 'CURRENT_TIMESTAMP',
    }),
    __metadata("design:type", Date)
], HolidayEntity.prototype, "start_date", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'datetime',
        name: 'end_date',
        default: () => 'CURRENT_TIMESTAMP',
    }),
    __metadata("design:type", Date)
], HolidayEntity.prototype, "end_date", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'boolean', name: 'is_recurring', default: false }),
    __metadata("design:type", Boolean)
], HolidayEntity.prototype, "is_recurring", void 0);
__decorate([
    (0, typeorm_1.ManyToMany)(() => DepartmentEntity, (department) => department.holidays),
    (0, typeorm_1.JoinTable)({
        name: '_holidaydepartments',
        joinColumn: { name: 'B', referencedColumnName: 'id' },
        inverseJoinColumn: { name: 'A', referencedColumnName: 'id' },
    }),
    __metadata("design:type", Array)
], HolidayEntity.prototype, "departments", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191, default: 'NT/APL' }),
    __metadata("design:type", String)
], HolidayEntity.prototype, "description", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => OwnerEntity, (owner) => owner.holidays, {
        onDelete: 'RESTRICT',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'owner_id' }),
    __metadata("design:type", OwnerEntity)
], HolidayEntity.prototype, "owner", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'owner_id', length: 191 }),
    __metadata("design:type", String)
], HolidayEntity.prototype, "owner_id", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ type: 'datetime', name: 'created_at', precision: 3 }),
    __metadata("design:type", Date)
], HolidayEntity.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)({ type: 'datetime', name: 'updated_at', precision: 3 }),
    __metadata("design:type", Date)
], HolidayEntity.prototype, "updated_at", void 0);
exports.HolidayEntity = HolidayEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'holidays' }),
    (0, typeorm_1.Index)(['owner_id'])
], HolidayEntity);
let NotificationEntity = class NotificationEntity {
};
exports.NotificationEntity = NotificationEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], NotificationEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191 }),
    __metadata("design:type", String)
], NotificationEntity.prototype, "title", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'text' }),
    __metadata("design:type", String)
], NotificationEntity.prototype, "message", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'datetime',
        name: 'start_time',
        nullable: true,
    }),
    __metadata("design:type", Date)
], NotificationEntity.prototype, "start_time", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'datetime',
        name: 'end_time',
        nullable: true,
    }),
    __metadata("design:type", Date)
], NotificationEntity.prototype, "end_time", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'float', name: 'duration', nullable: true, default: 0 }),
    __metadata("design:type", Number)
], NotificationEntity.prototype, "duration", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191, nullable: true }),
    __metadata("design:type", String)
], NotificationEntity.prototype, "source_id", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'enum',
        enum: NotificationTypeEnum,
    }),
    __metadata("design:type", String)
], NotificationEntity.prototype, "type", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'json', nullable: true }),
    __metadata("design:type", Object)
], NotificationEntity.prototype, "meta", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191 }),
    __metadata("design:type", String)
], NotificationEntity.prototype, "owner_id", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)(),
    __metadata("design:type", Date)
], NotificationEntity.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)(),
    __metadata("design:type", Date)
], NotificationEntity.prototype, "updated_at", void 0);
exports.NotificationEntity = NotificationEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'notifications' })
], NotificationEntity);
let NotificationTargetEntity = class NotificationTargetEntity {
};
exports.NotificationTargetEntity = NotificationTargetEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], NotificationTargetEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => NotificationEntity, { onDelete: 'CASCADE' }),
    (0, typeorm_1.JoinColumn)({ name: 'notification_id' }),
    __metadata("design:type", NotificationEntity)
], NotificationTargetEntity.prototype, "notification", void 0);
__decorate([
    (0, typeorm_1.Column)(),
    __metadata("design:type", String)
], NotificationTargetEntity.prototype, "notification_id", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'enum',
        enum: NotificationTargetTypeEnum,
    }),
    __metadata("design:type", String)
], NotificationTargetEntity.prototype, "target_type", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'json', nullable: true }),
    __metadata("design:type", Object)
], NotificationTargetEntity.prototype, "target_value", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)(),
    __metadata("design:type", Date)
], NotificationTargetEntity.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)(),
    __metadata("design:type", Date)
], NotificationTargetEntity.prototype, "updated_at", void 0);
exports.NotificationTargetEntity = NotificationTargetEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'notification_targets' })
], NotificationTargetEntity);
let NotificationReceiverEntity = class NotificationReceiverEntity {
};
exports.NotificationReceiverEntity = NotificationReceiverEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], NotificationReceiverEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.Column)(),
    __metadata("design:type", String)
], NotificationReceiverEntity.prototype, "notification_id", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => NotificationEntity, { onDelete: 'CASCADE' }),
    (0, typeorm_1.JoinColumn)({ name: 'notification_id' }),
    __metadata("design:type", NotificationEntity)
], NotificationReceiverEntity.prototype, "notification", void 0);
__decorate([
    (0, typeorm_1.Column)(),
    __metadata("design:type", String)
], NotificationReceiverEntity.prototype, "member_id", void 0);
__decorate([
    (0, typeorm_1.Column)({ default: false }),
    __metadata("design:type", Boolean)
], NotificationReceiverEntity.prototype, "is_read", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'datetime',
        name: 'read_at',
        default: () => 'CURRENT_TIMESTAMP',
    }),
    __metadata("design:type", Date)
], NotificationReceiverEntity.prototype, "read_at", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)(),
    __metadata("design:type", Date)
], NotificationReceiverEntity.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)(),
    __metadata("design:type", Date)
], NotificationReceiverEntity.prototype, "updated_at", void 0);
exports.NotificationReceiverEntity = NotificationReceiverEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'notification_receivers' })
], NotificationReceiverEntity);
let AccessRoleEntity = class AccessRoleEntity {
};
exports.AccessRoleEntity = AccessRoleEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], AccessRoleEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191 }),
    __metadata("design:type", String)
], AccessRoleEntity.prototype, "owner_id", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => OwnerEntity, { onDelete: 'CASCADE' }),
    (0, typeorm_1.JoinColumn)({ name: 'owner_id' }),
    __metadata("design:type", OwnerEntity)
], AccessRoleEntity.prototype, "owner", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191 }),
    __metadata("design:type", String)
], AccessRoleEntity.prototype, "name", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191 }),
    __metadata("design:type", String)
], AccessRoleEntity.prototype, "slug", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191, default: 'NT/APL' }),
    __metadata("design:type", String)
], AccessRoleEntity.prototype, "description", void 0);
__decorate([
    (0, typeorm_1.Column)({ default: false }),
    __metadata("design:type", Boolean)
], AccessRoleEntity.prototype, "is_system", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'int', default: 0 }),
    __metadata("design:type", Number)
], AccessRoleEntity.prototype, "hierarchy", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => RolePermissionEntity, (permission) => permission.role),
    __metadata("design:type", Array)
], AccessRoleEntity.prototype, "permissions", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)(),
    __metadata("design:type", Date)
], AccessRoleEntity.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)(),
    __metadata("design:type", Date)
], AccessRoleEntity.prototype, "updated_at", void 0);
exports.AccessRoleEntity = AccessRoleEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'access_roles' }),
    (0, typeorm_1.Index)(['owner_id', 'slug'], { unique: true })
], AccessRoleEntity);
let RolePermissionEntity = class RolePermissionEntity {
};
exports.RolePermissionEntity = RolePermissionEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], RolePermissionEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191 }),
    __metadata("design:type", String)
], RolePermissionEntity.prototype, "role_id", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => AccessRoleEntity, (role) => role.permissions, {
        onDelete: 'CASCADE',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'role_id' }),
    __metadata("design:type", AccessRoleEntity)
], RolePermissionEntity.prototype, "role", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191 }),
    __metadata("design:type", String)
], RolePermissionEntity.prototype, "permission_key", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191 }),
    __metadata("design:type", String)
], RolePermissionEntity.prototype, "permission_value", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)(),
    __metadata("design:type", Date)
], RolePermissionEntity.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)(),
    __metadata("design:type", Date)
], RolePermissionEntity.prototype, "updated_at", void 0);
exports.RolePermissionEntity = RolePermissionEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'role_permissions' }),
    (0, typeorm_1.Index)(['role_id', 'permission_key'], { unique: true })
], RolePermissionEntity);
let JobPostingEntity = class JobPostingEntity {
};
exports.JobPostingEntity = JobPostingEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], JobPostingEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191 }),
    __metadata("design:type", String)
], JobPostingEntity.prototype, "title", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191 }),
    __metadata("design:type", String)
], JobPostingEntity.prototype, "slug", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 500, default: 'NT/APL' }),
    __metadata("design:type", String)
], JobPostingEntity.prototype, "short_description", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191, default: 'NT/APL' }),
    __metadata("design:type", String)
], JobPostingEntity.prototype, "salary_range", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191, default: 'NT/APL' }),
    __metadata("design:type", String)
], JobPostingEntity.prototype, "location", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'job_type', length: 191, default: 'NT/APL' }),
    __metadata("design:type", String)
], JobPostingEntity.prototype, "job_type", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191, default: 'NT/APL' }),
    __metadata("design:type", String)
], JobPostingEntity.prototype, "experience", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'department_id',
        length: 191,
        nullable: true,
    }),
    __metadata("design:type", String)
], JobPostingEntity.prototype, "department_id", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => DepartmentEntity, { nullable: true, onDelete: 'SET NULL' }),
    (0, typeorm_1.JoinColumn)({ name: 'department_id' }),
    __metadata("design:type", DepartmentEntity)
], JobPostingEntity.prototype, "department", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'datetime', nullable: true }),
    __metadata("design:type", Date)
], JobPostingEntity.prototype, "deadline", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'int', name: 'vacancy_count', default: 1 }),
    __metadata("design:type", Number)
], JobPostingEntity.prototype, "vacancy_count", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'json', nullable: true }),
    __metadata("design:type", Object)
], JobPostingEntity.prototype, "role_overview", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'json', name: 'basics_benefits', nullable: true }),
    __metadata("design:type", Object)
], JobPostingEntity.prototype, "basics_benefits", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'json', name: 'what_youll_do', nullable: true }),
    __metadata("design:type", Object)
], JobPostingEntity.prototype, "what_youll_do", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'json', name: 'what_were_looking_for', nullable: true }),
    __metadata("design:type", Object)
], JobPostingEntity.prototype, "what_were_looking_for", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'json', name: 'banner_image', nullable: true }),
    __metadata("design:type", Object)
], JobPostingEntity.prototype, "banner_image", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'json', name: 'icon_image', nullable: true }),
    __metadata("design:type", Object)
], JobPostingEntity.prototype, "icon_image", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'json', nullable: true }),
    __metadata("design:type", Object)
], JobPostingEntity.prototype, "categories", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'json', nullable: true }),
    __metadata("design:type", Object)
], JobPostingEntity.prototype, "tags", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'enum',
        enum: JobPostingStatusEnum,
        default: JobPostingStatusEnum.draft,
    }),
    __metadata("design:type", String)
], JobPostingEntity.prototype, "status", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'enum',
        enum: GeneralStatusEnum,
        default: GeneralStatusEnum.active,
        name: 'record_status',
    }),
    __metadata("design:type", String)
], JobPostingEntity.prototype, "record_status", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => OwnerEntity, (owner) => owner.jobPostings, {
        onDelete: 'RESTRICT',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'owner_id' }),
    __metadata("design:type", OwnerEntity)
], JobPostingEntity.prototype, "owner", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'owner_id', length: 191 }),
    __metadata("design:type", String)
], JobPostingEntity.prototype, "owner_id", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ type: 'datetime', name: 'created_at', precision: 3 }),
    __metadata("design:type", Date)
], JobPostingEntity.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)({ type: 'datetime', name: 'updated_at', precision: 3 }),
    __metadata("design:type", Date)
], JobPostingEntity.prototype, "updated_at", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => JobApplicationEntity, (application) => application.job_posting),
    __metadata("design:type", Array)
], JobPostingEntity.prototype, "applications", void 0);
exports.JobPostingEntity = JobPostingEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'job_postings' }),
    (0, typeorm_1.Index)(['owner_id', 'slug'], { unique: true }),
    (0, typeorm_1.Index)(['owner_id']),
    (0, typeorm_1.Index)(['department_id'])
], JobPostingEntity);
let JobApplicationEntity = class JobApplicationEntity {
};
exports.JobApplicationEntity = JobApplicationEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], JobApplicationEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'job_posting_id', length: 191 }),
    __metadata("design:type", String)
], JobApplicationEntity.prototype, "job_posting_id", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => JobPostingEntity, (job) => job.applications, {
        onDelete: 'CASCADE',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'job_posting_id' }),
    __metadata("design:type", JobPostingEntity)
], JobApplicationEntity.prototype, "job_posting", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'full_name', length: 191 }),
    __metadata("design:type", String)
], JobApplicationEntity.prototype, "full_name", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191 }),
    __metadata("design:type", String)
], JobApplicationEntity.prototype, "email", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191, default: 'NT/APL' }),
    __metadata("design:type", String)
], JobApplicationEntity.prototype, "phone", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191, default: 'NT/APL' }),
    __metadata("design:type", String)
], JobApplicationEntity.prototype, "location", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'json', name: 'photo_url', nullable: true }),
    __metadata("design:type", Object)
], JobApplicationEntity.prototype, "photo_url", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'int', name: 'experience_years', default: 0 }),
    __metadata("design:type", Number)
], JobApplicationEntity.prototype, "experience_years", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'json', nullable: true }),
    __metadata("design:type", Object)
], JobApplicationEntity.prototype, "resume", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'json', nullable: true }),
    __metadata("design:type", Object)
], JobApplicationEntity.prototype, "skills", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'json', name: 'work_history', nullable: true }),
    __metadata("design:type", Object)
], JobApplicationEntity.prototype, "work_history", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'enum',
        enum: JobApplicationStatusEnum,
        default: JobApplicationStatusEnum.applied,
    }),
    __metadata("design:type", String)
], JobApplicationEntity.prototype, "status", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'enum',
        enum: JobApplicationSourceEnum,
        default: JobApplicationSourceEnum.manual,
    }),
    __metadata("design:type", String)
], JobApplicationEntity.prototype, "source", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'datetime',
        name: 'applied_at',
        default: () => 'CURRENT_TIMESTAMP',
    }),
    __metadata("design:type", Date)
], JobApplicationEntity.prototype, "applied_at", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'datetime', name: 'interview_at', nullable: true }),
    __metadata("design:type", Date)
], JobApplicationEntity.prototype, "interview_at", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'offer_status',
        length: 191,
        nullable: true,
    }),
    __metadata("design:type", String)
], JobApplicationEntity.prototype, "offer_status", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'datetime', name: 'start_date', nullable: true }),
    __metadata("design:type", Date)
], JobApplicationEntity.prototype, "start_date", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'text', nullable: true }),
    __metadata("design:type", String)
], JobApplicationEntity.prototype, "notes", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => OwnerEntity, (owner) => owner.jobApplications, {
        onDelete: 'RESTRICT',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'owner_id' }),
    __metadata("design:type", OwnerEntity)
], JobApplicationEntity.prototype, "owner", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'owner_id', length: 191 }),
    __metadata("design:type", String)
], JobApplicationEntity.prototype, "owner_id", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ type: 'datetime', name: 'created_at', precision: 3 }),
    __metadata("design:type", Date)
], JobApplicationEntity.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)({ type: 'datetime', name: 'updated_at', precision: 3 }),
    __metadata("design:type", Date)
], JobApplicationEntity.prototype, "updated_at", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => RecruitmentTaskEntity, (task) => task.application),
    __metadata("design:type", Array)
], JobApplicationEntity.prototype, "tasks", void 0);
exports.JobApplicationEntity = JobApplicationEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'job_applications' }),
    (0, typeorm_1.Index)(['owner_id']),
    (0, typeorm_1.Index)(['job_posting_id']),
    (0, typeorm_1.Index)(['status'])
], JobApplicationEntity);
let RecruitmentTaskEntity = class RecruitmentTaskEntity {
};
exports.RecruitmentTaskEntity = RecruitmentTaskEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], RecruitmentTaskEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'application_id',
        length: 191,
        nullable: true,
    }),
    __metadata("design:type", String)
], RecruitmentTaskEntity.prototype, "application_id", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => JobApplicationEntity, (application) => application.tasks, {
        onDelete: 'CASCADE',
        nullable: true,
    }),
    (0, typeorm_1.JoinColumn)({ name: 'application_id' }),
    __metadata("design:type", JobApplicationEntity)
], RecruitmentTaskEntity.prototype, "application", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191 }),
    __metadata("design:type", String)
], RecruitmentTaskEntity.prototype, "title", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'text', nullable: true }),
    __metadata("design:type", String)
], RecruitmentTaskEntity.prototype, "description", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'datetime', name: 'due_date', nullable: true }),
    __metadata("design:type", Date)
], RecruitmentTaskEntity.prototype, "due_date", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'enum',
        enum: RecruitmentTaskStatusEnum,
        default: RecruitmentTaskStatusEnum.pending,
    }),
    __metadata("design:type", String)
], RecruitmentTaskEntity.prototype, "status", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'public_token', length: 191 }),
    __metadata("design:type", String)
], RecruitmentTaskEntity.prototype, "public_token", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'json', nullable: true }),
    __metadata("design:type", Object)
], RecruitmentTaskEntity.prototype, "submission", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'owner_id', length: 191 }),
    __metadata("design:type", String)
], RecruitmentTaskEntity.prototype, "owner_id", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ type: 'datetime', name: 'created_at', precision: 3 }),
    __metadata("design:type", Date)
], RecruitmentTaskEntity.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)({ type: 'datetime', name: 'updated_at', precision: 3 }),
    __metadata("design:type", Date)
], RecruitmentTaskEntity.prototype, "updated_at", void 0);
exports.RecruitmentTaskEntity = RecruitmentTaskEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'recruitment_tasks' }),
    (0, typeorm_1.Index)(['application_id']),
    (0, typeorm_1.Index)(['public_token'], { unique: true })
], RecruitmentTaskEntity);
let TenantApiKeyEntity = class TenantApiKeyEntity {
};
exports.TenantApiKeyEntity = TenantApiKeyEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], TenantApiKeyEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191 }),
    __metadata("design:type", String)
], TenantApiKeyEntity.prototype, "name", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'key_prefix', length: 191 }),
    __metadata("design:type", String)
], TenantApiKeyEntity.prototype, "key_prefix", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'secret_hash', length: 191 }),
    __metadata("design:type", String)
], TenantApiKeyEntity.prototype, "secret_hash", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'enum',
        enum: TenantApiKeyStatusEnum,
        default: TenantApiKeyStatusEnum.active,
    }),
    __metadata("design:type", String)
], TenantApiKeyEntity.prototype, "status", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'datetime', name: 'last_used_at', nullable: true }),
    __metadata("design:type", Date)
], TenantApiKeyEntity.prototype, "last_used_at", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => OwnerEntity, (owner) => owner.tenantApiKeys, {
        onDelete: 'CASCADE',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'owner_id' }),
    __metadata("design:type", OwnerEntity)
], TenantApiKeyEntity.prototype, "owner", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'owner_id', length: 191 }),
    __metadata("design:type", String)
], TenantApiKeyEntity.prototype, "owner_id", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ type: 'datetime', name: 'created_at', precision: 3 }),
    __metadata("design:type", Date)
], TenantApiKeyEntity.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)({ type: 'datetime', name: 'updated_at', precision: 3 }),
    __metadata("design:type", Date)
], TenantApiKeyEntity.prototype, "updated_at", void 0);
exports.TenantApiKeyEntity = TenantApiKeyEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'tenant_api_keys' }),
    (0, typeorm_1.Index)(['owner_id']),
    (0, typeorm_1.Index)(['key_prefix'])
], TenantApiKeyEntity);
let OnboardingTemplateEntity = class OnboardingTemplateEntity {
};
exports.OnboardingTemplateEntity = OnboardingTemplateEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], OnboardingTemplateEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191 }),
    __metadata("design:type", String)
], OnboardingTemplateEntity.prototype, "title", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'text', nullable: true }),
    __metadata("design:type", String)
], OnboardingTemplateEntity.prototype, "description", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'boolean', name: 'is_active', default: true }),
    __metadata("design:type", Boolean)
], OnboardingTemplateEntity.prototype, "is_active", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'boolean', name: 'is_default', default: false }),
    __metadata("design:type", Boolean)
], OnboardingTemplateEntity.prototype, "is_default", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'owner_id', length: 191 }),
    __metadata("design:type", String)
], OnboardingTemplateEntity.prototype, "owner_id", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ type: 'datetime', name: 'created_at', precision: 3 }),
    __metadata("design:type", Date)
], OnboardingTemplateEntity.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)({ type: 'datetime', name: 'updated_at', precision: 3 }),
    __metadata("design:type", Date)
], OnboardingTemplateEntity.prototype, "updated_at", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => OnboardingTemplateTaskEntity, (task) => task.template, {
        cascade: true,
    }),
    __metadata("design:type", Array)
], OnboardingTemplateEntity.prototype, "tasks", void 0);
exports.OnboardingTemplateEntity = OnboardingTemplateEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'onboarding_templates' }),
    (0, typeorm_1.Index)(['owner_id'])
], OnboardingTemplateEntity);
let OnboardingTemplateTaskEntity = class OnboardingTemplateTaskEntity {
};
exports.OnboardingTemplateTaskEntity = OnboardingTemplateTaskEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], OnboardingTemplateTaskEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'template_id', length: 191 }),
    __metadata("design:type", String)
], OnboardingTemplateTaskEntity.prototype, "template_id", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => OnboardingTemplateEntity, (tpl) => tpl.tasks, {
        onDelete: 'CASCADE',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'template_id' }),
    __metadata("design:type", OnboardingTemplateEntity)
], OnboardingTemplateTaskEntity.prototype, "template", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191 }),
    __metadata("design:type", String)
], OnboardingTemplateTaskEntity.prototype, "title", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'text', nullable: true }),
    __metadata("design:type", String)
], OnboardingTemplateTaskEntity.prototype, "description", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'enum',
        enum: TaskOwnerTypeEnum,
        default: TaskOwnerTypeEnum.hr,
    }),
    __metadata("design:type", String)
], OnboardingTemplateTaskEntity.prototype, "owner_type", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'enum', enum: PriorityEnum, default: PriorityEnum.medium }),
    __metadata("design:type", String)
], OnboardingTemplateTaskEntity.prototype, "priority", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'int', name: 'relative_due_days', default: 7 }),
    __metadata("design:type", Number)
], OnboardingTemplateTaskEntity.prototype, "relative_due_days", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'int', name: 'order_index', default: 0 }),
    __metadata("design:type", Number)
], OnboardingTemplateTaskEntity.prototype, "order_index", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ type: 'datetime', name: 'created_at', precision: 3 }),
    __metadata("design:type", Date)
], OnboardingTemplateTaskEntity.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)({ type: 'datetime', name: 'updated_at', precision: 3 }),
    __metadata("design:type", Date)
], OnboardingTemplateTaskEntity.prototype, "updated_at", void 0);
exports.OnboardingTemplateTaskEntity = OnboardingTemplateTaskEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'onboarding_template_tasks' }),
    (0, typeorm_1.Index)(['template_id'])
], OnboardingTemplateTaskEntity);
let OnboardingCaseEntity = class OnboardingCaseEntity {
};
exports.OnboardingCaseEntity = OnboardingCaseEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], OnboardingCaseEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'member_id', length: 191 }),
    __metadata("design:type", String)
], OnboardingCaseEntity.prototype, "member_id", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => MemberEntity, { onDelete: 'CASCADE' }),
    (0, typeorm_1.JoinColumn)({ name: 'member_id' }),
    __metadata("design:type", MemberEntity)
], OnboardingCaseEntity.prototype, "member", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'job_application_id',
        length: 191,
        nullable: true,
    }),
    __metadata("design:type", String)
], OnboardingCaseEntity.prototype, "job_application_id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'template_id', length: 191, nullable: true }),
    __metadata("design:type", String)
], OnboardingCaseEntity.prototype, "template_id", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'enum',
        enum: OnboardingCaseStatusEnum,
        default: OnboardingCaseStatusEnum.pending,
    }),
    __metadata("design:type", String)
], OnboardingCaseEntity.prototype, "status", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'datetime', name: 'start_date', nullable: true }),
    __metadata("design:type", Date)
], OnboardingCaseEntity.prototype, "start_date", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'datetime', name: 'target_completion_date', nullable: true }),
    __metadata("design:type", Date)
], OnboardingCaseEntity.prototype, "target_completion_date", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'datetime', name: 'completed_at', nullable: true }),
    __metadata("design:type", Date)
], OnboardingCaseEntity.prototype, "completed_at", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'text', nullable: true }),
    __metadata("design:type", String)
], OnboardingCaseEntity.prototype, "notes", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'owner_id', length: 191 }),
    __metadata("design:type", String)
], OnboardingCaseEntity.prototype, "owner_id", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ type: 'datetime', name: 'created_at', precision: 3 }),
    __metadata("design:type", Date)
], OnboardingCaseEntity.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)({ type: 'datetime', name: 'updated_at', precision: 3 }),
    __metadata("design:type", Date)
], OnboardingCaseEntity.prototype, "updated_at", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => OnboardingTaskEntity, (task) => task.onboarding_case, {
        cascade: true,
    }),
    __metadata("design:type", Array)
], OnboardingCaseEntity.prototype, "tasks", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => OnboardingDocumentEntity, (doc) => doc.onboarding_case, {
        cascade: true,
    }),
    __metadata("design:type", Array)
], OnboardingCaseEntity.prototype, "documents", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => ProvisioningItemEntity, (item) => item.onboarding_case, {
        cascade: true,
    }),
    __metadata("design:type", Array)
], OnboardingCaseEntity.prototype, "provisioning_items", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => BuddyAssignmentEntity, (buddy) => buddy.onboarding_case, {
        cascade: true,
    }),
    __metadata("design:type", Array)
], OnboardingCaseEntity.prototype, "buddies", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => OnboardingSurveyEntity, (survey) => survey.onboarding_case, {
        cascade: true,
    }),
    __metadata("design:type", Array)
], OnboardingCaseEntity.prototype, "surveys", void 0);
exports.OnboardingCaseEntity = OnboardingCaseEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'onboarding_cases' }),
    (0, typeorm_1.Index)(['owner_id']),
    (0, typeorm_1.Index)(['member_id']),
    (0, typeorm_1.Index)(['status'])
], OnboardingCaseEntity);
let OnboardingTaskEntity = class OnboardingTaskEntity {
};
exports.OnboardingTaskEntity = OnboardingTaskEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], OnboardingTaskEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'onboarding_case_id', length: 191 }),
    __metadata("design:type", String)
], OnboardingTaskEntity.prototype, "onboarding_case_id", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => OnboardingCaseEntity, (c) => c.tasks, {
        onDelete: 'CASCADE',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'onboarding_case_id' }),
    __metadata("design:type", OnboardingCaseEntity)
], OnboardingTaskEntity.prototype, "onboarding_case", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191 }),
    __metadata("design:type", String)
], OnboardingTaskEntity.prototype, "title", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'text', nullable: true }),
    __metadata("design:type", String)
], OnboardingTaskEntity.prototype, "description", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'enum',
        enum: TaskOwnerTypeEnum,
        default: TaskOwnerTypeEnum.hr,
    }),
    __metadata("design:type", String)
], OnboardingTaskEntity.prototype, "owner_type", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'assigned_member_id',
        length: 191,
        nullable: true,
    }),
    __metadata("design:type", String)
], OnboardingTaskEntity.prototype, "assigned_member_id", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => MemberEntity, { nullable: true, onDelete: 'SET NULL' }),
    (0, typeorm_1.JoinColumn)({ name: 'assigned_member_id' }),
    __metadata("design:type", MemberEntity)
], OnboardingTaskEntity.prototype, "assigned_member", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'datetime', name: 'due_date', nullable: true }),
    __metadata("design:type", Date)
], OnboardingTaskEntity.prototype, "due_date", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'enum', enum: PriorityEnum, default: PriorityEnum.medium }),
    __metadata("design:type", String)
], OnboardingTaskEntity.prototype, "priority", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'enum',
        enum: TaskStatusEnum,
        default: TaskStatusEnum.pending,
    }),
    __metadata("design:type", String)
], OnboardingTaskEntity.prototype, "status", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'datetime', name: 'completed_at', nullable: true }),
    __metadata("design:type", Date)
], OnboardingTaskEntity.prototype, "completed_at", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'completed_by_id',
        length: 191,
        nullable: true,
    }),
    __metadata("design:type", String)
], OnboardingTaskEntity.prototype, "completed_by_id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'text', nullable: true }),
    __metadata("design:type", String)
], OnboardingTaskEntity.prototype, "notes", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'int', name: 'order_index', default: 0 }),
    __metadata("design:type", Number)
], OnboardingTaskEntity.prototype, "order_index", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ type: 'datetime', name: 'created_at', precision: 3 }),
    __metadata("design:type", Date)
], OnboardingTaskEntity.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)({ type: 'datetime', name: 'updated_at', precision: 3 }),
    __metadata("design:type", Date)
], OnboardingTaskEntity.prototype, "updated_at", void 0);
exports.OnboardingTaskEntity = OnboardingTaskEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'onboarding_tasks' }),
    (0, typeorm_1.Index)(['onboarding_case_id']),
    (0, typeorm_1.Index)(['status'])
], OnboardingTaskEntity);
let OnboardingDocumentEntity = class OnboardingDocumentEntity {
};
exports.OnboardingDocumentEntity = OnboardingDocumentEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], OnboardingDocumentEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'onboarding_case_id', length: 191 }),
    __metadata("design:type", String)
], OnboardingDocumentEntity.prototype, "onboarding_case_id", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => OnboardingCaseEntity, (c) => c.documents, {
        onDelete: 'CASCADE',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'onboarding_case_id' }),
    __metadata("design:type", OnboardingCaseEntity)
], OnboardingDocumentEntity.prototype, "onboarding_case", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191 }),
    __metadata("design:type", String)
], OnboardingDocumentEntity.prototype, "title", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'document_type',
        length: 191,
        default: 'contract',
    }),
    __metadata("design:type", String)
], OnboardingDocumentEntity.prototype, "document_type", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'file_url', length: 500, nullable: true }),
    __metadata("design:type", String)
], OnboardingDocumentEntity.prototype, "file_url", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'boolean', name: 'is_required', default: true }),
    __metadata("design:type", Boolean)
], OnboardingDocumentEntity.prototype, "is_required", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'enum',
        enum: DocumentSigningStatusEnum,
        default: DocumentSigningStatusEnum.pending,
    }),
    __metadata("design:type", String)
], OnboardingDocumentEntity.prototype, "status", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'datetime', name: 'signed_at', nullable: true }),
    __metadata("design:type", Date)
], OnboardingDocumentEntity.prototype, "signed_at", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'signed_by_id',
        length: 191,
        nullable: true,
    }),
    __metadata("design:type", String)
], OnboardingDocumentEntity.prototype, "signed_by_id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'json', nullable: true }),
    __metadata("design:type", Object)
], OnboardingDocumentEntity.prototype, "signature_metadata", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'text', nullable: true }),
    __metadata("design:type", String)
], OnboardingDocumentEntity.prototype, "notes", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ type: 'datetime', name: 'created_at', precision: 3 }),
    __metadata("design:type", Date)
], OnboardingDocumentEntity.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)({ type: 'datetime', name: 'updated_at', precision: 3 }),
    __metadata("design:type", Date)
], OnboardingDocumentEntity.prototype, "updated_at", void 0);
exports.OnboardingDocumentEntity = OnboardingDocumentEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'onboarding_documents' }),
    (0, typeorm_1.Index)(['onboarding_case_id'])
], OnboardingDocumentEntity);
let ProvisioningItemEntity = class ProvisioningItemEntity {
};
exports.ProvisioningItemEntity = ProvisioningItemEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], ProvisioningItemEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'onboarding_case_id', length: 191 }),
    __metadata("design:type", String)
], ProvisioningItemEntity.prototype, "onboarding_case_id", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => OnboardingCaseEntity, (c) => c.provisioning_items, {
        onDelete: 'CASCADE',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'onboarding_case_id' }),
    __metadata("design:type", OnboardingCaseEntity)
], ProvisioningItemEntity.prototype, "onboarding_case", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'item_name', length: 191 }),
    __metadata("design:type", String)
], ProvisioningItemEntity.prototype, "item_name", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'item_type',
        length: 191,
        default: 'hardware',
    }),
    __metadata("design:type", String)
], ProvisioningItemEntity.prototype, "item_type", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'text', nullable: true }),
    __metadata("design:type", String)
], ProvisioningItemEntity.prototype, "description", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'enum',
        enum: TaskOwnerTypeEnum,
        default: TaskOwnerTypeEnum.it,
    }),
    __metadata("design:type", String)
], ProvisioningItemEntity.prototype, "owner_type", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'assigned_member_id',
        length: 191,
        nullable: true,
    }),
    __metadata("design:type", String)
], ProvisioningItemEntity.prototype, "assigned_member_id", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'enum',
        enum: ProvisioningStatusEnum,
        default: ProvisioningStatusEnum.pending,
    }),
    __metadata("design:type", String)
], ProvisioningItemEntity.prototype, "status", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'serial_number',
        length: 191,
        nullable: true,
    }),
    __metadata("design:type", String)
], ProvisioningItemEntity.prototype, "serial_number", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'datetime', name: 'provisioned_at', nullable: true }),
    __metadata("design:type", Date)
], ProvisioningItemEntity.prototype, "provisioned_at", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'datetime', name: 'confirmed_at', nullable: true }),
    __metadata("design:type", Date)
], ProvisioningItemEntity.prototype, "confirmed_at", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'text', nullable: true }),
    __metadata("design:type", String)
], ProvisioningItemEntity.prototype, "notes", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ type: 'datetime', name: 'created_at', precision: 3 }),
    __metadata("design:type", Date)
], ProvisioningItemEntity.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)({ type: 'datetime', name: 'updated_at', precision: 3 }),
    __metadata("design:type", Date)
], ProvisioningItemEntity.prototype, "updated_at", void 0);
exports.ProvisioningItemEntity = ProvisioningItemEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'provisioning_items' }),
    (0, typeorm_1.Index)(['onboarding_case_id'])
], ProvisioningItemEntity);
let BuddyAssignmentEntity = class BuddyAssignmentEntity {
};
exports.BuddyAssignmentEntity = BuddyAssignmentEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], BuddyAssignmentEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'onboarding_case_id', length: 191 }),
    __metadata("design:type", String)
], BuddyAssignmentEntity.prototype, "onboarding_case_id", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => OnboardingCaseEntity, (c) => c.buddies, {
        onDelete: 'CASCADE',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'onboarding_case_id' }),
    __metadata("design:type", OnboardingCaseEntity)
], BuddyAssignmentEntity.prototype, "onboarding_case", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'member_id', length: 191 }),
    __metadata("design:type", String)
], BuddyAssignmentEntity.prototype, "member_id", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => MemberEntity, { onDelete: 'CASCADE' }),
    (0, typeorm_1.JoinColumn)({ name: 'member_id' }),
    __metadata("design:type", MemberEntity)
], BuddyAssignmentEntity.prototype, "member", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'buddy_member_id', length: 191 }),
    __metadata("design:type", String)
], BuddyAssignmentEntity.prototype, "buddy_member_id", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => MemberEntity, { onDelete: 'CASCADE' }),
    (0, typeorm_1.JoinColumn)({ name: 'buddy_member_id' }),
    __metadata("design:type", MemberEntity)
], BuddyAssignmentEntity.prototype, "buddy_member", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'assigned_by_id',
        length: 191,
        nullable: true,
    }),
    __metadata("design:type", String)
], BuddyAssignmentEntity.prototype, "assigned_by_id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'datetime', name: 'start_date', nullable: true }),
    __metadata("design:type", Date)
], BuddyAssignmentEntity.prototype, "start_date", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'datetime', name: 'end_date', nullable: true }),
    __metadata("design:type", Date)
], BuddyAssignmentEntity.prototype, "end_date", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 50, default: 'active' }),
    __metadata("design:type", String)
], BuddyAssignmentEntity.prototype, "status", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'text', nullable: true }),
    __metadata("design:type", String)
], BuddyAssignmentEntity.prototype, "notes", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ type: 'datetime', name: 'created_at', precision: 3 }),
    __metadata("design:type", Date)
], BuddyAssignmentEntity.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)({ type: 'datetime', name: 'updated_at', precision: 3 }),
    __metadata("design:type", Date)
], BuddyAssignmentEntity.prototype, "updated_at", void 0);
exports.BuddyAssignmentEntity = BuddyAssignmentEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'buddy_assignments' }),
    (0, typeorm_1.Index)(['onboarding_case_id']),
    (0, typeorm_1.Index)(['member_id'])
], BuddyAssignmentEntity);
let OnboardingSurveyEntity = class OnboardingSurveyEntity {
};
exports.OnboardingSurveyEntity = OnboardingSurveyEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], OnboardingSurveyEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'onboarding_case_id', length: 191 }),
    __metadata("design:type", String)
], OnboardingSurveyEntity.prototype, "onboarding_case_id", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => OnboardingCaseEntity, (c) => c.surveys, {
        onDelete: 'CASCADE',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'onboarding_case_id' }),
    __metadata("design:type", OnboardingCaseEntity)
], OnboardingSurveyEntity.prototype, "onboarding_case", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'member_id', length: 191 }),
    __metadata("design:type", String)
], OnboardingSurveyEntity.prototype, "member_id", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => MemberEntity, { onDelete: 'CASCADE' }),
    (0, typeorm_1.JoinColumn)({ name: 'member_id' }),
    __metadata("design:type", MemberEntity)
], OnboardingSurveyEntity.prototype, "member", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191 }),
    __metadata("design:type", String)
], OnboardingSurveyEntity.prototype, "title", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'int', name: 'interval_days', default: 30 }),
    __metadata("design:type", Number)
], OnboardingSurveyEntity.prototype, "interval_days", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 50, default: 'scheduled' }),
    __metadata("design:type", String)
], OnboardingSurveyEntity.prototype, "status", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'datetime', name: 'sent_at', nullable: true }),
    __metadata("design:type", Date)
], OnboardingSurveyEntity.prototype, "sent_at", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'datetime', name: 'completed_at', nullable: true }),
    __metadata("design:type", Date)
], OnboardingSurveyEntity.prototype, "completed_at", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'json', nullable: true }),
    __metadata("design:type", Object)
], OnboardingSurveyEntity.prototype, "responses", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'text', nullable: true }),
    __metadata("design:type", String)
], OnboardingSurveyEntity.prototype, "notes", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ type: 'datetime', name: 'created_at', precision: 3 }),
    __metadata("design:type", Date)
], OnboardingSurveyEntity.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)({ type: 'datetime', name: 'updated_at', precision: 3 }),
    __metadata("design:type", Date)
], OnboardingSurveyEntity.prototype, "updated_at", void 0);
exports.OnboardingSurveyEntity = OnboardingSurveyEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'onboarding_surveys' }),
    (0, typeorm_1.Index)(['onboarding_case_id']),
    (0, typeorm_1.Index)(['member_id'])
], OnboardingSurveyEntity);
let ProbationEntity = class ProbationEntity {
};
exports.ProbationEntity = ProbationEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], ProbationEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'member_id', length: 191 }),
    __metadata("design:type", String)
], ProbationEntity.prototype, "member_id", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => MemberEntity, { onDelete: 'CASCADE' }),
    (0, typeorm_1.JoinColumn)({ name: 'member_id' }),
    __metadata("design:type", MemberEntity)
], ProbationEntity.prototype, "member", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'onboarding_case_id',
        length: 191,
        nullable: true,
    }),
    __metadata("design:type", String)
], ProbationEntity.prototype, "onboarding_case_id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'datetime', name: 'start_date' }),
    __metadata("design:type", Date)
], ProbationEntity.prototype, "start_date", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'int', name: 'duration_months', default: 3 }),
    __metadata("design:type", Number)
], ProbationEntity.prototype, "duration_months", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'datetime', name: 'calculated_end_date' }),
    __metadata("design:type", Date)
], ProbationEntity.prototype, "calculated_end_date", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'datetime', name: 'current_end_date' }),
    __metadata("design:type", Date)
], ProbationEntity.prototype, "current_end_date", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'enum',
        enum: ProbationStatusEnum,
        default: ProbationStatusEnum.pending,
    }),
    __metadata("design:type", String)
], ProbationEntity.prototype, "status", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'manager_id', length: 191, nullable: true }),
    __metadata("design:type", String)
], ProbationEntity.prototype, "manager_id", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => MemberEntity, { nullable: true, onDelete: 'SET NULL' }),
    (0, typeorm_1.JoinColumn)({ name: 'manager_id' }),
    __metadata("design:type", MemberEntity)
], ProbationEntity.prototype, "manager", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'datetime', name: 'review_due_date', nullable: true }),
    __metadata("design:type", Date)
], ProbationEntity.prototype, "review_due_date", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'datetime', name: 'reviewed_at', nullable: true }),
    __metadata("design:type", Date)
], ProbationEntity.prototype, "reviewed_at", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'enum',
        enum: ProbationOutcomeEnum,
        nullable: true,
    }),
    __metadata("design:type", String)
], ProbationEntity.prototype, "final_outcome", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'text', nullable: true }),
    __metadata("design:type", String)
], ProbationEntity.prototype, "notes", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'owner_id', length: 191 }),
    __metadata("design:type", String)
], ProbationEntity.prototype, "owner_id", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ type: 'datetime', name: 'created_at', precision: 3 }),
    __metadata("design:type", Date)
], ProbationEntity.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)({ type: 'datetime', name: 'updated_at', precision: 3 }),
    __metadata("design:type", Date)
], ProbationEntity.prototype, "updated_at", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => ProbationReviewEntity, (review) => review.probation, {
        cascade: true,
    }),
    __metadata("design:type", Array)
], ProbationEntity.prototype, "reviews", void 0);
exports.ProbationEntity = ProbationEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'probations' }),
    (0, typeorm_1.Index)(['owner_id']),
    (0, typeorm_1.Index)(['member_id']),
    (0, typeorm_1.Index)(['status'])
], ProbationEntity);
let ProbationReviewEntity = class ProbationReviewEntity {
};
exports.ProbationReviewEntity = ProbationReviewEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], ProbationReviewEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'probation_id', length: 191 }),
    __metadata("design:type", String)
], ProbationReviewEntity.prototype, "probation_id", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => ProbationEntity, (p) => p.reviews, { onDelete: 'CASCADE' }),
    (0, typeorm_1.JoinColumn)({ name: 'probation_id' }),
    __metadata("design:type", ProbationEntity)
], ProbationReviewEntity.prototype, "probation", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'datetime', name: 'previous_end_date' }),
    __metadata("design:type", Date)
], ProbationReviewEntity.prototype, "previous_end_date", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'int', name: 'extension_months', default: 0 }),
    __metadata("design:type", Number)
], ProbationReviewEntity.prototype, "extension_months", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'datetime', name: 'new_end_date' }),
    __metadata("design:type", Date)
], ProbationReviewEntity.prototype, "new_end_date", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'datetime', name: 'review_date' }),
    __metadata("design:type", Date)
], ProbationReviewEntity.prototype, "review_date", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'reviewer_id', length: 191, nullable: true }),
    __metadata("design:type", String)
], ProbationReviewEntity.prototype, "reviewer_id", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'enum',
        enum: ProbationOutcomeEnum,
        default: ProbationOutcomeEnum.extend,
    }),
    __metadata("design:type", String)
], ProbationReviewEntity.prototype, "outcome", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'text', nullable: true }),
    __metadata("design:type", String)
], ProbationReviewEntity.prototype, "comments", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ type: 'datetime', name: 'created_at', precision: 3 }),
    __metadata("design:type", Date)
], ProbationReviewEntity.prototype, "created_at", void 0);
exports.ProbationReviewEntity = ProbationReviewEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'probation_reviews' }),
    (0, typeorm_1.Index)(['probation_id'])
], ProbationReviewEntity);
let OffboardingTemplateEntity = class OffboardingTemplateEntity {
};
exports.OffboardingTemplateEntity = OffboardingTemplateEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], OffboardingTemplateEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191 }),
    __metadata("design:type", String)
], OffboardingTemplateEntity.prototype, "title", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'text', nullable: true }),
    __metadata("design:type", String)
], OffboardingTemplateEntity.prototype, "description", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'boolean', name: 'is_active', default: true }),
    __metadata("design:type", Boolean)
], OffboardingTemplateEntity.prototype, "is_active", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'owner_id', length: 191 }),
    __metadata("design:type", String)
], OffboardingTemplateEntity.prototype, "owner_id", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ type: 'datetime', name: 'created_at', precision: 3 }),
    __metadata("design:type", Date)
], OffboardingTemplateEntity.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)({ type: 'datetime', name: 'updated_at', precision: 3 }),
    __metadata("design:type", Date)
], OffboardingTemplateEntity.prototype, "updated_at", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => OffboardingTemplateTaskEntity, (task) => task.template, {
        cascade: true,
    }),
    __metadata("design:type", Array)
], OffboardingTemplateEntity.prototype, "tasks", void 0);
exports.OffboardingTemplateEntity = OffboardingTemplateEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'offboarding_templates' }),
    (0, typeorm_1.Index)(['owner_id'])
], OffboardingTemplateEntity);
let OffboardingTemplateTaskEntity = class OffboardingTemplateTaskEntity {
};
exports.OffboardingTemplateTaskEntity = OffboardingTemplateTaskEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], OffboardingTemplateTaskEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'template_id', length: 191 }),
    __metadata("design:type", String)
], OffboardingTemplateTaskEntity.prototype, "template_id", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => OffboardingTemplateEntity, (tpl) => tpl.tasks, {
        onDelete: 'CASCADE',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'template_id' }),
    __metadata("design:type", OffboardingTemplateEntity)
], OffboardingTemplateTaskEntity.prototype, "template", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191 }),
    __metadata("design:type", String)
], OffboardingTemplateTaskEntity.prototype, "title", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'text', nullable: true }),
    __metadata("design:type", String)
], OffboardingTemplateTaskEntity.prototype, "description", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'enum',
        enum: TaskOwnerTypeEnum,
        default: TaskOwnerTypeEnum.hr,
    }),
    __metadata("design:type", String)
], OffboardingTemplateTaskEntity.prototype, "owner_type", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'enum', enum: PriorityEnum, default: PriorityEnum.medium }),
    __metadata("design:type", String)
], OffboardingTemplateTaskEntity.prototype, "priority", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'int', name: 'relative_due_days', default: 7 }),
    __metadata("design:type", Number)
], OffboardingTemplateTaskEntity.prototype, "relative_due_days", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'int', name: 'order_index', default: 0 }),
    __metadata("design:type", Number)
], OffboardingTemplateTaskEntity.prototype, "order_index", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ type: 'datetime', name: 'created_at', precision: 3 }),
    __metadata("design:type", Date)
], OffboardingTemplateTaskEntity.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)({ type: 'datetime', name: 'updated_at', precision: 3 }),
    __metadata("design:type", Date)
], OffboardingTemplateTaskEntity.prototype, "updated_at", void 0);
exports.OffboardingTemplateTaskEntity = OffboardingTemplateTaskEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'offboarding_template_tasks' }),
    (0, typeorm_1.Index)(['template_id'])
], OffboardingTemplateTaskEntity);
let OffboardingCaseEntity = class OffboardingCaseEntity {
};
exports.OffboardingCaseEntity = OffboardingCaseEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], OffboardingCaseEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'member_id', length: 191 }),
    __metadata("design:type", String)
], OffboardingCaseEntity.prototype, "member_id", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => MemberEntity, { onDelete: 'CASCADE' }),
    (0, typeorm_1.JoinColumn)({ name: 'member_id' }),
    __metadata("design:type", MemberEntity)
], OffboardingCaseEntity.prototype, "member", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'template_id', length: 191, nullable: true }),
    __metadata("design:type", String)
], OffboardingCaseEntity.prototype, "template_id", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'initiated_by_id',
        length: 191,
        nullable: true,
    }),
    __metadata("design:type", String)
], OffboardingCaseEntity.prototype, "initiated_by_id", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'enum',
        enum: OffboardingReasonEnum,
        default: OffboardingReasonEnum.resignation,
    }),
    __metadata("design:type", String)
], OffboardingCaseEntity.prototype, "reason", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'datetime', name: 'last_working_date' }),
    __metadata("design:type", Date)
], OffboardingCaseEntity.prototype, "last_working_date", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'int', name: 'notice_period_days', default: 30 }),
    __metadata("design:type", Number)
], OffboardingCaseEntity.prototype, "notice_period_days", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'enum',
        enum: OffboardingCaseStatusEnum,
        default: OffboardingCaseStatusEnum.initiated,
    }),
    __metadata("design:type", String)
], OffboardingCaseEntity.prototype, "status", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'datetime', name: 'completed_at', nullable: true }),
    __metadata("design:type", Date)
], OffboardingCaseEntity.prototype, "completed_at", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'datetime', name: 'access_deactivated_at', nullable: true }),
    __metadata("design:type", Date)
], OffboardingCaseEntity.prototype, "access_deactivated_at", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'text', nullable: true }),
    __metadata("design:type", String)
], OffboardingCaseEntity.prototype, "notes", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'owner_id', length: 191 }),
    __metadata("design:type", String)
], OffboardingCaseEntity.prototype, "owner_id", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ type: 'datetime', name: 'created_at', precision: 3 }),
    __metadata("design:type", Date)
], OffboardingCaseEntity.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)({ type: 'datetime', name: 'updated_at', precision: 3 }),
    __metadata("design:type", Date)
], OffboardingCaseEntity.prototype, "updated_at", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => OffboardingTaskEntity, (task) => task.offboarding_case, {
        cascade: true,
    }),
    __metadata("design:type", Array)
], OffboardingCaseEntity.prototype, "tasks", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => EquipmentReturnEntity, (eq) => eq.offboarding_case, {
        cascade: true,
    }),
    __metadata("design:type", Array)
], OffboardingCaseEntity.prototype, "equipment_returns", void 0);
__decorate([
    (0, typeorm_1.OneToOne)(() => ExitInterviewEntity, (interview) => interview.offboarding_case),
    __metadata("design:type", Object)
], OffboardingCaseEntity.prototype, "exit_interview", void 0);
__decorate([
    (0, typeorm_1.OneToOne)(() => FinalSettlementEntity, (settlement) => settlement.offboarding_case),
    __metadata("design:type", Object)
], OffboardingCaseEntity.prototype, "final_settlement", void 0);
exports.OffboardingCaseEntity = OffboardingCaseEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'offboarding_cases' }),
    (0, typeorm_1.Index)(['owner_id']),
    (0, typeorm_1.Index)(['member_id']),
    (0, typeorm_1.Index)(['status'])
], OffboardingCaseEntity);
let OffboardingTaskEntity = class OffboardingTaskEntity {
};
exports.OffboardingTaskEntity = OffboardingTaskEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], OffboardingTaskEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'offboarding_case_id', length: 191 }),
    __metadata("design:type", String)
], OffboardingTaskEntity.prototype, "offboarding_case_id", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => OffboardingCaseEntity, (c) => c.tasks, {
        onDelete: 'CASCADE',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'offboarding_case_id' }),
    __metadata("design:type", OffboardingCaseEntity)
], OffboardingTaskEntity.prototype, "offboarding_case", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191 }),
    __metadata("design:type", String)
], OffboardingTaskEntity.prototype, "title", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'text', nullable: true }),
    __metadata("design:type", String)
], OffboardingTaskEntity.prototype, "description", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'enum',
        enum: TaskOwnerTypeEnum,
        default: TaskOwnerTypeEnum.hr,
    }),
    __metadata("design:type", String)
], OffboardingTaskEntity.prototype, "owner_type", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'assigned_member_id',
        length: 191,
        nullable: true,
    }),
    __metadata("design:type", String)
], OffboardingTaskEntity.prototype, "assigned_member_id", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => MemberEntity, { nullable: true, onDelete: 'SET NULL' }),
    (0, typeorm_1.JoinColumn)({ name: 'assigned_member_id' }),
    __metadata("design:type", MemberEntity)
], OffboardingTaskEntity.prototype, "assigned_member", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'datetime', name: 'due_date', nullable: true }),
    __metadata("design:type", Date)
], OffboardingTaskEntity.prototype, "due_date", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'enum', enum: PriorityEnum, default: PriorityEnum.medium }),
    __metadata("design:type", String)
], OffboardingTaskEntity.prototype, "priority", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'enum',
        enum: TaskStatusEnum,
        default: TaskStatusEnum.pending,
    }),
    __metadata("design:type", String)
], OffboardingTaskEntity.prototype, "status", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'datetime', name: 'completed_at', nullable: true }),
    __metadata("design:type", Date)
], OffboardingTaskEntity.prototype, "completed_at", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'completed_by_id',
        length: 191,
        nullable: true,
    }),
    __metadata("design:type", String)
], OffboardingTaskEntity.prototype, "completed_by_id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'text', nullable: true }),
    __metadata("design:type", String)
], OffboardingTaskEntity.prototype, "notes", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'int', name: 'order_index', default: 0 }),
    __metadata("design:type", Number)
], OffboardingTaskEntity.prototype, "order_index", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ type: 'datetime', name: 'created_at', precision: 3 }),
    __metadata("design:type", Date)
], OffboardingTaskEntity.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)({ type: 'datetime', name: 'updated_at', precision: 3 }),
    __metadata("design:type", Date)
], OffboardingTaskEntity.prototype, "updated_at", void 0);
exports.OffboardingTaskEntity = OffboardingTaskEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'offboarding_tasks' }),
    (0, typeorm_1.Index)(['offboarding_case_id']),
    (0, typeorm_1.Index)(['status'])
], OffboardingTaskEntity);
let EquipmentReturnEntity = class EquipmentReturnEntity {
};
exports.EquipmentReturnEntity = EquipmentReturnEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], EquipmentReturnEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'offboarding_case_id', length: 191 }),
    __metadata("design:type", String)
], EquipmentReturnEntity.prototype, "offboarding_case_id", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => OffboardingCaseEntity, (c) => c.equipment_returns, {
        onDelete: 'CASCADE',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'offboarding_case_id' }),
    __metadata("design:type", OffboardingCaseEntity)
], EquipmentReturnEntity.prototype, "offboarding_case", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'item_name', length: 191 }),
    __metadata("design:type", String)
], EquipmentReturnEntity.prototype, "item_name", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'item_type',
        length: 191,
        default: 'hardware',
    }),
    __metadata("design:type", String)
], EquipmentReturnEntity.prototype, "item_type", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'serial_number',
        length: 191,
        nullable: true,
    }),
    __metadata("design:type", String)
], EquipmentReturnEntity.prototype, "serial_number", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 50, default: 'good' }),
    __metadata("design:type", String)
], EquipmentReturnEntity.prototype, "condition", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'datetime', name: 'returned_at', nullable: true }),
    __metadata("design:type", Date)
], EquipmentReturnEntity.prototype, "returned_at", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'received_by_id',
        length: 191,
        nullable: true,
    }),
    __metadata("design:type", String)
], EquipmentReturnEntity.prototype, "received_by_id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'text', nullable: true }),
    __metadata("design:type", String)
], EquipmentReturnEntity.prototype, "notes", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ type: 'datetime', name: 'created_at', precision: 3 }),
    __metadata("design:type", Date)
], EquipmentReturnEntity.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)({ type: 'datetime', name: 'updated_at', precision: 3 }),
    __metadata("design:type", Date)
], EquipmentReturnEntity.prototype, "updated_at", void 0);
exports.EquipmentReturnEntity = EquipmentReturnEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'equipment_returns' }),
    (0, typeorm_1.Index)(['offboarding_case_id'])
], EquipmentReturnEntity);
let ExitInterviewTemplateEntity = class ExitInterviewTemplateEntity {
};
exports.ExitInterviewTemplateEntity = ExitInterviewTemplateEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], ExitInterviewTemplateEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 191 }),
    __metadata("design:type", String)
], ExitInterviewTemplateEntity.prototype, "title", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'text', nullable: true }),
    __metadata("design:type", String)
], ExitInterviewTemplateEntity.prototype, "description", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'boolean', name: 'is_active', default: true }),
    __metadata("design:type", Boolean)
], ExitInterviewTemplateEntity.prototype, "is_active", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'json', nullable: true }),
    __metadata("design:type", Object)
], ExitInterviewTemplateEntity.prototype, "questions", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'owner_id', length: 191 }),
    __metadata("design:type", String)
], ExitInterviewTemplateEntity.prototype, "owner_id", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ type: 'datetime', name: 'created_at', precision: 3 }),
    __metadata("design:type", Date)
], ExitInterviewTemplateEntity.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)({ type: 'datetime', name: 'updated_at', precision: 3 }),
    __metadata("design:type", Date)
], ExitInterviewTemplateEntity.prototype, "updated_at", void 0);
exports.ExitInterviewTemplateEntity = ExitInterviewTemplateEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'exit_interview_templates' }),
    (0, typeorm_1.Index)(['owner_id'])
], ExitInterviewTemplateEntity);
let ExitInterviewEntity = class ExitInterviewEntity {
};
exports.ExitInterviewEntity = ExitInterviewEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], ExitInterviewEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'offboarding_case_id', length: 191 }),
    __metadata("design:type", String)
], ExitInterviewEntity.prototype, "offboarding_case_id", void 0);
__decorate([
    (0, typeorm_1.OneToOne)(() => OffboardingCaseEntity, (c) => c.exit_interview, {
        onDelete: 'CASCADE',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'offboarding_case_id' }),
    __metadata("design:type", OffboardingCaseEntity)
], ExitInterviewEntity.prototype, "offboarding_case", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'member_id', length: 191 }),
    __metadata("design:type", String)
], ExitInterviewEntity.prototype, "member_id", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => MemberEntity, { onDelete: 'CASCADE' }),
    (0, typeorm_1.JoinColumn)({ name: 'member_id' }),
    __metadata("design:type", MemberEntity)
], ExitInterviewEntity.prototype, "member", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'template_id', length: 191, nullable: true }),
    __metadata("design:type", String)
], ExitInterviewEntity.prototype, "template_id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', length: 50, default: 'pending' }),
    __metadata("design:type", String)
], ExitInterviewEntity.prototype, "status", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'datetime', name: 'submitted_at', nullable: true }),
    __metadata("design:type", Date)
], ExitInterviewEntity.prototype, "submitted_at", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'json', nullable: true }),
    __metadata("design:type", Object)
], ExitInterviewEntity.prototype, "responses", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'text', nullable: true }),
    __metadata("design:type", String)
], ExitInterviewEntity.prototype, "notes", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ type: 'datetime', name: 'created_at', precision: 3 }),
    __metadata("design:type", Date)
], ExitInterviewEntity.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)({ type: 'datetime', name: 'updated_at', precision: 3 }),
    __metadata("design:type", Date)
], ExitInterviewEntity.prototype, "updated_at", void 0);
exports.ExitInterviewEntity = ExitInterviewEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'exit_interviews' }),
    (0, typeorm_1.Index)(['offboarding_case_id']),
    (0, typeorm_1.Index)(['member_id'])
], ExitInterviewEntity);
let FinalSettlementEntity = class FinalSettlementEntity {
};
exports.FinalSettlementEntity = FinalSettlementEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], FinalSettlementEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'offboarding_case_id', length: 191 }),
    __metadata("design:type", String)
], FinalSettlementEntity.prototype, "offboarding_case_id", void 0);
__decorate([
    (0, typeorm_1.OneToOne)(() => OffboardingCaseEntity, (c) => c.final_settlement, {
        onDelete: 'CASCADE',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'offboarding_case_id' }),
    __metadata("design:type", OffboardingCaseEntity)
], FinalSettlementEntity.prototype, "offboarding_case", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'member_id', length: 191 }),
    __metadata("design:type", String)
], FinalSettlementEntity.prototype, "member_id", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => MemberEntity, { onDelete: 'CASCADE' }),
    (0, typeorm_1.JoinColumn)({ name: 'member_id' }),
    __metadata("design:type", MemberEntity)
], FinalSettlementEntity.prototype, "member", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'enum',
        enum: SettlementStatusEnum,
        default: SettlementStatusEnum.draft,
    }),
    __metadata("design:type", String)
], FinalSettlementEntity.prototype, "status", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'datetime', name: 'calculation_date', nullable: true }),
    __metadata("design:type", Date)
], FinalSettlementEntity.prototype, "calculation_date", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'datetime', name: 'approved_at', nullable: true }),
    __metadata("design:type", Date)
], FinalSettlementEntity.prototype, "approved_at", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'approved_by_id',
        length: 191,
        nullable: true,
    }),
    __metadata("design:type", String)
], FinalSettlementEntity.prototype, "approved_by_id", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'decimal',
        name: 'gross_settlement',
        precision: 12,
        scale: 2,
        default: 0,
    }),
    __metadata("design:type", Number)
], FinalSettlementEntity.prototype, "gross_settlement", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'decimal',
        name: 'total_deductions',
        precision: 12,
        scale: 2,
        default: 0,
    }),
    __metadata("design:type", Number)
], FinalSettlementEntity.prototype, "total_deductions", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'decimal',
        name: 'net_settlement',
        precision: 12,
        scale: 2,
        default: 0,
    }),
    __metadata("design:type", Number)
], FinalSettlementEntity.prototype, "net_settlement", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'text', nullable: true }),
    __metadata("design:type", String)
], FinalSettlementEntity.prototype, "notes", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'owner_id', length: 191 }),
    __metadata("design:type", String)
], FinalSettlementEntity.prototype, "owner_id", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ type: 'datetime', name: 'created_at', precision: 3 }),
    __metadata("design:type", Date)
], FinalSettlementEntity.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)({ type: 'datetime', name: 'updated_at', precision: 3 }),
    __metadata("design:type", Date)
], FinalSettlementEntity.prototype, "updated_at", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => FinalSettlementItemEntity, (item) => item.settlement, {
        cascade: true,
    }),
    __metadata("design:type", Array)
], FinalSettlementEntity.prototype, "items", void 0);
exports.FinalSettlementEntity = FinalSettlementEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'final_settlements' }),
    (0, typeorm_1.Index)(['owner_id']),
    (0, typeorm_1.Index)(['offboarding_case_id']),
    (0, typeorm_1.Index)(['member_id']),
    (0, typeorm_1.Index)(['status'])
], FinalSettlementEntity);
let FinalSettlementItemEntity = class FinalSettlementItemEntity {
};
exports.FinalSettlementItemEntity = FinalSettlementItemEntity;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], FinalSettlementItemEntity.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'settlement_id', length: 191 }),
    __metadata("design:type", String)
], FinalSettlementItemEntity.prototype, "settlement_id", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => FinalSettlementEntity, (s) => s.items, {
        onDelete: 'CASCADE',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'settlement_id' }),
    __metadata("design:type", FinalSettlementEntity)
], FinalSettlementItemEntity.prototype, "settlement", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'varchar', name: 'item_name', length: 191 }),
    __metadata("design:type", String)
], FinalSettlementItemEntity.prototype, "item_name", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        name: 'item_type',
        length: 50,
        default: 'earning',
    }),
    __metadata("design:type", String)
], FinalSettlementItemEntity.prototype, "item_type", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'decimal', precision: 12, scale: 2, default: 0 }),
    __metadata("design:type", Number)
], FinalSettlementItemEntity.prototype, "amount", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'text', nullable: true }),
    __metadata("design:type", String)
], FinalSettlementItemEntity.prototype, "description", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)({ type: 'datetime', name: 'created_at', precision: 3 }),
    __metadata("design:type", Date)
], FinalSettlementItemEntity.prototype, "created_at", void 0);
exports.FinalSettlementItemEntity = FinalSettlementItemEntity = __decorate([
    (0, typeorm_1.Entity)({ name: 'final_settlement_items' }),
    (0, typeorm_1.Index)(['settlement_id'])
], FinalSettlementItemEntity);
//# sourceMappingURL=entities.js.map