diff --git a/apps/gauzy/src/app/pages/import-export/export/export.component.html b/apps/gauzy/src/app/pages/import-export/export/export.component.html index 83a4cbc616c..fd3065c5a9a 100644 --- a/apps/gauzy/src/app/pages/import-export/export/export.component.html +++ b/apps/gauzy/src/app/pages/import-export/export/export.component.html @@ -1,5 +1,5 @@ - diff --git a/apps/gauzy/src/app/pages/import-export/export/export.component.ts b/apps/gauzy/src/app/pages/import-export/export/export.component.ts index 9d72c2a2b00..be7f34bd5cc 100644 --- a/apps/gauzy/src/app/pages/import-export/export/export.component.ts +++ b/apps/gauzy/src/app/pages/import-export/export/export.component.ts @@ -8,7 +8,7 @@ import { Subject } from 'rxjs'; import { finalize, tap } from 'rxjs/operators'; import { IEntityModel } from '@gauzy/contracts'; import { TranslationBaseComponent } from '@gauzy/ui-core/i18n'; -import { ExportAllService } from '@gauzy/ui-core/core'; +import { ExportAllService, Store } from '@gauzy/ui-core/core'; @UntilDestroy({ checkProperties: true }) @Component({ @@ -24,7 +24,11 @@ export class ExportComponent extends TranslationBaseComponent implements AfterVi subject$: Subject = new Subject(); loading: boolean; - constructor(private readonly exportAll: ExportAllService, public readonly translateService: TranslateService) { + constructor( + private readonly exportAll: ExportAllService, + public readonly translateService: TranslateService, + private readonly store: Store + ) { super(translateService); } @@ -99,7 +103,7 @@ export class ExportComponent extends TranslationBaseComponent implements AfterVi this.loading = true; const entities = this.selectedEntities.filter(isNotEmpty); this.exportAll - .downloadSpecificTable(entities) + .downloadSpecificTable(entities, this.store.selectedOrganization.id) .pipe( finalize(() => (this.loading = false)), untilDestroyed(this) @@ -351,8 +355,8 @@ export class ExportComponent extends TranslationBaseComponent implements AfterVi name: this.getTranslation('MENU.IMPORT_EXPORT.TASK'), value: 'task', checked: true, - isGroup: false, - entities: [] + isGroup: true, + entities: this.getTaskEntities() }, { name: this.getTranslation('MENU.IMPORT_EXPORT.TENANT'), @@ -381,6 +385,165 @@ export class ExportComponent extends TranslationBaseComponent implements AfterVi checked: true, isGroup: true, entities: this.getUserEntities() + }, + { + name: this.getTranslation('INVOICES_PAGE.COMMENT'), + value: 'comment', + checked: true, + isGroup: false, + entities: [] + }, + { + name: this.getTranslation('MENU.IMPORT_EXPORT.DAILY_PLAN'), + value: 'daily_plan', + checked: true, + isGroup: false, + entities: [] + }, + { + name: this.getTranslation('MENU.IMPORT_EXPORT.FAVORITE'), + value: 'favorite', + checked: true, + isGroup: false, + entities: [] + }, + { + name: this.getTranslation('MENU.IMPORT_EXPORT.MENTION'), + value: 'mention', + checked: true, + isGroup: false, + entities: [] + }, + { + name: this.getTranslation('MENU.IMPORT_EXPORT.REACTION'), + value: 'reaction', + checked: true, + isGroup: false, + entities: [] + }, + { + name: this.getTranslation('MENU.IMPORT_EXPORT.RESOURCE_LINK'), + value: 'resource_link', + checked: true, + isGroup: false, + entities: [] + }, + { + name: this.getTranslation('MENU.IMPORT_EXPORT.SCREENING_TASK'), + value: 'screening_task', + checked: true, + isGroup: false, + entities: [] + }, + { + name: this.getTranslation('PLUGIN.VIDEO.SINGLE'), + value: 'video', + checked: true, + isGroup: false, + entities: [] + }, + { + name: this.getTranslation('INVOICES_PAGE.EMAIL.EMAIL_SENT'), + value: 'email_sent', + checked: true, + isGroup: false, + entities: [] + }, + { + name: this.getTranslation('MENU.IMPORT_EXPORT.ACTIVITY_LOG'), + value: 'activity_log', + checked: true, + isGroup: false, + entities: [] + }, + { + name: this.getTranslation('MENU.IMPORT_EXPORT.ENTITY_SUBSCRIPTION'), + value: 'entity_subscription', + checked: true, + isGroup: false, + entities: [] + }, + { + name: this.getTranslation('MENU.IMPORT_EXPORT.SOCIAL_ACCOUNT'), + value: 'social_account', + checked: true, + isGroup: false, + entities: [] + }, + { + name: this.getTranslation('MENU.IMPORT_EXPORT.CHANGELOG'), + value: 'changelog', + checked: true, + isGroup: false, + entities: [] + } + ]; + } + + getTaskEntities(): IEntityModel[] { + return [ + { + name: this.getTranslation('MENU.IMPORT_EXPORT.ISSUE_TYPE'), + value: 'issue_type', + checked: true, + isGroup: false, + entities: [] + }, + { + name: this.getTranslation('MENU.IMPORT_EXPORT.TASK_ESTIMATION'), + value: 'task_estimation', + checked: true, + isGroup: false, + entities: [] + }, + { + name: this.getTranslation('MENU.IMPORT_EXPORT.TASK_PRIORITY'), + value: 'task_priority', + checked: true, + isGroup: false, + entities: [] + }, + { + name: this.getTranslation('MENU.IMPORT_EXPORT.TASK_SIZE'), + value: 'task_size', + checked: true, + isGroup: false, + entities: [] + }, + { + name: this.getTranslation('MENU.IMPORT_EXPORT.TASK_STATUS'), + value: 'task_status', + checked: true, + isGroup: false, + entities: [] + }, + { + name: this.getTranslation('MENU.IMPORT_EXPORT.TASK_VERSION'), + value: 'task_version', + checked: true, + isGroup: false, + entities: [] + }, + { + name: this.getTranslation('MENU.IMPORT_EXPORT.TASK_VIEW'), + value: 'task_view', + checked: true, + isGroup: false, + entities: [] + }, + { + name: this.getTranslation('MENU.IMPORT_EXPORT.TASK_LINKED_ISSUES'), + value: 'task_linked_issues', + checked: true, + isGroup: false, + entities: [] + }, + { + name: this.getTranslation('MENU.IMPORT_EXPORT.TASK_RELATED_ISSUE_TYPE'), + value: 'task_related_issue_type', + checked: true, + isGroup: false, + entities: [] } ]; } @@ -566,6 +729,76 @@ export class ExportComponent extends TranslationBaseComponent implements AfterVi checked: true, isGroup: false, entities: [] + }, + { + name: this.getTranslation('MENU.IMPORT_EXPORT.ORGANIZATION_PROJECT_EMPLOYEE'), + value: 'organization_project_employee', + checked: true, + isGroup: false, + entities: [] + }, + { + name: this.getTranslation('MENU.IMPORT_EXPORT.ORGANIZATION_PROJECT_MODULE'), + value: 'organization_project_module', + checked: true, + isGroup: false, + entities: [] + }, + { + name: this.getTranslation('MENU.IMPORT_EXPORT.ORGANIZATION_PROJECT_MODULE_EMPLOYEE'), + value: 'organization_project_module_employee', + checked: true, + isGroup: false, + entities: [] + }, + { + name: this.getTranslation('MENU.IMPORT_EXPORT.ORGANIZATION_SPRINT_EMPLOYEE'), + value: 'organization_sprint_employee', + checked: true, + isGroup: false, + entities: [] + }, + { + name: this.getTranslation('MENU.IMPORT_EXPORT.ORGANIZATION_SPRINT_TASK'), + value: 'organization_sprint_task', + checked: true, + isGroup: false, + entities: [] + }, + { + name: this.getTranslation('MENU.IMPORT_EXPORT.ORGANIZATION_SPRINT_TASK_HISTORY'), + value: 'organization_sprint_task_history', + checked: true, + isGroup: false, + entities: [] + }, + { + name: this.getTranslation('MENU.IMPORT_EXPORT.ORGANIZATION_TASK_SETTING'), + value: 'organization_task_setting', + checked: true, + isGroup: false, + entities: [] + }, + { + name: this.getTranslation('MENU.IMPORT_EXPORT.ORGANIZATION_TEAM_JOIN_REQUEST'), + value: 'organization_team_join_request', + checked: true, + isGroup: false, + entities: [] + }, + { + name: this.getTranslation('MENU.IMPORT_EXPORT.ORGANIZATION_GITHUB_REPOSITORY'), + value: 'organization_github_repository', + checked: true, + isGroup: false, + entities: [] + }, + { + name: this.getTranslation('MENU.IMPORT_EXPORT.ORGANIZATION_GITHUB_REPOSITORY_ISSUE'), + value: 'organization_github_repository_issue', + checked: true, + isGroup: false, + entities: [] } ]; } @@ -632,6 +865,41 @@ export class ExportComponent extends TranslationBaseComponent implements AfterVi checked: true, isGroup: false, entities: [] + }, + { + name: this.getTranslation('MENU.IMPORT_EXPORT.EMPLOYEE_AVAILABILITY'), + value: 'employee_availability', + checked: true, + isGroup: false, + entities: [] + }, + { + name: this.getTranslation('MENU.IMPORT_EXPORT.EMPLOYEE_NOTIFICATION'), + value: 'employee_notification', + checked: true, + isGroup: false, + entities: [] + }, + { + name: this.getTranslation('MENU.IMPORT_EXPORT.EMPLOYEE_PHONE'), + value: 'employee_phone', + checked: true, + isGroup: false, + entities: [] + }, + { + name: this.getTranslation('MENU.IMPORT_EXPORT.APPOINTMENT_EMPLOYEE'), + value: 'appointment_employee', + checked: true, + isGroup: false, + entities: [] + }, + { + name: this.getTranslation('SETTINGS_FEATURES_TEXT.EMPLOYEES.EMPLOYEE_LEVEL'), + value: 'employee_level', + checked: true, + isGroup: false, + entities: [] } ]; } @@ -810,6 +1078,13 @@ export class ExportComponent extends TranslationBaseComponent implements AfterVi checked: true, isGroup: false, entities: [] + }, + { + name: this.getTranslation('MENU.IMPORT_EXPORT.PRODUCT_REVIEW'), + value: 'product_review', + checked: true, + isGroup: false, + entities: [] } ]; } diff --git a/apps/gauzy/src/app/pages/import-export/import/import.component.ts b/apps/gauzy/src/app/pages/import-export/import/import.component.ts index fff6e0ad4d3..5fa8916e050 100644 --- a/apps/gauzy/src/app/pages/import-export/import/import.component.ts +++ b/apps/gauzy/src/app/pages/import-export/import/import.component.ts @@ -86,6 +86,9 @@ export class ImportComponent extends TranslationBaseComponent implements AfterVi } ] }); + this.uploader.onAfterAddingFile = (file) => { + file.withCredentials = false; + }; this.uploader.onBuildItemForm = (item, form) => { form.append('importType', this.importType); }; diff --git a/packages/core/src/lib/comment/comment.module.ts b/packages/core/src/lib/comment/comment.module.ts index b46865b288a..8496fc3a472 100644 --- a/packages/core/src/lib/comment/comment.module.ts +++ b/packages/core/src/lib/comment/comment.module.ts @@ -9,7 +9,7 @@ import { CommandHandlers } from './commands/handlers'; import { CommentService } from './comment.service'; import { CommentController } from './comment.controller'; import { Comment } from './comment.entity'; -import { TypeOrmCommentRepository } from './repository/type-orm.comment.repository'; +import { TypeOrmCommentRepository } from './repository/type-orm-comment.repository'; @Module({ imports: [ diff --git a/packages/core/src/lib/comment/comment.service.ts b/packages/core/src/lib/comment/comment.service.ts index 9e82c1cd180..a7b03013bf2 100644 --- a/packages/core/src/lib/comment/comment.service.ts +++ b/packages/core/src/lib/comment/comment.service.ts @@ -15,7 +15,7 @@ import { CreateEntitySubscriptionEvent } from '../entity-subscription/events'; import { EmployeeService } from '../employee/employee.service'; import { MentionService } from '../mention/mention.service'; import { Comment } from './comment.entity'; -import { TypeOrmCommentRepository } from './repository/type-orm.comment.repository'; +import { TypeOrmCommentRepository } from './repository/type-orm-comment.repository'; import { MikroOrmCommentRepository } from './repository/mikro-orm-comment.repository'; @Injectable() diff --git a/packages/core/src/lib/comment/repository/type-orm.comment.repository.ts b/packages/core/src/lib/comment/repository/type-orm-comment.repository.ts similarity index 100% rename from packages/core/src/lib/comment/repository/type-orm.comment.repository.ts rename to packages/core/src/lib/comment/repository/type-orm-comment.repository.ts diff --git a/packages/core/src/lib/employee/employee.subscriber.ts b/packages/core/src/lib/employee/employee.subscriber.ts index 159b2d2369d..db9e6865e20 100644 --- a/packages/core/src/lib/employee/employee.subscriber.ts +++ b/packages/core/src/lib/employee/employee.subscriber.ts @@ -60,7 +60,9 @@ export class EmployeeSubscriber extends BaseEntityEventSubscriber { } // Set a default avatar image if none is provided - entity.user.imageUrl = entity.user.imageUrl ?? getUserDummyImage(entity.user); + if (entity.user) { + entity.user.imageUrl = entity.user.imageUrl ?? getUserDummyImage(entity.user); + } // Updates the employee's status based on the start and end work dates. this.updateEmployeeStatus(entity, em); diff --git a/packages/core/src/lib/export-import/export/export.controller.ts b/packages/core/src/lib/export-import/export/export.controller.ts index 3d3368bd273..49ed9636dae 100644 --- a/packages/core/src/lib/export-import/export/export.controller.ts +++ b/packages/core/src/lib/export-import/export/export.controller.ts @@ -23,9 +23,14 @@ export class ExportController { description: 'Record not found' }) @Get() - async exportAll(@Query('data', ParseJsonPipe) data: any, @Res() res): Promise { + async exportAll( + @Query('data', ParseJsonPipe) data: any, + @Query('organizationId') organizationId: string, + @Res() res + ): Promise { + await this._exportService.registerAllRepositories(); await this._exportService.createFolders(); - await this._exportService.exportTables(); + await this._exportService.exportTables(organizationId); await this._exportService.archiveAndDownload(); await this._exportService.downloadToUser(res); await this._exportService.deleteCsvFiles(); @@ -61,12 +66,17 @@ export class ExportController { description: 'Record not found' }) @Get('filter') - async exportByName(@Query('data', ParseJsonPipe) data: any, @Res() res): Promise { + async exportByName( + @Query('data', ParseJsonPipe) data: any, + @Query('organizationId') organizationId: string, + @Res() res + ): Promise { const { entities: { names } } = data; + await this._exportService.registerAllRepositories(); await this._exportService.createFolders(); - await this._exportService.exportSpecificTables(names); + await this._exportService.exportSpecificTables(names, organizationId); await this._exportService.archiveAndDownload(); await this._exportService.downloadToUser(res); await this._exportService.deleteCsvFiles(); diff --git a/packages/core/src/lib/export-import/export/export.module.ts b/packages/core/src/lib/export-import/export/export.module.ts index 1159cc0c4d9..aff6324d8c6 100644 --- a/packages/core/src/lib/export-import/export/export.module.ts +++ b/packages/core/src/lib/export-import/export/export.module.ts @@ -8,6 +8,7 @@ import { coreEntities } from '../../core/entities'; import { RolePermissionModule } from '../../role-permission/role-permission.module'; import { ExportController } from './export.controller'; import { ExportService } from './export.service'; +import { RepositoriesService } from '../repositories/repositories.service'; @Module({ imports: [ @@ -17,6 +18,6 @@ import { ExportService } from './export.service'; CqrsModule ], controllers: [ExportController], - providers: [ExportService] + providers: [ExportService, RepositoriesService] }) export class ExportModule {} diff --git a/packages/core/src/lib/export-import/export/export.service.ts b/packages/core/src/lib/export-import/export/export.service.ts index 9a84e1023aa..bc757f5b7e7 100644 --- a/packages/core/src/lib/export-import/export/export.service.ts +++ b/packages/core/src/lib/export-import/export/export.service.ts @@ -1,7 +1,5 @@ import { Injectable, OnModuleInit } from '@nestjs/common'; -import { InjectRepository } from '@nestjs/typeorm'; -import { Repository } from 'typeorm'; -import { camelCase } from 'typeorm/util/StringUtils'; +import { FindManyOptions, IsNull } from 'typeorm'; import { ColumnMetadata } from 'typeorm/metadata/ColumnMetadata'; import { BehaviorSubject } from 'rxjs'; import { v4 as uuidv4 } from 'uuid'; @@ -11,376 +9,11 @@ import * as fs from 'fs'; import * as path from 'path'; import * as fse from 'fs-extra'; import { ConfigService } from '@gauzy/config'; -import { getEntitiesFromPlugins } from '@gauzy/plugin'; -import { isFunction, isNotEmpty } from '@gauzy/utils'; +import { isNotEmpty } from '@gauzy/utils'; import { ConnectionEntityManager } from '../../database/connection-entity-manager'; -import { - AccountingTemplate, - Activity, - AppointmentEmployee, - ApprovalPolicy, - AvailabilitySlot, - Candidate, - CandidateCriterionsRating, - CandidateDocument, - CandidateEducation, - CandidateExperience, - CandidateFeedback, - CandidateInterview, - CandidateInterviewers, - CandidatePersonalQualities, - CandidateSkill, - CandidateSource, - CandidateTechnologies, - Contact, - Country, - Currency, - CustomSmtp, - Deal, - EmailHistory, - EmailTemplate, - Employee, - EmployeeAppointment, - EmployeeAward, - EmployeeLevel, - EmployeeRecurringExpense, - EmployeeSetting, - Equipment, - EquipmentSharing, - EquipmentSharingPolicy, - EstimateEmail, - EventType, - Expense, - ExpenseCategory, - Feature, - FeatureOrganization, - Goal, - GoalGeneralSetting, - GoalKPI, - GoalKPITemplate, - GoalTemplate, - GoalTimeFrame, - ImageAsset, - Income, - Integration, - IntegrationEntitySetting, - IntegrationEntitySettingTied, - IntegrationMap, - IntegrationSetting, - IntegrationTenant, - IntegrationType, - Invite, - Invoice, - InvoiceEstimateHistory, - InvoiceItem, - KeyResult, - KeyResultTemplate, - KeyResultUpdate, - Language, - Merchant, - Organization, - OrganizationAward, - OrganizationContact, - OrganizationDepartment, - OrganizationDocument, - OrganizationEmploymentType, - OrganizationLanguage, - OrganizationPosition, - OrganizationProject, - OrganizationRecurringExpense, - OrganizationSprint, - OrganizationTeam, - OrganizationTeamEmployee, - OrganizationVendor, - Payment, - Pipeline, - PipelineStage, - Product, - ProductCategory, - ProductCategoryTranslation, - ProductOption, - ProductOptionGroup, - ProductOptionGroupTranslation, - ProductOptionTranslation, - ProductTranslation, - ProductType, - ProductTypeTranslation, - ProductVariant, - ProductVariantPrice, - ProductVariantSetting, - Report, - ReportCategory, - ReportOrganization, - RequestApproval, - RequestApprovalEmployee, - RequestApprovalTeam, - Role, - RolePermission, - Screenshot, - Skill, - Tag, - Task, - Tenant, - TenantSetting, - TimeLog, - TimeOffPolicy, - TimeOffRequest, - Timesheet, - TimeSlot, - TimeSlotMinute, - User, - UserOrganization, - Warehouse, - WarehouseProduct, - WarehouseProductVariant -} from './../../core/entities/internal'; import { RequestContext } from './../../core/context'; -import { MikroOrmAccountingTemplateRepository } from '../../accounting-template/repository/mikro-orm-accounting-template.repository'; -import { TypeOrmAccountingTemplateRepository } from '../../accounting-template/repository/type-orm-accounting-template.repository'; -import { MikroOrmAppointmentEmployeeRepository } from '../../appointment-employees/repository/mikro-orm-appointment-employee.repository'; -import { TypeOrmAppointmentEmployeeRepository } from '../../appointment-employees/repository/type-orm-appointment-employee.repository'; -import { MikroOrmApprovalPolicyRepository } from '../../approval-policy/repository/mikro-orm-approval-policy.repository'; -import { TypeOrmApprovalPolicyRepository } from '../../approval-policy/repository/type-orm-approval-policy.repository'; -import { MikroOrmAvailabilitySlotRepository } from '../../availability-slots/repository/mikro-orm-availability-slot.repository'; -import { TypeOrmAvailabilitySlotRepository } from '../../availability-slots/repository/type-orm-availability-slot.repository'; -import { MikroOrmCandidateCriterionsRatingRepository } from '../../candidate-criterions-rating/repository/mikro-orm-candidate-criterions-rating.repository'; -import { TypeOrmCandidateCriterionsRatingRepository } from '../../candidate-criterions-rating/repository/type-orm-candidate-criterions-rating.repository'; -import { MikroOrmCandidateDocumentRepository } from '../../candidate-documents/repository/mikro-orm-candidate-document.repository'; -import { TypeOrmCandidateDocumentRepository } from '../../candidate-documents/repository/type-orm-candidate-document.repository'; -import { MikroOrmCandidateEducationRepository } from '../../candidate-education/repository/mikro-orm-candidate-education.repository'; -import { TypeOrmCandidateEducationRepository } from '../../candidate-education/repository/type-orm-candidate-education.repository'; -import { MikroOrmCandidateExperienceRepository } from '../../candidate-experience/repository/mikro-orm-candidate-experience.repository'; -import { TypeOrmCandidateExperienceRepository } from '../../candidate-experience/repository/type-orm-candidate-experience.repository'; -import { MikroOrmCandidateFeedbackRepository } from '../../candidate-feedbacks/repository/mikro-orm-candidate-feedback.repository'; -import { TypeOrmCandidateFeedbackRepository } from '../../candidate-feedbacks/repository/type-orm-candidate-feedback.repository'; -import { MikroOrmCandidateInterviewRepository } from '../../candidate-interview/repository/mikro-orm-candidate-interview.repository'; -import { TypeOrmCandidateInterviewRepository } from '../../candidate-interview/repository/type-orm-candidate-interview.repository'; -import { MikroOrmCandidateInterviewersRepository } from '../../candidate-interviewers/repository/mikro-orm-candidate-interviewers.repository'; -import { TypeOrmCandidateInterviewersRepository } from '../../candidate-interviewers/repository/type-orm-candidate-interviewers.repository'; -import { MikroOrmCandidatePersonalQualitiesRepository } from '../../candidate-personal-qualities/repository/mikro-orm-candidate-personal-qualities.repository'; -import { TypeOrmCandidatePersonalQualitiesRepository } from '../../candidate-personal-qualities/repository/type-orm-candidate-personal-qualities.repository'; -import { MikroOrmCandidateSkillRepository } from '../../candidate-skill/repository/mikro-orm-candidate-skill.repository'; -import { TypeOrmCandidateSkillRepository } from '../../candidate-skill/repository/type-orm-candidate-skill.repository'; -import { MikroOrmCandidateSourceRepository } from '../../candidate-source/repository/mikro-orm-candidate-source.repository'; -import { TypeOrmCandidateSourceRepository } from '../../candidate-source/repository/type-orm-candidate-source.repository'; -import { MikroOrmCandidateTechnologiesRepository } from '../../candidate-technologies/repository/mikro-orm-candidate-technologies.repository'; -import { TypeOrmCandidateTechnologiesRepository } from '../../candidate-technologies/repository/type-orm-candidate-technologies.repository'; -import { MikroOrmCandidateRepository } from '../../candidate/repository/mikro-orm-candidate.repository'; -import { TypeOrmCandidateRepository } from '../../candidate/repository/type-orm-candidate.repository'; -import { MikroOrmContactRepository } from '../../contact/repository/mikro-orm-contact.repository'; -import { TypeOrmContactRepository } from '../../contact/repository/type-orm-contact.repository'; -import { MikroOrmCountryRepository } from '../../country/repository/mikro-orm-country.repository'; -import { TypeOrmCountryRepository } from '../../country/repository/type-orm-country.repository'; -import { MikroOrmCurrencyRepository } from '../../currency/repository/mikro-orm-currency.repository'; -import { TypeOrmCurrencyRepository } from '../../currency/repository/type-orm-currency.repository'; -import { MikroOrmCustomSmtpRepository } from '../../custom-smtp/repository/mikro-orm-custom-smtp.repository'; -import { TypeOrmCustomSmtpRepository } from '../../custom-smtp/repository/type-orm-custom-smtp.repository'; -import { MikroOrmDealRepository } from '../../deal/repository/mikro-orm-deal.repository'; -import { TypeOrmDealRepository } from '../../deal/repository/type-orm-deal.repository'; -import { MikroOrmEmailHistoryRepository } from '../../email-history/repository/mikro-orm-email-history.repository'; -import { TypeOrmEmailHistoryRepository } from '../../email-history/repository/type-orm-email-history.repository'; -import { MikroOrmEmailTemplateRepository } from '../../email-template/repository/mikro-orm-email-template.repository'; -import { TypeOrmEmailTemplateRepository } from '../../email-template/repository/type-orm-email-template.repository'; -import { MikroOrmEmployeeAppointmentRepository } from '../../employee-appointment/repository/mikro-orm-employee-appointment.repository'; -import { TypeOrmEmployeeAppointmentRepository } from '../../employee-appointment/repository/type-orm-employee-appointment.repository'; -import { MikroOrmEmployeeAwardRepository } from '../../employee-award/repository/mikro-orm-employee-award.repository'; -import { TypeOrmEmployeeAwardRepository } from '../../employee-award/repository/type-orm-employee-award.repository'; -import { MikroOrmEmployeeLevelRepository } from '../../employee-level/repository/mikro-orm-employee-level.repository'; -import { TypeOrmEmployeeLevelRepository } from '../../employee-level/repository/type-orm-employee-level.repository'; -import { MikroOrmEmployeeRecurringExpenseRepository } from '../../employee-recurring-expense/repository/mikro-orm-employee-recurring-expense.repository'; -import { TypeOrmEmployeeRecurringExpenseRepository } from '../../employee-recurring-expense/repository/type-orm-employee-recurring-expense.repository'; -import { MikroOrmEmployeeSettingRepository } from '../../employee-setting/repository/mikro-orm-employee-setting.repository'; -import { TypeOrmEmployeeSettingRepository } from '../../employee-setting/repository/type-orm-employee-setting.repository'; -import { MikroOrmEmployeeRepository } from '../../employee/repository/mikro-orm-employee.repository'; -import { TypeOrmEmployeeRepository } from '../../employee/repository/type-orm-employee.repository'; -import { MikroOrmEquipmentSharingPolicyRepository } from '../../equipment-sharing-policy/repository/mikro-orm-equipment-sharing-policy.repository'; -import { TypeOrmEquipmentSharingPolicyRepository } from '../../equipment-sharing-policy/repository/type-orm-equipment-sharing-policy.repository'; -import { MikroOrmEquipmentSharingRepository } from '../../equipment-sharing/repository/mikro-orm-equipment-sharing.repository'; -import { TypeOrmEquipmentSharingRepository } from '../../equipment-sharing/repository/type-orm-equipment-sharing.repository'; -import { MikroOrmEquipmentRepository } from '../../equipment/repository/mikro-orm-equipment.repository'; -import { TypeOrmEquipmentRepository } from '../../equipment/repository/type-orm-equipment.repository'; -import { MikroOrmEstimateEmailRepository } from '../../estimate-email/repository/mikro-orm-estimate-email.repository'; -import { TypeOrmEstimateEmailRepository } from '../../estimate-email/repository/type-orm-estimate-email.repository'; -import { MikroOrmEventTypeRepository } from '../../event-types/repository/mikro-orm-event-type.repository'; -import { TypeOrmEventTypeRepository } from '../../event-types/repository/type-orm-event-types.repository'; -import { MikroOrmExpenseCategoryRepository } from '../../expense-categories/repository/mikro-orm-expense-category.repository'; -import { TypeOrmExpenseCategoryRepository } from '../../expense-categories/repository/type-orm-expense-category.repository'; -import { MikroOrmExpenseRepository } from '../../expense/repository/mikro-orm-expense.repository'; -import { TypeOrmExpenseRepository } from '../../expense/repository/type-orm-expense.repository'; -import { MikroOrmFeatureOrganizationRepository } from '../../feature/repository/mikro-orm-feature-organization.repository'; -import { MikroOrmFeatureRepository } from '../../feature/repository/mikro-orm-feature.repository'; -import { TypeOrmFeatureRepository } from '../../feature/repository/type-orm-feature.repository'; -import { TypeOrmFeatureOrganizationRepository } from '../../feature/repository/type-orm-feature-organization.repository'; -import { MikroOrmGoalGeneralSettingRepository } from '../../goal-general-setting/repository/mikro-orm-goal-general-setting.repository'; -import { TypeOrmGoalGeneralSettingRepository } from '../../goal-general-setting/repository/type-orm-goal-general-setting.repository'; -import { MikroOrmGoalKPITemplateRepository } from '../../goal-kpi-template/repository/mikro-orm-goal-kpi-template.repository'; -import { TypeOrmGoalKPITemplateRepository } from '../../goal-kpi-template/repository/type-orm-goal-kpi-template.repository'; -import { MikroOrmGoalKPIRepository } from '../../goal-kpi/repository/mikro-orm-goal-kpi.repository'; -import { TypeOrmGoalKPIRepository } from '../../goal-kpi/repository/type-orm-goal-kpi.repository'; -import { MikroOrmGoalTemplateRepository } from '../../goal-template/repository/mikro-orm-goal-template.repository'; -import { TypeOrmGoalTemplateRepository } from '../../goal-template/repository/type-orm-goal-template.repository'; -import { MikroOrmGoalTimeFrameRepository } from '../../goal-time-frame/repository/mikro-orm-goal-time-frame.repository'; -import { TypeOrmGoalTimeFrameRepository } from '../../goal-time-frame/repository/type-orm-goal-time-frame.repository'; -import { MikroOrmGoalRepository } from '../../goal/repository/mikro-orm-goal.repository'; -import { TypeOrmGoalRepository } from '../../goal/repository/type-orm-goal.repository'; -import { MikroOrmImageAssetRepository } from '../../image-asset/repository/mikro-orm-image-asset.repository'; -import { TypeOrmImageAssetRepository } from '../../image-asset/repository/type-orm-image-asset.repository'; -import { MikroOrmIncomeRepository } from '../../income/repository/mikro-orm-income.repository'; -import { TypeOrmIncomeRepository } from '../../income/repository/type-orm-income.repository'; -import { MikroOrmIntegrationEntitySettingTiedRepository } from '../../integration-entity-setting-tied/repository/mikro-orm-integration-entity-setting-tied.repository'; -import { TypeOrmIntegrationEntitySettingTiedRepository } from '../../integration-entity-setting-tied/repository/type-orm-integration-entity-setting-tied.repository'; -import { MikroOrmIntegrationEntitySettingRepository } from '../../integration-entity-setting/repository/mikro-orm-integration-entity-setting.repository'; -import { TypeOrmIntegrationEntitySettingRepository } from '../../integration-entity-setting/repository/type-orm-integration-entity-setting.repository'; -import { MikroOrmIntegrationMapRepository } from '../../integration-map/repository/mikro-orm-integration-map.repository'; -import { TypeOrmIntegrationMapRepository } from '../../integration-map/repository/type-orm-integration-map.repository'; -import { MikroOrmIntegrationSettingRepository } from '../../integration-setting/repository/mikro-orm-integration-setting.repository'; -import { TypeOrmIntegrationSettingRepository } from '../../integration-setting/repository/type-orm-integration-setting.repository'; -import { MikroOrmIntegrationTenantRepository } from '../../integration-tenant/repository/mikro-orm-integration-tenant.repository'; -import { TypeOrmIntegrationTenantRepository } from '../../integration-tenant/repository/type-orm-integration-tenant.repository'; -import { MikroOrmIntegrationTypeRepository } from '../../integration/repository/mikro-orm-integration-type.repository'; -import { MikroOrmIntegrationRepository } from '../../integration/repository/mikro-orm-integration.repository'; -import { TypeOrmIntegrationTypeRepository } from '../../integration/repository/type-orm-integration-type.repository'; -import { TypeOrmIntegrationRepository } from '../../integration/repository/type-orm-integration.repository'; -import { MikroOrmInviteRepository } from '../../invite/repository/mikro-orm-invite.repository'; -import { TypeOrmInviteRepository } from '../../invite/repository/type-orm-invite.repository'; -import { MikroOrmInvoiceEstimateHistoryRepository } from '../../invoice-estimate-history/repository/mikro-orm-invoice-estimate-history.repository'; -import { TypeOrmInvoiceEstimateHistoryRepository } from '../../invoice-estimate-history/repository/type-orm-invoice-estimate-history.repository'; -import { MikroOrmInvoiceItemRepository } from '../../invoice-item/repository/mikro-orm-invoice-item.repository'; -import { TypeOrmInvoiceItemRepository } from '../../invoice-item/repository/type-orm-invoice-item.repository'; -import { MikroOrmInvoiceRepository } from '../../invoice/repository/mikro-orm-invoice.repository'; -import { TypeOrmInvoiceRepository } from '../../invoice/repository/type-orm-invoice.repository'; -import { MikroOrmKeyResultTemplateRepository } from '../../keyresult-template/repository/mikro-orm-keyresult-template.repository'; -import { TypeOrmKeyResultTemplateRepository } from '../../keyresult-template/repository/type-orm-keyresult-template.repository'; -import { MikroOrmKeyResultUpdateRepository } from '../../keyresult-update/repository/mikro-orm-keyresult-update.repository'; -import { TypeOrmKeyResultUpdateRepository } from '../../keyresult-update/repository/type-orm-keyresult-update.repository'; -import { MikroOrmKeyResultRepository } from '../../keyresult/repository/mikro-orm-keyresult.repository'; -import { TypeOrmKeyResultRepository } from '../../keyresult/repository/type-orm-keyresult.repository'; -import { MikroOrmLanguageRepository } from '../../language/repository/mikro-orm-language.repository'; -import { TypeOrmLanguageRepository } from '../../language/repository/type-orm-language.repository'; -import { MikroOrmMerchantRepository } from '../../merchant/repository/mikro-orm-merchant.repository'; -import { TypeOrmMerchantRepository } from '../../merchant/repository/type-orm-merchant.repository'; -import { MikroOrmOrganizationAwardRepository } from '../../organization-award/repository/mikro-orm-organization-award.repository'; -import { TypeOrmOrganizationAwardRepository } from '../../organization-award/repository/type-orm-organization-award.repository'; -import { MikroOrmOrganizationContactRepository } from '../../organization-contact/repository/mikro-orm-organization-contact.repository'; -import { TypeOrmOrganizationContactRepository } from '../../organization-contact/repository/type-orm-organization-contact.repository'; -import { MikroOrmOrganizationDepartmentRepository } from '../../organization-department/repository/mikro-orm-organization-department.repository'; -import { TypeOrmOrganizationDepartmentRepository } from '../../organization-department/repository/type-orm-organization-department.repository'; -import { MikroOrmOrganizationDocumentRepository } from '../../organization-document/repository/mikro-orm-organization-document.repository'; -import { TypeOrmOrganizationDocumentRepository } from '../../organization-document/repository/type-orm-organization-document.repository'; -import { MikroOrmOrganizationEmploymentTypeRepository } from '../../organization-employment-type/repository/mikro-orm-organization-employment-type.repository'; -import { TypeOrmOrganizationEmploymentTypeRepository } from '../../organization-employment-type/repository/type-orm-organization-employment-type.repository'; -import { MikroOrmOrganizationLanguageRepository } from '../../organization-language/repository/mikro-orm-organization-language.repository'; -import { TypeOrmOrganizationLanguageRepository } from '../../organization-language/repository/type-orm-organization-language.repository'; -import { MikroOrmOrganizationPositionRepository } from '../../organization-position/repository/mikro-orm-organization-position.repository'; -import { TypeOrmOrganizationPositionRepository } from '../../organization-position/repository/type-orm-organization-position.repository'; -import { MikroOrmOrganizationProjectRepository } from '../../organization-project/repository/mikro-orm-organization-project.repository'; -import { TypeOrmOrganizationProjectRepository } from '../../organization-project/repository/type-orm-organization-project.repository'; -import { MikroOrmOrganizationRecurringExpenseRepository } from '../../organization-recurring-expense/repository/mikro-orm-organization-recurring-expense.repository'; -import { TypeOrmOrganizationRecurringExpenseRepository } from '../../organization-recurring-expense/repository/type-orm-organization-recurring-expense.repository'; -import { MikroOrmOrganizationSprintRepository } from '../../organization-sprint/repository/mikro-orm-organization-sprint.repository'; -import { TypeOrmOrganizationSprintRepository } from '../../organization-sprint/repository/type-orm-organization-sprint.repository'; -import { MikroOrmOrganizationTeamEmployeeRepository } from '../../organization-team-employee/repository/mikro-orm-organization-team-employee.repository'; -import { TypeOrmOrganizationTeamEmployeeRepository } from '../../organization-team-employee/repository/type-orm-organization-team-employee.repository'; -import { MikroOrmOrganizationTeamRepository } from '../../organization-team/repository/mikro-orm-organization-team.repository'; -import { TypeOrmOrganizationTeamRepository } from '../../organization-team/repository/type-orm-organization-team.repository'; -import { MikroOrmOrganizationVendorRepository } from '../../organization-vendor/repository/mikro-orm-organization-vendor.repository'; -import { TypeOrmOrganizationVendorRepository } from '../../organization-vendor/repository/type-orm-organization-vendor.repository'; -import { MikroOrmOrganizationRepository } from '../../organization/repository/mikro-orm-organization.repository'; -import { TypeOrmOrganizationRepository } from '../../organization/repository/type-orm-organization.repository'; -import { MikroOrmPaymentRepository } from '../../payment/repository/mikro-orm-payment.repository'; -import { TypeOrmPaymentRepository } from '../../payment/repository/type-orm-payment.repository'; -import { MikroOrmPipelineStageRepository } from '../../pipeline-stage/repository/mikro-orm-pipeline-stage.repository'; -import { TypeOrmPipelineStageRepository } from '../../pipeline-stage/repository/type-orm-pipeline-stage.repository'; -import { MikroOrmPipelineRepository } from '../../pipeline/repository/mikro-orm-pipeline.repository'; -import { TypeOrmPipelineRepository } from '../../pipeline/repository/type-orm-pipeline.repository'; -import { MikroOrmProductCategoryTranslationRepository } from '../../product-category/repository/mikro-orm-product-category-translation.repository'; -import { MikroOrmProductCategoryRepository } from '../../product-category/repository/mikro-orm-product-category.repository'; -import { TypeOrmProductCategoryTranslationRepository } from '../../product-category/repository/type-orm-product-category-translation.repository'; -import { TypeOrmProductCategoryRepository } from '../../product-category/repository/type-orm-product-category.repository'; -import { MikroOrmProductOptionGroupTranslationRepository } from '../../product-option/repository/mikro-orm-product-option-group-translation.repository'; -import { MikroOrmProductOptionGroupRepository } from '../../product-option/repository/mikro-orm-product-option-group.repository'; -import { MikroOrmProductOptionTranslationRepository } from '../../product-option/repository/mikro-orm-product-option-translation.repository'; -import { MikroOrmProductOptionRepository } from '../../product-option/repository/mikro-orm-product-option.repository'; -import { TypeOrmProductOptionGroupTranslationRepository } from '../../product-option/repository/type-orm-product-option-group-translation.repository'; -import { TypeOrmProductOptionGroupRepository } from '../../product-option/repository/type-orm-product-option-group.repository'; -import { TypeOrmProductOptionTranslationRepository } from '../../product-option/repository/type-orm-product-option-translation.repository'; -import { TypeOrmProductOptionRepository } from '../../product-option/repository/type-orm-product-option.repository'; -import { MikroOrmProductVariantSettingRepository } from '../../product-setting/repository/mikro-orm-product-setting.repository'; -import { TypeOrmProductVariantSettingRepository } from '../../product-setting/repository/type-orm-product-setting.repository'; -import { MikroOrmProductTypeTranslationRepository } from '../../product-type/repository/mikro-orm-product-type-translation.repository'; -import { MikroOrmProductTypeRepository } from '../../product-type/repository/mikro-orm-product-type.repository'; -import { TypeOrmProductTypeTranslationRepository } from '../../product-type/repository/type-orm-product-type-translation.repository'; -import { TypeOrmProductTypeRepository } from '../../product-type/repository/type-orm-product-type.repository'; -import { MikroOrmProductVariantPriceRepository } from '../../product-variant-price/repository/mikro-orm-product-variant-price.repository'; -import { TypeOrmProductVariantPriceRepository } from '../../product-variant-price/repository/type-orm-product-variant-price.repository'; -import { MikroOrmProductVariantRepository } from '../../product-variant/repository/mikro-orm-product-variant.repository'; -import { TypeOrmProductVariantRepository } from '../../product-variant/repository/type-orm-product-variant.repository'; -import { MikroOrmProductTranslationRepository } from '../../product/repository/mikro-orm-product-translation.repository'; -import { MikroOrmProductRepository } from '../../product/repository/mikro-orm-product.repository'; -import { TypeOrmProductTranslationRepository } from '../../product/repository/type-orm-product-translation.repository'; -import { TypeOrmProductRepository } from '../../product/repository/type-orm-product.repository'; -import { MikroOrmReportCategoryRepository } from '../../reports/repository/mikro-orm-report-category.repository'; -import { MikroOrmReportOrganizationRepository } from '../../reports/repository/mikro-orm-report-organization.repository'; -import { MikroOrmReportRepository } from '../../reports/repository/mikro-orm-report.repository'; -import { TypeOrmReportCategoryRepository } from '../../reports/repository/type-orm-report-category.repository'; -import { TypeOrmReportOrganizationRepository } from '../../reports/repository/type-orm-report-organization.repository'; -import { TypeOrmReportRepository } from '../../reports/repository/type-orm-report.repository'; -import { MikroOrmRequestApprovalEmployeeRepository } from '../../request-approval-employee/repository/mikro-orm-request-approval-employee.repository'; -import { TypeOrmRequestApprovalEmployeeRepository } from '../../request-approval-employee/repository/type-orm-request-approval-employee.repository'; -import { MikroOrmRequestApprovalTeamRepository } from '../../request-approval-team/repository/mikro-orm-request-approval-team.repository'; -import { TypeOrmRequestApprovalTeamRepository } from '../../request-approval-team/repository/type-orm-request-approval-team.repository'; -import { MikroOrmRequestApprovalRepository } from '../../request-approval/repository/mikro-orm-request-approval.repository'; -import { TypeOrmRequestApprovalRepository } from '../../request-approval/repository/type-orm-request-approval.repository'; -import { MikroOrmRolePermissionRepository } from '../../role-permission/repository/mikro-orm-role-permission.repository'; -import { TypeOrmRolePermissionRepository } from '../../role-permission/repository/type-orm-role-permission.repository'; -import { MikroOrmRoleRepository } from '../../role/repository/mikro-orm-role.repository'; -import { TypeOrmRoleRepository } from '../../role/repository/type-orm-role.repository'; -import { MikroOrmSkillRepository } from '../../skills/repository/mikro-orm-skill.repository'; -import { TypeOrmSkillRepository } from '../../skills/repository/type-orm-skill.repository'; -import { MikroOrmTagRepository } from '../../tags/repository/mikro-orm-tag.repository'; -import { TypeOrmTagRepository } from '../../tags/repository/type-orm-tag.repository'; -import { MikroOrmTaskRepository } from '../../tasks/repository/mikro-orm-task.repository'; -import { TypeOrmTaskRepository } from '../../tasks/repository/type-orm-task.repository'; -import { MikroOrmTenantRepository } from '../../tenant/repository/mikro-orm-tenant.repository'; -import { TypeOrmTenantRepository } from '../../tenant/repository/type-orm-tenant.repository'; -import { MikroOrmTenantSettingRepository } from '../../tenant/tenant-setting/repository/mikro-orm-tenant-setting.repository'; -import { TypeOrmTenantSettingRepository } from '../../tenant/tenant-setting/repository/type-orm-tenant-setting.repository'; -import { MikroOrmTimeOffPolicyRepository } from '../../time-off-policy/repository/mikro-orm-time-off-policy.repository'; -import { TypeOrmTimeOffPolicyRepository } from '../../time-off-policy/repository/type-orm-time-off-policy.repository'; -import { MikroOrmTimeOffRequestRepository } from '../../time-off-request/repository/mikro-orm-time-off-request.repository'; -import { TypeOrmTimeOffRequestRepository } from '../../time-off-request/repository/type-orm-time-off-request.repository'; -import { MikroOrmActivityRepository } from '../../time-tracking/activity/repository/mikro-orm-activity.repository'; -import { TypeOrmActivityRepository } from '../../time-tracking/activity/repository/type-orm-activity.repository'; -import { MikroOrmScreenshotRepository } from '../../time-tracking/screenshot/repository/mikro-orm-screenshot.repository'; -import { TypeOrmScreenshotRepository } from '../../time-tracking/screenshot/repository/type-orm-screenshot.repository'; -import { MikroOrmTimeLogRepository } from '../../time-tracking/time-log/repository/mikro-orm-time-log.repository'; -import { TypeOrmTimeLogRepository } from '../../time-tracking/time-log/repository/type-orm-time-log.repository'; -import { MikroOrmTimeSlotMinuteRepository } from '../../time-tracking/time-slot/repository/mikro-orm-time-slot-minute.repository'; -import { MikroOrmTimeSlotRepository } from '../../time-tracking/time-slot/repository/mikro-orm-time-slot.repository'; -import { TypeOrmTimeSlotMinuteRepository } from '../../time-tracking/time-slot/repository/type-orm-time-slot-minute.repository'; -import { TypeOrmTimeSlotRepository } from '../../time-tracking/time-slot/repository/type-orm-time-slot.repository'; -import { MikroOrmTimesheetRepository } from '../../time-tracking/timesheet/repository/mikro-orm-timesheet.repository'; -import { TypeOrmTimesheetRepository } from '../../time-tracking/timesheet/repository/type-orm-timesheet.repository'; -import { MikroOrmUserOrganizationRepository } from '../../user-organization/repository/mikro-orm-user-organization.repository'; -import { TypeOrmUserOrganizationRepository } from '../../user-organization/repository/type-orm-user-organization.repository'; -import { MikroOrmUserRepository } from '../../user/repository/mikro-orm-user.repository'; -import { TypeOrmUserRepository } from '../../user/repository/type-orm-user.repository'; -import { MikroOrmWarehouseProductVariantRepository } from '../../warehouse/repository/mikro-orm-warehouse-product-variant.repository'; -import { MikroOrmWarehouseProductRepository } from '../../warehouse/repository/mikro-orm-warehouse-product.repository '; -import { MikroOrmWarehouseRepository } from '../../warehouse/repository/mikro-orm-warehouse.repository'; -import { TypeOrmWarehouseProductVariantRepository } from '../../warehouse/repository/type-orm-warehouse-product-variant.repository'; -import { TypeOrmWarehouseProductRepository } from '../../warehouse/repository/type-orm-warehouse-product.repository '; -import { TypeOrmWarehouseRepository } from '../../warehouse/repository/type-orm-warehouse.repository'; -export interface IColumnRelationMetadata { - joinTableName: string; -} -export interface IRepositoryModel { - repository: Repository; - tenantBase?: boolean; - relations?: IColumnRelationMetadata[]; - condition?: any; -} +import { IColumnRelationMetadata, IRepositoryModel, RepositoriesService } from '../repositories/repositories.service'; @Injectable() export class ExportService implements OnModuleInit { @@ -390,611 +23,18 @@ export class ExportService implements OnModuleInit { public idZip = new BehaviorSubject(''); public idCsv = new BehaviorSubject(''); - private dynamicEntitiesClassMap: IRepositoryModel[] = []; - private repositories: IRepositoryModel[] = []; - - constructor( - @InjectRepository(AccountingTemplate) - private typeOrmAccountingTemplateRepository: TypeOrmAccountingTemplateRepository, - - mikroOrmAccountingTemplateRepository: MikroOrmAccountingTemplateRepository, - - @InjectRepository(Activity) - private typeOrmActivityRepository: TypeOrmActivityRepository, - - mikroOrmActivityRepository: MikroOrmActivityRepository, - - @InjectRepository(AppointmentEmployee) - private typeOrmAppointmentEmployeeRepository: TypeOrmAppointmentEmployeeRepository, - - mikroOrmAppointmentEmployeeRepository: MikroOrmAppointmentEmployeeRepository, - - @InjectRepository(ApprovalPolicy) - private typeOrmApprovalPolicyRepository: TypeOrmApprovalPolicyRepository, - - mikroOrmApprovalPolicyRepository: MikroOrmApprovalPolicyRepository, - - @InjectRepository(AvailabilitySlot) - private typeOrmAvailabilitySlotRepository: TypeOrmAvailabilitySlotRepository, - - mikroOrmAvailabilitySlotRepository: MikroOrmAvailabilitySlotRepository, - - @InjectRepository(Candidate) - private typeOrmCandidateRepository: TypeOrmCandidateRepository, - - mikroOrmCandidateRepository: MikroOrmCandidateRepository, - - @InjectRepository(CandidateCriterionsRating) - private typeOrmCandidateCriterionsRatingRepository: TypeOrmCandidateCriterionsRatingRepository, - - mikroOrmCandidateCriterionsRatingRepository: MikroOrmCandidateCriterionsRatingRepository, - - @InjectRepository(CandidateDocument) - private typeOrmCandidateDocumentRepository: TypeOrmCandidateDocumentRepository, - - mikroOrmCandidateDocumentRepository: MikroOrmCandidateDocumentRepository, - - @InjectRepository(CandidateEducation) - private typeOrmCandidateEducationRepository: TypeOrmCandidateEducationRepository, - - mikroOrmCandidateEducationRepository: MikroOrmCandidateEducationRepository, - - @InjectRepository(CandidateExperience) - private typeOrmCandidateExperienceRepository: TypeOrmCandidateExperienceRepository, - - mikroOrmCandidateExperienceRepository: MikroOrmCandidateExperienceRepository, - - @InjectRepository(CandidateFeedback) - private typeOrmCandidateFeedbackRepository: TypeOrmCandidateFeedbackRepository, - - mikroOrmCandidateFeedbackRepository: MikroOrmCandidateFeedbackRepository, - - @InjectRepository(CandidateInterview) - private typeOrmCandidateInterviewRepository: TypeOrmCandidateInterviewRepository, - - mikroOrmCandidateInterviewRepository: MikroOrmCandidateInterviewRepository, - - @InjectRepository(CandidateInterviewers) - private typeOrmCandidateInterviewersRepository: TypeOrmCandidateInterviewersRepository, - - mikroOrmCandidateInterviewersRepository: MikroOrmCandidateInterviewersRepository, - - @InjectRepository(CandidatePersonalQualities) - private typeOrmCandidatePersonalQualitiesRepository: TypeOrmCandidatePersonalQualitiesRepository, - - mikroOrmCandidatePersonalQualitiesRepository: MikroOrmCandidatePersonalQualitiesRepository, - - @InjectRepository(CandidateSkill) - private typeOrmCandidateSkillRepository: TypeOrmCandidateSkillRepository, - - mikroOrmCandidateSkillRepository: MikroOrmCandidateSkillRepository, - - @InjectRepository(CandidateSource) - private typeOrmCandidateSourceRepository: TypeOrmCandidateSourceRepository, - - mikroOrmCandidateSourceRepository: MikroOrmCandidateSourceRepository, - - @InjectRepository(CandidateTechnologies) - private typeOrmCandidateTechnologiesRepository: TypeOrmCandidateTechnologiesRepository, - - mikroOrmCandidateTechnologiesRepository: MikroOrmCandidateTechnologiesRepository, - - @InjectRepository(Contact) - private typeOrmContactRepository: TypeOrmContactRepository, - - mikroOrmContactRepository: MikroOrmContactRepository, - - @InjectRepository(Country) - private typeOrmCountryRepository: TypeOrmCountryRepository, - - mikroOrmCountryRepository: MikroOrmCountryRepository, - - @InjectRepository(Currency) - private typeOrmCurrencyRepository: TypeOrmCurrencyRepository, - - mikroOrmCurrencyRepository: MikroOrmCurrencyRepository, - - @InjectRepository(CustomSmtp) - private typeOrmCustomSmtpRepository: TypeOrmCustomSmtpRepository, - - mikroOrmCustomSmtpRepository: MikroOrmCustomSmtpRepository, - - @InjectRepository(Deal) - private typeOrmDealRepository: TypeOrmDealRepository, - - mikroOrmDealRepository: MikroOrmDealRepository, - - @InjectRepository(EmailHistory) - private typeOrmEmailHistoryRepository: TypeOrmEmailHistoryRepository, - - mikroOrmEmailHistoryRepository: MikroOrmEmailHistoryRepository, - - @InjectRepository(EmailTemplate) - private typeOrmEmailTemplateRepository: TypeOrmEmailTemplateRepository, - - mikroOrmEmailTemplateRepository: MikroOrmEmailTemplateRepository, - - @InjectRepository(Employee) - private typeOrmEmployeeRepository: TypeOrmEmployeeRepository, - - mikroOrmEmployeeRepository: MikroOrmEmployeeRepository, - - @InjectRepository(EmployeeAppointment) - private typeOrmEmployeeAppointmentRepository: TypeOrmEmployeeAppointmentRepository, - - mikroOrmEmployeeAppointmentRepository: MikroOrmEmployeeAppointmentRepository, - - @InjectRepository(EmployeeAward) - private typeOrmEmployeeAwardRepository: TypeOrmEmployeeAwardRepository, - - mikroOrmEmployeeAwardRepository: MikroOrmEmployeeAwardRepository, - - @InjectRepository(EmployeeRecurringExpense) - private typeOrmEmployeeRecurringExpenseRepository: TypeOrmEmployeeRecurringExpenseRepository, - - mikroOrmEmployeeRecurringExpenseRepository: MikroOrmEmployeeRecurringExpenseRepository, - - @InjectRepository(EmployeeSetting) - private typeOrmEmployeeSettingRepository: TypeOrmEmployeeSettingRepository, - - mikroOrmEmployeeSettingRepository: MikroOrmEmployeeSettingRepository, - - @InjectRepository(Equipment) - private typeOrmEquipmentRepository: TypeOrmEquipmentRepository, - - mikroOrmEquipmentRepository: MikroOrmEquipmentRepository, - - @InjectRepository(EquipmentSharing) - private typeOrmEquipmentSharingRepository: TypeOrmEquipmentSharingRepository, - - mikroOrmEquipmentSharingRepository: MikroOrmEquipmentSharingRepository, - - @InjectRepository(EquipmentSharingPolicy) - private typeOrmEquipmentSharingPolicyRepository: TypeOrmEquipmentSharingPolicyRepository, - - mikroOrmEquipmentSharingPolicyRepository: MikroOrmEquipmentSharingPolicyRepository, - - @InjectRepository(EstimateEmail) - private typeOrmEstimateEmailRepository: TypeOrmEstimateEmailRepository, - - mikroOrmEstimateEmailRepository: MikroOrmEstimateEmailRepository, - - @InjectRepository(EventType) - private typeOrmEventTypeRepository: TypeOrmEventTypeRepository, - - mikroOrmEventTypeRepository: MikroOrmEventTypeRepository, - - @InjectRepository(Expense) - private typeOrmExpenseRepository: TypeOrmExpenseRepository, - - mikroOrmExpenseRepository: MikroOrmExpenseRepository, - - @InjectRepository(ExpenseCategory) - private typeOrmExpenseCategoryRepository: TypeOrmExpenseCategoryRepository, - - mikroOrmExpenseCategoryRepository: MikroOrmExpenseCategoryRepository, - - @InjectRepository(Feature) - private typeOrmFeatureRepository: TypeOrmFeatureRepository, - - mikroOrmFeatureRepository: MikroOrmFeatureRepository, - - @InjectRepository(FeatureOrganization) - private typeOrmFeatureOrganizationRepository: TypeOrmFeatureOrganizationRepository, - - mikroOrmFeatureOrganizationRepository: MikroOrmFeatureOrganizationRepository, - - @InjectRepository(Goal) - private typeOrmGoalRepository: TypeOrmGoalRepository, - - mikroOrmGoalRepository: MikroOrmGoalRepository, - - @InjectRepository(GoalTemplate) - private typeOrmGoalTemplateRepository: TypeOrmGoalTemplateRepository, - - mikroOrmGoalTemplateRepository: MikroOrmGoalTemplateRepository, - - @InjectRepository(GoalKPI) - private typeOrmGoalKPIRepository: TypeOrmGoalKPIRepository, - - mikroOrmGoalKPIRepository: MikroOrmGoalKPIRepository, - - @InjectRepository(GoalKPITemplate) - private typeOrmGoalKPITemplateRepository: TypeOrmGoalKPITemplateRepository, - - mikroOrmGoalKPITemplateRepository: MikroOrmGoalKPITemplateRepository, - - @InjectRepository(GoalTimeFrame) - private typeOrmGoalTimeFrameRepository: TypeOrmGoalTimeFrameRepository, - - mikroOrmGoalTimeFrameRepository: MikroOrmGoalTimeFrameRepository, - - @InjectRepository(GoalGeneralSetting) - private typeOrmGoalGeneralSettingRepository: TypeOrmGoalGeneralSettingRepository, - - mikroOrmGoalGeneralSettingRepository: MikroOrmGoalGeneralSettingRepository, - - @InjectRepository(Income) - private typeOrmIncomeRepository: TypeOrmIncomeRepository, - - mikroOrmIncomeRepository: MikroOrmIncomeRepository, - - @InjectRepository(Integration) - private typeOrmIntegrationRepository: TypeOrmIntegrationRepository, - - mikroOrmIntegrationRepository: MikroOrmIntegrationRepository, - - @InjectRepository(IntegrationType) - private typeOrmIntegrationTypeRepository: TypeOrmIntegrationTypeRepository, - - mikroOrmIntegrationTypeRepository: MikroOrmIntegrationTypeRepository, - - @InjectRepository(IntegrationEntitySetting) - private typeOrmIntegrationEntitySettingRepository: TypeOrmIntegrationEntitySettingRepository, - - mikroOrmIntegrationEntitySettingRepository: MikroOrmIntegrationEntitySettingRepository, - - @InjectRepository(IntegrationEntitySettingTied) - private typeOrmIntegrationEntitySettingTiedRepository: TypeOrmIntegrationEntitySettingTiedRepository, - - mikroOrmIntegrationEntitySettingTiedRepository: MikroOrmIntegrationEntitySettingTiedRepository, - - @InjectRepository(IntegrationMap) - private typeOrmIntegrationMapRepository: TypeOrmIntegrationMapRepository, - - mikroOrmIntegrationMapRepository: MikroOrmIntegrationMapRepository, - - @InjectRepository(IntegrationSetting) - private typeOrmIntegrationSettingRepository: TypeOrmIntegrationSettingRepository, - - mikroOrmIntegrationSettingRepository: MikroOrmIntegrationSettingRepository, - - @InjectRepository(IntegrationTenant) - private typeOrmIntegrationTenantRepository: TypeOrmIntegrationTenantRepository, - - mikroOrmIntegrationTenantRepository: MikroOrmIntegrationTenantRepository, - - @InjectRepository(Invite) - private typeOrmInviteRepository: TypeOrmInviteRepository, - - mikroOrmInviteRepository: MikroOrmInviteRepository, - - @InjectRepository(Invoice) - private typeOrmInvoiceRepository: TypeOrmInvoiceRepository, - - mikroOrmInvoiceRepository: MikroOrmInvoiceRepository, - - @InjectRepository(InvoiceEstimateHistory) - private typeOrmInvoiceEstimateHistoryRepository: TypeOrmInvoiceEstimateHistoryRepository, - - mikroOrmInvoiceEstimateHistoryRepository: MikroOrmInvoiceEstimateHistoryRepository, - - @InjectRepository(InvoiceItem) - private typeOrmInvoiceItemRepository: TypeOrmInvoiceItemRepository, - - mikroOrmInvoiceItemRepository: MikroOrmInvoiceItemRepository, - - @InjectRepository(KeyResult) - private typeOrmKeyResultRepository: TypeOrmKeyResultRepository, - - mikroOrmKeyResultRepository: MikroOrmKeyResultRepository, - - @InjectRepository(KeyResultTemplate) - private typeOrmKeyResultTemplateRepository: TypeOrmKeyResultTemplateRepository, - - mikroOrmKeyResultTemplateRepository: MikroOrmKeyResultTemplateRepository, - - @InjectRepository(KeyResultUpdate) - private typeOrmKeyResultUpdateRepository: TypeOrmKeyResultUpdateRepository, - - mikroOrmKeyResultUpdateRepository: MikroOrmKeyResultUpdateRepository, - - @InjectRepository(Language) - private typeOrmLanguageRepository: TypeOrmLanguageRepository, - - mikroOrmLanguageRepository: MikroOrmLanguageRepository, - - @InjectRepository(Organization) - private typeOrmOrganizationRepository: TypeOrmOrganizationRepository, - - mikroOrmOrganizationRepository: MikroOrmOrganizationRepository, - - @InjectRepository(EmployeeLevel) - private typeOrmEmployeeLevelRepository: TypeOrmEmployeeLevelRepository, - - mikroOrmEmployeeLevelRepository: MikroOrmEmployeeLevelRepository, - - @InjectRepository(OrganizationAward) - private typeOrmOrganizationAwardRepository: TypeOrmOrganizationAwardRepository, - - mikroOrmOrganizationAwardRepository: MikroOrmOrganizationAwardRepository, - - @InjectRepository(OrganizationContact) - private typeOrmOrganizationContactRepository: TypeOrmOrganizationContactRepository, - - mikroOrmOrganizationContactRepository: MikroOrmOrganizationContactRepository, - - @InjectRepository(OrganizationDepartment) - private typeOrmOrganizationDepartmentRepository: TypeOrmOrganizationDepartmentRepository, - - mikroOrmOrganizationDepartmentRepository: MikroOrmOrganizationDepartmentRepository, - - @InjectRepository(OrganizationDocument) - private typeOrmOrganizationDocumentRepository: TypeOrmOrganizationDocumentRepository, - - mikroOrmOrganizationDocumentRepository: MikroOrmOrganizationDocumentRepository, - - @InjectRepository(OrganizationEmploymentType) - private typeOrmOrganizationEmploymentTypeRepository: TypeOrmOrganizationEmploymentTypeRepository, - - mikroOrmOrganizationEmploymentTypeRepository: MikroOrmOrganizationEmploymentTypeRepository, - - @InjectRepository(OrganizationLanguage) - private typeOrmOrganizationLanguageRepository: TypeOrmOrganizationLanguageRepository, - - mikroOrmOrganizationLanguageRepository: MikroOrmOrganizationLanguageRepository, - - @InjectRepository(OrganizationPosition) - private typeOrmOrganizationPositionRepository: TypeOrmOrganizationPositionRepository, - - mikroOrmOrganizationPositionRepository: MikroOrmOrganizationPositionRepository, - - @InjectRepository(OrganizationProject) - private typeOrmOrganizationProjectRepository: TypeOrmOrganizationProjectRepository, - - mikroOrmOrganizationProjectRepository: MikroOrmOrganizationProjectRepository, - - @InjectRepository(OrganizationRecurringExpense) - private typeOrmOrganizationRecurringExpenseRepository: TypeOrmOrganizationRecurringExpenseRepository, - - mikroOrmOrganizationRecurringExpenseRepository: MikroOrmOrganizationRecurringExpenseRepository, - - @InjectRepository(OrganizationSprint) - private typeOrmOrganizationSprintRepository: TypeOrmOrganizationSprintRepository, - - mikroOrmOrganizationSprintRepository: MikroOrmOrganizationSprintRepository, - - @InjectRepository(OrganizationTeam) - private typeOrmOrganizationTeamRepository: TypeOrmOrganizationTeamRepository, - - mikroOrmOrganizationTeamRepository: MikroOrmOrganizationTeamRepository, - - @InjectRepository(OrganizationTeamEmployee) - private typeOrmOrganizationTeamEmployeeRepository: TypeOrmOrganizationTeamEmployeeRepository, - - mikroOrmOrganizationTeamEmployeeRepository: MikroOrmOrganizationTeamEmployeeRepository, - - @InjectRepository(OrganizationVendor) - private typeOrmOrganizationVendorRepository: TypeOrmOrganizationVendorRepository, - - mikroOrmOrganizationVendorRepository: MikroOrmOrganizationVendorRepository, - - @InjectRepository(Payment) - private typeOrmPaymentRepository: TypeOrmPaymentRepository, - - mikroOrmPaymentRepository: MikroOrmPaymentRepository, - - @InjectRepository(Pipeline) - private typeOrmPipelineRepository: TypeOrmPipelineRepository, - - mikroOrmPipelineRepository: MikroOrmPipelineRepository, - - @InjectRepository(PipelineStage) - private typeOrmPipelineStageRepository: TypeOrmPipelineStageRepository, - - mikroOrmPipelineStageRepository: MikroOrmPipelineStageRepository, - - @InjectRepository(Product) - private typeOrmProductRepository: TypeOrmProductRepository, - - mikroOrmProductRepository: MikroOrmProductRepository, - - @InjectRepository(ProductTranslation) - private typeOrmProductTranslationRepository: TypeOrmProductTranslationRepository, - - mikroOrmProductTranslationRepository: MikroOrmProductTranslationRepository, - - @InjectRepository(ProductCategory) - private typeOrmProductCategoryRepository: TypeOrmProductCategoryRepository, - - mikroOrmProductCategoryRepository: MikroOrmProductCategoryRepository, - - @InjectRepository(ProductCategoryTranslation) - private typeOrmProductCategoryTranslationRepository: TypeOrmProductCategoryTranslationRepository, - - mikroOrmProductCategoryTranslationRepository: MikroOrmProductCategoryTranslationRepository, - - @InjectRepository(ProductOption) - private typeOrmProductOptionRepository: TypeOrmProductOptionRepository, - - mikroOrmProductOptionRepository: MikroOrmProductOptionRepository, - - @InjectRepository(ProductOptionTranslation) - private typeOrmProductOptionTranslationRepository: TypeOrmProductOptionTranslationRepository, - - mikroOrmProductOptionTranslationRepository: MikroOrmProductOptionTranslationRepository, - - @InjectRepository(ProductOptionGroup) - private typeOrmProductOptionGroupRepository: TypeOrmProductOptionGroupRepository, - - mikroOrmProductOptionGroupRepository: MikroOrmProductOptionGroupRepository, - - @InjectRepository(ProductOptionGroupTranslation) - private typeOrmProductOptionGroupTranslationRepository: TypeOrmProductOptionGroupTranslationRepository, - - mikroOrmProductOptionGroupTranslationRepository: MikroOrmProductOptionGroupTranslationRepository, - - @InjectRepository(ProductVariantSetting) - private typeOrmProductVariantSettingRepository: TypeOrmProductVariantSettingRepository, - - mikroOrmProductVariantSettingRepository: MikroOrmProductVariantSettingRepository, - - @InjectRepository(ProductType) - private typeOrmProductTypeRepository: TypeOrmProductTypeRepository, - - mikroOrmProductTypeRepository: MikroOrmProductTypeRepository, - - @InjectRepository(ProductTypeTranslation) - private typeOrmProductTypeTranslationRepository: TypeOrmProductTypeTranslationRepository, - - mikroOrmProductTypeTranslationRepository: MikroOrmProductTypeTranslationRepository, - - @InjectRepository(ProductVariant) - private typeOrmProductVariantRepository: TypeOrmProductVariantRepository, - - mikroOrmProductVariantRepository: MikroOrmProductVariantRepository, - - @InjectRepository(ProductVariantPrice) - private typeOrmProductVariantPriceRepository: TypeOrmProductVariantPriceRepository, - - mikroOrmProductVariantPriceRepository: MikroOrmProductVariantPriceRepository, - - @InjectRepository(ImageAsset) - private typeOrmImageAssetRepository: TypeOrmImageAssetRepository, - - mikroOrmImageAssetRepository: MikroOrmImageAssetRepository, - - @InjectRepository(Warehouse) - private typeOrmWarehouseRepository: TypeOrmWarehouseRepository, - - mikroOrmWarehouseRepository: MikroOrmWarehouseRepository, - - @InjectRepository(Merchant) - private typeOrmMerchantRepository: TypeOrmMerchantRepository, - - mikroOrmMerchantRepository: MikroOrmMerchantRepository, - - @InjectRepository(WarehouseProduct) - private typeOrmWarehouseProductRepository: TypeOrmWarehouseProductRepository, - - mikroOrmWarehouseProductRepository: MikroOrmWarehouseProductRepository, - - @InjectRepository(WarehouseProductVariant) - private typeOrmWarehouseProductVariantRepository: TypeOrmWarehouseProductVariantRepository, - - mikroOrmWarehouseProductVariantRepository: MikroOrmWarehouseProductVariantRepository, + private repositories: IRepositoryModel[] = []; - @InjectRepository(Skill) - private typeOrmSkillRepository: TypeOrmSkillRepository, - - mikroOrmSkillRepository: MikroOrmSkillRepository, - - @InjectRepository(Screenshot) - private typeOrmScreenshotRepository: TypeOrmScreenshotRepository, - - mikroOrmScreenshotRepository: MikroOrmScreenshotRepository, - - @InjectRepository(RequestApproval) - private typeOrmRequestApprovalRepository: TypeOrmRequestApprovalRepository, - - mikroOrmRequestApprovalRepository: MikroOrmRequestApprovalRepository, - - @InjectRepository(RequestApprovalEmployee) - private typeOrmRequestApprovalEmployeeRepository: TypeOrmRequestApprovalEmployeeRepository, - - mikroOrmRequestApprovalEmployeeRepository: MikroOrmRequestApprovalEmployeeRepository, - - @InjectRepository(RequestApprovalTeam) - private typeOrmRequestApprovalTeamRepository: TypeOrmRequestApprovalTeamRepository, - - mikroOrmRequestApprovalTeamRepository: MikroOrmRequestApprovalTeamRepository, - - @InjectRepository(Role) - private typeOrmRoleRepository: TypeOrmRoleRepository, - - mikroOrmRoleRepository: MikroOrmRoleRepository, - - @InjectRepository(RolePermission) - private typeOrmRolePermissionRepository: TypeOrmRolePermissionRepository, - - mikroOrmRolePermissionRepository: MikroOrmRolePermissionRepository, - - @InjectRepository(Report) - private typeOrmReportRepository: TypeOrmReportRepository, - - mikroOrmReportRepository: MikroOrmReportRepository, - - @InjectRepository(ReportCategory) - private typeOrmReportCategoryRepository: TypeOrmReportCategoryRepository, - - mikroOrmReportCategoryRepository: MikroOrmReportCategoryRepository, - - @InjectRepository(ReportOrganization) - private typeOrmReportOrganizationRepository: TypeOrmReportOrganizationRepository, - - mikroOrmReportOrganizationRepository: MikroOrmReportOrganizationRepository, - - @InjectRepository(Tag) - private typeOrmTagRepository: TypeOrmTagRepository, - - mikroOrmTagRepository: MikroOrmTagRepository, - - @InjectRepository(Task) - private typeOrmTaskRepository: TypeOrmTaskRepository, - - mikroOrmTaskRepository: MikroOrmTaskRepository, - - @InjectRepository(Tenant) - private typeOrmTenantRepository: TypeOrmTenantRepository, - - mikroOrmTenantRepository: MikroOrmTenantRepository, - - @InjectRepository(TenantSetting) - private typeOrmTenantSettingRepository: TypeOrmTenantSettingRepository, - - mikroOrmTenantSettingRepository: MikroOrmTenantSettingRepository, - - @InjectRepository(Timesheet) - private typeOrmTimesheetRepository: TypeOrmTimesheetRepository, - - mikroOrmTimesheetRepository: MikroOrmTimesheetRepository, - - @InjectRepository(TimeLog) - private typeOrmTimeLogRepository: TypeOrmTimeLogRepository, - - mikroOrmTimeLogRepository: MikroOrmTimeLogRepository, - - @InjectRepository(TimeSlot) - private typeOrmTimeSlotRepository: TypeOrmTimeSlotRepository, - - mikroOrmTimeSlotRepository: MikroOrmTimeSlotRepository, - - @InjectRepository(TimeSlotMinute) - private typeOrmTimeSlotMinuteRepository: TypeOrmTimeSlotMinuteRepository, - - mikroOrmTimeSlotMinuteRepository: MikroOrmTimeSlotMinuteRepository, - - @InjectRepository(TimeOffRequest) - private typeOrmTimeOffRequestRepository: TypeOrmTimeOffRequestRepository, - - mikroOrmTimeOffRequestRepository: MikroOrmTimeOffRequestRepository, - - @InjectRepository(TimeOffPolicy) - private typeOrmTimeOffPolicyRepository: TypeOrmTimeOffPolicyRepository, - - mikroOrmTimeOffPolicyRepository: MikroOrmTimeOffPolicyRepository, - - @InjectRepository(User) - private typeOrmUserRepository: TypeOrmUserRepository, - - mikroOrmUserRepository: MikroOrmUserRepository, - - @InjectRepository(UserOrganization) - private typeOrmUserOrganizationRepository: TypeOrmUserOrganizationRepository, - - mikroOrmUserOrganizationRepository: MikroOrmUserOrganizationRepository, - - private readonly configService: ConfigService, - private readonly _connectionEntityManager: ConnectionEntityManager - ) {} + constructor(private repositoriesServices: RepositoriesService, private readonly configService: ConfigService) {} async onModuleInit() { const public_path = this.configService.assetOptions.assetPublicPath || __dirname; //base import csv directory path this._dirname = path.join(public_path, this._basename); + } - await this.createDynamicInstanceForPluginEntities(); - await this.registerCoreRepositories(); + public async registerAllRepositories() { + this.repositories = await this.repositoriesServices.buildRepositoriesRelationsGraph(); } async createFolders(): Promise { @@ -1059,9 +99,9 @@ export class ExportService implements OnModuleInit { }); } - async getAsCsv(item: IRepositoryModel, where: { tenantId: string }): Promise { - const conditions = {}; - if (item.tenantBase !== false) { + async getAsCsv(item: IRepositoryModel, where: { tenantId: string }, organizationId: string): Promise { + const conditions: FindManyOptions = {}; + if (item.isTenantBased !== false) { conditions['where'] = { tenantId: where['tenantId'] }; @@ -1070,22 +110,53 @@ export class ExportService implements OnModuleInit { /* * Replace condition with default condition */ - if (isNotEmpty(item.condition) && isNotEmpty(conditions['where'])) { + if (isNotEmpty(item.substitute) && isNotEmpty(conditions['where'])) { const { - condition: { replace = 'tenantId', column = 'id' } + substitute: { originalField = 'tenantId', substituteField = 'id' } } = item; - if (`${replace}` in conditions['where']) { - delete conditions['where'][replace]; - conditions['where'][column] = where[replace]; + if (`${originalField}` in conditions['where']) { + delete conditions['where'][originalField]; + conditions['where'][substituteField] = where[originalField]; } } const { repository } = item; const nameFile = repository.metadata.tableName; - const [items, count] = await repository.findAndCount(conditions); + const [items, itemsCount] = await repository.findAndCount(conditions); + + /** + * Include global (default) entities used in the current organization. + * E.g., task statuses, task priorities, etc. + */ + + const columnNames = repository.metadata.columns.map((col) => col.databaseName); + const hasTenantId = columnNames.includes('tenantId'); + const hasOrganizationId = columnNames.includes('organizationId'); + + let defaultItems: unknown[] = []; + let defaultItemsCount = 0; + + if (item.isTenantBased !== false && hasTenantId && hasOrganizationId) { + [defaultItems, defaultItemsCount] = await repository.findAndCount({ + where: { + tenantId: IsNull(), + organizationId: IsNull() + } + }); + } + + const count = itemsCount + defaultItemsCount; + + if (defaultItemsCount > 0) { + defaultItems.forEach((el) => { + el['organizationId'] = organizationId; + el['tenantId'] = RequestContext.currentTenantId(); + }); + } + if (count > 0) { - return await this.csvWriter(nameFile, items); + return await this.csvWriter(nameFile, [...items, ...defaultItems]); } return false; @@ -1198,13 +269,17 @@ export class ExportService implements OnModuleInit { }); } - async exportTables() { + async exportTables(organizationId: string) { return new Promise(async (resolve, reject) => { try { for await (const item of this.repositories) { - await this.getAsCsv(item, { - tenantId: RequestContext.currentTenantId() - }); + await this.getAsCsv( + item, + { + tenantId: RequestContext.currentTenantId() + }, + organizationId + ); // export pivot relational tables if (isNotEmpty(item.relations)) { @@ -1220,15 +295,19 @@ export class ExportService implements OnModuleInit { }); } - async exportSpecificTables(names: string[]) { + async exportSpecificTables(names: string[], organizationId: string) { return new Promise(async (resolve, reject) => { try { for await (const item of this.repositories) { const nameFile = item.repository.metadata.tableName; if (names.includes(nameFile)) { - await this.getAsCsv(item, { - tenantId: RequestContext.currentTenantId() - }); + await this.getAsCsv( + item, + { + tenantId: RequestContext.currentTenantId() + }, + organizationId + ); // export pivot relational tables if (isNotEmpty(item.relations)) { @@ -1248,13 +327,13 @@ export class ExportService implements OnModuleInit { /* * Export Many To Many Pivot Table Using TypeORM Relations */ - async exportRelationalTables(entity: IRepositoryModel, where: { tenantId: string }) { + async exportRelationalTables(entity: IRepositoryModel, where: { tenantId: string }) { const { repository, relations } = entity; const masterTable = repository.metadata.givenTableName as string; for await (const item of repository.metadata.manyToManyRelations) { const relation = relations.find( - (relation: IColumnRelationMetadata) => relation.joinTableName === item.joinTableName + (relation: IColumnRelationMetadata) => relation.joinTableName === item.joinTableName ); if (relation) { const [joinColumn] = item.joinColumns as ColumnMetadata[]; @@ -1268,10 +347,10 @@ export class ExportService implements OnModuleInit { ${referenceTableName}.* FROM ${referenceTableName} - INNER JOIN ${masterTable} + INNER JOIN "${masterTable}" ON "${referenceTableName}"."${propertyName}" = "${masterTable}"."${referenceColumn}" `; - if (entity.tenantBase !== false) { + if (entity.isTenantBased !== false) { sql += ` WHERE "${masterTable}"."tenantId" = '${where['tenantId']}'`; } @@ -1306,7 +385,7 @@ export class ExportService implements OnModuleInit { }); } - async exportRelationalTablesSchema(entity: IRepositoryModel) { + async exportRelationalTablesSchema(entity: IRepositoryModel) { const { repository, relations } = entity; for await (const item of repository.metadata.manyToManyRelations) { const relation = relations.find( @@ -1322,451 +401,4 @@ export class ExportService implements OnModuleInit { } } } - - /* - * Load all plugins entities for export data - */ - private async createDynamicInstanceForPluginEntities() { - for await (const entity of getEntitiesFromPlugins(this.configService.plugins)) { - if (!isFunction(entity)) { - continue; - } - - const className = camelCase(entity.name); - const repository = this._connectionEntityManager.getRepository(entity); - - this[className] = repository; - this.dynamicEntitiesClassMap.push({ repository }); - } - } - - /* - * Load all entities repository after create instance - */ - private async registerCoreRepositories() { - this.repositories = [ - { - repository: this.typeOrmAccountingTemplateRepository - }, - { - repository: this.typeOrmActivityRepository - }, - { - repository: this.typeOrmAppointmentEmployeeRepository - }, - { - repository: this.typeOrmApprovalPolicyRepository - }, - { - repository: this.typeOrmAvailabilitySlotRepository - }, - { - repository: this.typeOrmCandidateRepository, - relations: [ - { joinTableName: 'candidate_department' }, - { joinTableName: 'candidate_employment_type' }, - { joinTableName: 'tag_candidate' } - ] - }, - { - repository: this.typeOrmCandidateCriterionsRatingRepository - }, - { - repository: this.typeOrmCandidateDocumentRepository - }, - { - repository: this.typeOrmCandidateEducationRepository - }, - { - repository: this.typeOrmCandidateExperienceRepository - }, - { - repository: this.typeOrmCandidateFeedbackRepository - }, - { - repository: this.typeOrmCandidateInterviewersRepository - }, - { - repository: this.typeOrmCandidateInterviewRepository - }, - { - repository: this.typeOrmCandidatePersonalQualitiesRepository - }, - { - repository: this.typeOrmCandidateSkillRepository - }, - { - repository: this.typeOrmCandidateSourceRepository - }, - { - repository: this.typeOrmCandidateTechnologiesRepository - }, - { - repository: this.typeOrmCustomSmtpRepository - }, - { - repository: this.typeOrmContactRepository - }, - { - repository: this.typeOrmCountryRepository, - tenantBase: false - }, - { - repository: this.typeOrmCurrencyRepository, - tenantBase: false - }, - { - repository: this.typeOrmDealRepository - }, - { - repository: this.typeOrmEmailHistoryRepository - }, - { - repository: this.typeOrmEmailTemplateRepository - }, - { - repository: this.typeOrmEmployeeAppointmentRepository - }, - { - repository: this.typeOrmEmployeeAwardRepository - }, - { - repository: this.typeOrmEmployeeLevelRepository, - relations: [{ joinTableName: 'tag_organization_employee_level' }] - }, - { - repository: this.typeOrmEmployeeRecurringExpenseRepository - }, - { - repository: this.typeOrmEmployeeRepository, - relations: [{ joinTableName: 'tag_employee' }] - }, - { - repository: this.typeOrmEmployeeSettingRepository - }, - { - repository: this.typeOrmEquipmentRepository, - relations: [{ joinTableName: 'tag_equipment' }] - }, - { - repository: this.typeOrmEquipmentSharingRepository, - relations: [ - { joinTableName: 'equipment_shares_employees' }, - { joinTableName: 'equipment_shares_teams' } - ] - }, - { - repository: this.typeOrmEquipmentSharingPolicyRepository - }, - { - repository: this.typeOrmEstimateEmailRepository - }, - { - repository: this.typeOrmEventTypeRepository, - relations: [{ joinTableName: 'tag_event_type' }] - }, - { - repository: this.typeOrmExpenseCategoryRepository, - relations: [{ joinTableName: 'tag_organization_expense_category' }] - }, - { - repository: this.typeOrmExpenseRepository, - relations: [{ joinTableName: 'tag_expense' }] - }, - { - repository: this.typeOrmFeatureRepository, - tenantBase: false - }, - { - repository: this.typeOrmFeatureOrganizationRepository - }, - { - repository: this.typeOrmGoalKPIRepository - }, - { - repository: this.typeOrmGoalKPITemplateRepository - }, - { - repository: this.typeOrmGoalRepository - }, - { - repository: this.typeOrmGoalTemplateRepository - }, - { - repository: this.typeOrmGoalTimeFrameRepository - }, - { - repository: this.typeOrmGoalGeneralSettingRepository - }, - { - repository: this.typeOrmIncomeRepository, - relations: [{ joinTableName: 'tag_income' }] - }, - { - repository: this.typeOrmIntegrationEntitySettingRepository - }, - { - repository: this.typeOrmIntegrationEntitySettingTiedRepository - }, - { - repository: this.typeOrmIntegrationMapRepository - }, - { - repository: this.typeOrmIntegrationRepository, - tenantBase: false, - relations: [{ joinTableName: 'integration_integration_type' }, { joinTableName: 'tag_integration' }] - }, - { - repository: this.typeOrmIntegrationSettingRepository - }, - { - repository: this.typeOrmIntegrationTypeRepository, - tenantBase: false - }, - { - repository: this.typeOrmIntegrationTenantRepository - }, - { - repository: this.typeOrmInviteRepository, - relations: [ - { joinTableName: 'invite_organization_contact' }, - { joinTableName: 'invite_organization_department' }, - { joinTableName: 'invite_organization_project' } - ] - }, - { - repository: this.typeOrmInvoiceEstimateHistoryRepository - }, - { - repository: this.typeOrmInvoiceItemRepository - }, - { - repository: this.typeOrmInvoiceRepository, - relations: [{ joinTableName: 'tag_invoice' }] - }, - { - repository: this.typeOrmKeyResultRepository - }, - { - repository: this.typeOrmKeyResultTemplateRepository - }, - { - repository: this.typeOrmKeyResultUpdateRepository - }, - { - repository: this.typeOrmLanguageRepository, - tenantBase: false - }, - { - repository: this.typeOrmOrganizationAwardRepository - }, - { - repository: this.typeOrmOrganizationContactRepository, - relations: [ - { joinTableName: 'organization_contact_employee' }, - { joinTableName: 'tag_organization_contact' } - ] - }, - { - repository: this.typeOrmOrganizationDepartmentRepository, - relations: [ - { joinTableName: 'organization_department_employee' }, - { joinTableName: 'tag_organization_department' } - ] - }, - { - repository: this.typeOrmOrganizationDocumentRepository - }, - { - repository: this.typeOrmOrganizationEmploymentTypeRepository, - relations: [ - { joinTableName: 'organization_employment_type_employee' }, - { joinTableName: 'tag_organization_employment_type' } - ] - }, - { - repository: this.typeOrmOrganizationLanguageRepository - }, - { - repository: this.typeOrmOrganizationPositionRepository, - relations: [{ joinTableName: 'tag_organization_position' }] - }, - { - repository: this.typeOrmOrganizationProjectRepository, - relations: [ - { joinTableName: 'organization_project_employee' }, - { joinTableName: 'tag_organization_project' } - ] - }, - { - repository: this.typeOrmOrganizationRecurringExpenseRepository - }, - { - repository: this.typeOrmOrganizationRepository, - relations: [{ joinTableName: 'tag_organization' }] - }, - { - repository: this.typeOrmOrganizationSprintRepository - }, - { - repository: this.typeOrmOrganizationTeamEmployeeRepository - }, - { - repository: this.typeOrmOrganizationTeamRepository, - relations: [{ joinTableName: 'tag_organization_team' }] - }, - { - repository: this.typeOrmOrganizationVendorRepository, - relations: [{ joinTableName: 'tag_organization_vendor' }] - }, - { - repository: this.typeOrmPaymentRepository, - relations: [{ joinTableName: 'tag_payment' }] - }, - { - repository: this.typeOrmPipelineRepository - }, - { - repository: this.typeOrmProductCategoryRepository - }, - { - repository: this.typeOrmProductCategoryTranslationRepository - }, - { - repository: this.typeOrmProductOptionRepository - }, - { - repository: this.typeOrmProductOptionGroupRepository - }, - { - repository: this.typeOrmProductOptionGroupTranslationRepository - }, - { - repository: this.typeOrmProductOptionTranslationRepository - }, - { - repository: this.typeOrmProductRepository, - relations: [{ joinTableName: 'product_gallery_item' }, { joinTableName: 'tag_product' }] - }, - { - repository: this.typeOrmProductTranslationRepository - }, - { - repository: this.typeOrmProductTypeRepository - }, - { - repository: this.typeOrmProductTypeTranslationRepository - }, - { - repository: this.typeOrmProductVariantPriceRepository - }, - { - repository: this.typeOrmProductVariantRepository, - relations: [{ joinTableName: 'product_variant_options_product_option' }] - }, - { - repository: this.typeOrmProductVariantSettingRepository - }, - { - repository: this.typeOrmImageAssetRepository - }, - { - repository: this.typeOrmWarehouseRepository, - relations: [{ joinTableName: 'tag_warehouse' }] - }, - { - repository: this.typeOrmMerchantRepository, - relations: [{ joinTableName: 'warehouse_merchant' }, { joinTableName: 'tag_merchant' }] - }, - { - repository: this.typeOrmWarehouseProductRepository - }, - { - repository: this.typeOrmWarehouseProductVariantRepository - }, - { - repository: this.typeOrmReportCategoryRepository, - tenantBase: false - }, - { - repository: this.typeOrmReportOrganizationRepository - }, - { - repository: this.typeOrmReportRepository, - tenantBase: false - }, - { - repository: this.typeOrmRequestApprovalRepository, - relations: [{ joinTableName: 'tag_request_approval' }] - }, - { - repository: this.typeOrmRequestApprovalEmployeeRepository - }, - { - repository: this.typeOrmRequestApprovalTeamRepository - }, - { - repository: this.typeOrmRolePermissionRepository - }, - { - repository: this.typeOrmRoleRepository - }, - { - repository: this.typeOrmScreenshotRepository - }, - { - repository: this.typeOrmSkillRepository, - relations: [{ joinTableName: 'skill_employee' }, { joinTableName: 'skill_organization' }] - }, - { - repository: this.typeOrmPipelineStageRepository - }, - { - repository: this.typeOrmTagRepository - }, - { - repository: this.typeOrmTaskRepository, - relations: [ - { joinTableName: 'task_employee' }, - { joinTableName: 'task_team' }, - { joinTableName: 'tag_task' } - ] - }, - { - repository: this.typeOrmTenantRepository, - condition: { column: 'id', replace: 'tenantId' } - }, - { - repository: this.typeOrmTenantSettingRepository - }, - { - repository: this.typeOrmTimeLogRepository, - relations: [{ joinTableName: 'time_slot_time_logs' }] - }, - { - repository: this.typeOrmTimeOffPolicyRepository, - relations: [{ joinTableName: 'time_off_policy_employee' }] - }, - { - repository: this.typeOrmTimeOffRequestRepository, - relations: [{ joinTableName: 'time_off_request_employee' }] - }, - { - repository: this.typeOrmTimesheetRepository - }, - { - repository: this.typeOrmTimeSlotRepository - }, - { - repository: this.typeOrmTimeSlotMinuteRepository - }, - { - repository: this.typeOrmUserOrganizationRepository - }, - { - repository: this.typeOrmUserRepository - }, - ...this.dynamicEntitiesClassMap - ] as IRepositoryModel[]; - } } diff --git a/packages/core/src/lib/export-import/import/import.controller.ts b/packages/core/src/lib/export-import/import/import.controller.ts index e8fb442d302..bd5133fac32 100644 --- a/packages/core/src/lib/export-import/import/import.controller.ts +++ b/packages/core/src/lib/export-import/import/import.controller.ts @@ -1,13 +1,15 @@ -import { Controller, HttpStatus, Post, Body, UseGuards } from '@nestjs/common'; +import { Controller, HttpStatus, Post, Body, UseGuards, UseInterceptors } from '@nestjs/common'; import { ApiTags, ApiOperation, ApiResponse } from '@nestjs/swagger'; import { CommandBus } from '@nestjs/cqrs'; import { ImportStatusEnum, ImportTypeEnum, PermissionsEnum, UploadedFile } from '@gauzy/contracts'; import { ImportService } from './import.service'; import { RequestContext } from '../../core/context'; -import { UploadedFileStorage } from '../../core/file-storage'; +import { FileStorage, UploadedFileStorage } from '../../core/file-storage'; import { PermissionGuard, TenantPermissionGuard } from '../../shared/guards'; import { Permissions } from '../../shared/decorators'; import { ImportHistoryCreateCommand } from '../import-history'; +import { FileInterceptor } from '@nestjs/platform-express'; +import * as path from 'node:path'; @ApiTags('Import') @UseGuards(TenantPermissionGuard, PermissionGuard) @@ -16,15 +18,12 @@ import { ImportHistoryCreateCommand } from '../import-history'; export class ImportController { constructor(private readonly _importService: ImportService, private readonly _commandBus: CommandBus) {} - // TODO: I commented this code for now as it seems running on the server start or maybe even on each request. - // We need to investigate this and fix it. /** * * @param param0 * @param file * @returns */ - /* @UseInterceptors( FileInterceptor('file', { storage: new FileStorage().storage({ @@ -33,8 +32,6 @@ export class ImportController { }) }) ) - */ - @ApiOperation({ summary: 'Imports templates records.' }) @ApiResponse({ status: HttpStatus.OK, @@ -56,7 +53,9 @@ export class ImportController { try { /** */ + await this._importService.registerAllRepositories(); await this._importService.unzipAndParse(key, importType === ImportTypeEnum.CLEAN); + await this._importService.addCurrentUserToImportedOrganizations(); this._importService.removeExtractedFiles(); /** */ return await this._commandBus.execute( diff --git a/packages/core/src/lib/export-import/import/import.module.ts b/packages/core/src/lib/export-import/import/import.module.ts index d95e7bef8a7..18a62a2dcd2 100644 --- a/packages/core/src/lib/export-import/import/import.module.ts +++ b/packages/core/src/lib/export-import/import/import.module.ts @@ -12,6 +12,7 @@ import { ImportRecordModule } from '../import-record'; import { ImportHistoryModule } from '../import-history'; import { RolePermissionModule } from '../../role-permission/role-permission.module'; import { UserModule } from '../../user/user.module'; +import { RepositoriesService } from '../repositories/repositories.service'; @Module({ imports: [ @@ -24,6 +25,6 @@ import { UserModule } from '../../user/user.module'; CqrsModule ], controllers: [ImportController], - providers: [ImportService, ...CommandHandlers] + providers: [ImportService, RepositoriesService, ...CommandHandlers] }) export class ImportModule {} diff --git a/packages/core/src/lib/export-import/import/import.service.ts b/packages/core/src/lib/export-import/import/import.service.ts index 82da14277c0..cce7c5af121 100644 --- a/packages/core/src/lib/export-import/import/import.service.ts +++ b/packages/core/src/lib/export-import/import/import.service.ts @@ -1,8 +1,6 @@ import { Injectable, OnModuleInit } from '@nestjs/common'; -import { InjectRepository } from '@nestjs/typeorm'; import { CommandBus } from '@nestjs/cqrs'; -import { IsNull, Repository } from 'typeorm'; -import { camelCase } from 'typeorm/util/StringUtils'; +import { IsNull } from 'typeorm'; import { ColumnMetadata } from 'typeorm/metadata/ColumnMetadata'; import * as fs from 'fs'; import * as unzipper from 'unzipper'; @@ -11,979 +9,40 @@ import * as rimraf from 'rimraf'; import * as path from 'path'; import * as chalk from 'chalk'; import { ConfigService } from '@gauzy/config'; -import { getEntitiesFromPlugins } from '@gauzy/plugin'; -import { isFunction, isNotEmpty } from '@gauzy/utils'; -import { ConnectionEntityManager } from '../../database/connection-entity-manager'; +import { isNotEmpty } from '@gauzy/utils'; import { convertToDatetime } from '../../core/utils'; import { FileStorage } from '../../core/file-storage'; -import { - AccountingTemplate, - Activity, - AppointmentEmployee, - ApprovalPolicy, - AvailabilitySlot, - Candidate, - CandidateCriterionsRating, - CandidateDocument, - CandidateEducation, - CandidateExperience, - CandidateFeedback, - CandidateInterview, - CandidateInterviewers, - CandidatePersonalQualities, - CandidateSkill, - CandidateSource, - CandidateTechnologies, - Contact, - CustomSmtp, - Deal, - EmailHistory, - EmailTemplate, - Employee, - EmployeeAppointment, - EmployeeAward, - EmployeeLevel, - EmployeeRecurringExpense, - EmployeeSetting, - Equipment, - EquipmentSharing, - EquipmentSharingPolicy, - EstimateEmail, - EventType, - Expense, - ExpenseCategory, - Feature, - FeatureOrganization, - Goal, - GoalGeneralSetting, - GoalKPI, - GoalKPITemplate, - GoalTemplate, - GoalTimeFrame, - ImageAsset, - Income, - Integration, - IntegrationEntitySetting, - IntegrationEntitySettingTied, - IntegrationMap, - IntegrationSetting, - IntegrationTenant, - IntegrationType, - Invite, - Invoice, - InvoiceEstimateHistory, - InvoiceItem, - KeyResult, - KeyResultTemplate, - KeyResultUpdate, - Language, - Merchant, - Organization, - OrganizationAward, - OrganizationContact, - OrganizationDepartment, - OrganizationDocument, - OrganizationEmploymentType, - OrganizationLanguage, - OrganizationPosition, - OrganizationProject, - OrganizationRecurringExpense, - OrganizationSprint, - OrganizationTeam, - OrganizationTeamEmployee, - OrganizationVendor, - Payment, - Pipeline, - PipelineStage, - Product, - ProductCategory, - ProductCategoryTranslation, - ProductOption, - ProductOptionGroup, - ProductOptionGroupTranslation, - ProductOptionTranslation, - ProductTranslation, - ProductType, - ProductTypeTranslation, - ProductVariant, - ProductVariantPrice, - ProductVariantSetting, - Report, - ReportCategory, - ReportOrganization, - RequestApproval, - RequestApprovalEmployee, - RequestApprovalTeam, - Role, - RolePermission, - Screenshot, - Skill, - Tag, - Task, - TenantSetting, - TimeLog, - TimeOffPolicy, - TimeOffRequest, - Timesheet, - TimeSlot, - TimeSlotMinute, - User, - UserOrganization, - Warehouse, - WarehouseProduct, - WarehouseProductVariant -} from '../../core/entities/internal'; +import { Organization } from '../../core/entities/internal'; import { RequestContext } from '../../core'; import { ImportEntityFieldMapOrCreateCommand } from './commands'; import { ImportRecordFindOrFailCommand, ImportRecordUpdateOrCreateCommand } from '../import-record'; -import { MikroOrmAccountingTemplateRepository } from '../../accounting-template/repository/mikro-orm-accounting-template.repository'; -import { TypeOrmAccountingTemplateRepository } from '../../accounting-template/repository/type-orm-accounting-template.repository'; -import { MikroOrmAppointmentEmployeeRepository } from '../../appointment-employees/repository/mikro-orm-appointment-employee.repository'; -import { TypeOrmAppointmentEmployeeRepository } from '../../appointment-employees/repository/type-orm-appointment-employee.repository'; -import { MikroOrmApprovalPolicyRepository } from '../../approval-policy/repository/mikro-orm-approval-policy.repository'; -import { TypeOrmApprovalPolicyRepository } from '../../approval-policy/repository/type-orm-approval-policy.repository'; -import { MikroOrmAvailabilitySlotRepository } from '../../availability-slots/repository/mikro-orm-availability-slot.repository'; -import { TypeOrmAvailabilitySlotRepository } from '../../availability-slots/repository/type-orm-availability-slot.repository'; -import { MikroOrmCandidateCriterionsRatingRepository } from '../../candidate-criterions-rating/repository/mikro-orm-candidate-criterions-rating.repository'; -import { TypeOrmCandidateCriterionsRatingRepository } from '../../candidate-criterions-rating/repository/type-orm-candidate-criterions-rating.repository'; -import { MikroOrmCandidateDocumentRepository } from '../../candidate-documents/repository/mikro-orm-candidate-document.repository'; -import { TypeOrmCandidateDocumentRepository } from '../../candidate-documents/repository/type-orm-candidate-document.repository'; -import { MikroOrmCandidateEducationRepository } from '../../candidate-education/repository/mikro-orm-candidate-education.repository'; -import { TypeOrmCandidateEducationRepository } from '../../candidate-education/repository/type-orm-candidate-education.repository'; -import { MikroOrmCandidateExperienceRepository } from '../../candidate-experience/repository/mikro-orm-candidate-experience.repository'; -import { TypeOrmCandidateExperienceRepository } from '../../candidate-experience/repository/type-orm-candidate-experience.repository'; -import { MikroOrmCandidateFeedbackRepository } from '../../candidate-feedbacks/repository/mikro-orm-candidate-feedback.repository'; -import { TypeOrmCandidateFeedbackRepository } from '../../candidate-feedbacks/repository/type-orm-candidate-feedback.repository'; -import { MikroOrmCandidateInterviewRepository } from '../../candidate-interview/repository/mikro-orm-candidate-interview.repository'; -import { TypeOrmCandidateInterviewRepository } from '../../candidate-interview/repository/type-orm-candidate-interview.repository'; -import { MikroOrmCandidateInterviewersRepository } from '../../candidate-interviewers/repository/mikro-orm-candidate-interviewers.repository'; -import { TypeOrmCandidateInterviewersRepository } from '../../candidate-interviewers/repository/type-orm-candidate-interviewers.repository'; -import { MikroOrmCandidatePersonalQualitiesRepository } from '../../candidate-personal-qualities/repository/mikro-orm-candidate-personal-qualities.repository'; -import { TypeOrmCandidatePersonalQualitiesRepository } from '../../candidate-personal-qualities/repository/type-orm-candidate-personal-qualities.repository'; -import { MikroOrmCandidateSkillRepository } from '../../candidate-skill/repository/mikro-orm-candidate-skill.repository'; -import { TypeOrmCandidateSkillRepository } from '../../candidate-skill/repository/type-orm-candidate-skill.repository'; -import { MikroOrmCandidateSourceRepository } from '../../candidate-source/repository/mikro-orm-candidate-source.repository'; -import { TypeOrmCandidateSourceRepository } from '../../candidate-source/repository/type-orm-candidate-source.repository'; -import { MikroOrmCandidateTechnologiesRepository } from '../../candidate-technologies/repository/mikro-orm-candidate-technologies.repository'; -import { TypeOrmCandidateTechnologiesRepository } from '../../candidate-technologies/repository/type-orm-candidate-technologies.repository'; -import { MikroOrmCandidateRepository } from '../../candidate/repository/mikro-orm-candidate.repository'; -import { TypeOrmCandidateRepository } from '../../candidate/repository/type-orm-candidate.repository'; -import { MikroOrmContactRepository } from '../../contact/repository/mikro-orm-contact.repository'; -import { TypeOrmContactRepository } from '../../contact/repository/type-orm-contact.repository'; -import { MikroOrmCustomSmtpRepository } from '../../custom-smtp/repository/mikro-orm-custom-smtp.repository'; -import { TypeOrmCustomSmtpRepository } from '../../custom-smtp/repository/type-orm-custom-smtp.repository'; -import { MikroOrmDealRepository } from '../../deal/repository/mikro-orm-deal.repository'; -import { TypeOrmDealRepository } from '../../deal/repository/type-orm-deal.repository'; -import { MikroOrmEmailHistoryRepository } from '../../email-history/repository/mikro-orm-email-history.repository'; -import { TypeOrmEmailHistoryRepository } from '../../email-history/repository/type-orm-email-history.repository'; -import { MikroOrmEmailTemplateRepository } from '../../email-template/repository/mikro-orm-email-template.repository'; -import { TypeOrmEmailTemplateRepository } from '../../email-template/repository/type-orm-email-template.repository'; -import { MikroOrmEmployeeAppointmentRepository } from '../../employee-appointment/repository/mikro-orm-employee-appointment.repository'; -import { TypeOrmEmployeeAppointmentRepository } from '../../employee-appointment/repository/type-orm-employee-appointment.repository'; -import { MikroOrmEmployeeAwardRepository } from '../../employee-award/repository/mikro-orm-employee-award.repository'; -import { TypeOrmEmployeeAwardRepository } from '../../employee-award/repository/type-orm-employee-award.repository'; -import { MikroOrmEmployeeLevelRepository } from '../../employee-level/repository/mikro-orm-employee-level.repository'; -import { TypeOrmEmployeeLevelRepository } from '../../employee-level/repository/type-orm-employee-level.repository'; -import { MikroOrmEmployeeRecurringExpenseRepository } from '../../employee-recurring-expense/repository/mikro-orm-employee-recurring-expense.repository'; -import { TypeOrmEmployeeRecurringExpenseRepository } from '../../employee-recurring-expense/repository/type-orm-employee-recurring-expense.repository'; -import { MikroOrmEmployeeSettingRepository } from '../../employee-setting/repository/mikro-orm-employee-setting.repository'; -import { TypeOrmEmployeeSettingRepository } from '../../employee-setting/repository/type-orm-employee-setting.repository'; -import { MikroOrmEmployeeRepository } from '../../employee/repository/mikro-orm-employee.repository'; -import { TypeOrmEmployeeRepository } from '../../employee/repository/type-orm-employee.repository'; -import { MikroOrmEquipmentSharingPolicyRepository } from '../../equipment-sharing-policy/repository/mikro-orm-equipment-sharing-policy.repository'; -import { TypeOrmEquipmentSharingPolicyRepository } from '../../equipment-sharing-policy/repository/type-orm-equipment-sharing-policy.repository'; -import { MikroOrmEquipmentSharingRepository } from '../../equipment-sharing/repository/mikro-orm-equipment-sharing.repository'; -import { TypeOrmEquipmentSharingRepository } from '../../equipment-sharing/repository/type-orm-equipment-sharing.repository'; -import { MikroOrmEquipmentRepository } from '../../equipment/repository/mikro-orm-equipment.repository'; -import { TypeOrmEquipmentRepository } from '../../equipment/repository/type-orm-equipment.repository'; -import { MikroOrmEstimateEmailRepository } from '../../estimate-email/repository/mikro-orm-estimate-email.repository'; -import { TypeOrmEstimateEmailRepository } from '../../estimate-email/repository/type-orm-estimate-email.repository'; -import { MikroOrmEventTypeRepository } from '../../event-types/repository/mikro-orm-event-type.repository'; -import { TypeOrmEventTypeRepository } from '../../event-types/repository/type-orm-event-types.repository'; -import { MikroOrmExpenseCategoryRepository } from '../../expense-categories/repository/mikro-orm-expense-category.repository'; -import { TypeOrmExpenseCategoryRepository } from '../../expense-categories/repository/type-orm-expense-category.repository'; -import { MikroOrmExpenseRepository } from '../../expense/repository/mikro-orm-expense.repository'; -import { TypeOrmExpenseRepository } from '../../expense/repository/type-orm-expense.repository'; -import { MikroOrmFeatureOrganizationRepository } from '../../feature/repository/mikro-orm-feature-organization.repository'; -import { MikroOrmFeatureRepository } from '../../feature/repository/mikro-orm-feature.repository'; -import { TypeOrmFeatureRepository } from '../../feature/repository/type-orm-feature.repository'; -import { TypeOrmFeatureOrganizationRepository } from '../../feature/repository/type-orm-feature-organization.repository'; -import { MikroOrmGoalGeneralSettingRepository } from '../../goal-general-setting/repository/mikro-orm-goal-general-setting.repository'; -import { TypeOrmGoalGeneralSettingRepository } from '../../goal-general-setting/repository/type-orm-goal-general-setting.repository'; -import { MikroOrmGoalKPITemplateRepository } from '../../goal-kpi-template/repository/mikro-orm-goal-kpi-template.repository'; -import { TypeOrmGoalKPITemplateRepository } from '../../goal-kpi-template/repository/type-orm-goal-kpi-template.repository'; -import { MikroOrmGoalKPIRepository } from '../../goal-kpi/repository/mikro-orm-goal-kpi.repository'; -import { TypeOrmGoalKPIRepository } from '../../goal-kpi/repository/type-orm-goal-kpi.repository'; -import { MikroOrmGoalTemplateRepository } from '../../goal-template/repository/mikro-orm-goal-template.repository'; -import { TypeOrmGoalTemplateRepository } from '../../goal-template/repository/type-orm-goal-template.repository'; -import { MikroOrmGoalTimeFrameRepository } from '../../goal-time-frame/repository/mikro-orm-goal-time-frame.repository'; -import { TypeOrmGoalTimeFrameRepository } from '../../goal-time-frame/repository/type-orm-goal-time-frame.repository'; -import { MikroOrmGoalRepository } from '../../goal/repository/mikro-orm-goal.repository'; -import { TypeOrmGoalRepository } from '../../goal/repository/type-orm-goal.repository'; -import { MikroOrmImageAssetRepository } from '../../image-asset/repository/mikro-orm-image-asset.repository'; -import { TypeOrmImageAssetRepository } from '../../image-asset/repository/type-orm-image-asset.repository'; -import { MikroOrmIncomeRepository } from '../../income/repository/mikro-orm-income.repository'; -import { TypeOrmIncomeRepository } from '../../income/repository/type-orm-income.repository'; -import { MikroOrmIntegrationEntitySettingTiedRepository } from '../../integration-entity-setting-tied/repository/mikro-orm-integration-entity-setting-tied.repository'; -import { TypeOrmIntegrationEntitySettingTiedRepository } from '../../integration-entity-setting-tied/repository/type-orm-integration-entity-setting-tied.repository'; -import { MikroOrmIntegrationEntitySettingRepository } from '../../integration-entity-setting/repository/mikro-orm-integration-entity-setting.repository'; -import { TypeOrmIntegrationEntitySettingRepository } from '../../integration-entity-setting/repository/type-orm-integration-entity-setting.repository'; -import { MikroOrmIntegrationMapRepository } from '../../integration-map/repository/mikro-orm-integration-map.repository'; -import { TypeOrmIntegrationMapRepository } from '../../integration-map/repository/type-orm-integration-map.repository'; -import { MikroOrmIntegrationSettingRepository } from '../../integration-setting/repository/mikro-orm-integration-setting.repository'; -import { TypeOrmIntegrationSettingRepository } from '../../integration-setting/repository/type-orm-integration-setting.repository'; -import { MikroOrmIntegrationTenantRepository } from '../../integration-tenant/repository/mikro-orm-integration-tenant.repository'; -import { TypeOrmIntegrationTenantRepository } from '../../integration-tenant/repository/type-orm-integration-tenant.repository'; -import { MikroOrmIntegrationTypeRepository } from '../../integration/repository/mikro-orm-integration-type.repository'; -import { MikroOrmIntegrationRepository } from '../../integration/repository/mikro-orm-integration.repository'; -import { TypeOrmIntegrationTypeRepository } from '../../integration/repository/type-orm-integration-type.repository'; -import { TypeOrmIntegrationRepository } from '../../integration/repository/type-orm-integration.repository'; -import { MikroOrmInviteRepository } from '../../invite/repository/mikro-orm-invite.repository'; -import { TypeOrmInviteRepository } from '../../invite/repository/type-orm-invite.repository'; -import { MikroOrmInvoiceEstimateHistoryRepository } from '../../invoice-estimate-history/repository/mikro-orm-invoice-estimate-history.repository'; -import { TypeOrmInvoiceEstimateHistoryRepository } from '../../invoice-estimate-history/repository/type-orm-invoice-estimate-history.repository'; -import { MikroOrmInvoiceItemRepository } from '../../invoice-item/repository/mikro-orm-invoice-item.repository'; -import { TypeOrmInvoiceItemRepository } from '../../invoice-item/repository/type-orm-invoice-item.repository'; -import { MikroOrmInvoiceRepository } from '../../invoice/repository/mikro-orm-invoice.repository'; -import { TypeOrmInvoiceRepository } from '../../invoice/repository/type-orm-invoice.repository'; -import { MikroOrmKeyResultTemplateRepository } from '../../keyresult-template/repository/mikro-orm-keyresult-template.repository'; -import { TypeOrmKeyResultTemplateRepository } from '../../keyresult-template/repository/type-orm-keyresult-template.repository'; -import { MikroOrmKeyResultUpdateRepository } from '../../keyresult-update/repository/mikro-orm-keyresult-update.repository'; -import { TypeOrmKeyResultUpdateRepository } from '../../keyresult-update/repository/type-orm-keyresult-update.repository'; -import { MikroOrmKeyResultRepository } from '../../keyresult/repository/mikro-orm-keyresult.repository'; -import { TypeOrmKeyResultRepository } from '../../keyresult/repository/type-orm-keyresult.repository'; -import { MikroOrmLanguageRepository } from '../../language/repository/mikro-orm-language.repository'; -import { TypeOrmLanguageRepository } from '../../language/repository/type-orm-language.repository'; -import { MikroOrmMerchantRepository } from '../../merchant/repository/mikro-orm-merchant.repository'; -import { TypeOrmMerchantRepository } from '../../merchant/repository/type-orm-merchant.repository'; -import { MikroOrmOrganizationAwardRepository } from '../../organization-award/repository/mikro-orm-organization-award.repository'; -import { TypeOrmOrganizationAwardRepository } from '../../organization-award/repository/type-orm-organization-award.repository'; -import { MikroOrmOrganizationContactRepository } from '../../organization-contact/repository/mikro-orm-organization-contact.repository'; -import { TypeOrmOrganizationContactRepository } from '../../organization-contact/repository/type-orm-organization-contact.repository'; -import { MikroOrmOrganizationDepartmentRepository } from '../../organization-department/repository/mikro-orm-organization-department.repository'; -import { TypeOrmOrganizationDepartmentRepository } from '../../organization-department/repository/type-orm-organization-department.repository'; -import { MikroOrmOrganizationDocumentRepository } from '../../organization-document/repository/mikro-orm-organization-document.repository'; -import { TypeOrmOrganizationDocumentRepository } from '../../organization-document/repository/type-orm-organization-document.repository'; -import { MikroOrmOrganizationEmploymentTypeRepository } from '../../organization-employment-type/repository/mikro-orm-organization-employment-type.repository'; -import { TypeOrmOrganizationEmploymentTypeRepository } from '../../organization-employment-type/repository/type-orm-organization-employment-type.repository'; -import { MikroOrmOrganizationLanguageRepository } from '../../organization-language/repository/mikro-orm-organization-language.repository'; -import { TypeOrmOrganizationLanguageRepository } from '../../organization-language/repository/type-orm-organization-language.repository'; -import { MikroOrmOrganizationPositionRepository } from '../../organization-position/repository/mikro-orm-organization-position.repository'; -import { TypeOrmOrganizationPositionRepository } from '../../organization-position/repository/type-orm-organization-position.repository'; -import { MikroOrmOrganizationProjectRepository } from '../../organization-project/repository/mikro-orm-organization-project.repository'; -import { TypeOrmOrganizationProjectRepository } from '../../organization-project/repository/type-orm-organization-project.repository'; -import { MikroOrmOrganizationRecurringExpenseRepository } from '../../organization-recurring-expense/repository/mikro-orm-organization-recurring-expense.repository'; -import { TypeOrmOrganizationRecurringExpenseRepository } from '../../organization-recurring-expense/repository/type-orm-organization-recurring-expense.repository'; -import { MikroOrmOrganizationSprintRepository } from '../../organization-sprint/repository/mikro-orm-organization-sprint.repository'; -import { TypeOrmOrganizationSprintRepository } from '../../organization-sprint/repository/type-orm-organization-sprint.repository'; -import { MikroOrmOrganizationTeamEmployeeRepository } from '../../organization-team-employee/repository/mikro-orm-organization-team-employee.repository'; -import { TypeOrmOrganizationTeamEmployeeRepository } from '../../organization-team-employee/repository/type-orm-organization-team-employee.repository'; -import { MikroOrmOrganizationTeamRepository } from '../../organization-team/repository/mikro-orm-organization-team.repository'; -import { TypeOrmOrganizationTeamRepository } from '../../organization-team/repository/type-orm-organization-team.repository'; -import { MikroOrmOrganizationVendorRepository } from '../../organization-vendor/repository/mikro-orm-organization-vendor.repository'; -import { TypeOrmOrganizationVendorRepository } from '../../organization-vendor/repository/type-orm-organization-vendor.repository'; -import { MikroOrmOrganizationRepository } from '../../organization/repository/mikro-orm-organization.repository'; -import { TypeOrmOrganizationRepository } from '../../organization/repository/type-orm-organization.repository'; -import { MikroOrmPaymentRepository } from '../../payment/repository/mikro-orm-payment.repository'; -import { TypeOrmPaymentRepository } from '../../payment/repository/type-orm-payment.repository'; -import { MikroOrmPipelineStageRepository } from '../../pipeline-stage/repository/mikro-orm-pipeline-stage.repository'; -import { TypeOrmPipelineStageRepository } from '../../pipeline-stage/repository/type-orm-pipeline-stage.repository'; -import { MikroOrmPipelineRepository } from '../../pipeline/repository/mikro-orm-pipeline.repository'; -import { TypeOrmPipelineRepository } from '../../pipeline/repository/type-orm-pipeline.repository'; -import { MikroOrmProductCategoryTranslationRepository } from '../../product-category/repository/mikro-orm-product-category-translation.repository'; -import { MikroOrmProductCategoryRepository } from '../../product-category/repository/mikro-orm-product-category.repository'; -import { TypeOrmProductCategoryTranslationRepository } from '../../product-category/repository/type-orm-product-category-translation.repository'; -import { TypeOrmProductCategoryRepository } from '../../product-category/repository/type-orm-product-category.repository'; -import { MikroOrmProductOptionGroupTranslationRepository } from '../../product-option/repository/mikro-orm-product-option-group-translation.repository'; -import { MikroOrmProductOptionGroupRepository } from '../../product-option/repository/mikro-orm-product-option-group.repository'; -import { MikroOrmProductOptionTranslationRepository } from '../../product-option/repository/mikro-orm-product-option-translation.repository'; -import { MikroOrmProductOptionRepository } from '../../product-option/repository/mikro-orm-product-option.repository'; -import { TypeOrmProductOptionGroupTranslationRepository } from '../../product-option/repository/type-orm-product-option-group-translation.repository'; -import { TypeOrmProductOptionGroupRepository } from '../../product-option/repository/type-orm-product-option-group.repository'; -import { TypeOrmProductOptionTranslationRepository } from '../../product-option/repository/type-orm-product-option-translation.repository'; -import { TypeOrmProductOptionRepository } from '../../product-option/repository/type-orm-product-option.repository'; -import { MikroOrmProductVariantSettingRepository } from '../../product-setting/repository/mikro-orm-product-setting.repository'; -import { TypeOrmProductVariantSettingRepository } from '../../product-setting/repository/type-orm-product-setting.repository'; -import { MikroOrmProductTypeTranslationRepository } from '../../product-type/repository/mikro-orm-product-type-translation.repository'; -import { MikroOrmProductTypeRepository } from '../../product-type/repository/mikro-orm-product-type.repository'; -import { TypeOrmProductTypeTranslationRepository } from '../../product-type/repository/type-orm-product-type-translation.repository'; -import { TypeOrmProductTypeRepository } from '../../product-type/repository/type-orm-product-type.repository'; -import { MikroOrmProductVariantPriceRepository } from '../../product-variant-price/repository/mikro-orm-product-variant-price.repository'; -import { TypeOrmProductVariantPriceRepository } from '../../product-variant-price/repository/type-orm-product-variant-price.repository'; -import { MikroOrmProductVariantRepository } from '../../product-variant/repository/mikro-orm-product-variant.repository'; -import { TypeOrmProductVariantRepository } from '../../product-variant/repository/type-orm-product-variant.repository'; -import { MikroOrmProductTranslationRepository } from '../../product/repository/mikro-orm-product-translation.repository'; -import { MikroOrmProductRepository } from '../../product/repository/mikro-orm-product.repository'; -import { TypeOrmProductTranslationRepository } from '../../product/repository/type-orm-product-translation.repository'; -import { TypeOrmProductRepository } from '../../product/repository/type-orm-product.repository'; -import { MikroOrmReportCategoryRepository } from '../../reports/repository/mikro-orm-report-category.repository'; -import { MikroOrmReportOrganizationRepository } from '../../reports/repository/mikro-orm-report-organization.repository'; -import { MikroOrmReportRepository } from '../../reports/repository/mikro-orm-report.repository'; -import { TypeOrmReportCategoryRepository } from '../../reports/repository/type-orm-report-category.repository'; -import { TypeOrmReportOrganizationRepository } from '../../reports/repository/type-orm-report-organization.repository'; -import { TypeOrmReportRepository } from '../../reports/repository/type-orm-report.repository'; -import { MikroOrmRequestApprovalEmployeeRepository } from '../../request-approval-employee/repository/mikro-orm-request-approval-employee.repository'; -import { TypeOrmRequestApprovalEmployeeRepository } from '../../request-approval-employee/repository/type-orm-request-approval-employee.repository'; -import { MikroOrmRequestApprovalTeamRepository } from '../../request-approval-team/repository/mikro-orm-request-approval-team.repository'; -import { TypeOrmRequestApprovalTeamRepository } from '../../request-approval-team/repository/type-orm-request-approval-team.repository'; -import { MikroOrmRequestApprovalRepository } from '../../request-approval/repository/mikro-orm-request-approval.repository'; -import { TypeOrmRequestApprovalRepository } from '../../request-approval/repository/type-orm-request-approval.repository'; -import { MikroOrmRolePermissionRepository } from '../../role-permission/repository/mikro-orm-role-permission.repository'; -import { TypeOrmRolePermissionRepository } from '../../role-permission/repository/type-orm-role-permission.repository'; -import { MikroOrmRoleRepository } from '../../role/repository/mikro-orm-role.repository'; -import { TypeOrmRoleRepository } from '../../role/repository/type-orm-role.repository'; -import { MikroOrmSkillRepository } from '../../skills/repository/mikro-orm-skill.repository'; -import { TypeOrmSkillRepository } from '../../skills/repository/type-orm-skill.repository'; -import { MikroOrmTagRepository } from '../../tags/repository/mikro-orm-tag.repository'; -import { TypeOrmTagRepository } from '../../tags/repository/type-orm-tag.repository'; -import { MikroOrmTaskRepository } from '../../tasks/repository/mikro-orm-task.repository'; -import { TypeOrmTaskRepository } from '../../tasks/repository/type-orm-task.repository'; -import { MikroOrmTenantSettingRepository } from '../../tenant/tenant-setting/repository/mikro-orm-tenant-setting.repository'; -import { TypeOrmTenantSettingRepository } from '../../tenant/tenant-setting/repository/type-orm-tenant-setting.repository'; -import { MikroOrmTimeOffPolicyRepository } from '../../time-off-policy/repository/mikro-orm-time-off-policy.repository'; -import { TypeOrmTimeOffPolicyRepository } from '../../time-off-policy/repository/type-orm-time-off-policy.repository'; -import { MikroOrmTimeOffRequestRepository } from '../../time-off-request/repository/mikro-orm-time-off-request.repository'; -import { TypeOrmTimeOffRequestRepository } from '../../time-off-request/repository/type-orm-time-off-request.repository'; -import { MikroOrmActivityRepository } from '../../time-tracking/activity/repository/mikro-orm-activity.repository'; -import { TypeOrmActivityRepository } from '../../time-tracking/activity/repository/type-orm-activity.repository'; -import { MikroOrmScreenshotRepository } from '../../time-tracking/screenshot/repository/mikro-orm-screenshot.repository'; -import { TypeOrmScreenshotRepository } from '../../time-tracking/screenshot/repository/type-orm-screenshot.repository'; -import { MikroOrmTimeLogRepository } from '../../time-tracking/time-log/repository/mikro-orm-time-log.repository'; -import { TypeOrmTimeLogRepository } from '../../time-tracking/time-log/repository/type-orm-time-log.repository'; -import { MikroOrmTimeSlotMinuteRepository } from '../../time-tracking/time-slot/repository/mikro-orm-time-slot-minute.repository'; -import { MikroOrmTimeSlotRepository } from '../../time-tracking/time-slot/repository/mikro-orm-time-slot.repository'; -import { TypeOrmTimeSlotMinuteRepository } from '../../time-tracking/time-slot/repository/type-orm-time-slot-minute.repository'; -import { TypeOrmTimeSlotRepository } from '../../time-tracking/time-slot/repository/type-orm-time-slot.repository'; -import { MikroOrmTimesheetRepository } from '../../time-tracking/timesheet/repository/mikro-orm-timesheet.repository'; -import { TypeOrmTimesheetRepository } from '../../time-tracking/timesheet/repository/type-orm-timesheet.repository'; -import { MikroOrmUserOrganizationRepository } from '../../user-organization/repository/mikro-orm-user-organization.repository'; -import { TypeOrmUserOrganizationRepository } from '../../user-organization/repository/type-orm-user-organization.repository'; -import { MikroOrmUserRepository } from '../../user/repository/mikro-orm-user.repository'; -import { TypeOrmUserRepository } from '../../user/repository/type-orm-user.repository'; -import { MikroOrmWarehouseProductVariantRepository } from '../../warehouse/repository/mikro-orm-warehouse-product-variant.repository'; -import { MikroOrmWarehouseProductRepository } from '../../warehouse/repository/mikro-orm-warehouse-product.repository '; -import { MikroOrmWarehouseRepository } from '../../warehouse/repository/mikro-orm-warehouse.repository'; -import { TypeOrmWarehouseProductVariantRepository } from '../../warehouse/repository/type-orm-warehouse-product-variant.repository'; -import { TypeOrmWarehouseProductRepository } from '../../warehouse/repository/type-orm-warehouse-product.repository '; -import { TypeOrmWarehouseRepository } from '../../warehouse/repository/type-orm-warehouse.repository'; - -export interface IForeignKey { - column: string; - repository: Repository; -} - -export interface IColumnRelationMetadata { - joinTableName: string; - foreignKeys: IForeignKey[]; - isCheckRelation: boolean; -} - -export interface IRepositoryModel { - repository: Repository; - relations?: IColumnRelationMetadata[]; - foreignKeys?: any; - uniqueIdentifier?: any; - - // additional condition - isStatic?: boolean; - isCheckRelation?: boolean; -} +import { + IColumnRelationMetadata, + IForeignKey, + IRepositoryModel, + RepositoriesService +} from '../repositories/repositories.service'; @Injectable() export class ImportService implements OnModuleInit { private _dirname: string; private _extractPath: string; - private dynamicEntitiesClassMap: IRepositoryModel[] = []; - private repositories: IRepositoryModel[] = []; + private repositories: IRepositoryModel[] = []; constructor( - @InjectRepository(AccountingTemplate) - private typeOrmAccountingTemplateRepository: TypeOrmAccountingTemplateRepository, - - mikroOrmAccountingTemplateRepository: MikroOrmAccountingTemplateRepository, - - @InjectRepository(Activity) - private typeOrmActivityRepository: TypeOrmActivityRepository, - - mikroOrmActivityRepository: MikroOrmActivityRepository, - - @InjectRepository(AppointmentEmployee) - private typeOrmAppointmentEmployeeRepository: TypeOrmAppointmentEmployeeRepository, - - mikroOrmAppointmentEmployeeRepository: MikroOrmAppointmentEmployeeRepository, - - @InjectRepository(ApprovalPolicy) - private typeOrmApprovalPolicyRepository: TypeOrmApprovalPolicyRepository, - - mikroOrmApprovalPolicyRepository: MikroOrmApprovalPolicyRepository, - - @InjectRepository(AvailabilitySlot) - private typeOrmAvailabilitySlotRepository: TypeOrmAvailabilitySlotRepository, - - mikroOrmAvailabilitySlotRepository: MikroOrmAvailabilitySlotRepository, - - @InjectRepository(Candidate) - private typeOrmCandidateRepository: TypeOrmCandidateRepository, - - mikroOrmCandidateRepository: MikroOrmCandidateRepository, - - @InjectRepository(CandidateCriterionsRating) - private typeOrmCandidateCriterionsRatingRepository: TypeOrmCandidateCriterionsRatingRepository, - - mikroOrmCandidateCriterionsRatingRepository: MikroOrmCandidateCriterionsRatingRepository, - - @InjectRepository(CandidateDocument) - private typeOrmCandidateDocumentRepository: TypeOrmCandidateDocumentRepository, - - mikroOrmCandidateDocumentRepository: MikroOrmCandidateDocumentRepository, - - @InjectRepository(CandidateEducation) - private typeOrmCandidateEducationRepository: TypeOrmCandidateEducationRepository, - - mikroOrmCandidateEducationRepository: MikroOrmCandidateEducationRepository, - - @InjectRepository(CandidateExperience) - private typeOrmCandidateExperienceRepository: TypeOrmCandidateExperienceRepository, - - mikroOrmCandidateExperienceRepository: MikroOrmCandidateExperienceRepository, - - @InjectRepository(CandidateFeedback) - private typeOrmCandidateFeedbackRepository: TypeOrmCandidateFeedbackRepository, - - mikroOrmCandidateFeedbackRepository: MikroOrmCandidateFeedbackRepository, - - @InjectRepository(CandidateInterview) - private typeOrmCandidateInterviewRepository: TypeOrmCandidateInterviewRepository, - - mikroOrmCandidateInterviewRepository: MikroOrmCandidateInterviewRepository, - - @InjectRepository(CandidateInterviewers) - private typeOrmCandidateInterviewersRepository: TypeOrmCandidateInterviewersRepository, - - mikroOrmCandidateInterviewersRepository: MikroOrmCandidateInterviewersRepository, - - @InjectRepository(CandidatePersonalQualities) - private typeOrmCandidatePersonalQualitiesRepository: TypeOrmCandidatePersonalQualitiesRepository, - - mikroOrmCandidatePersonalQualitiesRepository: MikroOrmCandidatePersonalQualitiesRepository, - - @InjectRepository(CandidateSkill) - private typeOrmCandidateSkillRepository: TypeOrmCandidateSkillRepository, - - mikroOrmCandidateSkillRepository: MikroOrmCandidateSkillRepository, - - @InjectRepository(CandidateSource) - private typeOrmCandidateSourceRepository: TypeOrmCandidateSourceRepository, - - mikroOrmCandidateSourceRepository: MikroOrmCandidateSourceRepository, - - @InjectRepository(CandidateTechnologies) - private typeOrmCandidateTechnologiesRepository: TypeOrmCandidateTechnologiesRepository, - - mikroOrmCandidateTechnologiesRepository: MikroOrmCandidateTechnologiesRepository, - - @InjectRepository(Contact) - private typeOrmContactRepository: TypeOrmContactRepository, - - mikroOrmContactRepository: MikroOrmContactRepository, - - @InjectRepository(CustomSmtp) - private typeOrmCustomSmtpRepository: TypeOrmCustomSmtpRepository, - - mikroOrmCustomSmtpRepository: MikroOrmCustomSmtpRepository, - - @InjectRepository(Deal) - private typeOrmDealRepository: TypeOrmDealRepository, - - mikroOrmDealRepository: MikroOrmDealRepository, - - @InjectRepository(EmailHistory) - private typeOrmEmailHistoryRepository: TypeOrmEmailHistoryRepository, - - mikroOrmEmailHistoryRepository: MikroOrmEmailHistoryRepository, - - @InjectRepository(EmailTemplate) - private typeOrmEmailTemplateRepository: TypeOrmEmailTemplateRepository, - - mikroOrmEmailTemplateRepository: MikroOrmEmailTemplateRepository, - - @InjectRepository(Employee) - private typeOrmEmployeeRepository: TypeOrmEmployeeRepository, - - mikroOrmEmployeeRepository: MikroOrmEmployeeRepository, - - @InjectRepository(EmployeeAppointment) - private typeOrmEmployeeAppointmentRepository: TypeOrmEmployeeAppointmentRepository, - - mikroOrmEmployeeAppointmentRepository: MikroOrmEmployeeAppointmentRepository, - - @InjectRepository(EmployeeAward) - private typeOrmEmployeeAwardRepository: TypeOrmEmployeeAwardRepository, - - mikroOrmEmployeeAwardRepository: MikroOrmEmployeeAwardRepository, - - @InjectRepository(EmployeeRecurringExpense) - private typeOrmEmployeeRecurringExpenseRepository: TypeOrmEmployeeRecurringExpenseRepository, - - mikroOrmEmployeeRecurringExpenseRepository: MikroOrmEmployeeRecurringExpenseRepository, - - @InjectRepository(EmployeeSetting) - private typeOrmEmployeeSettingRepository: TypeOrmEmployeeSettingRepository, - - mikroOrmEmployeeSettingRepository: MikroOrmEmployeeSettingRepository, - - @InjectRepository(Equipment) - private typeOrmEquipmentRepository: TypeOrmEquipmentRepository, - - mikroOrmEquipmentRepository: MikroOrmEquipmentRepository, - - @InjectRepository(EquipmentSharing) - private typeOrmEquipmentSharingRepository: TypeOrmEquipmentSharingRepository, - - mikroOrmEquipmentSharingRepository: MikroOrmEquipmentSharingRepository, - - @InjectRepository(EquipmentSharingPolicy) - private typeOrmEquipmentSharingPolicyRepository: TypeOrmEquipmentSharingPolicyRepository, - - mikroOrmEquipmentSharingPolicyRepository: MikroOrmEquipmentSharingPolicyRepository, - - @InjectRepository(EstimateEmail) - private typeOrmEstimateEmailRepository: TypeOrmEstimateEmailRepository, - - mikroOrmEstimateEmailRepository: MikroOrmEstimateEmailRepository, - - @InjectRepository(EventType) - private typeOrmEventTypeRepository: TypeOrmEventTypeRepository, - - mikroOrmEventTypeRepository: MikroOrmEventTypeRepository, - - @InjectRepository(Expense) - private typeOrmExpenseRepository: TypeOrmExpenseRepository, - - mikroOrmExpenseRepository: MikroOrmExpenseRepository, - - @InjectRepository(ExpenseCategory) - private typeOrmExpenseCategoryRepository: TypeOrmExpenseCategoryRepository, - - mikroOrmExpenseCategoryRepository: MikroOrmExpenseCategoryRepository, - - @InjectRepository(Feature) - private typeOrmFeatureRepository: TypeOrmFeatureRepository, - - mikroOrmFeatureRepository: MikroOrmFeatureRepository, - - @InjectRepository(FeatureOrganization) - private typeOrmFeatureOrganizationRepository: TypeOrmFeatureOrganizationRepository, - - mikroOrmFeatureOrganizationRepository: MikroOrmFeatureOrganizationRepository, - - @InjectRepository(Goal) - private typeOrmGoalRepository: TypeOrmGoalRepository, - - mikroOrmGoalRepository: MikroOrmGoalRepository, - - @InjectRepository(GoalTemplate) - private typeOrmGoalTemplateRepository: TypeOrmGoalTemplateRepository, - - mikroOrmGoalTemplateRepository: MikroOrmGoalTemplateRepository, - - @InjectRepository(GoalKPI) - private typeOrmGoalKPIRepository: TypeOrmGoalKPIRepository, - - mikroOrmGoalKPIRepository: MikroOrmGoalKPIRepository, - - @InjectRepository(GoalKPITemplate) - private typeOrmGoalKPITemplateRepository: TypeOrmGoalKPITemplateRepository, - - mikroOrmGoalKPITemplateRepository: MikroOrmGoalKPITemplateRepository, - - @InjectRepository(GoalTimeFrame) - private typeOrmGoalTimeFrameRepository: TypeOrmGoalTimeFrameRepository, - - mikroOrmGoalTimeFrameRepository: MikroOrmGoalTimeFrameRepository, - - @InjectRepository(GoalGeneralSetting) - private typeOrmGoalGeneralSettingRepository: TypeOrmGoalGeneralSettingRepository, - - mikroOrmGoalGeneralSettingRepository: MikroOrmGoalGeneralSettingRepository, - - @InjectRepository(Income) - private typeOrmIncomeRepository: TypeOrmIncomeRepository, - - mikroOrmIncomeRepository: MikroOrmIncomeRepository, - - @InjectRepository(Integration) - private typeOrmIntegrationRepository: TypeOrmIntegrationRepository, - - mikroOrmIntegrationRepository: MikroOrmIntegrationRepository, - - @InjectRepository(IntegrationType) - private typeOrmIntegrationTypeRepository: TypeOrmIntegrationTypeRepository, - - mikroOrmIntegrationTypeRepository: MikroOrmIntegrationTypeRepository, - - @InjectRepository(IntegrationEntitySetting) - private typeOrmIntegrationEntitySettingRepository: TypeOrmIntegrationEntitySettingRepository, - - mikroOrmIntegrationEntitySettingRepository: MikroOrmIntegrationEntitySettingRepository, - - @InjectRepository(IntegrationEntitySettingTied) - private typeOrmIntegrationEntitySettingTiedRepository: TypeOrmIntegrationEntitySettingTiedRepository, - - mikroOrmIntegrationEntitySettingTiedRepository: MikroOrmIntegrationEntitySettingTiedRepository, - - @InjectRepository(IntegrationMap) - private typeOrmIntegrationMapRepository: TypeOrmIntegrationMapRepository, - - mikroOrmIntegrationMapRepository: MikroOrmIntegrationMapRepository, - - @InjectRepository(IntegrationSetting) - private typeOrmIntegrationSettingRepository: TypeOrmIntegrationSettingRepository, - - mikroOrmIntegrationSettingRepository: MikroOrmIntegrationSettingRepository, - - @InjectRepository(IntegrationTenant) - private typeOrmIntegrationTenantRepository: TypeOrmIntegrationTenantRepository, - - mikroOrmIntegrationTenantRepository: MikroOrmIntegrationTenantRepository, - - @InjectRepository(Invite) - private typeOrmInviteRepository: TypeOrmInviteRepository, - - mikroOrmInviteRepository: MikroOrmInviteRepository, - - @InjectRepository(Invoice) - private typeOrmInvoiceRepository: TypeOrmInvoiceRepository, - - mikroOrmInvoiceRepository: MikroOrmInvoiceRepository, - - @InjectRepository(InvoiceEstimateHistory) - private typeOrmInvoiceEstimateHistoryRepository: TypeOrmInvoiceEstimateHistoryRepository, - - mikroOrmInvoiceEstimateHistoryRepository: MikroOrmInvoiceEstimateHistoryRepository, - - @InjectRepository(InvoiceItem) - private typeOrmInvoiceItemRepository: TypeOrmInvoiceItemRepository, - - mikroOrmInvoiceItemRepository: MikroOrmInvoiceItemRepository, - - @InjectRepository(KeyResult) - private typeOrmKeyResultRepository: TypeOrmKeyResultRepository, - - mikroOrmKeyResultRepository: MikroOrmKeyResultRepository, - - @InjectRepository(KeyResultTemplate) - private typeOrmKeyResultTemplateRepository: TypeOrmKeyResultTemplateRepository, - - mikroOrmKeyResultTemplateRepository: MikroOrmKeyResultTemplateRepository, - - @InjectRepository(KeyResultUpdate) - private typeOrmKeyResultUpdateRepository: TypeOrmKeyResultUpdateRepository, - - mikroOrmKeyResultUpdateRepository: MikroOrmKeyResultUpdateRepository, - - @InjectRepository(Language) - private typeOrmLanguageRepository: TypeOrmLanguageRepository, - - mikroOrmLanguageRepository: MikroOrmLanguageRepository, - - @InjectRepository(Organization) - private typeOrmOrganizationRepository: TypeOrmOrganizationRepository, - - mikroOrmOrganizationRepository: MikroOrmOrganizationRepository, - - @InjectRepository(EmployeeLevel) - private typeOrmEmployeeLevelRepository: TypeOrmEmployeeLevelRepository, - - mikroOrmEmployeeLevelRepository: MikroOrmEmployeeLevelRepository, - - @InjectRepository(OrganizationAward) - private typeOrmOrganizationAwardRepository: TypeOrmOrganizationAwardRepository, - - mikroOrmOrganizationAwardRepository: MikroOrmOrganizationAwardRepository, - - @InjectRepository(OrganizationContact) - private typeOrmOrganizationContactRepository: TypeOrmOrganizationContactRepository, - - mikroOrmOrganizationContactRepository: MikroOrmOrganizationContactRepository, - - @InjectRepository(OrganizationDepartment) - private typeOrmOrganizationDepartmentRepository: TypeOrmOrganizationDepartmentRepository, - - mikroOrmOrganizationDepartmentRepository: MikroOrmOrganizationDepartmentRepository, - - @InjectRepository(OrganizationDocument) - private typeOrmOrganizationDocumentRepository: TypeOrmOrganizationDocumentRepository, - - mikroOrmOrganizationDocumentRepository: MikroOrmOrganizationDocumentRepository, - - @InjectRepository(OrganizationEmploymentType) - private typeOrmOrganizationEmploymentTypeRepository: TypeOrmOrganizationEmploymentTypeRepository, - - mikroOrmOrganizationEmploymentTypeRepository: MikroOrmOrganizationEmploymentTypeRepository, - - @InjectRepository(OrganizationLanguage) - private typeOrmOrganizationLanguageRepository: TypeOrmOrganizationLanguageRepository, - - mikroOrmOrganizationLanguageRepository: MikroOrmOrganizationLanguageRepository, - - @InjectRepository(OrganizationPosition) - private typeOrmOrganizationPositionRepository: TypeOrmOrganizationPositionRepository, - - mikroOrmOrganizationPositionRepository: MikroOrmOrganizationPositionRepository, - - @InjectRepository(OrganizationProject) - private typeOrmOrganizationProjectRepository: TypeOrmOrganizationProjectRepository, - - mikroOrmOrganizationProjectRepository: MikroOrmOrganizationProjectRepository, - - @InjectRepository(OrganizationRecurringExpense) - private typeOrmOrganizationRecurringExpenseRepository: TypeOrmOrganizationRecurringExpenseRepository, - - mikroOrmOrganizationRecurringExpenseRepository: MikroOrmOrganizationRecurringExpenseRepository, - - @InjectRepository(OrganizationSprint) - private typeOrmOrganizationSprintRepository: TypeOrmOrganizationSprintRepository, - - mikroOrmOrganizationSprintRepository: MikroOrmOrganizationSprintRepository, - - @InjectRepository(OrganizationTeam) - private typeOrmOrganizationTeamRepository: TypeOrmOrganizationTeamRepository, - - mikroOrmOrganizationTeamRepository: MikroOrmOrganizationTeamRepository, - - @InjectRepository(OrganizationTeamEmployee) - private typeOrmOrganizationTeamEmployeeRepository: TypeOrmOrganizationTeamEmployeeRepository, - - mikroOrmOrganizationTeamEmployeeRepository: MikroOrmOrganizationTeamEmployeeRepository, - - @InjectRepository(OrganizationVendor) - private typeOrmOrganizationVendorRepository: TypeOrmOrganizationVendorRepository, - - mikroOrmOrganizationVendorRepository: MikroOrmOrganizationVendorRepository, - - @InjectRepository(Payment) - private typeOrmPaymentRepository: TypeOrmPaymentRepository, - - mikroOrmPaymentRepository: MikroOrmPaymentRepository, - - @InjectRepository(Pipeline) - private typeOrmPipelineRepository: TypeOrmPipelineRepository, - - mikroOrmPipelineRepository: MikroOrmPipelineRepository, - - @InjectRepository(PipelineStage) - private typeOrmPipelineStageRepository: TypeOrmPipelineStageRepository, - - mikroOrmPipelineStageRepository: MikroOrmPipelineStageRepository, - - @InjectRepository(Product) - private typeOrmProductRepository: TypeOrmProductRepository, - - mikroOrmProductRepository: MikroOrmProductRepository, - - @InjectRepository(ProductTranslation) - private typeOrmProductTranslationRepository: TypeOrmProductTranslationRepository, - - mikroOrmProductTranslationRepository: MikroOrmProductTranslationRepository, - - @InjectRepository(ProductCategory) - private typeOrmProductCategoryRepository: TypeOrmProductCategoryRepository, - - mikroOrmProductCategoryRepository: MikroOrmProductCategoryRepository, - - @InjectRepository(ProductCategoryTranslation) - private typeOrmProductCategoryTranslationRepository: TypeOrmProductCategoryTranslationRepository, - - mikroOrmProductCategoryTranslationRepository: MikroOrmProductCategoryTranslationRepository, - - @InjectRepository(ProductOption) - private typeOrmProductOptionRepository: TypeOrmProductOptionRepository, - - mikroOrmProductOptionRepository: MikroOrmProductOptionRepository, - - @InjectRepository(ProductOptionTranslation) - private typeOrmProductOptionTranslationRepository: TypeOrmProductOptionTranslationRepository, - - mikroOrmProductOptionTranslationRepository: MikroOrmProductOptionTranslationRepository, - - @InjectRepository(ProductOptionGroup) - private typeOrmProductOptionGroupRepository: TypeOrmProductOptionGroupRepository, - - mikroOrmProductOptionGroupRepository: MikroOrmProductOptionGroupRepository, - - @InjectRepository(ProductOptionGroupTranslation) - private typeOrmProductOptionGroupTranslationRepository: TypeOrmProductOptionGroupTranslationRepository, - - mikroOrmProductOptionGroupTranslationRepository: MikroOrmProductOptionGroupTranslationRepository, - - @InjectRepository(ProductVariantSetting) - private typeOrmProductVariantSettingRepository: TypeOrmProductVariantSettingRepository, - - mikroOrmProductVariantSettingRepository: MikroOrmProductVariantSettingRepository, - - @InjectRepository(ProductType) - private typeOrmProductTypeRepository: TypeOrmProductTypeRepository, - - mikroOrmProductTypeRepository: MikroOrmProductTypeRepository, - - @InjectRepository(ProductTypeTranslation) - private typeOrmProductTypeTranslationRepository: TypeOrmProductTypeTranslationRepository, - - mikroOrmProductTypeTranslationRepository: MikroOrmProductTypeTranslationRepository, - - @InjectRepository(ProductVariant) - private typeOrmProductVariantRepository: TypeOrmProductVariantRepository, - - mikroOrmProductVariantRepository: MikroOrmProductVariantRepository, - - @InjectRepository(ProductVariantPrice) - private typeOrmProductVariantPriceRepository: TypeOrmProductVariantPriceRepository, - - mikroOrmProductVariantPriceRepository: MikroOrmProductVariantPriceRepository, - - @InjectRepository(ImageAsset) - private typeOrmImageAssetRepository: TypeOrmImageAssetRepository, - - mikroOrmImageAssetRepository: MikroOrmImageAssetRepository, - - @InjectRepository(Warehouse) - private typeOrmWarehouseRepository: TypeOrmWarehouseRepository, - - mikroOrmWarehouseRepository: MikroOrmWarehouseRepository, - - @InjectRepository(Merchant) - private typeOrmMerchantRepository: TypeOrmMerchantRepository, - - mikroOrmMerchantRepository: MikroOrmMerchantRepository, - - @InjectRepository(WarehouseProduct) - private typeOrmWarehouseProductRepository: TypeOrmWarehouseProductRepository, - - mikroOrmWarehouseProductRepository: MikroOrmWarehouseProductRepository, - - @InjectRepository(WarehouseProductVariant) - private typeOrmWarehouseProductVariantRepository: TypeOrmWarehouseProductVariantRepository, - - mikroOrmWarehouseProductVariantRepository: MikroOrmWarehouseProductVariantRepository, - - @InjectRepository(Skill) - private typeOrmSkillRepository: TypeOrmSkillRepository, - - mikroOrmSkillRepository: MikroOrmSkillRepository, - - @InjectRepository(Screenshot) - private typeOrmScreenshotRepository: TypeOrmScreenshotRepository, - - mikroOrmScreenshotRepository: MikroOrmScreenshotRepository, - - @InjectRepository(RequestApproval) - private typeOrmRequestApprovalRepository: TypeOrmRequestApprovalRepository, - - mikroOrmRequestApprovalRepository: MikroOrmRequestApprovalRepository, - - @InjectRepository(RequestApprovalEmployee) - private typeOrmRequestApprovalEmployeeRepository: TypeOrmRequestApprovalEmployeeRepository, - - mikroOrmRequestApprovalEmployeeRepository: MikroOrmRequestApprovalEmployeeRepository, - - @InjectRepository(RequestApprovalTeam) - private typeOrmRequestApprovalTeamRepository: TypeOrmRequestApprovalTeamRepository, - - mikroOrmRequestApprovalTeamRepository: MikroOrmRequestApprovalTeamRepository, - - @InjectRepository(Role) - private typeOrmRoleRepository: TypeOrmRoleRepository, - - mikroOrmRoleRepository: MikroOrmRoleRepository, - - @InjectRepository(RolePermission) - private typeOrmRolePermissionRepository: TypeOrmRolePermissionRepository, - - mikroOrmRolePermissionRepository: MikroOrmRolePermissionRepository, - - @InjectRepository(Report) - private typeOrmReportRepository: TypeOrmReportRepository, - - mikroOrmReportRepository: MikroOrmReportRepository, - - @InjectRepository(ReportCategory) - private typeOrmReportCategoryRepository: TypeOrmReportCategoryRepository, - - mikroOrmReportCategoryRepository: MikroOrmReportCategoryRepository, - - @InjectRepository(ReportOrganization) - private typeOrmReportOrganizationRepository: TypeOrmReportOrganizationRepository, - - mikroOrmReportOrganizationRepository: MikroOrmReportOrganizationRepository, - - @InjectRepository(Tag) - private typeOrmTagRepository: TypeOrmTagRepository, - - mikroOrmTagRepository: MikroOrmTagRepository, - - @InjectRepository(Task) - private typeOrmTaskRepository: TypeOrmTaskRepository, - - mikroOrmTaskRepository: MikroOrmTaskRepository, - - @InjectRepository(TenantSetting) - private typeOrmTenantSettingRepository: TypeOrmTenantSettingRepository, - - mikroOrmTenantSettingRepository: MikroOrmTenantSettingRepository, - - @InjectRepository(Timesheet) - private typeOrmTimesheetRepository: TypeOrmTimesheetRepository, - - mikroOrmTimesheetRepository: MikroOrmTimesheetRepository, - - @InjectRepository(TimeLog) - private typeOrmTimeLogRepository: TypeOrmTimeLogRepository, - - mikroOrmTimeLogRepository: MikroOrmTimeLogRepository, - - @InjectRepository(TimeSlot) - private typeOrmTimeSlotRepository: TypeOrmTimeSlotRepository, - - mikroOrmTimeSlotRepository: MikroOrmTimeSlotRepository, - - @InjectRepository(TimeSlotMinute) - private typeOrmTimeSlotMinuteRepository: TypeOrmTimeSlotMinuteRepository, - - mikroOrmTimeSlotMinuteRepository: MikroOrmTimeSlotMinuteRepository, - - @InjectRepository(TimeOffRequest) - private typeOrmTimeOffRequestRepository: TypeOrmTimeOffRequestRepository, - - mikroOrmTimeOffRequestRepository: MikroOrmTimeOffRequestRepository, - - @InjectRepository(TimeOffPolicy) - private typeOrmTimeOffPolicyRepository: TypeOrmTimeOffPolicyRepository, - - mikroOrmTimeOffPolicyRepository: MikroOrmTimeOffPolicyRepository, - - @InjectRepository(User) - private typeOrmUserRepository: TypeOrmUserRepository, - - mikroOrmUserRepository: MikroOrmUserRepository, - - @InjectRepository(UserOrganization) - private typeOrmUserOrganizationRepository: TypeOrmUserOrganizationRepository, - - mikroOrmUserOrganizationRepository: MikroOrmUserOrganizationRepository, - private readonly configService: ConfigService, - private readonly _connectionEntityManager: ConnectionEntityManager, - private readonly commandBus: CommandBus + private readonly commandBus: CommandBus, + private repositoriesService: RepositoriesService ) {} async onModuleInit() { //base import csv directory path this._dirname = path.join(this.configService.assetOptions.assetPublicPath || __dirname); + } - await this.createDynamicInstanceForPluginEntities(); - await this.registerCoreRepositories(); + public async registerAllRepositories() { + this.repositories = await this.repositoriesService.buildRepositoriesRelationsGraph(); } public removeExtractedFiles() { @@ -1075,7 +134,7 @@ export class ImportService implements OnModuleInit { } } - async parseRelationalTables(entity: IRepositoryModel, cleanup: boolean = false) { + async parseRelationalTables(entity: IRepositoryModel, cleanup: boolean = false) { const { relations } = entity; for await (const item of relations) { const { joinTableName } = item; @@ -1131,19 +190,19 @@ export class ImportService implements OnModuleInit { /* * Map static tables import record before insert data */ - async migrateImportEntityRecord(item: IRepositoryModel, entity: any): Promise { - const { repository, uniqueIdentifier = [] } = item; + async migrateImportEntityRecord(item: IRepositoryModel, entity: any): Promise { + const { repository, uniqueIdentifiers = [] } = item; const masterTable = repository.metadata.tableName; return await new Promise(async (resolve, reject) => { try { const source = JSON.parse(JSON.stringify(entity)); const where = []; - if (isNotEmpty(uniqueIdentifier) && uniqueIdentifier instanceof Array) { + if (isNotEmpty(uniqueIdentifiers) && Array.isArray(uniqueIdentifiers)) { if ('tenantId' in entity && isNotEmpty(entity['tenantId'])) { where.push({ tenantId: RequestContext.currentTenantId() }); } - for (const unique of uniqueIdentifier) { + for (const unique of uniqueIdentifiers) { where.push({ [unique.column]: entity[unique.column] }); } } @@ -1169,7 +228,7 @@ export class ImportService implements OnModuleInit { /* * Map import record after find or insert data */ - async mappedImportRecord(item: IRepositoryModel, destination: any, row: any): Promise { + async mappedImportRecord(item: IRepositoryModel, destination: any, row: any): Promise { const { repository } = item; const entityType = repository.metadata.tableName; @@ -1197,7 +256,7 @@ export class ImportService implements OnModuleInit { * Map tenant & organization base fields here * Notice: Please add timestamp field here if missing */ - async mapFields(item: IRepositoryModel, data: any) { + async mapFields(item: IRepositoryModel, data: any) { if ('id' in data && isNotEmpty(data['id'])) { delete data['id']; } @@ -1206,7 +265,7 @@ export class ImportService implements OnModuleInit { } if ('organizationId' in data && isNotEmpty(data['organizationId'])) { try { - const organization = await this.typeOrmOrganizationRepository.findOneByOrFail({ + const organization = await this.repositoriesService.typeOrmOrganizationRepository.findOneByOrFail({ id: data['organizationId'], tenantId: RequestContext.currentTenantId() }); @@ -1216,7 +275,7 @@ export class ImportService implements OnModuleInit { new ImportRecordFindOrFailCommand({ tenantId: RequestContext.currentTenantId(), sourceId: data['organizationId'], - entityType: this.typeOrmOrganizationRepository.metadata.tableName + entityType: this.repositoriesService.typeOrmOrganizationRepository.metadata.tableName }) ); data['organizationId'] = record ? record.destinationId : IsNull().value; @@ -1228,44 +287,65 @@ export class ImportService implements OnModuleInit { /* * Map timestamps fields here */ - async mapTimeStampsFields(item: IRepositoryModel, data: any) { + async mapTimeStampsFields(item: IRepositoryModel, data: any) { const { repository } = item; for await (const column of repository.metadata.columns as ColumnMetadata[]) { const { propertyName, type } = column; - if (`${propertyName}` in data && isNotEmpty(data[`${propertyName}`])) { - if (type.valueOf() === Date || type === 'datetime' || type === 'timestamp') { - data[`${propertyName}`] = convertToDatetime(data[`${propertyName}`]); - } else if (data[`${propertyName}`] === 'true') { - data[`${propertyName}`] = true; - } else if (data[`${propertyName}`] === 'false') { - data[`${propertyName}`] = false; + if (`${propertyName}` in data) { + if (isNotEmpty(data[`${propertyName}`])) { + if (type.valueOf() === Date || type === 'datetime' || type === 'timestamp') { + data[`${propertyName}`] = convertToDatetime(data[`${propertyName}`]); + } else if (data[`${propertyName}`] === 'true') { + data[`${propertyName}`] = true; + } else if (data[`${propertyName}`] === 'false') { + data[`${propertyName}`] = false; + } + } else { + data[`${propertyName}`] = null; } } } return data; } + /** + * Helper function to map a list of foreign key relations. + * It uses the ImportRecordFindOrFailCommand to resolve destination IDs from source IDs (cdv files). + * + * @param data - The current row of CSV data being processed. + * @param relationSet - An array of relation definitions containing column name and referenced repository. + */ + private async mapRelationSet(data: any, relationSet: IForeignKey[]): Promise { + for await (const { column, repository } of relationSet) { + if (data[column]) { + const { record } = await this.commandBus.execute( + new ImportRecordFindOrFailCommand({ + tenantId: RequestContext.currentTenantId(), + sourceId: data[column], + entityType: repository.metadata.tableName + }) + ); + data[column] = record ? record.destinationId : IsNull().value; + } + } + } + /* * Map relation fields here */ - async mapRelationFields(item: IRepositoryModel | IColumnRelationMetadata, data: any): Promise { + async mapRelationFields(item: IRepositoryModel | IColumnRelationMetadata, data: any): Promise { return await new Promise(async (resolve, reject) => { try { const { foreignKeys = [], isCheckRelation = false } = item; - if (isCheckRelation) { - if (isNotEmpty(foreignKeys) && foreignKeys instanceof Array) { - for await (const { column, repository } of foreignKeys) { - const { record } = await this.commandBus.execute( - new ImportRecordFindOrFailCommand({ - tenantId: RequestContext.currentTenantId(), - sourceId: data[column], - entityType: repository.metadata.tableName - }) - ); - data[column] = record ? record.destinationId : IsNull().value; - } - } + + // Map base entity relations fields + await this.mapRelationSet(data, this.repositoriesService.baseEntityRelationFields); + + // Other entity relation fields + if (isCheckRelation && isNotEmpty(foreignKeys)) { + await this.mapRelationSet(data, foreignKeys); } + resolve(data); } catch (error) { console.log(chalk.red('Failed to map relation entity before insert'), error); @@ -1274,894 +354,55 @@ export class ImportService implements OnModuleInit { }); } - //load plugins entities for import data - private async createDynamicInstanceForPluginEntities() { - for await (const entity of getEntitiesFromPlugins(this.configService.plugins)) { - if (!isFunction(entity)) { - continue; - } - - const className = camelCase(entity.name); - const repository = this._connectionEntityManager.getRepository(entity); + public async addCurrentUserToImportedOrganizations() { + const userId = RequestContext.currentUserId(); - this[className] = repository; - this.dynamicEntitiesClassMap.push({ repository }); - } - } + const organizationsCsvPath = path.join(this._extractPath, 'organization.csv'); - /* - * Load all entities repository after create instance - * Warning: Changing position here can be FATAL - */ - private async registerCoreRepositories() { - this.repositories = [ - /** - * These entities do not have any other dependency so need to be mapped first - */ - { - repository: this.typeOrmReportCategoryRepository, - isStatic: true, - uniqueIdentifier: [{ column: 'name' }] - }, - { - repository: this.typeOrmReportRepository, - isStatic: true, - uniqueIdentifier: [{ column: 'name' }, { column: 'slug' }] - }, - { - repository: this.typeOrmFeatureRepository, - isStatic: true, - uniqueIdentifier: [{ column: 'name' }, { column: 'code' }] - }, - { - repository: this.typeOrmLanguageRepository, - isStatic: true, - uniqueIdentifier: [{ column: 'name' }, { column: 'code' }] - }, - { - repository: this.typeOrmIntegrationRepository, - isStatic: true, - uniqueIdentifier: [{ column: 'name' }] - }, - { - repository: this.typeOrmIntegrationTypeRepository, - isStatic: true, - uniqueIdentifier: [{ column: 'name' }, { column: 'groupName' }], - relations: [ - { - joinTableName: 'integration_integration_type', - isCheckRelation: true, - foreignKeys: [ - { column: 'integrationId', repository: this.typeOrmIntegrationRepository }, - { column: 'integrationTypeId', repository: this.typeOrmIntegrationTypeRepository } - ] - } - ] - }, - /** - * These entities need TENANT - */ - { - repository: this.typeOrmTenantSettingRepository - }, - { - repository: this.typeOrmRoleRepository - }, - { - repository: this.typeOrmRolePermissionRepository, - isCheckRelation: true, - foreignKeys: [{ column: 'roleId', repository: this.typeOrmRoleRepository }] - }, - { - repository: this.typeOrmOrganizationRepository - }, - /** - * These entities need TENANT and ORGANIZATION - */ - { - repository: this.typeOrmUserRepository, - isStatic: true, - isCheckRelation: true, - foreignKeys: [{ column: 'roleId', repository: this.typeOrmRoleRepository }] - }, - { - repository: this.typeOrmUserOrganizationRepository, - isCheckRelation: true, - foreignKeys: [{ column: 'userId', repository: this.typeOrmUserRepository }] - }, - //Organization & Related Entities - { - repository: this.typeOrmOrganizationPositionRepository - }, - { - repository: this.typeOrmOrganizationTeamRepository - }, - { - repository: this.typeOrmOrganizationAwardRepository - }, - { - repository: this.typeOrmOrganizationVendorRepository - }, - { - repository: this.typeOrmOrganizationDepartmentRepository - }, - { - repository: this.typeOrmOrganizationDocumentRepository - }, - { - repository: this.typeOrmOrganizationLanguageRepository - }, - { - repository: this.typeOrmOrganizationEmploymentTypeRepository - }, - { - repository: this.typeOrmOrganizationContactRepository - }, - { - repository: this.typeOrmOrganizationProjectRepository, - isCheckRelation: true, - foreignKeys: [ - { column: 'organizationContactId', repository: this.typeOrmOrganizationContactRepository } - ] - }, - { - repository: this.typeOrmOrganizationSprintRepository, - isCheckRelation: true, - foreignKeys: [{ column: 'projectId', repository: this.typeOrmOrganizationProjectRepository }] - }, - { - repository: this.typeOrmOrganizationRecurringExpenseRepository - }, - { - repository: this.typeOrmContactRepository - }, - { - repository: this.typeOrmCustomSmtpRepository - }, - { - repository: this.typeOrmReportOrganizationRepository, - isCheckRelation: true, - foreignKeys: [{ column: 'reportId', repository: this.typeOrmReportRepository }] - }, - /** - * These entities need TENANT, ORGANIZATION & USER - */ - { - repository: this.typeOrmEmployeeRepository, - isCheckRelation: true, - foreignKeys: [ - { column: 'userId', repository: this.typeOrmUserRepository }, - { column: 'contactId', repository: this.typeOrmContactRepository }, - { column: 'organizationPositionId', repository: this.typeOrmOrganizationPositionRepository } - ], - relations: [ - { joinTableName: 'employee_job_preset' }, - { - joinTableName: 'organization_department_employee', - foreignKeys: [ - { - column: 'organizationDepartmentId', - repository: this.typeOrmOrganizationDepartmentRepository - }, - { column: 'employeeId', repository: this.typeOrmEmployeeRepository } - ] - }, - { - joinTableName: 'organization_employment_type_employee', - foreignKeys: [ - { - column: 'organizationEmploymentTypeId', - repository: this.typeOrmOrganizationEmploymentTypeRepository - }, - { column: 'employeeId', repository: this.typeOrmEmployeeRepository } - ] - }, - { - joinTableName: 'organization_contact_employee', - foreignKeys: [ - { column: 'organizationContactId', repository: this.typeOrmOrganizationContactRepository }, - { column: 'employeeId', repository: this.typeOrmEmployeeRepository } - ] - }, - { - joinTableName: 'organization_project_employee', - foreignKeys: [ - { column: 'organizationProjectId', repository: this.typeOrmOrganizationProjectRepository }, - { column: 'employeeId', repository: this.typeOrmEmployeeRepository } - ] - } - ] - }, - /** - * These entities need TENANT, ORGANIZATION & CANDIDATE - */ - { - repository: this.typeOrmCandidateRepository, - isCheckRelation: true, - foreignKeys: [ - { column: 'userId', repository: this.typeOrmUserRepository }, - { column: 'organizationPositionId', repository: this.typeOrmOrganizationPositionRepository } - ], - relations: [ - { - joinTableName: 'candidate_department', - foreignKeys: [ - { column: 'candidateId', repository: this.typeOrmCandidateRepository }, - { - column: 'organizationDepartmentId', - repository: this.typeOrmOrganizationDepartmentRepository - } - ] - }, - { - joinTableName: 'candidate_employment_type', - foreignKeys: [ - { column: 'candidateId', repository: this.typeOrmCandidateRepository }, - { - column: 'organizationEmploymentTypeId', - repository: this.typeOrmOrganizationEmploymentTypeRepository - } - ] - } - ] - }, - { - repository: this.typeOrmCandidateDocumentRepository, - isCheckRelation: true, - foreignKeys: [{ column: 'candidateId', repository: this.typeOrmCandidateRepository }] - }, - { - repository: this.typeOrmCandidateEducationRepository, - isCheckRelation: true, - foreignKeys: [{ column: 'candidateId', repository: this.typeOrmCandidateRepository }] - }, - { - repository: this.typeOrmCandidateSkillRepository, - isCheckRelation: true, - foreignKeys: [{ column: 'candidateId', repository: this.typeOrmCandidateRepository }] - }, - { - repository: this.typeOrmCandidateSourceRepository, - isCheckRelation: true, - foreignKeys: [{ column: 'candidateId', repository: this.typeOrmCandidateRepository }] - }, - { - repository: this.typeOrmCandidateInterviewRepository, - isCheckRelation: true, - foreignKeys: [{ column: 'candidateId', repository: this.typeOrmCandidateRepository }] - }, - { - repository: this.typeOrmCandidateInterviewersRepository, - isCheckRelation: true, - foreignKeys: [ - { column: 'interviewId', repository: this.typeOrmCandidateInterviewRepository }, - { column: 'employeeId', repository: this.typeOrmEmployeeRepository } - ] - }, - { - repository: this.typeOrmCandidateExperienceRepository, - isCheckRelation: true, - foreignKeys: [{ column: 'candidateId', repository: this.typeOrmCandidateRepository }] - }, - { - repository: this.typeOrmCandidateFeedbackRepository, - isCheckRelation: true, - foreignKeys: [ - { column: 'candidateId', repository: this.typeOrmCandidateRepository }, - { column: 'interviewId', repository: this.typeOrmCandidateInterviewRepository }, - { column: 'interviewerId', repository: this.typeOrmCandidateInterviewersRepository } - ] - }, - { - repository: this.typeOrmCandidatePersonalQualitiesRepository, - isCheckRelation: true, - foreignKeys: [{ column: 'interviewId', repository: this.typeOrmCandidateInterviewRepository }] - }, - { - repository: this.typeOrmCandidateTechnologiesRepository, - isCheckRelation: true, - foreignKeys: [{ column: 'interviewId', repository: this.typeOrmCandidateInterviewRepository }] - }, - { - repository: this.typeOrmCandidateCriterionsRatingRepository, - isCheckRelation: true, - foreignKeys: [ - { column: 'feedbackId', repository: this.typeOrmCandidateFeedbackRepository }, - { column: 'technologyId', repository: this.typeOrmCandidateTechnologiesRepository }, - { column: 'personalQualityId', repository: this.typeOrmCandidatePersonalQualitiesRepository } - ] - }, - /** - * These entities need TENANT and ORGANIZATION - */ - { - repository: this.typeOrmSkillRepository, - uniqueIdentifier: [{ column: 'name' }], - relations: [ - { - joinTableName: 'skill_employee', - foreignKeys: [ - { column: 'skillId', repository: this.typeOrmSkillRepository }, - { column: 'employeeId', repository: this.typeOrmEmployeeRepository } - ] - }, - { - joinTableName: 'skill_organization', - foreignKeys: [ - { column: 'skillId', repository: this.typeOrmSkillRepository }, - { column: 'organizationId', repository: this.typeOrmOrganizationRepository } - ] - } - ] - }, - { - repository: this.typeOrmAccountingTemplateRepository - }, - { - repository: this.typeOrmApprovalPolicyRepository - }, - { - repository: this.typeOrmAvailabilitySlotRepository, - isCheckRelation: true, - foreignKeys: [{ column: 'employeeId', repository: this.typeOrmEmployeeRepository }] - }, - { - repository: this.typeOrmEmployeeAppointmentRepository, - isCheckRelation: true, - foreignKeys: [{ column: 'employeeId', repository: this.typeOrmEmployeeRepository }] - }, - { - repository: this.typeOrmAppointmentEmployeeRepository, - isCheckRelation: true, - foreignKeys: [ - { column: 'employeeId', repository: this.typeOrmEmployeeRepository }, - { column: 'employeeAppointmentId', repository: this.typeOrmEmployeeAppointmentRepository } - ] - }, - /* - * Email & Template - */ - { - repository: this.typeOrmEmailTemplateRepository - }, - { - repository: this.typeOrmEmailHistoryRepository, - isCheckRelation: true, - foreignKeys: [ - { column: 'emailTemplateId', repository: this.typeOrmEmailTemplateRepository }, - { column: 'userId', repository: this.typeOrmUserRepository } - ] - }, - { - repository: this.typeOrmEstimateEmailRepository - }, - /* - * Employee & Related Entities - */ - { - repository: this.typeOrmEmployeeAwardRepository, - isCheckRelation: true, - foreignKeys: [{ column: 'employeeId', repository: this.typeOrmEmployeeRepository }] - }, - { - repository: this.typeOrmEmployeeRecurringExpenseRepository, - isCheckRelation: true, - foreignKeys: [{ column: 'employeeId', repository: this.typeOrmEmployeeRepository }] - }, - { - repository: this.typeOrmEmployeeSettingRepository, - isCheckRelation: true, - foreignKeys: [{ column: 'employeeId', repository: this.typeOrmEmployeeRepository }] - }, - { - repository: this.typeOrmEmployeeLevelRepository - }, - /* - * Equipment & Related Entities - */ - { - repository: this.typeOrmEquipmentSharingPolicyRepository - }, - { - repository: this.typeOrmEquipmentRepository - }, - { - repository: this.typeOrmEquipmentSharingRepository, - isCheckRelation: true, - foreignKeys: [ - { column: 'equipmentId', repository: this.typeOrmEquipmentRepository }, - { column: 'equipmentSharingPolicyId', repository: this.typeOrmEquipmentSharingPolicyRepository } - ], - relations: [ - { - joinTableName: 'equipment_shares_employees', - foreignKeys: [ - { column: 'equipmentSharingId', repository: this.typeOrmEquipmentSharingRepository }, - { column: 'employeeId', repository: this.typeOrmEmployeeRepository } - ] - }, - { - joinTableName: 'equipment_shares_teams', - foreignKeys: [ - { column: 'equipmentSharingId', repository: this.typeOrmEquipmentSharingRepository }, - { column: 'organizationTeamId', repository: this.typeOrmOrganizationTeamRepository } - ] - } - ] - }, - /* - * Event Type & Related Entities - */ - { - repository: this.typeOrmEventTypeRepository, - isCheckRelation: true, - foreignKeys: [{ column: 'employeeId', repository: this.typeOrmEmployeeRepository }] - }, - /* - * Invoice & Related Entities - */ - { - repository: this.typeOrmInvoiceRepository, - isCheckRelation: true, - foreignKeys: [ - { column: 'sendTo', repository: this.typeOrmOrganizationContactRepository }, - { column: 'organizationContactId', repository: this.typeOrmOrganizationContactRepository }, - { column: 'fromOrganizationId', repository: this.typeOrmOrganizationRepository }, - { column: 'toContactId', repository: this.typeOrmOrganizationContactRepository } - ] - }, - { - repository: this.typeOrmInvoiceItemRepository, - isCheckRelation: true, - foreignKeys: [ - { column: 'invoiceId', repository: this.typeOrmInvoiceRepository }, - { column: 'taskId', repository: this.typeOrmTaskRepository }, - { column: 'employeeId', repository: this.typeOrmEmployeeRepository }, - { column: 'projectId', repository: this.typeOrmOrganizationProjectRepository }, - { column: 'productId', repository: this.typeOrmProductRepository }, - { column: 'expenseId', repository: this.typeOrmExpenseRepository } - ] - }, - { - repository: this.typeOrmInvoiceEstimateHistoryRepository, - isCheckRelation: true, - foreignKeys: [ - { column: 'userId', repository: this.typeOrmUserRepository }, - { column: 'invoiceId', repository: this.typeOrmInvoiceRepository } - ] - }, - /* - * Expense & Related Entities - */ - { - repository: this.typeOrmExpenseCategoryRepository - }, - { - repository: this.typeOrmExpenseRepository, - isCheckRelation: true, - foreignKeys: [ - { column: 'employeeId', repository: this.typeOrmEmployeeRepository }, - { column: 'vendorId', repository: this.typeOrmOrganizationVendorRepository }, - { column: 'categoryId', repository: this.typeOrmExpenseCategoryRepository }, - { column: 'projectId', repository: this.typeOrmOrganizationProjectRepository } - ] - }, - /* - * Income - */ - { - repository: this.typeOrmIncomeRepository, - isCheckRelation: true, - foreignKeys: [{ column: 'employeeId', repository: this.typeOrmEmployeeRepository }] - }, - /* - * Feature & Related Entities - */ - { - repository: this.typeOrmFeatureOrganizationRepository, - isCheckRelation: true, - foreignKeys: [{ column: 'featureId', repository: this.typeOrmFeatureRepository }] - }, - { - repository: this.typeOrmGoalRepository, - isCheckRelation: true, - foreignKeys: [ - { column: 'ownerTeamId', repository: this.typeOrmOrganizationTeamRepository }, - { column: 'ownerEmployeeId', repository: this.typeOrmEmployeeRepository }, - { column: 'leadId', repository: this.typeOrmEmployeeRepository } - ] - }, - /* - * Key Result & Related Entities - */ - { - repository: this.typeOrmKeyResultRepository, - isCheckRelation: true, - foreignKeys: [ - { column: 'projectId', repository: this.typeOrmOrganizationProjectRepository }, - { column: 'taskId', repository: this.typeOrmTaskRepository }, - { column: 'leadId', repository: this.typeOrmEmployeeRepository }, - { column: 'ownerId', repository: this.typeOrmEmployeeRepository }, - { column: 'goalId', repository: this.typeOrmGoalRepository } - ] - }, - { - repository: this.typeOrmKeyResultTemplateRepository - }, - { - repository: this.typeOrmKeyResultUpdateRepository - }, - /* - * Goal KPI & Related Entities - */ - { - repository: this.typeOrmGoalKPIRepository, - isCheckRelation: true, - foreignKeys: [{ column: 'leadId', repository: this.typeOrmEmployeeRepository }] - }, - { - repository: this.typeOrmGoalKPITemplateRepository, - isCheckRelation: true, - foreignKeys: [{ column: 'leadId', repository: this.typeOrmEmployeeRepository }] - }, - { - repository: this.typeOrmGoalTemplateRepository - }, - { - repository: this.typeOrmGoalTimeFrameRepository - }, - { - repository: this.typeOrmGoalGeneralSettingRepository - }, - /* - * Integration & Related Entities - */ - { - repository: this.typeOrmIntegrationTenantRepository - }, - { - repository: this.typeOrmIntegrationSettingRepository, - isCheckRelation: true, - foreignKeys: [{ column: 'integrationId', repository: this.typeOrmIntegrationTenantRepository }] - }, - { - repository: this.typeOrmIntegrationMapRepository, - isCheckRelation: true, - foreignKeys: [{ column: 'integrationId', repository: this.typeOrmIntegrationTenantRepository }] - }, - { - repository: this.typeOrmIntegrationEntitySettingRepository, - isCheckRelation: true, - foreignKeys: [{ column: 'integrationId', repository: this.typeOrmIntegrationTenantRepository }] - }, - { - repository: this.typeOrmIntegrationEntitySettingTiedRepository, - isCheckRelation: true, - foreignKeys: [ - { column: 'integrationEntitySettingId', repository: this.typeOrmIntegrationEntitySettingRepository } - ] - }, - /* - * Invite & Related Entities - */ - { - repository: this.typeOrmInviteRepository, - isCheckRelation: true, - foreignKeys: [ - { column: 'roleId', repository: this.typeOrmRoleRepository }, - { column: 'invitedByUserId', repository: this.typeOrmUserRepository }, - { column: 'organizationContactId', repository: this.typeOrmOrganizationContactRepository } - ], - relations: [ - { - joinTableName: 'invite_organization_contact', - foreignKeys: [ - { column: 'inviteId', repository: this.typeOrmEquipmentSharingRepository }, - { column: 'organizationContactId', repository: this.typeOrmOrganizationContactRepository } - ] - }, - { - joinTableName: 'invite_organization_department', - foreignKeys: [ - { column: 'inviteId', repository: this.typeOrmEquipmentSharingRepository }, - { - column: 'organizationDepartmentId', - repository: this.typeOrmOrganizationDepartmentRepository + return new Promise(async (resolve, reject) => { + const results: Organization[] = []; + const stream = fs.createReadStream(organizationsCsvPath, 'utf8').pipe(csv()); + stream.on('data', (data) => { + if (isNotEmpty(data)) results.push(data); + }); + stream.on('error', (error) => { + console.log(chalk.red(`Failed to parse CSV for table: organization`), error); + reject(error); + }); + stream.on('end', async () => { + try { + for await (const organizationId of results.map((el) => el.id)) { + const { record } = await this.commandBus.execute( + new ImportRecordFindOrFailCommand({ + tenantId: RequestContext.currentTenantId(), + sourceId: organizationId, + entityType: this.repositoriesService.typeOrmOrganizationRepository.metadata.tableName + }) + ); + + if (!record || !record['destinationId']) continue; + + const isAlreadyIn = await this.repositoriesService.typeOrmUserOrganizationRepository.findOne({ + where: { + userId, + organizationId: record['destinationId'] } - ] - }, - { - joinTableName: 'invite_organization_project', - foreignKeys: [ - { column: 'inviteId', repository: this.typeOrmEquipmentSharingRepository }, - { column: 'organizationProjectId', repository: this.typeOrmOrganizationProjectRepository } - ] + }); + + if (isAlreadyIn) continue; + + await this.repositoriesService.typeOrmUserOrganizationRepository.save({ + userId, + organizationId: record['destinationId'], + tenantId: RequestContext.currentTenantId() + }); } - ] - }, - { - repository: this.typeOrmOrganizationTeamEmployeeRepository, - isCheckRelation: true, - foreignKeys: [ - { column: 'organizationTeamId', repository: this.typeOrmOrganizationTeamRepository }, - { column: 'employeeId', repository: this.typeOrmEmployeeRepository }, - { column: 'roleId', repository: this.typeOrmRoleRepository } - ] - }, - /* - * Pipeline & Stage Entities - */ - { - repository: this.typeOrmPipelineRepository - }, - { - repository: this.typeOrmPipelineStageRepository, - isCheckRelation: true, - foreignKeys: [{ column: 'pipelineId', repository: this.typeOrmPipelineRepository }] - }, - { - repository: this.typeOrmDealRepository, - isCheckRelation: true, - foreignKeys: [ - { column: 'createdByUserId', repository: this.typeOrmUserRepository }, - { column: 'stageId', repository: this.typeOrmPipelineStageRepository }, - { column: 'clientId', repository: this.typeOrmOrganizationContactRepository } - ] - }, - /* - * Product & Related Entities - */ - { - repository: this.typeOrmProductCategoryRepository - }, - { - repository: this.typeOrmProductCategoryTranslationRepository, - isCheckRelation: true, - foreignKeys: [{ column: 'referenceId', repository: this.typeOrmProductCategoryRepository }] - }, - { - repository: this.typeOrmProductTypeRepository - }, - { - repository: this.typeOrmProductTypeTranslationRepository, - isCheckRelation: true, - foreignKeys: [{ column: 'referenceId', repository: this.typeOrmProductTypeRepository }] - }, - { - repository: this.typeOrmProductOptionGroupRepository - }, - { - repository: this.typeOrmProductOptionRepository, - isCheckRelation: true, - foreignKeys: [{ column: 'groupId', repository: this.typeOrmProductOptionGroupRepository }] - }, - { - repository: this.typeOrmProductOptionTranslationRepository, - isCheckRelation: true, - foreignKeys: [{ column: 'referenceId', repository: this.typeOrmProductOptionRepository }] - }, - { - repository: this.typeOrmProductOptionGroupTranslationRepository, - isCheckRelation: true, - foreignKeys: [{ column: 'referenceId', repository: this.typeOrmProductOptionGroupRepository }] - }, - { - repository: this.typeOrmImageAssetRepository - }, - { - repository: this.typeOrmProductRepository, - isCheckRelation: true, - foreignKeys: [ - { column: 'featuredImageId', repository: this.typeOrmImageAssetRepository }, - { column: 'typeId', repository: this.typeOrmProductTypeRepository }, - { column: 'categoryId', repository: this.typeOrmProductCategoryRepository } - ], - relations: [{ joinTableName: 'product_gallery_item' }] - }, - { - repository: this.typeOrmProductTranslationRepository, - isCheckRelation: true, - foreignKeys: [{ column: 'referenceId', repository: this.typeOrmProductRepository }] - }, - { - repository: this.typeOrmProductVariantPriceRepository, - isCheckRelation: true - }, - { - repository: this.typeOrmProductVariantSettingRepository - }, - { - repository: this.typeOrmProductVariantRepository, - isCheckRelation: true, - foreignKeys: [ - { column: 'productId', repository: this.typeOrmProductRepository }, - { column: 'imageId', repository: this.typeOrmImageAssetRepository }, - { column: 'priceId', repository: this.typeOrmProductVariantPriceRepository }, - { column: 'settingsId', repository: this.typeOrmProductVariantSettingRepository } - ], - relations: [{ joinTableName: 'product_variant_options_product_option' }] - }, - { - repository: this.typeOrmWarehouseRepository, - uniqueIdentifier: [{ column: 'email' }, { column: 'code' }], - isCheckRelation: true, - foreignKeys: [ - { column: 'logoId', repository: this.typeOrmImageAssetRepository }, - { column: 'contactId', repository: this.typeOrmContactRepository } - ] - }, - { - repository: this.typeOrmMerchantRepository, - uniqueIdentifier: [{ column: 'email' }, { column: 'code' }], - isCheckRelation: true, - foreignKeys: [ - { column: 'logoId', repository: this.typeOrmImageAssetRepository }, - { column: 'contactId', repository: this.typeOrmContactRepository } - ], - relations: [{ joinTableName: 'warehouse_merchant' }] - }, - { - repository: this.typeOrmWarehouseProductRepository, - isCheckRelation: true, - foreignKeys: [ - { column: 'warehouseId', repository: this.typeOrmWarehouseRepository }, - { column: 'productId', repository: this.typeOrmProductRepository } - ] - }, - { - repository: this.typeOrmWarehouseProductVariantRepository, - isCheckRelation: true, - foreignKeys: [ - { column: 'variantId', repository: this.typeOrmProductVariantRepository }, - { column: 'warehouseProductId', repository: this.typeOrmWarehouseProductRepository } - ] - }, - /* - * Payment & Related Entities - */ - { - repository: this.typeOrmPaymentRepository, - isCheckRelation: true, - foreignKeys: [ - { column: 'invoiceId', repository: this.typeOrmInvoiceRepository }, - { column: 'employeeId', repository: this.typeOrmEmployeeRepository }, - { column: 'recordedById', repository: this.typeOrmUserRepository }, - { column: 'projectId', repository: this.typeOrmOrganizationProjectRepository }, - { column: 'contactId', repository: this.typeOrmOrganizationContactRepository } - ] - }, - /* - * Request Approval & Related Entities - */ - { - repository: this.typeOrmRequestApprovalRepository, - isCheckRelation: true, - foreignKeys: [{ column: 'approvalPolicyId', repository: this.typeOrmApprovalPolicyRepository }] - }, - { - repository: this.typeOrmRequestApprovalEmployeeRepository, - isCheckRelation: true, - foreignKeys: [ - { column: 'requestApprovalId', repository: this.typeOrmRequestApprovalRepository }, - { column: 'employeeId', repository: this.typeOrmEmployeeRepository } - ] - }, - { - repository: this.typeOrmRequestApprovalTeamRepository, - isCheckRelation: true, - foreignKeys: [ - { column: 'requestApprovalId', repository: this.typeOrmRequestApprovalRepository }, - { column: 'teamId', repository: this.typeOrmOrganizationTeamRepository } - ] - }, - /* - * Tasks & Related Entities - */ - { - repository: this.typeOrmTaskRepository, - isCheckRelation: true, - foreignKeys: [ - { column: 'projectId', repository: this.typeOrmOrganizationProjectRepository }, - { column: 'createdByUserId', repository: this.typeOrmUserRepository }, - { column: 'organizationSprintId', repository: this.typeOrmOrganizationSprintRepository } - ], - relations: [{ joinTableName: 'task_employee' }, { joinTableName: 'task_team' }] - }, - /* - * Timeoff & Related Entities - */ - { - repository: this.typeOrmTimeOffPolicyRepository, - relations: [{ joinTableName: 'time_off_policy_employee' }] - }, - { - repository: this.typeOrmTimeOffRequestRepository, - isCheckRelation: true, - foreignKeys: [{ column: 'policyId', repository: this.typeOrmTimeOffPolicyRepository }], - relations: [{ joinTableName: 'time_off_request_employee' }] - }, - /* - * Timesheet & Related Entities - */ - { - repository: this.typeOrmTimesheetRepository, - isCheckRelation: true, - foreignKeys: [ - { column: 'employeeId', repository: this.typeOrmEmployeeRepository }, - { column: 'approvedById', repository: this.typeOrmEmployeeRepository } - ] - }, - { - repository: this.typeOrmTimeLogRepository, - isCheckRelation: true, - foreignKeys: [ - { column: 'employeeId', repository: this.typeOrmEmployeeRepository }, - { column: 'timesheetId', repository: this.typeOrmTimesheetRepository }, - { column: 'projectId', repository: this.typeOrmOrganizationProjectRepository }, - { column: 'taskId', repository: this.typeOrmTaskRepository }, - { column: 'organizationContactId', repository: this.typeOrmOrganizationContactRepository } - ], - relations: [{ joinTableName: 'time_slot_time_logs' }] - }, - { - repository: this.typeOrmTimeSlotRepository, - isCheckRelation: true, - foreignKeys: [{ column: 'employeeId', repository: this.typeOrmEmployeeRepository }] - }, - { - repository: this.typeOrmTimeSlotMinuteRepository, - isCheckRelation: true, - foreignKeys: [{ column: 'timeSlotId', repository: this.typeOrmTimeSlotRepository }] - }, - { - repository: this.typeOrmScreenshotRepository, - isCheckRelation: true, - foreignKeys: [{ column: 'timeSlotId', repository: this.typeOrmTimeSlotRepository }] - }, - { - repository: this.typeOrmActivityRepository, - isCheckRelation: true, - foreignKeys: [ - { column: 'employeeId', repository: this.typeOrmEmployeeRepository }, - { column: 'projectId', repository: this.typeOrmOrganizationProjectRepository }, - { column: 'timeSlotId', repository: this.typeOrmTimeSlotRepository }, - { column: 'taskId', repository: this.typeOrmTaskRepository } - ] - }, - /* - * Tag & Related Entities - */ - { - repository: this.typeOrmTagRepository, - relations: [ - { joinTableName: 'tag_candidate' }, - { joinTableName: 'tag_employee' }, - { joinTableName: 'tag_equipment' }, - { joinTableName: 'tag_event_type' }, - { joinTableName: 'tag_expense' }, - { joinTableName: 'tag_income' }, - { joinTableName: 'tag_integration' }, - { joinTableName: 'tag_invoice' }, - { joinTableName: 'tag_merchant' }, - { joinTableName: 'tag_organization_contact' }, - { joinTableName: 'tag_organization_department' }, - { joinTableName: 'tag_organization_employee_level' }, - { joinTableName: 'tag_organization_employment_type' }, - { joinTableName: 'tag_organization_expense_category' }, - { joinTableName: 'tag_organization_position' }, - { joinTableName: 'tag_organization_project' }, - { joinTableName: 'tag_organization_team' }, - { joinTableName: 'tag_organization_vendor' }, - { joinTableName: 'tag_organization' }, - { joinTableName: 'tag_payment' }, - { joinTableName: 'tag_product' }, - { joinTableName: 'tag_proposal' }, - { joinTableName: 'tag_request_approval' }, - { joinTableName: 'tag_task' }, - { joinTableName: 'tag_warehouse' } - ] - }, - ...this.dynamicEntitiesClassMap - ] as IRepositoryModel[]; + } catch (error) { + console.log(chalk.red('Failed to add the current user to imported organization', error)); + reject(error); + } + resolve(true); + }); + }); } } diff --git a/packages/core/src/lib/export-import/repositories/repositories.service.ts b/packages/core/src/lib/export-import/repositories/repositories.service.ts new file mode 100644 index 00000000000..aa59cd416b3 --- /dev/null +++ b/packages/core/src/lib/export-import/repositories/repositories.service.ts @@ -0,0 +1,1855 @@ +import { Injectable, OnModuleInit } from '@nestjs/common'; +import { InjectRepository } from '@nestjs/typeorm'; +import { CommandBus } from '@nestjs/cqrs'; +import { IsNull, Repository } from 'typeorm'; +import { camelCase } from 'typeorm/util/StringUtils'; +import { ColumnMetadata } from 'typeorm/metadata/ColumnMetadata'; +import * as fs from 'fs'; +import * as unzipper from 'unzipper'; +import * as csv from 'csv-parser'; +import * as rimraf from 'rimraf'; +import * as path from 'path'; +import * as chalk from 'chalk'; +import { ConfigService } from '@gauzy/config'; +import { getEntitiesFromPlugins } from '@gauzy/plugin'; +import { isEmpty, isFunction, isNotEmpty } from '@gauzy/utils'; +import { ConnectionEntityManager } from '../../database/connection-entity-manager'; +import { convertToDatetime } from '../../core/utils'; +import { FileStorage } from '../../core/file-storage'; +import { + AccountingTemplate, + Activity, + ActivityLog, + AppointmentEmployee, + ApprovalPolicy, + AvailabilitySlot, + Candidate, + CandidateCriterionsRating, + CandidateDocument, + CandidateEducation, + CandidateExperience, + CandidateFeedback, + CandidateInterview, + CandidateInterviewers, + CandidatePersonalQualities, + CandidateSkill, + CandidateSource, + CandidateTechnologies, + Comment, + Contact, + Country, + Currency, + CustomSmtp, + DailyPlan, + Dashboard, + DashboardWidget, + Deal, + EmailHistory, + EmailReset, + EmailTemplate, + Employee, + EmployeeAppointment, + EmployeeAvailability, + EmployeeAward, + EmployeeLevel, + EmployeeNotification, + EmployeeNotificationSetting, + EmployeePhone, + EmployeeRecurringExpense, + EmployeeSetting, + EntitySubscription, + Equipment, + EquipmentSharing, + EquipmentSharingPolicy, + EstimateEmail, + EventType, + Expense, + ExpenseCategory, + Favorite, + Feature, + FeatureOrganization, + Goal, + GoalGeneralSetting, + GoalKPI, + GoalKPITemplate, + GoalTemplate, + GoalTimeFrame, + ImageAsset, + ImportHistory, + Income, + Integration, + IntegrationEntitySetting, + IntegrationEntitySettingTied, + IntegrationMap, + IntegrationSetting, + IntegrationTenant, + IntegrationType, + Invite, + Invoice, + InvoiceEstimateHistory, + InvoiceItem, + IssueType, + KeyResult, + KeyResultTemplate, + KeyResultUpdate, + Language, + Mention, + Merchant, + Organization, + OrganizationAward, + OrganizationContact, + OrganizationDepartment, + OrganizationDocument, + OrganizationEmploymentType, + OrganizationLanguage, + OrganizationPosition, + OrganizationProject, + OrganizationProjectEmployee, + OrganizationProjectModule, + OrganizationProjectModuleEmployee, + OrganizationRecurringExpense, + OrganizationSprint, + OrganizationSprintEmployee, + OrganizationSprintTask, + OrganizationSprintTaskHistory, + OrganizationTaskSetting, + OrganizationTeam, + OrganizationTeamEmployee, + OrganizationTeamJoinRequest, + OrganizationVendor, + Payment, + Pipeline, + PipelineStage, + Product, + ProductCategory, + ProductCategoryTranslation, + ProductOption, + ProductOptionGroup, + ProductOptionGroupTranslation, + ProductOptionTranslation, + ProductTranslation, + ProductType, + ProductTypeTranslation, + ProductVariant, + ProductVariantPrice, + ProductVariantSetting, + Reaction, + Report, + ReportCategory, + ReportOrganization, + RequestApproval, + RequestApprovalEmployee, + RequestApprovalTeam, + ResourceLink, + Role, + RolePermission, + ScreeningTask, + Screenshot, + Skill, + SocialAccount, + Tag, + TagType, + Task, + TaskEstimation, + TaskLinkedIssue, + TaskPriority, + TaskRelatedIssueType, + TaskSize, + TaskStatus, + TaskVersion, + TaskView, + Tenant, + TenantSetting, + TimeLog, + TimeOffPolicy, + TimeOffRequest, + Timesheet, + TimeSlot, + TimeSlotMinute, + User, + UserOrganization, + Warehouse, + WarehouseProduct, + WarehouseProductVariant +} from '../../core/entities/internal'; +import { RequestContext } from '../../core'; +import { ImportRecord, ImportRecordFindOrFailCommand, ImportRecordUpdateOrCreateCommand } from '../import-record'; +import { MikroOrmAccountingTemplateRepository } from '../../accounting-template/repository/mikro-orm-accounting-template.repository'; +import { TypeOrmAccountingTemplateRepository } from '../../accounting-template/repository/type-orm-accounting-template.repository'; +import { MikroOrmAppointmentEmployeeRepository } from '../../appointment-employees/repository/mikro-orm-appointment-employee.repository'; +import { TypeOrmAppointmentEmployeeRepository } from '../../appointment-employees/repository/type-orm-appointment-employee.repository'; +import { MikroOrmApprovalPolicyRepository } from '../../approval-policy/repository/mikro-orm-approval-policy.repository'; +import { TypeOrmApprovalPolicyRepository } from '../../approval-policy/repository/type-orm-approval-policy.repository'; +import { MikroOrmAvailabilitySlotRepository } from '../../availability-slots/repository/mikro-orm-availability-slot.repository'; +import { TypeOrmAvailabilitySlotRepository } from '../../availability-slots/repository/type-orm-availability-slot.repository'; +import { MikroOrmCandidateCriterionsRatingRepository } from '../../candidate-criterions-rating/repository/mikro-orm-candidate-criterions-rating.repository'; +import { TypeOrmCandidateCriterionsRatingRepository } from '../../candidate-criterions-rating/repository/type-orm-candidate-criterions-rating.repository'; +import { MikroOrmCandidateDocumentRepository } from '../../candidate-documents/repository/mikro-orm-candidate-document.repository'; +import { TypeOrmCandidateDocumentRepository } from '../../candidate-documents/repository/type-orm-candidate-document.repository'; +import { MikroOrmCandidateEducationRepository } from '../../candidate-education/repository/mikro-orm-candidate-education.repository'; +import { TypeOrmCandidateEducationRepository } from '../../candidate-education/repository/type-orm-candidate-education.repository'; +import { MikroOrmCandidateExperienceRepository } from '../../candidate-experience/repository/mikro-orm-candidate-experience.repository'; +import { TypeOrmCandidateExperienceRepository } from '../../candidate-experience/repository/type-orm-candidate-experience.repository'; +import { MikroOrmCandidateFeedbackRepository } from '../../candidate-feedbacks/repository/mikro-orm-candidate-feedback.repository'; +import { TypeOrmCandidateFeedbackRepository } from '../../candidate-feedbacks/repository/type-orm-candidate-feedback.repository'; +import { MikroOrmCandidateInterviewRepository } from '../../candidate-interview/repository/mikro-orm-candidate-interview.repository'; +import { TypeOrmCandidateInterviewRepository } from '../../candidate-interview/repository/type-orm-candidate-interview.repository'; +import { MikroOrmCandidateInterviewersRepository } from '../../candidate-interviewers/repository/mikro-orm-candidate-interviewers.repository'; +import { TypeOrmCandidateInterviewersRepository } from '../../candidate-interviewers/repository/type-orm-candidate-interviewers.repository'; +import { MikroOrmCandidatePersonalQualitiesRepository } from '../../candidate-personal-qualities/repository/mikro-orm-candidate-personal-qualities.repository'; +import { TypeOrmCandidatePersonalQualitiesRepository } from '../../candidate-personal-qualities/repository/type-orm-candidate-personal-qualities.repository'; +import { MikroOrmCandidateSkillRepository } from '../../candidate-skill/repository/mikro-orm-candidate-skill.repository'; +import { TypeOrmCandidateSkillRepository } from '../../candidate-skill/repository/type-orm-candidate-skill.repository'; +import { MikroOrmCandidateSourceRepository } from '../../candidate-source/repository/mikro-orm-candidate-source.repository'; +import { TypeOrmCandidateSourceRepository } from '../../candidate-source/repository/type-orm-candidate-source.repository'; +import { MikroOrmCandidateTechnologiesRepository } from '../../candidate-technologies/repository/mikro-orm-candidate-technologies.repository'; +import { TypeOrmCandidateTechnologiesRepository } from '../../candidate-technologies/repository/type-orm-candidate-technologies.repository'; +import { MikroOrmCandidateRepository } from '../../candidate/repository/mikro-orm-candidate.repository'; +import { TypeOrmCandidateRepository } from '../../candidate/repository/type-orm-candidate.repository'; +import { MikroOrmContactRepository } from '../../contact/repository/mikro-orm-contact.repository'; +import { TypeOrmContactRepository } from '../../contact/repository/type-orm-contact.repository'; +import { MikroOrmCustomSmtpRepository } from '../../custom-smtp/repository/mikro-orm-custom-smtp.repository'; +import { TypeOrmCustomSmtpRepository } from '../../custom-smtp/repository/type-orm-custom-smtp.repository'; +import { MikroOrmDealRepository } from '../../deal/repository/mikro-orm-deal.repository'; +import { TypeOrmDealRepository } from '../../deal/repository/type-orm-deal.repository'; +import { MikroOrmEmailHistoryRepository } from '../../email-history/repository/mikro-orm-email-history.repository'; +import { TypeOrmEmailHistoryRepository } from '../../email-history/repository/type-orm-email-history.repository'; +import { MikroOrmEmailTemplateRepository } from '../../email-template/repository/mikro-orm-email-template.repository'; +import { TypeOrmEmailTemplateRepository } from '../../email-template/repository/type-orm-email-template.repository'; +import { MikroOrmEmployeeAppointmentRepository } from '../../employee-appointment/repository/mikro-orm-employee-appointment.repository'; +import { TypeOrmEmployeeAppointmentRepository } from '../../employee-appointment/repository/type-orm-employee-appointment.repository'; +import { MikroOrmEmployeeAwardRepository } from '../../employee-award/repository/mikro-orm-employee-award.repository'; +import { TypeOrmEmployeeAwardRepository } from '../../employee-award/repository/type-orm-employee-award.repository'; +import { MikroOrmEmployeeLevelRepository } from '../../employee-level/repository/mikro-orm-employee-level.repository'; +import { TypeOrmEmployeeLevelRepository } from '../../employee-level/repository/type-orm-employee-level.repository'; +import { MikroOrmEmployeeRecurringExpenseRepository } from '../../employee-recurring-expense/repository/mikro-orm-employee-recurring-expense.repository'; +import { TypeOrmEmployeeRecurringExpenseRepository } from '../../employee-recurring-expense/repository/type-orm-employee-recurring-expense.repository'; +import { MikroOrmEmployeeSettingRepository } from '../../employee-setting/repository/mikro-orm-employee-setting.repository'; +import { TypeOrmEmployeeSettingRepository } from '../../employee-setting/repository/type-orm-employee-setting.repository'; +import { MikroOrmEmployeeRepository } from '../../employee/repository/mikro-orm-employee.repository'; +import { TypeOrmEmployeeRepository } from '../../employee/repository/type-orm-employee.repository'; +import { MikroOrmEquipmentSharingPolicyRepository } from '../../equipment-sharing-policy/repository/mikro-orm-equipment-sharing-policy.repository'; +import { TypeOrmEquipmentSharingPolicyRepository } from '../../equipment-sharing-policy/repository/type-orm-equipment-sharing-policy.repository'; +import { MikroOrmEquipmentSharingRepository } from '../../equipment-sharing/repository/mikro-orm-equipment-sharing.repository'; +import { TypeOrmEquipmentSharingRepository } from '../../equipment-sharing/repository/type-orm-equipment-sharing.repository'; +import { MikroOrmEquipmentRepository } from '../../equipment/repository/mikro-orm-equipment.repository'; +import { TypeOrmEquipmentRepository } from '../../equipment/repository/type-orm-equipment.repository'; +import { MikroOrmEstimateEmailRepository } from '../../estimate-email/repository/mikro-orm-estimate-email.repository'; +import { TypeOrmEstimateEmailRepository } from '../../estimate-email/repository/type-orm-estimate-email.repository'; +import { MikroOrmEventTypeRepository } from '../../event-types/repository/mikro-orm-event-type.repository'; +import { TypeOrmEventTypeRepository } from '../../event-types/repository/type-orm-event-types.repository'; +import { MikroOrmExpenseCategoryRepository } from '../../expense-categories/repository/mikro-orm-expense-category.repository'; +import { TypeOrmExpenseCategoryRepository } from '../../expense-categories/repository/type-orm-expense-category.repository'; +import { MikroOrmExpenseRepository } from '../../expense/repository/mikro-orm-expense.repository'; +import { TypeOrmExpenseRepository } from '../../expense/repository/type-orm-expense.repository'; +import { MikroOrmFeatureOrganizationRepository } from '../../feature/repository/mikro-orm-feature-organization.repository'; +import { MikroOrmFeatureRepository } from '../../feature/repository/mikro-orm-feature.repository'; +import { TypeOrmFeatureRepository } from '../../feature/repository/type-orm-feature.repository'; +import { TypeOrmFeatureOrganizationRepository } from '../../feature/repository/type-orm-feature-organization.repository'; +import { MikroOrmGoalGeneralSettingRepository } from '../../goal-general-setting/repository/mikro-orm-goal-general-setting.repository'; +import { TypeOrmGoalGeneralSettingRepository } from '../../goal-general-setting/repository/type-orm-goal-general-setting.repository'; +import { MikroOrmGoalKPITemplateRepository } from '../../goal-kpi-template/repository/mikro-orm-goal-kpi-template.repository'; +import { TypeOrmGoalKPITemplateRepository } from '../../goal-kpi-template/repository/type-orm-goal-kpi-template.repository'; +import { MikroOrmGoalKPIRepository } from '../../goal-kpi/repository/mikro-orm-goal-kpi.repository'; +import { TypeOrmGoalKPIRepository } from '../../goal-kpi/repository/type-orm-goal-kpi.repository'; +import { MikroOrmGoalTemplateRepository } from '../../goal-template/repository/mikro-orm-goal-template.repository'; +import { TypeOrmGoalTemplateRepository } from '../../goal-template/repository/type-orm-goal-template.repository'; +import { MikroOrmGoalTimeFrameRepository } from '../../goal-time-frame/repository/mikro-orm-goal-time-frame.repository'; +import { TypeOrmGoalTimeFrameRepository } from '../../goal-time-frame/repository/type-orm-goal-time-frame.repository'; +import { MikroOrmGoalRepository } from '../../goal/repository/mikro-orm-goal.repository'; +import { TypeOrmGoalRepository } from '../../goal/repository/type-orm-goal.repository'; +import { MikroOrmImageAssetRepository } from '../../image-asset/repository/mikro-orm-image-asset.repository'; +import { TypeOrmImageAssetRepository } from '../../image-asset/repository/type-orm-image-asset.repository'; +import { MikroOrmIncomeRepository } from '../../income/repository/mikro-orm-income.repository'; +import { TypeOrmIncomeRepository } from '../../income/repository/type-orm-income.repository'; +import { MikroOrmIntegrationEntitySettingTiedRepository } from '../../integration-entity-setting-tied/repository/mikro-orm-integration-entity-setting-tied.repository'; +import { TypeOrmIntegrationEntitySettingTiedRepository } from '../../integration-entity-setting-tied/repository/type-orm-integration-entity-setting-tied.repository'; +import { MikroOrmIntegrationEntitySettingRepository } from '../../integration-entity-setting/repository/mikro-orm-integration-entity-setting.repository'; +import { TypeOrmIntegrationEntitySettingRepository } from '../../integration-entity-setting/repository/type-orm-integration-entity-setting.repository'; +import { MikroOrmIntegrationMapRepository } from '../../integration-map/repository/mikro-orm-integration-map.repository'; +import { TypeOrmIntegrationMapRepository } from '../../integration-map/repository/type-orm-integration-map.repository'; +import { MikroOrmIntegrationSettingRepository } from '../../integration-setting/repository/mikro-orm-integration-setting.repository'; +import { TypeOrmIntegrationSettingRepository } from '../../integration-setting/repository/type-orm-integration-setting.repository'; +import { MikroOrmIntegrationTenantRepository } from '../../integration-tenant/repository/mikro-orm-integration-tenant.repository'; +import { TypeOrmIntegrationTenantRepository } from '../../integration-tenant/repository/type-orm-integration-tenant.repository'; +import { MikroOrmIntegrationTypeRepository } from '../../integration/repository/mikro-orm-integration-type.repository'; +import { MikroOrmIntegrationRepository } from '../../integration/repository/mikro-orm-integration.repository'; +import { TypeOrmIntegrationTypeRepository } from '../../integration/repository/type-orm-integration-type.repository'; +import { TypeOrmIntegrationRepository } from '../../integration/repository/type-orm-integration.repository'; +import { MikroOrmInviteRepository } from '../../invite/repository/mikro-orm-invite.repository'; +import { TypeOrmInviteRepository } from '../../invite/repository/type-orm-invite.repository'; +import { MikroOrmInvoiceEstimateHistoryRepository } from '../../invoice-estimate-history/repository/mikro-orm-invoice-estimate-history.repository'; +import { TypeOrmInvoiceEstimateHistoryRepository } from '../../invoice-estimate-history/repository/type-orm-invoice-estimate-history.repository'; +import { MikroOrmInvoiceItemRepository } from '../../invoice-item/repository/mikro-orm-invoice-item.repository'; +import { TypeOrmInvoiceItemRepository } from '../../invoice-item/repository/type-orm-invoice-item.repository'; +import { MikroOrmInvoiceRepository } from '../../invoice/repository/mikro-orm-invoice.repository'; +import { TypeOrmInvoiceRepository } from '../../invoice/repository/type-orm-invoice.repository'; +import { MikroOrmKeyResultTemplateRepository } from '../../keyresult-template/repository/mikro-orm-keyresult-template.repository'; +import { TypeOrmKeyResultTemplateRepository } from '../../keyresult-template/repository/type-orm-keyresult-template.repository'; +import { MikroOrmKeyResultUpdateRepository } from '../../keyresult-update/repository/mikro-orm-keyresult-update.repository'; +import { TypeOrmKeyResultUpdateRepository } from '../../keyresult-update/repository/type-orm-keyresult-update.repository'; +import { MikroOrmKeyResultRepository } from '../../keyresult/repository/mikro-orm-keyresult.repository'; +import { TypeOrmKeyResultRepository } from '../../keyresult/repository/type-orm-keyresult.repository'; +import { MikroOrmLanguageRepository } from '../../language/repository/mikro-orm-language.repository'; +import { TypeOrmLanguageRepository } from '../../language/repository/type-orm-language.repository'; +import { MikroOrmMerchantRepository } from '../../merchant/repository/mikro-orm-merchant.repository'; +import { TypeOrmMerchantRepository } from '../../merchant/repository/type-orm-merchant.repository'; +import { MikroOrmOrganizationAwardRepository } from '../../organization-award/repository/mikro-orm-organization-award.repository'; +import { TypeOrmOrganizationAwardRepository } from '../../organization-award/repository/type-orm-organization-award.repository'; +import { MikroOrmOrganizationContactRepository } from '../../organization-contact/repository/mikro-orm-organization-contact.repository'; +import { TypeOrmOrganizationContactRepository } from '../../organization-contact/repository/type-orm-organization-contact.repository'; +import { MikroOrmOrganizationDepartmentRepository } from '../../organization-department/repository/mikro-orm-organization-department.repository'; +import { TypeOrmOrganizationDepartmentRepository } from '../../organization-department/repository/type-orm-organization-department.repository'; +import { MikroOrmOrganizationDocumentRepository } from '../../organization-document/repository/mikro-orm-organization-document.repository'; +import { TypeOrmOrganizationDocumentRepository } from '../../organization-document/repository/type-orm-organization-document.repository'; +import { MikroOrmOrganizationEmploymentTypeRepository } from '../../organization-employment-type/repository/mikro-orm-organization-employment-type.repository'; +import { TypeOrmOrganizationEmploymentTypeRepository } from '../../organization-employment-type/repository/type-orm-organization-employment-type.repository'; +import { MikroOrmOrganizationLanguageRepository } from '../../organization-language/repository/mikro-orm-organization-language.repository'; +import { TypeOrmOrganizationLanguageRepository } from '../../organization-language/repository/type-orm-organization-language.repository'; +import { MikroOrmOrganizationPositionRepository } from '../../organization-position/repository/mikro-orm-organization-position.repository'; +import { TypeOrmOrganizationPositionRepository } from '../../organization-position/repository/type-orm-organization-position.repository'; +import { MikroOrmOrganizationProjectRepository } from '../../organization-project/repository/mikro-orm-organization-project.repository'; +import { TypeOrmOrganizationProjectRepository } from '../../organization-project/repository/type-orm-organization-project.repository'; +import { MikroOrmOrganizationRecurringExpenseRepository } from '../../organization-recurring-expense/repository/mikro-orm-organization-recurring-expense.repository'; +import { TypeOrmOrganizationRecurringExpenseRepository } from '../../organization-recurring-expense/repository/type-orm-organization-recurring-expense.repository'; +import { MikroOrmOrganizationSprintRepository } from '../../organization-sprint/repository/mikro-orm-organization-sprint.repository'; +import { TypeOrmOrganizationSprintRepository } from '../../organization-sprint/repository/type-orm-organization-sprint.repository'; +import { MikroOrmOrganizationTeamEmployeeRepository } from '../../organization-team-employee/repository/mikro-orm-organization-team-employee.repository'; +import { TypeOrmOrganizationTeamEmployeeRepository } from '../../organization-team-employee/repository/type-orm-organization-team-employee.repository'; +import { MikroOrmOrganizationTeamRepository } from '../../organization-team/repository/mikro-orm-organization-team.repository'; +import { TypeOrmOrganizationTeamRepository } from '../../organization-team/repository/type-orm-organization-team.repository'; +import { MikroOrmOrganizationVendorRepository } from '../../organization-vendor/repository/mikro-orm-organization-vendor.repository'; +import { TypeOrmOrganizationVendorRepository } from '../../organization-vendor/repository/type-orm-organization-vendor.repository'; +import { MikroOrmOrganizationRepository } from '../../organization/repository/mikro-orm-organization.repository'; +import { TypeOrmOrganizationRepository } from '../../organization/repository/type-orm-organization.repository'; +import { MikroOrmPaymentRepository } from '../../payment/repository/mikro-orm-payment.repository'; +import { TypeOrmPaymentRepository } from '../../payment/repository/type-orm-payment.repository'; +import { MikroOrmPipelineStageRepository } from '../../pipeline-stage/repository/mikro-orm-pipeline-stage.repository'; +import { TypeOrmPipelineStageRepository } from '../../pipeline-stage/repository/type-orm-pipeline-stage.repository'; +import { MikroOrmPipelineRepository } from '../../pipeline/repository/mikro-orm-pipeline.repository'; +import { TypeOrmPipelineRepository } from '../../pipeline/repository/type-orm-pipeline.repository'; +import { MikroOrmProductCategoryTranslationRepository } from '../../product-category/repository/mikro-orm-product-category-translation.repository'; +import { MikroOrmProductCategoryRepository } from '../../product-category/repository/mikro-orm-product-category.repository'; +import { TypeOrmProductCategoryTranslationRepository } from '../../product-category/repository/type-orm-product-category-translation.repository'; +import { TypeOrmProductCategoryRepository } from '../../product-category/repository/type-orm-product-category.repository'; +import { MikroOrmProductOptionGroupTranslationRepository } from '../../product-option/repository/mikro-orm-product-option-group-translation.repository'; +import { MikroOrmProductOptionGroupRepository } from '../../product-option/repository/mikro-orm-product-option-group.repository'; +import { MikroOrmProductOptionTranslationRepository } from '../../product-option/repository/mikro-orm-product-option-translation.repository'; +import { MikroOrmProductOptionRepository } from '../../product-option/repository/mikro-orm-product-option.repository'; +import { TypeOrmProductOptionGroupTranslationRepository } from '../../product-option/repository/type-orm-product-option-group-translation.repository'; +import { TypeOrmProductOptionGroupRepository } from '../../product-option/repository/type-orm-product-option-group.repository'; +import { TypeOrmProductOptionTranslationRepository } from '../../product-option/repository/type-orm-product-option-translation.repository'; +import { TypeOrmProductOptionRepository } from '../../product-option/repository/type-orm-product-option.repository'; +import { MikroOrmProductVariantSettingRepository } from '../../product-setting/repository/mikro-orm-product-setting.repository'; +import { TypeOrmProductVariantSettingRepository } from '../../product-setting/repository/type-orm-product-setting.repository'; +import { MikroOrmProductTypeTranslationRepository } from '../../product-type/repository/mikro-orm-product-type-translation.repository'; +import { MikroOrmProductTypeRepository } from '../../product-type/repository/mikro-orm-product-type.repository'; +import { TypeOrmProductTypeTranslationRepository } from '../../product-type/repository/type-orm-product-type-translation.repository'; +import { TypeOrmProductTypeRepository } from '../../product-type/repository/type-orm-product-type.repository'; +import { MikroOrmProductVariantPriceRepository } from '../../product-variant-price/repository/mikro-orm-product-variant-price.repository'; +import { TypeOrmProductVariantPriceRepository } from '../../product-variant-price/repository/type-orm-product-variant-price.repository'; +import { MikroOrmProductVariantRepository } from '../../product-variant/repository/mikro-orm-product-variant.repository'; +import { TypeOrmProductVariantRepository } from '../../product-variant/repository/type-orm-product-variant.repository'; +import { MikroOrmProductTranslationRepository } from '../../product/repository/mikro-orm-product-translation.repository'; +import { MikroOrmProductRepository } from '../../product/repository/mikro-orm-product.repository'; +import { TypeOrmProductTranslationRepository } from '../../product/repository/type-orm-product-translation.repository'; +import { TypeOrmProductRepository } from '../../product/repository/type-orm-product.repository'; +import { MikroOrmReportCategoryRepository } from '../../reports/repository/mikro-orm-report-category.repository'; +import { MikroOrmReportOrganizationRepository } from '../../reports/repository/mikro-orm-report-organization.repository'; +import { MikroOrmReportRepository } from '../../reports/repository/mikro-orm-report.repository'; +import { TypeOrmReportCategoryRepository } from '../../reports/repository/type-orm-report-category.repository'; +import { TypeOrmReportOrganizationRepository } from '../../reports/repository/type-orm-report-organization.repository'; +import { TypeOrmReportRepository } from '../../reports/repository/type-orm-report.repository'; +import { MikroOrmRequestApprovalEmployeeRepository } from '../../request-approval-employee/repository/mikro-orm-request-approval-employee.repository'; +import { TypeOrmRequestApprovalEmployeeRepository } from '../../request-approval-employee/repository/type-orm-request-approval-employee.repository'; +import { MikroOrmRequestApprovalTeamRepository } from '../../request-approval-team/repository/mikro-orm-request-approval-team.repository'; +import { TypeOrmRequestApprovalTeamRepository } from '../../request-approval-team/repository/type-orm-request-approval-team.repository'; +import { MikroOrmRequestApprovalRepository } from '../../request-approval/repository/mikro-orm-request-approval.repository'; +import { TypeOrmRequestApprovalRepository } from '../../request-approval/repository/type-orm-request-approval.repository'; +import { MikroOrmRolePermissionRepository } from '../../role-permission/repository/mikro-orm-role-permission.repository'; +import { TypeOrmRolePermissionRepository } from '../../role-permission/repository/type-orm-role-permission.repository'; +import { MikroOrmRoleRepository } from '../../role/repository/mikro-orm-role.repository'; +import { TypeOrmRoleRepository } from '../../role/repository/type-orm-role.repository'; +import { MikroOrmSkillRepository } from '../../skills/repository/mikro-orm-skill.repository'; +import { TypeOrmSkillRepository } from '../../skills/repository/type-orm-skill.repository'; +import { MikroOrmTagRepository } from '../../tags/repository/mikro-orm-tag.repository'; +import { TypeOrmTagRepository } from '../../tags/repository/type-orm-tag.repository'; +import { MikroOrmTaskRepository } from '../../tasks/repository/mikro-orm-task.repository'; +import { TypeOrmTaskRepository } from '../../tasks/repository/type-orm-task.repository'; +import { MikroOrmTenantSettingRepository } from '../../tenant/tenant-setting/repository/mikro-orm-tenant-setting.repository'; +import { TypeOrmTenantSettingRepository } from '../../tenant/tenant-setting/repository/type-orm-tenant-setting.repository'; +import { MikroOrmTimeOffPolicyRepository } from '../../time-off-policy/repository/mikro-orm-time-off-policy.repository'; +import { TypeOrmTimeOffPolicyRepository } from '../../time-off-policy/repository/type-orm-time-off-policy.repository'; +import { MikroOrmTimeOffRequestRepository } from '../../time-off-request/repository/mikro-orm-time-off-request.repository'; +import { TypeOrmTimeOffRequestRepository } from '../../time-off-request/repository/type-orm-time-off-request.repository'; +import { MikroOrmActivityRepository } from '../../time-tracking/activity/repository/mikro-orm-activity.repository'; +import { TypeOrmActivityRepository } from '../../time-tracking/activity/repository/type-orm-activity.repository'; +import { MikroOrmScreenshotRepository } from '../../time-tracking/screenshot/repository/mikro-orm-screenshot.repository'; +import { TypeOrmScreenshotRepository } from '../../time-tracking/screenshot/repository/type-orm-screenshot.repository'; +import { MikroOrmTimeLogRepository } from '../../time-tracking/time-log/repository/mikro-orm-time-log.repository'; +import { TypeOrmTimeLogRepository } from '../../time-tracking/time-log/repository/type-orm-time-log.repository'; +import { MikroOrmTimeSlotMinuteRepository } from '../../time-tracking/time-slot/repository/mikro-orm-time-slot-minute.repository'; +import { MikroOrmTimeSlotRepository } from '../../time-tracking/time-slot/repository/mikro-orm-time-slot.repository'; +import { TypeOrmTimeSlotMinuteRepository } from '../../time-tracking/time-slot/repository/type-orm-time-slot-minute.repository'; +import { TypeOrmTimeSlotRepository } from '../../time-tracking/time-slot/repository/type-orm-time-slot.repository'; +import { MikroOrmTimesheetRepository } from '../../time-tracking/timesheet/repository/mikro-orm-timesheet.repository'; +import { TypeOrmTimesheetRepository } from '../../time-tracking/timesheet/repository/type-orm-timesheet.repository'; +import { MikroOrmUserOrganizationRepository } from '../../user-organization/repository/mikro-orm-user-organization.repository'; +import { TypeOrmUserOrganizationRepository } from '../../user-organization/repository/type-orm-user-organization.repository'; +import { MikroOrmUserRepository } from '../../user/repository/mikro-orm-user.repository'; +import { TypeOrmUserRepository } from '../../user/repository/type-orm-user.repository'; +import { MikroOrmWarehouseProductVariantRepository } from '../../warehouse/repository/mikro-orm-warehouse-product-variant.repository'; +import { MikroOrmWarehouseProductRepository } from '../../warehouse/repository/mikro-orm-warehouse-product.repository '; +import { MikroOrmWarehouseRepository } from '../../warehouse/repository/mikro-orm-warehouse.repository'; +import { TypeOrmWarehouseProductVariantRepository } from '../../warehouse/repository/type-orm-warehouse-product-variant.repository'; +import { TypeOrmWarehouseProductRepository } from '../../warehouse/repository/type-orm-warehouse-product.repository '; +import { TypeOrmWarehouseRepository } from '../../warehouse/repository/type-orm-warehouse.repository'; +import { TypeOrmTagTypeRepository } from '../../tag-type/repository/type-orm-tag-type.repository'; +import { TypeOrmTenantRepository } from '../../tenant/repository/type-orm-tenant.repository'; +import { TypeOrmActivityLogRepository } from '../../activity-log/repository/type-orm-activity-log.repository'; +import { TypeOrmSocialAccountRepository } from '../../auth/social-account/repository/type-orm-social-account.repository'; +import { TypeOrmCommentRepository } from '../../comment/repository/type-orm-comment.repository'; +import { TypeOrmEmailResetRepository } from '../../email-reset/repository/type-orm-email-reset.repository'; +import { TypeOrmEmployeeAvailabilityRepository } from '../../employee-availability/repository/type-orm-employee-availability.repository'; +import { TypeOrmEmployeeNotificationSettingRepository } from '../../employee-notification-setting/repository/type-orm-employee-notification-setting.repository'; +import { TypeOrmEmployeeNotificationRepository } from '../../employee-notification/repository/type-orm-employee-notification.repository'; +import { TypeOrmEmployeePhoneRepository } from '../../employee-phone/repository/type-orm-employee-phone.repository'; +import { TypeOrmEntitySubscriptionRepository } from '../../entity-subscription/repository/type-orm-entity-subscription.repository'; +import { TypeOrmFavoriteRepository } from '../../favorite/repository/type-orm-favorite.repository'; +import { TypeOrmMentionRepository } from '../../mention/repository/type-orm-mention.repository'; +import { TypeOrmOrganizationProjectModuleEmployeeRepository } from '../../organization-project-module/repository/type-orm-organization-project-module-employee.repository'; +import { TypeOrmOrganizationProjectModuleRepository } from '../../organization-project-module/repository/type-orm-organization-project-module.repository'; +import { TypeOrmOrganizationProjectEmployeeRepository } from '../../organization-project/repository/type-orm-organization-project-employee.repository'; +import { TypeOrmOrganizationSprintEmployeeRepository } from '../../organization-sprint/repository/type-orm-organization-sprint-employee.repository'; +import { TypeOrmOrganizationSprintTaskHistoryRepository } from '../../organization-sprint/repository/type-orm-organization-sprint-task-history.repository'; +import { TypeOrmOrganizationSprintTaskRepository } from '../../organization-sprint/repository/type-orm-organization-sprint-task.repository'; +import { TypeOrmOrganizationTaskSettingRepository } from '../../organization-task-setting/repository/type-orm-organization-task-setting.repository'; +import { TypeOrmOrganizationTeamJoinRequestRepository } from '../../organization-team-join-request/repository/type-orm-organization-team-join-request.repository'; +import { TypeOrmReactionRepository } from '../../reaction/repository/type-orm-reaction.repository'; +import { TypeOrmResourceLinkRepository } from '../../resource-link/repository/type-orm-resource-link.repository'; +import { TypeOrmDailyPlanRepository } from '../../tasks/daily-plan/repository/type-orm-daily-plan.repository'; +import { TypeOrmTaskEstimationRepository } from '../../tasks/estimation/repository/type-orm-estimation.repository'; +import { TypeOrmIssueTypeRepository } from '../../tasks/issue-type/repository/type-orm-issue-type.repository'; +import { TypeOrmTaskLinkedIssueRepository } from '../../tasks/linked-issue/repository/type-orm-linked-issue.repository'; +import { TypeOrmTaskPriorityRepository } from '../../tasks/priorities/repository/type-orm-task-priority.repository'; +import { TypeOrmTaskRelatedIssueTypeRepository } from '../../tasks/related-issue-type/repository/type-orm-related-issue-type.repository'; +import { TypeOrmScreeningTaskRepository } from '../../tasks/screening-tasks/repository/type-orm-screening-task.repository'; +import { TypeOrmTaskSizeRepository } from '../../tasks/sizes/repository/type-orm-task-size.repository'; +import { TypeOrmTaskStatusRepository } from '../../tasks/statuses/repository/type-orm-task-status.repository'; +import { TypeOrmTaskVersionRepository } from '../../tasks/versions/repository/type-orm-task-version.repository'; +import { TypeOrmTaskViewRepository } from '../../tasks/views/repository/type-orm-task-view.repository'; +import { TypeOrmImportHistoryRepository } from '../import-history/repository/type-orm-import-history.repository'; +import { TypeOrmImportRecordRepository } from '../import-record/repository/type-orm-import-record.repository'; +import { TypeOrmCountryRepository } from '../../country/repository/type-orm-country.repository'; +import { TypeOrmCurrencyRepository } from '../../currency/repository/type-orm-currency.repository'; +import { TypeOrmDashboardRepository } from '../../dashboard/repository/type-orm-dashboard.repository'; +import { TypeOrmDashboardWidgetRepository } from '../../dashboard/dashboard-widget/repository/type-orm-dashboard-widget.repository'; + +export interface IForeignKey { + column: string; + inverseColumn?: string; + repository: Repository; +} + +export interface IColumnRelationMetadata { + joinTableName: string; + foreignKeys: IForeignKey[]; + isCheckRelation: boolean; +} + +export interface IRepositoryModel { + repository: Repository; + relations?: IColumnRelationMetadata[]; + foreignKeys?: IForeignKey[]; + uniqueIdentifiers?: { column: string }[]; + + // additional condition + isStatic?: boolean; + isCheckRelation: boolean; + + // export service fields + isTenantBased?: boolean; + substitute?: { + originalField: string; + substituteField: string; + }; +} + +@Injectable() +export class RepositoriesService implements OnModuleInit { + constructor( + @InjectRepository(AccountingTemplate) + public typeOrmAccountingTemplateRepository: TypeOrmAccountingTemplateRepository, + + mikroOrmAccountingTemplateRepository: MikroOrmAccountingTemplateRepository, + + @InjectRepository(Activity) + public typeOrmActivityRepository: TypeOrmActivityRepository, + + mikroOrmActivityRepository: MikroOrmActivityRepository, + + @InjectRepository(AppointmentEmployee) + public typeOrmAppointmentEmployeeRepository: TypeOrmAppointmentEmployeeRepository, + + mikroOrmAppointmentEmployeeRepository: MikroOrmAppointmentEmployeeRepository, + + @InjectRepository(ApprovalPolicy) + public typeOrmApprovalPolicyRepository: TypeOrmApprovalPolicyRepository, + + mikroOrmApprovalPolicyRepository: MikroOrmApprovalPolicyRepository, + + @InjectRepository(AvailabilitySlot) + public typeOrmAvailabilitySlotRepository: TypeOrmAvailabilitySlotRepository, + + mikroOrmAvailabilitySlotRepository: MikroOrmAvailabilitySlotRepository, + + @InjectRepository(Candidate) + public typeOrmCandidateRepository: TypeOrmCandidateRepository, + + mikroOrmCandidateRepository: MikroOrmCandidateRepository, + + @InjectRepository(CandidateCriterionsRating) + public typeOrmCandidateCriterionsRatingRepository: TypeOrmCandidateCriterionsRatingRepository, + + mikroOrmCandidateCriterionsRatingRepository: MikroOrmCandidateCriterionsRatingRepository, + + @InjectRepository(CandidateDocument) + public typeOrmCandidateDocumentRepository: TypeOrmCandidateDocumentRepository, + + mikroOrmCandidateDocumentRepository: MikroOrmCandidateDocumentRepository, + + @InjectRepository(CandidateEducation) + public typeOrmCandidateEducationRepository: TypeOrmCandidateEducationRepository, + + mikroOrmCandidateEducationRepository: MikroOrmCandidateEducationRepository, + + @InjectRepository(CandidateExperience) + public typeOrmCandidateExperienceRepository: TypeOrmCandidateExperienceRepository, + + mikroOrmCandidateExperienceRepository: MikroOrmCandidateExperienceRepository, + + @InjectRepository(CandidateFeedback) + public typeOrmCandidateFeedbackRepository: TypeOrmCandidateFeedbackRepository, + + mikroOrmCandidateFeedbackRepository: MikroOrmCandidateFeedbackRepository, + + @InjectRepository(CandidateInterview) + public typeOrmCandidateInterviewRepository: TypeOrmCandidateInterviewRepository, + + mikroOrmCandidateInterviewRepository: MikroOrmCandidateInterviewRepository, + + @InjectRepository(CandidateInterviewers) + public typeOrmCandidateInterviewersRepository: TypeOrmCandidateInterviewersRepository, + + mikroOrmCandidateInterviewersRepository: MikroOrmCandidateInterviewersRepository, + + @InjectRepository(CandidatePersonalQualities) + public typeOrmCandidatePersonalQualitiesRepository: TypeOrmCandidatePersonalQualitiesRepository, + + mikroOrmCandidatePersonalQualitiesRepository: MikroOrmCandidatePersonalQualitiesRepository, + + @InjectRepository(CandidateSkill) + public typeOrmCandidateSkillRepository: TypeOrmCandidateSkillRepository, + + mikroOrmCandidateSkillRepository: MikroOrmCandidateSkillRepository, + + @InjectRepository(CandidateSource) + public typeOrmCandidateSourceRepository: TypeOrmCandidateSourceRepository, + + mikroOrmCandidateSourceRepository: MikroOrmCandidateSourceRepository, + + @InjectRepository(CandidateTechnologies) + public typeOrmCandidateTechnologiesRepository: TypeOrmCandidateTechnologiesRepository, + + mikroOrmCandidateTechnologiesRepository: MikroOrmCandidateTechnologiesRepository, + + @InjectRepository(Contact) + public typeOrmContactRepository: TypeOrmContactRepository, + + mikroOrmContactRepository: MikroOrmContactRepository, + + @InjectRepository(CustomSmtp) + public typeOrmCustomSmtpRepository: TypeOrmCustomSmtpRepository, + + mikroOrmCustomSmtpRepository: MikroOrmCustomSmtpRepository, + + @InjectRepository(Deal) + public typeOrmDealRepository: TypeOrmDealRepository, + + mikroOrmDealRepository: MikroOrmDealRepository, + + @InjectRepository(EmailHistory) + public typeOrmEmailHistoryRepository: TypeOrmEmailHistoryRepository, + + mikroOrmEmailHistoryRepository: MikroOrmEmailHistoryRepository, + + @InjectRepository(EmailTemplate) + public typeOrmEmailTemplateRepository: TypeOrmEmailTemplateRepository, + + mikroOrmEmailTemplateRepository: MikroOrmEmailTemplateRepository, + + @InjectRepository(Employee) + public typeOrmEmployeeRepository: TypeOrmEmployeeRepository, + + mikroOrmEmployeeRepository: MikroOrmEmployeeRepository, + + @InjectRepository(EmployeeAppointment) + public typeOrmEmployeeAppointmentRepository: TypeOrmEmployeeAppointmentRepository, + + mikroOrmEmployeeAppointmentRepository: MikroOrmEmployeeAppointmentRepository, + + @InjectRepository(EmployeeAward) + public typeOrmEmployeeAwardRepository: TypeOrmEmployeeAwardRepository, + + mikroOrmEmployeeAwardRepository: MikroOrmEmployeeAwardRepository, + + @InjectRepository(EmployeeRecurringExpense) + public typeOrmEmployeeRecurringExpenseRepository: TypeOrmEmployeeRecurringExpenseRepository, + + mikroOrmEmployeeRecurringExpenseRepository: MikroOrmEmployeeRecurringExpenseRepository, + + @InjectRepository(EmployeeSetting) + public typeOrmEmployeeSettingRepository: TypeOrmEmployeeSettingRepository, + + mikroOrmEmployeeSettingRepository: MikroOrmEmployeeSettingRepository, + + @InjectRepository(Equipment) + public typeOrmEquipmentRepository: TypeOrmEquipmentRepository, + + mikroOrmEquipmentRepository: MikroOrmEquipmentRepository, + + @InjectRepository(EquipmentSharing) + public typeOrmEquipmentSharingRepository: TypeOrmEquipmentSharingRepository, + + mikroOrmEquipmentSharingRepository: MikroOrmEquipmentSharingRepository, + + @InjectRepository(EquipmentSharingPolicy) + public typeOrmEquipmentSharingPolicyRepository: TypeOrmEquipmentSharingPolicyRepository, + + mikroOrmEquipmentSharingPolicyRepository: MikroOrmEquipmentSharingPolicyRepository, + + @InjectRepository(EstimateEmail) + public typeOrmEstimateEmailRepository: TypeOrmEstimateEmailRepository, + + mikroOrmEstimateEmailRepository: MikroOrmEstimateEmailRepository, + + @InjectRepository(EventType) + public typeOrmEventTypeRepository: TypeOrmEventTypeRepository, + + mikroOrmEventTypeRepository: MikroOrmEventTypeRepository, + + @InjectRepository(Expense) + public typeOrmExpenseRepository: TypeOrmExpenseRepository, + + mikroOrmExpenseRepository: MikroOrmExpenseRepository, + + @InjectRepository(ExpenseCategory) + public typeOrmExpenseCategoryRepository: TypeOrmExpenseCategoryRepository, + + mikroOrmExpenseCategoryRepository: MikroOrmExpenseCategoryRepository, + + @InjectRepository(Feature) + public typeOrmFeatureRepository: TypeOrmFeatureRepository, + + mikroOrmFeatureRepository: MikroOrmFeatureRepository, + + @InjectRepository(FeatureOrganization) + public typeOrmFeatureOrganizationRepository: TypeOrmFeatureOrganizationRepository, + + mikroOrmFeatureOrganizationRepository: MikroOrmFeatureOrganizationRepository, + + @InjectRepository(Goal) + public typeOrmGoalRepository: TypeOrmGoalRepository, + + mikroOrmGoalRepository: MikroOrmGoalRepository, + + @InjectRepository(GoalTemplate) + public typeOrmGoalTemplateRepository: TypeOrmGoalTemplateRepository, + + mikroOrmGoalTemplateRepository: MikroOrmGoalTemplateRepository, + + @InjectRepository(GoalKPI) + public typeOrmGoalKPIRepository: TypeOrmGoalKPIRepository, + + mikroOrmGoalKPIRepository: MikroOrmGoalKPIRepository, + + @InjectRepository(GoalKPITemplate) + public typeOrmGoalKPITemplateRepository: TypeOrmGoalKPITemplateRepository, + + mikroOrmGoalKPITemplateRepository: MikroOrmGoalKPITemplateRepository, + + @InjectRepository(GoalTimeFrame) + public typeOrmGoalTimeFrameRepository: TypeOrmGoalTimeFrameRepository, + + mikroOrmGoalTimeFrameRepository: MikroOrmGoalTimeFrameRepository, + + @InjectRepository(GoalGeneralSetting) + public typeOrmGoalGeneralSettingRepository: TypeOrmGoalGeneralSettingRepository, + + mikroOrmGoalGeneralSettingRepository: MikroOrmGoalGeneralSettingRepository, + + @InjectRepository(Income) + public typeOrmIncomeRepository: TypeOrmIncomeRepository, + + mikroOrmIncomeRepository: MikroOrmIncomeRepository, + + @InjectRepository(Integration) + public typeOrmIntegrationRepository: TypeOrmIntegrationRepository, + + mikroOrmIntegrationRepository: MikroOrmIntegrationRepository, + + @InjectRepository(IntegrationType) + public typeOrmIntegrationTypeRepository: TypeOrmIntegrationTypeRepository, + + mikroOrmIntegrationTypeRepository: MikroOrmIntegrationTypeRepository, + + @InjectRepository(IntegrationEntitySetting) + public typeOrmIntegrationEntitySettingRepository: TypeOrmIntegrationEntitySettingRepository, + + mikroOrmIntegrationEntitySettingRepository: MikroOrmIntegrationEntitySettingRepository, + + @InjectRepository(IntegrationEntitySettingTied) + public typeOrmIntegrationEntitySettingTiedRepository: TypeOrmIntegrationEntitySettingTiedRepository, + + mikroOrmIntegrationEntitySettingTiedRepository: MikroOrmIntegrationEntitySettingTiedRepository, + + @InjectRepository(IntegrationMap) + public typeOrmIntegrationMapRepository: TypeOrmIntegrationMapRepository, + + mikroOrmIntegrationMapRepository: MikroOrmIntegrationMapRepository, + + @InjectRepository(IntegrationSetting) + public typeOrmIntegrationSettingRepository: TypeOrmIntegrationSettingRepository, + + mikroOrmIntegrationSettingRepository: MikroOrmIntegrationSettingRepository, + + @InjectRepository(IntegrationTenant) + public typeOrmIntegrationTenantRepository: TypeOrmIntegrationTenantRepository, + + mikroOrmIntegrationTenantRepository: MikroOrmIntegrationTenantRepository, + + @InjectRepository(Invite) + public typeOrmInviteRepository: TypeOrmInviteRepository, + + mikroOrmInviteRepository: MikroOrmInviteRepository, + + @InjectRepository(Invoice) + public typeOrmInvoiceRepository: TypeOrmInvoiceRepository, + + mikroOrmInvoiceRepository: MikroOrmInvoiceRepository, + + @InjectRepository(InvoiceEstimateHistory) + public typeOrmInvoiceEstimateHistoryRepository: TypeOrmInvoiceEstimateHistoryRepository, + + mikroOrmInvoiceEstimateHistoryRepository: MikroOrmInvoiceEstimateHistoryRepository, + + @InjectRepository(InvoiceItem) + public typeOrmInvoiceItemRepository: TypeOrmInvoiceItemRepository, + + mikroOrmInvoiceItemRepository: MikroOrmInvoiceItemRepository, + + @InjectRepository(KeyResult) + public typeOrmKeyResultRepository: TypeOrmKeyResultRepository, + + mikroOrmKeyResultRepository: MikroOrmKeyResultRepository, + + @InjectRepository(KeyResultTemplate) + public typeOrmKeyResultTemplateRepository: TypeOrmKeyResultTemplateRepository, + + mikroOrmKeyResultTemplateRepository: MikroOrmKeyResultTemplateRepository, + + @InjectRepository(KeyResultUpdate) + public typeOrmKeyResultUpdateRepository: TypeOrmKeyResultUpdateRepository, + + mikroOrmKeyResultUpdateRepository: MikroOrmKeyResultUpdateRepository, + + @InjectRepository(Language) + public typeOrmLanguageRepository: TypeOrmLanguageRepository, + + mikroOrmLanguageRepository: MikroOrmLanguageRepository, + + @InjectRepository(Organization) + public typeOrmOrganizationRepository: TypeOrmOrganizationRepository, + + mikroOrmOrganizationRepository: MikroOrmOrganizationRepository, + + @InjectRepository(EmployeeLevel) + public typeOrmEmployeeLevelRepository: TypeOrmEmployeeLevelRepository, + + mikroOrmEmployeeLevelRepository: MikroOrmEmployeeLevelRepository, + + @InjectRepository(OrganizationAward) + public typeOrmOrganizationAwardRepository: TypeOrmOrganizationAwardRepository, + + mikroOrmOrganizationAwardRepository: MikroOrmOrganizationAwardRepository, + + @InjectRepository(OrganizationContact) + public typeOrmOrganizationContactRepository: TypeOrmOrganizationContactRepository, + + mikroOrmOrganizationContactRepository: MikroOrmOrganizationContactRepository, + + @InjectRepository(OrganizationDepartment) + public typeOrmOrganizationDepartmentRepository: TypeOrmOrganizationDepartmentRepository, + + mikroOrmOrganizationDepartmentRepository: MikroOrmOrganizationDepartmentRepository, + + @InjectRepository(OrganizationDocument) + public typeOrmOrganizationDocumentRepository: TypeOrmOrganizationDocumentRepository, + + mikroOrmOrganizationDocumentRepository: MikroOrmOrganizationDocumentRepository, + + @InjectRepository(OrganizationEmploymentType) + public typeOrmOrganizationEmploymentTypeRepository: TypeOrmOrganizationEmploymentTypeRepository, + + mikroOrmOrganizationEmploymentTypeRepository: MikroOrmOrganizationEmploymentTypeRepository, + + @InjectRepository(OrganizationLanguage) + public typeOrmOrganizationLanguageRepository: TypeOrmOrganizationLanguageRepository, + + mikroOrmOrganizationLanguageRepository: MikroOrmOrganizationLanguageRepository, + + @InjectRepository(OrganizationPosition) + public typeOrmOrganizationPositionRepository: TypeOrmOrganizationPositionRepository, + + mikroOrmOrganizationPositionRepository: MikroOrmOrganizationPositionRepository, + + @InjectRepository(OrganizationProject) + public typeOrmOrganizationProjectRepository: TypeOrmOrganizationProjectRepository, + + mikroOrmOrganizationProjectRepository: MikroOrmOrganizationProjectRepository, + + @InjectRepository(OrganizationRecurringExpense) + public typeOrmOrganizationRecurringExpenseRepository: TypeOrmOrganizationRecurringExpenseRepository, + + mikroOrmOrganizationRecurringExpenseRepository: MikroOrmOrganizationRecurringExpenseRepository, + + @InjectRepository(OrganizationSprint) + public typeOrmOrganizationSprintRepository: TypeOrmOrganizationSprintRepository, + + mikroOrmOrganizationSprintRepository: MikroOrmOrganizationSprintRepository, + + @InjectRepository(OrganizationTeam) + public typeOrmOrganizationTeamRepository: TypeOrmOrganizationTeamRepository, + + mikroOrmOrganizationTeamRepository: MikroOrmOrganizationTeamRepository, + + @InjectRepository(OrganizationTeamEmployee) + public typeOrmOrganizationTeamEmployeeRepository: TypeOrmOrganizationTeamEmployeeRepository, + + mikroOrmOrganizationTeamEmployeeRepository: MikroOrmOrganizationTeamEmployeeRepository, + + @InjectRepository(OrganizationVendor) + public typeOrmOrganizationVendorRepository: TypeOrmOrganizationVendorRepository, + + mikroOrmOrganizationVendorRepository: MikroOrmOrganizationVendorRepository, + + @InjectRepository(Payment) + public typeOrmPaymentRepository: TypeOrmPaymentRepository, + + mikroOrmPaymentRepository: MikroOrmPaymentRepository, + + @InjectRepository(Pipeline) + public typeOrmPipelineRepository: TypeOrmPipelineRepository, + + mikroOrmPipelineRepository: MikroOrmPipelineRepository, + + @InjectRepository(PipelineStage) + public typeOrmPipelineStageRepository: TypeOrmPipelineStageRepository, + + mikroOrmPipelineStageRepository: MikroOrmPipelineStageRepository, + + @InjectRepository(Product) + public typeOrmProductRepository: TypeOrmProductRepository, + + mikroOrmProductRepository: MikroOrmProductRepository, + + @InjectRepository(ProductTranslation) + public typeOrmProductTranslationRepository: TypeOrmProductTranslationRepository, + + mikroOrmProductTranslationRepository: MikroOrmProductTranslationRepository, + + @InjectRepository(ProductCategory) + public typeOrmProductCategoryRepository: TypeOrmProductCategoryRepository, + + mikroOrmProductCategoryRepository: MikroOrmProductCategoryRepository, + + @InjectRepository(ProductCategoryTranslation) + public typeOrmProductCategoryTranslationRepository: TypeOrmProductCategoryTranslationRepository, + + mikroOrmProductCategoryTranslationRepository: MikroOrmProductCategoryTranslationRepository, + + @InjectRepository(ProductOption) + public typeOrmProductOptionRepository: TypeOrmProductOptionRepository, + + mikroOrmProductOptionRepository: MikroOrmProductOptionRepository, + + @InjectRepository(ProductOptionTranslation) + public typeOrmProductOptionTranslationRepository: TypeOrmProductOptionTranslationRepository, + + mikroOrmProductOptionTranslationRepository: MikroOrmProductOptionTranslationRepository, + + @InjectRepository(ProductOptionGroup) + public typeOrmProductOptionGroupRepository: TypeOrmProductOptionGroupRepository, + + mikroOrmProductOptionGroupRepository: MikroOrmProductOptionGroupRepository, + + @InjectRepository(ProductOptionGroupTranslation) + public typeOrmProductOptionGroupTranslationRepository: TypeOrmProductOptionGroupTranslationRepository, + + mikroOrmProductOptionGroupTranslationRepository: MikroOrmProductOptionGroupTranslationRepository, + + @InjectRepository(ProductVariantSetting) + public typeOrmProductVariantSettingRepository: TypeOrmProductVariantSettingRepository, + + mikroOrmProductVariantSettingRepository: MikroOrmProductVariantSettingRepository, + + @InjectRepository(ProductType) + public typeOrmProductTypeRepository: TypeOrmProductTypeRepository, + + mikroOrmProductTypeRepository: MikroOrmProductTypeRepository, + + @InjectRepository(ProductTypeTranslation) + public typeOrmProductTypeTranslationRepository: TypeOrmProductTypeTranslationRepository, + + mikroOrmProductTypeTranslationRepository: MikroOrmProductTypeTranslationRepository, + + @InjectRepository(ProductVariant) + public typeOrmProductVariantRepository: TypeOrmProductVariantRepository, + + mikroOrmProductVariantRepository: MikroOrmProductVariantRepository, + + @InjectRepository(ProductVariantPrice) + public typeOrmProductVariantPriceRepository: TypeOrmProductVariantPriceRepository, + + mikroOrmProductVariantPriceRepository: MikroOrmProductVariantPriceRepository, + + @InjectRepository(ImageAsset) + public typeOrmImageAssetRepository: TypeOrmImageAssetRepository, + + mikroOrmImageAssetRepository: MikroOrmImageAssetRepository, + + @InjectRepository(Warehouse) + public typeOrmWarehouseRepository: TypeOrmWarehouseRepository, + + mikroOrmWarehouseRepository: MikroOrmWarehouseRepository, + + @InjectRepository(Merchant) + public typeOrmMerchantRepository: TypeOrmMerchantRepository, + + mikroOrmMerchantRepository: MikroOrmMerchantRepository, + + @InjectRepository(WarehouseProduct) + public typeOrmWarehouseProductRepository: TypeOrmWarehouseProductRepository, + + mikroOrmWarehouseProductRepository: MikroOrmWarehouseProductRepository, + + @InjectRepository(WarehouseProductVariant) + public typeOrmWarehouseProductVariantRepository: TypeOrmWarehouseProductVariantRepository, + + mikroOrmWarehouseProductVariantRepository: MikroOrmWarehouseProductVariantRepository, + + @InjectRepository(Skill) + public typeOrmSkillRepository: TypeOrmSkillRepository, + + mikroOrmSkillRepository: MikroOrmSkillRepository, + + @InjectRepository(Screenshot) + public typeOrmScreenshotRepository: TypeOrmScreenshotRepository, + + mikroOrmScreenshotRepository: MikroOrmScreenshotRepository, + + @InjectRepository(RequestApproval) + public typeOrmRequestApprovalRepository: TypeOrmRequestApprovalRepository, + + mikroOrmRequestApprovalRepository: MikroOrmRequestApprovalRepository, + + @InjectRepository(RequestApprovalEmployee) + public typeOrmRequestApprovalEmployeeRepository: TypeOrmRequestApprovalEmployeeRepository, + + mikroOrmRequestApprovalEmployeeRepository: MikroOrmRequestApprovalEmployeeRepository, + + @InjectRepository(RequestApprovalTeam) + public typeOrmRequestApprovalTeamRepository: TypeOrmRequestApprovalTeamRepository, + + mikroOrmRequestApprovalTeamRepository: MikroOrmRequestApprovalTeamRepository, + + @InjectRepository(Role) + public typeOrmRoleRepository: TypeOrmRoleRepository, + + mikroOrmRoleRepository: MikroOrmRoleRepository, + + @InjectRepository(RolePermission) + public typeOrmRolePermissionRepository: TypeOrmRolePermissionRepository, + + mikroOrmRolePermissionRepository: MikroOrmRolePermissionRepository, + + @InjectRepository(Report) + public typeOrmReportRepository: TypeOrmReportRepository, + + mikroOrmReportRepository: MikroOrmReportRepository, + + @InjectRepository(ReportCategory) + public typeOrmReportCategoryRepository: TypeOrmReportCategoryRepository, + + mikroOrmReportCategoryRepository: MikroOrmReportCategoryRepository, + + @InjectRepository(ReportOrganization) + public typeOrmReportOrganizationRepository: TypeOrmReportOrganizationRepository, + + mikroOrmReportOrganizationRepository: MikroOrmReportOrganizationRepository, + + @InjectRepository(Tag) + public typeOrmTagRepository: TypeOrmTagRepository, + + mikroOrmTagRepository: MikroOrmTagRepository, + + @InjectRepository(Task) + public typeOrmTaskRepository: TypeOrmTaskRepository, + + mikroOrmTaskRepository: MikroOrmTaskRepository, + + @InjectRepository(TenantSetting) + public typeOrmTenantSettingRepository: TypeOrmTenantSettingRepository, + + mikroOrmTenantSettingRepository: MikroOrmTenantSettingRepository, + + @InjectRepository(Timesheet) + public typeOrmTimesheetRepository: TypeOrmTimesheetRepository, + + mikroOrmTimesheetRepository: MikroOrmTimesheetRepository, + + @InjectRepository(TimeLog) + public typeOrmTimeLogRepository: TypeOrmTimeLogRepository, + + mikroOrmTimeLogRepository: MikroOrmTimeLogRepository, + + @InjectRepository(TimeSlot) + public typeOrmTimeSlotRepository: TypeOrmTimeSlotRepository, + + mikroOrmTimeSlotRepository: MikroOrmTimeSlotRepository, + + @InjectRepository(TimeSlotMinute) + public typeOrmTimeSlotMinuteRepository: TypeOrmTimeSlotMinuteRepository, + + mikroOrmTimeSlotMinuteRepository: MikroOrmTimeSlotMinuteRepository, + + @InjectRepository(TimeOffRequest) + public typeOrmTimeOffRequestRepository: TypeOrmTimeOffRequestRepository, + + mikroOrmTimeOffRequestRepository: MikroOrmTimeOffRequestRepository, + + @InjectRepository(TimeOffPolicy) + public typeOrmTimeOffPolicyRepository: TypeOrmTimeOffPolicyRepository, + + mikroOrmTimeOffPolicyRepository: MikroOrmTimeOffPolicyRepository, + + @InjectRepository(User) + public typeOrmUserRepository: TypeOrmUserRepository, + + mikroOrmUserRepository: MikroOrmUserRepository, + + @InjectRepository(UserOrganization) + public typeOrmUserOrganizationRepository: TypeOrmUserOrganizationRepository, + + mikroOrmUserOrganizationRepository: MikroOrmUserOrganizationRepository, + + @InjectRepository(TagType) + public typeOrmTagTypeRepository: TypeOrmTagTypeRepository, + + @InjectRepository(Tenant) + public typeOrmTenantRepository: TypeOrmTenantRepository, + + @InjectRepository(ActivityLog) + public typeOrmActivityLogRepository: TypeOrmActivityLogRepository, + + @InjectRepository(EmployeeAvailability) + public typeOrmEmployeeAvailabilityRepository: TypeOrmEmployeeAvailabilityRepository, + + @InjectRepository(Comment) + public typeOrmCommentRepository: TypeOrmCommentRepository, + + @InjectRepository(DailyPlan) + public typeOrmDailyPlanRepository: TypeOrmDailyPlanRepository, + + @InjectRepository(EmailReset) + public typeOrmEmailResetRepository: TypeOrmEmailResetRepository, + + @InjectRepository(EmployeeNotification) + public typeOrmEmployeeNotificationRepository: TypeOrmEmployeeNotificationRepository, + + @InjectRepository(EmployeeNotificationSetting) + public typeOrmEmployeeNotificationSettingRepository: TypeOrmEmployeeNotificationSettingRepository, + + @InjectRepository(EmployeePhone) + public typeOrmEmployeePhoneRepository: TypeOrmEmployeePhoneRepository, + + @InjectRepository(EntitySubscription) + public typeOrmEntitySubscriptionRepository: TypeOrmEntitySubscriptionRepository, + + @InjectRepository(Favorite) + public typeOrmFavoriteRepository: TypeOrmFavoriteRepository, + + @InjectRepository(ImportHistory) + public typeOrmImportHistoryRepository: TypeOrmImportHistoryRepository, + + @InjectRepository(ImportRecord) + public typeOrmImportRecordRepository: TypeOrmImportRecordRepository, + + @InjectRepository(IssueType) + public typeOrmIssueTypeRepository: TypeOrmIssueTypeRepository, + + @InjectRepository(Mention) + public typeOrmMentionRepository: TypeOrmMentionRepository, + + @InjectRepository(OrganizationProjectEmployee) + public typeOrmOrganizationProjectEmployeeRepository: TypeOrmOrganizationProjectEmployeeRepository, + + @InjectRepository(OrganizationProjectModule) + public typeOrmOrganizationProjectModuleRepository: TypeOrmOrganizationProjectModuleRepository, + + @InjectRepository(OrganizationProjectModuleEmployee) + public typeOrmOrganizationProjectModuleEmployeeRepository: TypeOrmOrganizationProjectModuleEmployeeRepository, + + @InjectRepository(OrganizationSprintEmployee) + public typeOrmOrganizationSprintEmployeeRepository: TypeOrmOrganizationSprintEmployeeRepository, + + @InjectRepository(OrganizationSprintTask) + public typeOrmOrganizationSprintTaskRepository: TypeOrmOrganizationSprintTaskRepository, + + @InjectRepository(OrganizationSprintTaskHistory) + public typeOrmOrganizationSprintTaskHistoryRepository: TypeOrmOrganizationSprintTaskHistoryRepository, + + @InjectRepository(OrganizationTaskSetting) + public typeOrmOrganizationTaskSettingRepository: TypeOrmOrganizationTaskSettingRepository, + + @InjectRepository(OrganizationTeamJoinRequest) + public typeOrmOrganizationTeamJoinRequestRepository: TypeOrmOrganizationTeamJoinRequestRepository, + + @InjectRepository(Reaction) + public typeOrmReactionRepository: TypeOrmReactionRepository, + + @InjectRepository(ResourceLink) + public typeOrmResourceLinkRepository: TypeOrmResourceLinkRepository, + + @InjectRepository(ScreeningTask) + public typeOrmScreeningTaskRepository: TypeOrmScreeningTaskRepository, + + @InjectRepository(SocialAccount) + public typeOrmSocialAccountRepository: TypeOrmSocialAccountRepository, + + @InjectRepository(TaskEstimation) + public typeOrmTaskEstimationRepository: TypeOrmTaskEstimationRepository, + + @InjectRepository(TaskLinkedIssue) + public typeOrmTaskLinkedIssueRepository: TypeOrmTaskLinkedIssueRepository, + + @InjectRepository(TaskPriority) + public typeOrmTaskPriorityRepository: TypeOrmTaskPriorityRepository, + + @InjectRepository(TaskRelatedIssueType) + public typeOrmTaskRelatedIssueTypeRepository: TypeOrmTaskRelatedIssueTypeRepository, + + @InjectRepository(TaskSize) + public typeOrmTaskSizeRepository: TypeOrmTaskSizeRepository, + + @InjectRepository(TaskStatus) + public typeOrmTaskStatusRepository: TypeOrmTaskStatusRepository, + + @InjectRepository(TaskVersion) + public typeOrmTaskVersionRepository: TypeOrmTaskVersionRepository, + + @InjectRepository(TaskView) + public typeOrmTaskViewRepository: TypeOrmTaskViewRepository, + + @InjectRepository(Country) + public typeOrmCountryRepository: TypeOrmCountryRepository, + + @InjectRepository(Currency) + public typeOrmCurrencyRepository: TypeOrmCurrencyRepository, + + @InjectRepository(Dashboard) + public typeOrmDashboardRepository: TypeOrmDashboardRepository, + + @InjectRepository(DashboardWidget) + public typeOrmDashboardWidgetRepository: TypeOrmDashboardWidgetRepository, + + private readonly configService: ConfigService, + private readonly _connectionEntityManager: ConnectionEntityManager + ) {} + + dynamicEntitiesClassMap: IRepositoryModel[] = []; + repositories: IRepositoryModel[] = []; + + public baseEntityRelationFields = [ + { column: 'createdByUserId', repository: this.typeOrmUserRepository }, + { column: 'updatedByUserId', repository: this.typeOrmUserRepository }, + { column: 'deletedByUserId', repository: this.typeOrmUserRepository } + ]; + + async onModuleInit() { + await this.createDynamicInstanceForPluginEntities(); + await this.registerCoreRepositories(); + } + + /** + * A helper function to get the repository relations graph + * @param repository the repository to work on + */ + private async getRepositoryRelationsGraph(repository: Repository): Promise { + const entityMetadata = repository.metadata; + + // Get unique identifiers (assuming they are part of unique constraints) + const uniqueIdentifiers = + entityMetadata.uniques.map((unique) => { + return { + column: unique.columns + .map((col) => col.propertyName) + .filter((propertyName) => { + return !repository.metadata.relations.some( + (relation) => relation.propertyName === propertyName + ); + })[0] + }; + }) || []; + + // Get foreign keys and relations + const foreignKeys = + entityMetadata.relations + .filter((relation) => relation.propertyName && (relation.isManyToOne || relation.isOneToOne)) + .filter( + (relation) => + ![ + ...this.baseEntityRelationFields.map((el) => el.column), + 'organizationId', + 'tenantId' + ].includes(relation.joinColumns[0]?.databaseName || `${relation.propertyName}Id`) + ) + .map((relation) => { + return { + column: relation.joinColumns[0]?.databaseName || `${relation.propertyName}Id`, + repository: this._connectionEntityManager.getRepository(relation.type) + }; + }) || []; + + const relations = + entityMetadata.relations + .filter((relation) => relation.isManyToMany && relation.joinTableName) + .map((relation) => { + const foreignKeys = + relation.foreignKeys.map((fk) => ({ + column: fk.columns[0]?.propertyName, + repository: this._connectionEntityManager.getRepository(fk.referencedEntityMetadata.target) + })) || []; + return { + joinTableName: relation.joinTableName, + foreignKeys, + isCheckRelation: foreignKeys.length > 0 + }; + }) || []; + + const isTenantBased = entityMetadata.foreignKeys.flatMap((el) => el.columnNames)?.includes('tenantId'); + + return { + repository, + isCheckRelation: foreignKeys.length > 0, + uniqueIdentifiers, + foreignKeys, + relations, + isTenantBased + }; + } + + /** + * + * A helper function that builds dynamically a dependencies / relations + * graph for each repository registered + * + */ + async buildRepositoriesRelationsGraph() { + const result: IRepositoryModel[] = []; + for await (const item of this.repositories) { + const { repository, isStatic, substitute } = item; + + const repositoryRelationsGraph = await this.getRepositoryRelationsGraph(item.repository); + + result.push({ + ...repositoryRelationsGraph, + isStatic, + substitute + }); + } + + return result; + } + + async createDynamicInstanceForPluginEntities() { + for await (const entity of getEntitiesFromPlugins(this.configService.plugins)) { + if (!isFunction(entity)) { + continue; + } + + const className = camelCase(entity.name); + const repository = this._connectionEntityManager.getRepository(entity); + + const repositoryRelationsGraph = await this.getRepositoryRelationsGraph(repository); + + this[className] = repository; + this.dynamicEntitiesClassMap.push(repositoryRelationsGraph); + } + } + + /* + * Core repositories + * Warning: Changing position here can be FATAL + */ + private async registerCoreRepositories() { + this.repositories = [ + { + repository: this.typeOrmTenantRepository, + substitute: { substituteField: 'id', originalField: 'tenantId' } + }, + /** + * These entities do not have any other dependency so need to be mapped first + */ + { + repository: this.typeOrmReportCategoryRepository, + isStatic: true + }, + { + repository: this.typeOrmReportRepository, + isStatic: true + }, + { + repository: this.typeOrmFeatureRepository, + isStatic: true + }, + { + repository: this.typeOrmLanguageRepository, + isStatic: true + }, + { + repository: this.typeOrmCountryRepository, + isStatic: true + }, + { + repository: this.typeOrmCurrencyRepository, + isStatic: true + }, + { + repository: this.typeOrmIntegrationRepository, + isStatic: true + }, + { + repository: this.typeOrmIntegrationTypeRepository, + isStatic: true + }, + /** + * These entities need TENANT + */ + { + repository: this.typeOrmTenantSettingRepository + }, + { + repository: this.typeOrmRoleRepository + }, + { + repository: this.typeOrmRolePermissionRepository + }, + { + repository: this.typeOrmOrganizationRepository + }, + /** + * These entities need TENANT and ORGANIZATION + */ + { + repository: this.typeOrmUserRepository, + isStatic: true + }, + { + repository: this.typeOrmUserOrganizationRepository + }, + //Organization & Related Entities + { + repository: this.typeOrmOrganizationPositionRepository + }, + { + repository: this.typeOrmOrganizationTeamRepository + }, + { + repository: this.typeOrmOrganizationAwardRepository + }, + { + repository: this.typeOrmOrganizationVendorRepository + }, + { + repository: this.typeOrmOrganizationDepartmentRepository + }, + { + repository: this.typeOrmOrganizationDocumentRepository + }, + { + repository: this.typeOrmOrganizationLanguageRepository + }, + { + repository: this.typeOrmOrganizationEmploymentTypeRepository + }, + { + repository: this.typeOrmContactRepository + }, + { + repository: this.typeOrmOrganizationContactRepository + }, + { + repository: this.typeOrmOrganizationProjectRepository + }, + { + repository: this.typeOrmOrganizationSprintRepository + }, + { + repository: this.typeOrmOrganizationRecurringExpenseRepository + }, + { + repository: this.typeOrmCustomSmtpRepository + }, + { + repository: this.typeOrmReportOrganizationRepository + }, + /** + * These entities need TENANT, ORGANIZATION & USER + */ + { + repository: this.typeOrmEmployeeRepository + }, + { + repository: this.typeOrmActivityLogRepository + }, + { + repository: this.typeOrmDashboardRepository + }, + { + repository: this.typeOrmDashboardWidgetRepository + }, + { + repository: this.typeOrmEmailResetRepository + }, + { + repository: this.typeOrmTagTypeRepository + }, + /** + * These entities need TENANT, ORGANIZATION & CANDIDATE + */ + { + repository: this.typeOrmCandidateRepository + }, + { + repository: this.typeOrmCandidateDocumentRepository + }, + { + repository: this.typeOrmCandidateEducationRepository + }, + { + repository: this.typeOrmCandidateSkillRepository + }, + { + repository: this.typeOrmCandidateSourceRepository + }, + { + repository: this.typeOrmCandidateInterviewRepository + }, + { + repository: this.typeOrmCandidateInterviewersRepository + }, + { + repository: this.typeOrmCandidateExperienceRepository + }, + { + repository: this.typeOrmCandidateFeedbackRepository + }, + { + repository: this.typeOrmCandidatePersonalQualitiesRepository + }, + { + repository: this.typeOrmCandidateTechnologiesRepository + }, + { + repository: this.typeOrmCandidateCriterionsRatingRepository + }, + /** + * These entities need TENANT and ORGANIZATION + */ + { + repository: this.typeOrmSkillRepository + }, + { + repository: this.typeOrmAccountingTemplateRepository + }, + { + repository: this.typeOrmApprovalPolicyRepository + }, + { + repository: this.typeOrmAvailabilitySlotRepository + }, + { + repository: this.typeOrmEmployeeAppointmentRepository + }, + { + repository: this.typeOrmAppointmentEmployeeRepository + }, + /* + * Email & Template + */ + { + repository: this.typeOrmEmailTemplateRepository + }, + { + repository: this.typeOrmEmailHistoryRepository + }, + { + repository: this.typeOrmEstimateEmailRepository + }, + /* + * Employee & Related Entities + */ + { + repository: this.typeOrmEmployeeAwardRepository + }, + { + repository: this.typeOrmEmployeeRecurringExpenseRepository + }, + { + repository: this.typeOrmEmployeeSettingRepository + }, + { + repository: this.typeOrmEmployeeLevelRepository + }, + /* + * Equipment & Related Entities + */ + { + repository: this.typeOrmEquipmentSharingPolicyRepository + }, + { + repository: this.typeOrmEquipmentRepository + }, + { + repository: this.typeOrmEquipmentSharingRepository + }, + /* + * Event Type & Related Entities + */ + { + repository: this.typeOrmEventTypeRepository + }, + /* + * Invoice & Related Entities + */ + { + repository: this.typeOrmInvoiceRepository + }, + { + repository: this.typeOrmInvoiceItemRepository + }, + { + repository: this.typeOrmInvoiceEstimateHistoryRepository + }, + /* + * Expense & Related Entities + */ + { + repository: this.typeOrmExpenseCategoryRepository + }, + { + repository: this.typeOrmExpenseRepository + }, + /* + * Income + */ + { + repository: this.typeOrmIncomeRepository + }, + /* + * Feature & Related Entities + */ + { + repository: this.typeOrmFeatureOrganizationRepository + }, + { + repository: this.typeOrmGoalRepository + }, + { + repository: this.typeOrmGoalKPIRepository + }, + /* + * Key Result & Related Entities + */ + { + repository: this.typeOrmKeyResultRepository + }, + { + repository: this.typeOrmKeyResultTemplateRepository + }, + { + repository: this.typeOrmKeyResultUpdateRepository + }, + /* + * Goal KPI & Related Entities + */ + { + repository: this.typeOrmGoalKPITemplateRepository + }, + { + repository: this.typeOrmGoalTemplateRepository + }, + { + repository: this.typeOrmGoalTimeFrameRepository + }, + { + repository: this.typeOrmGoalGeneralSettingRepository + }, + /* + * Integration & Related Entities + */ + { + repository: this.typeOrmIntegrationTenantRepository + }, + { + repository: this.typeOrmIntegrationSettingRepository + }, + { + repository: this.typeOrmIntegrationMapRepository + }, + { + repository: this.typeOrmIntegrationEntitySettingRepository + }, + { + repository: this.typeOrmIntegrationEntitySettingTiedRepository + }, + /* + * Invite & Related Entities + */ + { + repository: this.typeOrmInviteRepository + }, + { + repository: this.typeOrmOrganizationTeamEmployeeRepository + }, + /* + * Pipeline & Stage Entities + */ + { + repository: this.typeOrmPipelineRepository + }, + { + repository: this.typeOrmPipelineStageRepository + }, + { + repository: this.typeOrmDealRepository + }, + /* + * Product & Related Entities + */ + { + repository: this.typeOrmImageAssetRepository + }, + { + repository: this.typeOrmProductCategoryRepository + }, + { + repository: this.typeOrmProductCategoryTranslationRepository + }, + { + repository: this.typeOrmProductTypeRepository + }, + { + repository: this.typeOrmProductTypeTranslationRepository + }, + { + repository: this.typeOrmProductOptionGroupRepository + }, + { + repository: this.typeOrmProductOptionRepository + }, + { + repository: this.typeOrmProductOptionTranslationRepository + }, + { + repository: this.typeOrmProductOptionGroupTranslationRepository + }, + { + repository: this.typeOrmProductRepository + }, + { + repository: this.typeOrmProductTranslationRepository + }, + { + repository: this.typeOrmProductVariantPriceRepository + }, + { + repository: this.typeOrmProductVariantSettingRepository + }, + { + repository: this.typeOrmProductVariantRepository + }, + { + repository: this.typeOrmWarehouseRepository + }, + { + repository: this.typeOrmMerchantRepository + }, + { + repository: this.typeOrmWarehouseProductRepository + }, + { + repository: this.typeOrmWarehouseProductVariantRepository + }, + /* + * Payment & Related Entities + */ + { + repository: this.typeOrmPaymentRepository + }, + /* + * Request Approval & Related Entities + */ + { + repository: this.typeOrmRequestApprovalRepository + }, + { + repository: this.typeOrmRequestApprovalEmployeeRepository + }, + { + repository: this.typeOrmRequestApprovalTeamRepository + }, + /* + * Tasks & Related Entities + */ + { + repository: this.typeOrmTaskRepository + }, + /* + * Timeoff & Related Entities + */ + { + repository: this.typeOrmTimeOffPolicyRepository + }, + { + repository: this.typeOrmTimeOffRequestRepository + }, + /* + * Timesheet & Related Entities + */ + { + repository: this.typeOrmTimesheetRepository + }, + { + repository: this.typeOrmTimeLogRepository + }, + { + repository: this.typeOrmTimeSlotRepository + }, + { + repository: this.typeOrmTimeSlotMinuteRepository + }, + { + repository: this.typeOrmScreenshotRepository + }, + { + repository: this.typeOrmActivityRepository + }, + /* + * Tag & Related Entities + */ + { + repository: this.typeOrmTagRepository + }, + { + repository: this.typeOrmCommentRepository + }, + { + repository: this.typeOrmDailyPlanRepository + }, + { + repository: this.typeOrmEmployeeNotificationRepository + }, + { + repository: this.typeOrmEmployeeNotificationSettingRepository + }, + { + repository: this.typeOrmEmployeePhoneRepository + }, + { + repository: this.typeOrmEntitySubscriptionRepository + }, + { + repository: this.typeOrmFavoriteRepository + }, + { + repository: this.typeOrmIssueTypeRepository + }, + { + repository: this.typeOrmMentionRepository + }, + { + repository: this.typeOrmOrganizationProjectEmployeeRepository + }, + { + repository: this.typeOrmOrganizationProjectModuleRepository + }, + { + repository: this.typeOrmOrganizationProjectModuleEmployeeRepository + }, + { + repository: this.typeOrmOrganizationSprintEmployeeRepository + }, + { + repository: this.typeOrmOrganizationSprintTaskRepository + }, + { + repository: this.typeOrmOrganizationSprintTaskHistoryRepository + }, + { + repository: this.typeOrmOrganizationTaskSettingRepository + }, + { + repository: this.typeOrmOrganizationTeamJoinRequestRepository + }, + { + repository: this.typeOrmReactionRepository + }, + { + repository: this.typeOrmResourceLinkRepository + }, + { + repository: this.typeOrmScreeningTaskRepository + }, + { + repository: this.typeOrmSocialAccountRepository + }, + { + repository: this.typeOrmTaskEstimationRepository + }, + { + repository: this.typeOrmTaskLinkedIssueRepository + }, + { + repository: this.typeOrmTaskPriorityRepository + }, + { + repository: this.typeOrmTaskRelatedIssueTypeRepository + }, + { + repository: this.typeOrmTaskSizeRepository + }, + { + repository: this.typeOrmTaskStatusRepository + }, + { + repository: this.typeOrmTaskVersionRepository + }, + { + repository: this.typeOrmTaskViewRepository + }, + ...this.dynamicEntitiesClassMap + ] as IRepositoryModel[]; + } +} diff --git a/packages/core/src/lib/organization-employment-type/organization-employment-type.entity.ts b/packages/core/src/lib/organization-employment-type/organization-employment-type.entity.ts index 728d7c5804b..56650df25bb 100644 --- a/packages/core/src/lib/organization-employment-type/organization-employment-type.entity.ts +++ b/packages/core/src/lib/organization-employment-type/organization-employment-type.entity.ts @@ -1,18 +1,14 @@ import { JoinTable } from 'typeorm'; import { ApiPropertyOptional } from '@nestjs/swagger'; import { ICandidate, IEmployee, IOrganizationEmploymentType, ITag } from '@gauzy/contracts'; -import { - Candidate, - Employee, - Tag, - TenantOrganizationBaseEntity -} from '../core/entities/internal'; +import { Candidate, Employee, Tag, TenantOrganizationBaseEntity } from '../core/entities/internal'; import { MultiORMColumn, MultiORMEntity, MultiORMManyToMany } from './../core/decorators/entity'; import { MikroOrmOrganizationEmploymentTypeRepository } from './repository/mikro-orm-organization-employment-type.repository'; -@MultiORMEntity('organization_employment_type', { mikroOrmRepository: () => MikroOrmOrganizationEmploymentTypeRepository }) +@MultiORMEntity('organization_employment_type', { + mikroOrmRepository: () => MikroOrmOrganizationEmploymentTypeRepository +}) export class OrganizationEmploymentType extends TenantOrganizationBaseEntity implements IOrganizationEmploymentType { - @MultiORMColumn() name: string; @@ -29,7 +25,7 @@ export class OrganizationEmploymentType extends TenantOrganizationBaseEntity imp owner: true, pivotTable: 'tag_organization_employment_type', joinColumn: 'organizationEmploymentTypeId', - inverseJoinColumn: 'tagId', + inverseJoinColumn: 'tagId' }) @JoinTable({ name: 'tag_organization_employment_type' @@ -45,7 +41,7 @@ export class OrganizationEmploymentType extends TenantOrganizationBaseEntity imp owner: true, pivotTable: 'organization_employment_type_employee', joinColumn: 'organizationEmploymentTypeId', - inverseJoinColumn: 'employeeId', + inverseJoinColumn: 'employeeId' }) @JoinTable({ name: 'organization_employment_type_employee' @@ -62,7 +58,7 @@ export class OrganizationEmploymentType extends TenantOrganizationBaseEntity imp owner: true, pivotTable: 'candidate_employment_type', joinColumn: 'organizationEmploymentTypeId', - inverseJoinColumn: 'candidateId', + inverseJoinColumn: 'candidateId' }) @JoinTable({ name: 'candidate_employment_type' diff --git a/packages/core/src/lib/organization-language/organization-language.entity.ts b/packages/core/src/lib/organization-language/organization-language.entity.ts index f22d354438c..f13f6d3716e 100644 --- a/packages/core/src/lib/organization-language/organization-language.entity.ts +++ b/packages/core/src/lib/organization-language/organization-language.entity.ts @@ -2,16 +2,12 @@ import { JoinColumn, RelationId } from 'typeorm'; import { ApiProperty } from '@nestjs/swagger'; import { IsNotEmpty, IsOptional, IsString } from 'class-validator'; import { IOrganizationLanguage } from '@gauzy/contracts'; -import { - Language, - TenantOrganizationBaseEntity -} from '../core/entities/internal'; +import { Language, TenantOrganizationBaseEntity } from '../core/entities/internal'; import { ColumnIndex, MultiORMColumn, MultiORMEntity, MultiORMManyToOne } from './../core/decorators/entity'; import { MikroOrmOrganizationLanguageRepository } from './repository/mikro-orm-organization-language.repository'; @MultiORMEntity('organization_language', { mikroOrmRepository: () => MikroOrmOrganizationLanguageRepository }) export class OrganizationLanguage extends TenantOrganizationBaseEntity implements IOrganizationLanguage { - @ApiProperty({ type: () => Language }) @MultiORMManyToOne(() => Language, { /** Database cascade action on delete. */ @@ -19,7 +15,7 @@ export class OrganizationLanguage extends TenantOrganizationBaseEntity implement referenceColumnName: 'code', joinColumn: 'languageCode' }) - @JoinColumn({ referencedColumnName: "code" }) + @JoinColumn({ referencedColumnName: 'code' }) language: Language; @ApiProperty({ type: () => String }) diff --git a/packages/ui-core/core/src/lib/services/import-export/export-all.service.ts b/packages/ui-core/core/src/lib/services/import-export/export-all.service.ts index 8ca7c7dba0d..87e3b820436 100644 --- a/packages/ui-core/core/src/lib/services/import-export/export-all.service.ts +++ b/packages/ui-core/core/src/lib/services/import-export/export-all.service.ts @@ -8,10 +8,10 @@ import { API_PREFIX } from '@gauzy/ui-core/common'; export class ExportAllService { constructor(private readonly http: HttpClient) {} - downloadAllData() { + downloadAllData(organizationId: string) { return this.http.get(`${API_PREFIX}/download`, { responseType: 'blob', - params: {} + params: { organizationId } }); } @@ -21,11 +21,14 @@ export class ExportAllService { }); } - downloadSpecificTable(names: string[]) { + downloadSpecificTable(names: string[], organizationId: string) { const data = JSON.stringify({ entities: { names } }); + + if (!names || !organizationId) return; + return this.http.get(`${API_PREFIX}/export/filter`, { responseType: 'blob', - params: { data } + params: { data, organizationId } }); } } diff --git a/packages/ui-core/i18n/assets/i18n/ach.json b/packages/ui-core/i18n/assets/i18n/ach.json index b341b77154d..6157ab64d12 100644 --- a/packages/ui-core/i18n/assets/i18n/ach.json +++ b/packages/ui-core/i18n/assets/i18n/ach.json @@ -955,7 +955,45 @@ "FEATURE_ORGANIZATION": "crwdns10474:0crwdne10474:0", "EXPORT_DATA": "crwdns11197:0crwdne11197:0", "IMPORT_DATA": "crwdns11199:0crwdne11199:0", - "ALL_ENTITIES": "crwdns11203:0crwdne11203:0" + "ALL_ENTITIES": "crwdns11203:0crwdne11203:0", + + "ACTIVITY_LOG": "Kit ma gityeko", + "DAILY_PLAN": "Cik me nino", + "ENTITY_SUBSCRIPTION": "Keto nying i jami", + "FAVORITE": "Gin ma itamo", + "MENTION": "Miyo nying", + "REACTION": "Lagam", + "RESOURCE_LINK": "Kube me jami", + "SCREENING_TASK": "Cik me kelo ngec", + "SOCIAL_ACCOUNT": "Akaunt me jami", + "CHANGELOG": "Lok me tic", + "ISSUE_TYPE": "Kit me peko", + "TASK_ESTIMATION": "Neno tic", + "TASK_LINKED_ISSUE": "Peko ma kubo i tic", + "TASK_PRIORITY": "Ma tic obedo matidi", + "TASK_RELATED_ISSUE": "Peko ma kubo i tic", + "TASK_SIZE": "Lac me tic", + "TASK_STATUS": "Kit me tic", + "TASK_VERSION": "Kit me tic", + "TASK_RELATED_ISSUE_TYPE": "Kit me peko ma kubo i tic", + "ORGANIZATION_PROJECT_EMPLOYEE": "Latic me tic", + "ORGANIZATION_PROJECT_MODULE": "Kit me tic", + "ORGANIZATION_PROJECT_MODULE_EMPLOYEE": "Latic me kit me tic", + "ORGANIZATION_SPRINT_EMPLOYEE": "Latic me tic", + "ORGANIZATION_SPRINT_TASK": "Tic me tic", + "ORGANIZATION_SPRINT_TASK_HISTORY": "Lok me tic", + "ORGANIZATION_TASK_SETTING": "Cik me tic", + "ORGANIZATION_TEAM_JOIN_REQUEST": "Cik me donyo i team", + "ORGANIZATION_GITHUB_REPOSITORY": "GitHub me jami", + "ORGANIZATION_GITHUB_REPOSITORY_ISSUE": "Peko me GitHub", + "EMPLOYEE_AVAILABILITY": "Latic me tic", + "EMPLOYEE_NOTIFICATION": "Latic me tic", + "EMPLOYEE_PHONE": "Latic me tic", + "APPOINTMENT_EMPLOYEE": "Latic me tic", + "EMPLOYEE_NOTIFICATION_SETTING": "Cik me latic me tic", + "PRODUCT_REVIEW": "Neno jami", + "TASK_LINKED_ISSUES": "Peko ma kubo i tic", + "TASK_VIEW": "Neno tic" }, "TAGS": "crwdns2861:0crwdne2861:0", "LANGUAGE": "crwdns4646:0crwdne4646:0", diff --git a/packages/ui-core/i18n/assets/i18n/ar.json b/packages/ui-core/i18n/assets/i18n/ar.json index 6b7476e170b..84a8c76e4b2 100644 --- a/packages/ui-core/i18n/assets/i18n/ar.json +++ b/packages/ui-core/i18n/assets/i18n/ar.json @@ -1043,7 +1043,44 @@ "FEATURE_ORGANIZATION": "تنظيم الميزات", "EXPORT_DATA": "تصدير البيانات", "IMPORT_DATA": "استيراد البيانات", - "ALL_ENTITIES": "جميع الكيانات" + "ALL_ENTITIES": "جميع الكيانات", + "ACTIVITY_LOG": "سجل النشاط", + "DAILY_PLAN": "الخطة اليومية", + "ENTITY_SUBSCRIPTION": "اشتراك الكيان", + "FAVORITE": "المفضل", + "MENTION": "إشارة", + "REACTION": "رد فعل", + "RESOURCE_LINK": "رابط المورد", + "SCREENING_TASK": "مهمة الفحص", + "SOCIAL_ACCOUNT": "الحساب الاجتماعي", + "CHANGELOG": "سجل التغييرات", + "ISSUE_TYPE": "نوع المشكلة", + "TASK_ESTIMATION": "تقدير المهمة", + "TASK_LINKED_ISSUE": "مشكلة مرتبطة بالمهمة", + "TASK_PRIORITY": "أولوية المهمة", + "TASK_RELATED_ISSUE": "مشكلة ذات صلة بالمهمة", + "TASK_SIZE": "حجم المهمة", + "TASK_STATUS": "حالة المهمة", + "TASK_VERSION": "إصدار المهمة", + "TASK_RELATED_ISSUE_TYPE": "نوع المشكلة ذات الصلة بالمهمة", + "ORGANIZATION_PROJECT_EMPLOYEE": "موظف مشروع المنظمة", + "ORGANIZATION_PROJECT_MODULE": "وحدة مشروع المنظمة", + "ORGANIZATION_PROJECT_MODULE_EMPLOYEE": "موظف وحدة مشروع المنظمة", + "ORGANIZATION_SPRINT_EMPLOYEE": "موظف سباق المنظمة", + "ORGANIZATION_SPRINT_TASK": "مهمة سباق المنظمة", + "ORGANIZATION_SPRINT_TASK_HISTORY": "تاريخ مهمة سباق المنظمة", + "ORGANIZATION_TASK_SETTING": "إعداد مهمة المنظمة", + "ORGANIZATION_TEAM_JOIN_REQUEST": "طلب الانضمام إلى فريق المنظمة", + "ORGANIZATION_GITHUB_REPOSITORY": "مستودع GitHub للمنظمة", + "ORGANIZATION_GITHUB_REPOSITORY_ISSUE": "مشكلة مستودع GitHub للمنظمة", + "EMPLOYEE_AVAILABILITY": "توفر الموظف", + "EMPLOYEE_NOTIFICATION": "إشعار الموظف", + "EMPLOYEE_PHONE": "هاتف الموظف", + "APPOINTMENT_EMPLOYEE": "تعيين الموظف", + "EMPLOYEE_NOTIFICATION_SETTING": "إعداد إشعار الموظف", + "PRODUCT_REVIEW": "مراجعة المنتج", + "TASK_LINKED_ISSUES": "المشكلات المرتبطة", + "TASK_VIEW": "عرض المهمة" }, "TAGS": "الوسوم", "LANGUAGE": "اللغة", diff --git a/packages/ui-core/i18n/assets/i18n/bg.json b/packages/ui-core/i18n/assets/i18n/bg.json index 967b34e7129..a5b8b4a5d1c 100644 --- a/packages/ui-core/i18n/assets/i18n/bg.json +++ b/packages/ui-core/i18n/assets/i18n/bg.json @@ -1073,7 +1073,44 @@ "FEATURE_ORGANIZATION": "Функция на организация", "EXPORT_DATA": "Експортиране на данни", "IMPORT_DATA": "Импортиране на данни", - "ALL_ENTITIES": "ВСИЧКИ СУЩНОСТИ" + "ALL_ENTITIES": "ВСИЧКИ СУЩНОСТИ", + "ACTIVITY_LOG": "Дневник на активността", + "DAILY_PLAN": "Дневен план", + "ENTITY_SUBSCRIPTION": "Абонамент за обект", + "FAVORITE": "Любим", + "MENTION": "Споменаване", + "REACTION": "Реакция", + "RESOURCE_LINK": "Връзка към ресурс", + "SCREENING_TASK": "Задача за скрининг", + "SOCIAL_ACCOUNT": "Социален акаунт", + "CHANGELOG": "Дневник на промените", + "ISSUE_TYPE": "Тип на проблема", + "TASK_ESTIMATION": "Оценка на задачата", + "TASK_LINKED_ISSUE": "Свързан проблем с задачата", + "TASK_PRIORITY": "Приоритет на задачата", + "TASK_RELATED_ISSUE": "Свързан проблем с задачата", + "TASK_SIZE": "Размер на задачата", + "TASK_STATUS": "Статус на задачата", + "TASK_VERSION": "Версия на задачата", + "TASK_RELATED_ISSUE_TYPE": "Тип на свързания проблем с задачата", + "ORGANIZATION_PROJECT_EMPLOYEE": "Служител на проект в организацията", + "ORGANIZATION_PROJECT_MODULE": "Модул на проект в организацията", + "ORGANIZATION_PROJECT_MODULE_EMPLOYEE": "Служител на модул на проект в организацията", + "ORGANIZATION_SPRINT_EMPLOYEE": "Служител на спринт в организацията", + "ORGANIZATION_SPRINT_TASK": "Задача на спринт в организацията", + "ORGANIZATION_SPRINT_TASK_HISTORY": "История на задачи на спринт в организацията", + "ORGANIZATION_TASK_SETTING": "Настройка на задачи в организацията", + "ORGANIZATION_TEAM_JOIN_REQUEST": "Заявка за присъединяване към екип в организацията", + "ORGANIZATION_GITHUB_REPOSITORY": "GitHub хранилище на организацията", + "ORGANIZATION_GITHUB_REPOSITORY_ISSUE": "Проблем в GitHub хранилище на организацията", + "EMPLOYEE_AVAILABILITY": "Наличност на служителя", + "EMPLOYEE_NOTIFICATION": "Известие на служителя", + "EMPLOYEE_PHONE": "Телефон на служителя", + "APPOINTMENT_EMPLOYEE": "Назначен служител", + "EMPLOYEE_NOTIFICATION_SETTING": "Настройка на известия на служителя", + "PRODUCT_REVIEW": "Преглед на продукта", + "TASK_LINKED_ISSUES": "Свързани проблеми", + "TASK_VIEW": "Изглед на задачата" }, "TAGS": "Тагове", "LANGUAGE": "Език", diff --git a/packages/ui-core/i18n/assets/i18n/de.json b/packages/ui-core/i18n/assets/i18n/de.json index 6934962047d..b2083df38d0 100644 --- a/packages/ui-core/i18n/assets/i18n/de.json +++ b/packages/ui-core/i18n/assets/i18n/de.json @@ -1044,7 +1044,44 @@ "FEATURE_ORGANIZATION": "Funktionsorganisation", "EXPORT_DATA": "Exportieren Sie Daten", "IMPORT_DATA": "Daten importieren", - "ALL_ENTITIES": "ALLE Einheiten" + "ALL_ENTITIES": "ALLE Einheiten", + "ACTIVITY_LOG": "Aktivitätsprotokoll", + "DAILY_PLAN": "Tagesplan", + "ENTITY_SUBSCRIPTION": "Entitätsabonnement", + "FAVORITE": "Favorit", + "MENTION": "Erwähnung", + "REACTION": "Reaktion", + "RESOURCE_LINK": "Ressourcenlink", + "SCREENING_TASK": "Screening-Aufgabe", + "SOCIAL_ACCOUNT": "Soziales Konto", + "CHANGELOG": "Änderungsprotokoll", + "ISSUE_TYPE": "Problemtyp", + "TASK_ESTIMATION": "Aufgabenschätzung", + "TASK_LINKED_ISSUE": "Verknüpftes Problem", + "TASK_PRIORITY": "Aufgabenpriorität", + "TASK_RELATED_ISSUE": "Zugehöriges Problem", + "TASK_SIZE": "Aufgabengröße", + "TASK_STATUS": "Aufgabenstatus", + "TASK_VERSION": "Aufgabenversion", + "TASK_RELATED_ISSUE_TYPE": "Typ des zugehörigen Problems", + "ORGANIZATION_PROJECT_EMPLOYEE": "Mitarbeiter des Organisationsprojekts", + "ORGANIZATION_PROJECT_MODULE": "Modul des Organisationsprojekts", + "ORGANIZATION_PROJECT_MODULE_EMPLOYEE": "Mitarbeiter des Projektmoduls der Organisation", + "ORGANIZATION_SPRINT_EMPLOYEE": "Mitarbeiter des Organisationssprints", + "ORGANIZATION_SPRINT_TASK": "Aufgabe des Organisationssprints", + "ORGANIZATION_SPRINT_TASK_HISTORY": "Aufgabenverlauf des Organisationssprints", + "ORGANIZATION_TASK_SETTING": "Aufgabeneinstellung der Organisation", + "ORGANIZATION_TEAM_JOIN_REQUEST": "Beitrittsanfrage des Organisationsteams", + "ORGANIZATION_GITHUB_REPOSITORY": "GitHub-Repository der Organisation", + "ORGANIZATION_GITHUB_REPOSITORY_ISSUE": "Problem des GitHub-Repositorys der Organisation", + "EMPLOYEE_AVAILABILITY": "Verfügbarkeit des Mitarbeiters", + "EMPLOYEE_NOTIFICATION": "Benachrichtigung des Mitarbeiters", + "EMPLOYEE_PHONE": "Telefon des Mitarbeiters", + "APPOINTMENT_EMPLOYEE": "Ernannter Mitarbeiter", + "EMPLOYEE_NOTIFICATION_SETTING": "Benachrichtigungseinstellung des Mitarbeiters", + "PRODUCT_REVIEW": "Produktbewertung", + "TASK_LINKED_ISSUES": "Verknüpfte Probleme", + "TASK_VIEW": "Aufgabenansicht" }, "TAGS": "Tags", "LANGUAGE": "Sprache", diff --git a/packages/ui-core/i18n/assets/i18n/en.json b/packages/ui-core/i18n/assets/i18n/en.json index 5d63d208f83..538664ac612 100644 --- a/packages/ui-core/i18n/assets/i18n/en.json +++ b/packages/ui-core/i18n/assets/i18n/en.json @@ -1083,7 +1083,44 @@ "FEATURE_ORGANIZATION": "Feature Organization", "EXPORT_DATA": "Export Data", "IMPORT_DATA": "Import Data", - "ALL_ENTITIES": "ALL Entities" + "ALL_ENTITIES": "ALL Entities", + "ACTIVITY_LOG": "Activity log", + "DAILY_PLAN": "Daily plan", + "ENTITY_SUBSCRIPTION": "Entity subscription", + "FAVORITE": "Favorite", + "MENTION": "Mention", + "REACTION": "Reaction", + "RESOURCE_LINK": "Resource link", + "SCREENING_TASK": "Screening task", + "SOCIAL_ACCOUNT": "Social account", + "CHANGELOG": "Changelog", + "ISSUE_TYPE": "Issue type", + "TASK_ESTIMATION": "Task estimation", + "TASK_LINKED_ISSUE": "Task linked issue", + "TASK_PRIORITY": "Task priority", + "TASK_RELATED_ISSUE": "Task related issue", + "TASK_SIZE": "Task size", + "TASK_STATUS": "Task status", + "TASK_VERSION": "Task version", + "TASK_RELATED_ISSUE_TYPE": "Task related issue type", + "ORGANIZATION_PROJECT_EMPLOYEE": "Organization project employee", + "ORGANIZATION_PROJECT_MODULE": "Organization project module", + "ORGANIZATION_PROJECT_MODULE_EMPLOYEE": "Organization project module employee", + "ORGANIZATION_SPRINT_EMPLOYEE": "Organization sprint employee", + "ORGANIZATION_SPRINT_TASK": "Organization sprint task", + "ORGANIZATION_SPRINT_TASK_HISTORY": "Organization sprint task history", + "ORGANIZATION_TASK_SETTING": "Organization task setting", + "ORGANIZATION_TEAM_JOIN_REQUEST": "Organization team join request", + "ORGANIZATION_GITHUB_REPOSITORY": "Organization GitHub repository", + "ORGANIZATION_GITHUB_REPOSITORY_ISSUE": "Organization GitHub repository issue", + "EMPLOYEE_AVAILABILITY": "Employee availability", + "EMPLOYEE_NOTIFICATION": "Employee notification", + "EMPLOYEE_PHONE": "Employee phone", + "APPOINTMENT_EMPLOYEE": "Appointment employee", + "EMPLOYEE_NOTIFICATION_SETTING": "Employee notification setting", + "PRODUCT_REVIEW": "Product review", + "TASK_LINKED_ISSUES": "Linked Issues", + "TASK_VIEW": "Task View" }, "TAGS": "Tags", "LANGUAGE": "Language", diff --git a/packages/ui-core/i18n/assets/i18n/es.json b/packages/ui-core/i18n/assets/i18n/es.json index 51d1a0ec589..ded310d49b9 100644 --- a/packages/ui-core/i18n/assets/i18n/es.json +++ b/packages/ui-core/i18n/assets/i18n/es.json @@ -1045,7 +1045,44 @@ "FEATURE_ORGANIZATION": "Organización de funciones", "EXPORT_DATA": "Exportar Datos", "IMPORT_DATA": "Importar datos", - "ALL_ENTITIES": "TODAS las entidades" + "ALL_ENTITIES": "TODAS las entidades", + "ACTIVITY_LOG": "Registro de actividad", + "DAILY_PLAN": "Plan diario", + "ENTITY_SUBSCRIPTION": "Suscripción de entidad", + "FAVORITE": "Favorito", + "MENTION": "Mención", + "REACTION": "Reacción", + "RESOURCE_LINK": "Enlace de recurso", + "SCREENING_TASK": "Tarea de evaluación", + "SOCIAL_ACCOUNT": "Cuenta social", + "CHANGELOG": "Registro de cambios", + "ISSUE_TYPE": "Tipo de incidencia", + "TASK_ESTIMATION": "Estimación de tarea", + "TASK_LINKED_ISSUE": "Tarea vinculada a incidencia", + "TASK_PRIORITY": "Prioridad de la tarea", + "TASK_RELATED_ISSUE": "Tarea relacionada con incidencia", + "TASK_SIZE": "Tamaño de la tarea", + "TASK_STATUS": "Estado de la tarea", + "TASK_VERSION": "Versión de la tarea", + "TASK_RELATED_ISSUE_TYPE": "Tipo de incidencia relacionada con la tarea", + "ORGANIZATION_PROJECT_EMPLOYEE": "Empleado del proyecto de la organización", + "ORGANIZATION_PROJECT_MODULE": "Módulo del proyecto de la organización", + "ORGANIZATION_PROJECT_MODULE_EMPLOYEE": "Empleado del módulo del proyecto de la organización", + "ORGANIZATION_SPRINT_EMPLOYEE": "Empleado del sprint de la organización", + "ORGANIZATION_SPRINT_TASK": "Tarea del sprint de la organización", + "ORGANIZATION_SPRINT_TASK_HISTORY": "Historial de tareas del sprint de la organización", + "ORGANIZATION_TASK_SETTING": "Configuración de tareas de la organización", + "ORGANIZATION_TEAM_JOIN_REQUEST": "Solicitud de unión al equipo de la organización", + "ORGANIZATION_GITHUB_REPOSITORY": "Repositorio GitHub de la organización", + "ORGANIZATION_GITHUB_REPOSITORY_ISSUE": "Incidencia del repositorio GitHub de la organización", + "EMPLOYEE_AVAILABILITY": "Disponibilidad del empleado", + "EMPLOYEE_NOTIFICATION": "Notificación al empleado", + "EMPLOYEE_PHONE": "Teléfono del empleado", + "APPOINTMENT_EMPLOYEE": "Empleado asignado", + "EMPLOYEE_NOTIFICATION_SETTING": "Configuración de notificaciones del empleado", + "PRODUCT_REVIEW": "Reseña del producto", + "TASK_LINKED_ISSUES": "Problemas vinculados", + "TASK_VIEW": "Vista de tarea" }, "TAGS": "Etiquetas", "LANGUAGE": "Idioma", diff --git a/packages/ui-core/i18n/assets/i18n/fr.json b/packages/ui-core/i18n/assets/i18n/fr.json index d40bcd797b6..b2064d7cea1 100644 --- a/packages/ui-core/i18n/assets/i18n/fr.json +++ b/packages/ui-core/i18n/assets/i18n/fr.json @@ -1045,7 +1045,44 @@ "FEATURE_ORGANIZATION": "Organisation des fonctionnalités", "EXPORT_DATA": "Exporter les données", "IMPORT_DATA": "Importer des données", - "ALL_ENTITIES": "Toutes les entités" + "ALL_ENTITIES": "Toutes les entités", + "ACTIVITY_LOG": "Journal d'activité", + "DAILY_PLAN": "Plan quotidien", + "ENTITY_SUBSCRIPTION": "Abonnement à l'entité", + "FAVORITE": "Favori", + "MENTION": "Mention", + "REACTION": "Réaction", + "RESOURCE_LINK": "Lien de ressource", + "SCREENING_TASK": "Tâche de présélection", + "SOCIAL_ACCOUNT": "Compte social", + "CHANGELOG": "Journal des modifications", + "ISSUE_TYPE": "Type de problème", + "TASK_ESTIMATION": "Estimation de la tâche", + "TASK_LINKED_ISSUE": "Problème lié à la tâche", + "TASK_PRIORITY": "Priorité de la tâche", + "TASK_RELATED_ISSUE": "Problème lié à la tâche", + "TASK_SIZE": "Taille de la tâche", + "TASK_STATUS": "Statut de la tâche", + "TASK_VERSION": "Version de la tâche", + "TASK_RELATED_ISSUE_TYPE": "Type de problème lié à la tâche", + "ORGANIZATION_PROJECT_EMPLOYEE": "Employé du projet de l'organisation", + "ORGANIZATION_PROJECT_MODULE": "Module du projet de l'organisation", + "ORGANIZATION_PROJECT_MODULE_EMPLOYEE": "Employé du module du projet de l'organisation", + "ORGANIZATION_SPRINT_EMPLOYEE": "Employé du sprint de l'organisation", + "ORGANIZATION_SPRINT_TASK": "Tâche du sprint de l'organisation", + "ORGANIZATION_SPRINT_TASK_HISTORY": "Historique des tâches du sprint de l'organisation", + "ORGANIZATION_TASK_SETTING": "Paramètre de tâche de l'organisation", + "ORGANIZATION_TEAM_JOIN_REQUEST": "Demande d'adhésion à l'équipe de l'organisation", + "ORGANIZATION_GITHUB_REPOSITORY": "Dépôt GitHub de l'organisation", + "ORGANIZATION_GITHUB_REPOSITORY_ISSUE": "Problème du dépôt GitHub de l'organisation", + "EMPLOYEE_AVAILABILITY": "Disponibilité de l'employé", + "EMPLOYEE_NOTIFICATION": "Notification de l'employé", + "EMPLOYEE_PHONE": "Téléphone de l'employé", + "APPOINTMENT_EMPLOYEE": "Employé nommé", + "EMPLOYEE_NOTIFICATION_SETTING": "Paramètre de notification de l'employé", + "PRODUCT_REVIEW": "Avis sur le produit", + "TASK_LINKED_ISSUES": "Problèmes liés", + "TASK_VIEW": "Vue de la tâche" }, "TAGS": "Étiquettes", "LANGUAGE": "Langue", diff --git a/packages/ui-core/i18n/assets/i18n/he.json b/packages/ui-core/i18n/assets/i18n/he.json index cf74a8b2431..e51e46146c9 100644 --- a/packages/ui-core/i18n/assets/i18n/he.json +++ b/packages/ui-core/i18n/assets/i18n/he.json @@ -1048,7 +1048,44 @@ "FEATURE_ORGANIZATION": "Feature Organization", "EXPORT_DATA": "Export Data", "IMPORT_DATA": "Import Data", - "ALL_ENTITIES": "ALL Entities" + "ALL_ENTITIES": "כל הישויות", + "ACTIVITY_LOG": "יומן פעילות", + "DAILY_PLAN": "תוכנית יומית", + "ENTITY_SUBSCRIPTION": "מנוי ישות", + "FAVORITE": "מועדף", + "MENTION": "אזכור", + "REACTION": "תגובה", + "RESOURCE_LINK": "קישור משאב", + "SCREENING_TASK": "משימת סינון", + "SOCIAL_ACCOUNT": "חשבון חברתי", + "CHANGELOG": "יומן שינויים", + "ISSUE_TYPE": "סוג בעיה", + "TASK_ESTIMATION": "הערכת משימה", + "TASK_LINKED_ISSUE": "בעיה מקושרת למשימה", + "TASK_PRIORITY": "עדיפות משימה", + "TASK_RELATED_ISSUE": "בעיה קשורה למשימה", + "TASK_SIZE": "גודל משימה", + "TASK_STATUS": "סטטוס משימה", + "TASK_VERSION": "גרסת משימה", + "TASK_RELATED_ISSUE_TYPE": "סוג בעיה קשורה", + "ORGANIZATION_PROJECT_EMPLOYEE": "עובד פרויקט בארגון", + "ORGANIZATION_PROJECT_MODULE": "מודול פרויקט בארגון", + "ORGANIZATION_PROJECT_MODULE_EMPLOYEE": "עובד מודול פרויקט בארגון", + "ORGANIZATION_SPRINT_EMPLOYEE": "עובד ספרינט בארגון", + "ORGANIZATION_SPRINT_TASK": "משימת ספרינט בארגון", + "ORGANIZATION_SPRINT_TASK_HISTORY": "היסטוריית משימת ספרינט בארגון", + "ORGANIZATION_TASK_SETTING": "הגדרת משימה בארגון", + "ORGANIZATION_TEAM_JOIN_REQUEST": "בקשת הצטרפות לצוות בארגון", + "ORGANIZATION_GITHUB_REPOSITORY": "מאגר GitHub של הארגון", + "ORGANIZATION_GITHUB_REPOSITORY_ISSUE": "בעיה במאגר GitHub של הארגון", + "EMPLOYEE_AVAILABILITY": "זמינות עובד", + "EMPLOYEE_NOTIFICATION": "הודעת עובד", + "EMPLOYEE_PHONE": "טלפון עובד", + "APPOINTMENT_EMPLOYEE": "פגישת עובד", + "EMPLOYEE_NOTIFICATION_SETTING": "הגדרת הודעת עובד", + "PRODUCT_REVIEW": "סקירת מוצר", + "TASK_LINKED_ISSUES": "בעיות מקושרות", + "TASK_VIEW": "תצוגת משימה" }, "TAGS": "Tags", "LANGUAGE": "Language", diff --git a/packages/ui-core/i18n/assets/i18n/it.json b/packages/ui-core/i18n/assets/i18n/it.json index 2f6de8d5ed1..a54f6c983a0 100644 --- a/packages/ui-core/i18n/assets/i18n/it.json +++ b/packages/ui-core/i18n/assets/i18n/it.json @@ -1044,7 +1044,44 @@ "FEATURE_ORGANIZATION": "Organizzazione delle funzioni", "EXPORT_DATA": "Esporta dati", "IMPORT_DATA": "Importare dati", - "ALL_ENTITIES": "TUTTE le entità" + "ALL_ENTITIES": "TUTTE le entità", + "ACTIVITY_LOG": "Registro attività", + "DAILY_PLAN": "Piano giornaliero", + "ENTITY_SUBSCRIPTION": "Sottoscrizione entità", + "FAVORITE": "Preferito", + "MENTION": "Menzione", + "REACTION": "Reazione", + "RESOURCE_LINK": "Link risorsa", + "SCREENING_TASK": "Attività di screening", + "SOCIAL_ACCOUNT": "Account social", + "CHANGELOG": "Registro modifiche", + "ISSUE_TYPE": "Tipo di problema", + "TASK_ESTIMATION": "Stima attività", + "TASK_LINKED_ISSUE": "Problema collegato all’attività", + "TASK_PRIORITY": "Priorità attività", + "TASK_RELATED_ISSUE": "Problema correlato all’attività", + "TASK_SIZE": "Dimensione attività", + "TASK_STATUS": "Stato attività", + "TASK_VERSION": "Versione attività", + "TASK_RELATED_ISSUE_TYPE": "Tipo di problema correlato", + "ORGANIZATION_PROJECT_EMPLOYEE": "Dipendente progetto organizzazione", + "ORGANIZATION_PROJECT_MODULE": "Modulo progetto organizzazione", + "ORGANIZATION_PROJECT_MODULE_EMPLOYEE": "Dipendente modulo progetto organizzazione", + "ORGANIZATION_SPRINT_EMPLOYEE": "Dipendente sprint organizzazione", + "ORGANIZATION_SPRINT_TASK": "Attività sprint organizzazione", + "ORGANIZATION_SPRINT_TASK_HISTORY": "Storico attività sprint organizzazione", + "ORGANIZATION_TASK_SETTING": "Impostazioni attività organizzazione", + "ORGANIZATION_TEAM_JOIN_REQUEST": "Richiesta di accesso al team organizzazione", + "ORGANIZATION_GITHUB_REPOSITORY": "Repository GitHub organizzazione", + "ORGANIZATION_GITHUB_REPOSITORY_ISSUE": "Problema repository GitHub organizzazione", + "EMPLOYEE_AVAILABILITY": "Disponibilità dipendente", + "EMPLOYEE_NOTIFICATION": "Notifica dipendente", + "EMPLOYEE_PHONE": "Telefono dipendente", + "APPOINTMENT_EMPLOYEE": "Appuntamento dipendente", + "EMPLOYEE_NOTIFICATION_SETTING": "Impostazioni notifica dipendente", + "PRODUCT_REVIEW": "Recensione prodotto", + "TASK_LINKED_ISSUES": "Problemi collegati", + "TASK_VIEW": "Vista attività" }, "TAGS": "Tag", "LANGUAGE": "Lingua", diff --git a/packages/ui-core/i18n/assets/i18n/nl.json b/packages/ui-core/i18n/assets/i18n/nl.json index 0b43e15f7bf..004f16f2380 100644 --- a/packages/ui-core/i18n/assets/i18n/nl.json +++ b/packages/ui-core/i18n/assets/i18n/nl.json @@ -1044,7 +1044,44 @@ "FEATURE_ORGANIZATION": "Functie Organisatie", "EXPORT_DATA": "Exporteren van gegevens", "IMPORT_DATA": "Gegevens importeren", - "ALL_ENTITIES": "ALLE Entiteiten" + "ALL_ENTITIES": "ALLE Entiteiten", + "ACTIVITY_LOG": "Activiteitenlogboek", + "DAILY_PLAN": "Dagelijkse planning", + "ENTITY_SUBSCRIPTION": "Entiteit abonnement", + "FAVORITE": "Favoriet", + "MENTION": "Vermelding", + "REACTION": "Reactie", + "RESOURCE_LINK": "Bronlink", + "SCREENING_TASK": "Screeningtaak", + "SOCIAL_ACCOUNT": "Sociaal account", + "CHANGELOG": "Wijzigingslogboek", + "ISSUE_TYPE": "Probleemtype", + "TASK_ESTIMATION": "Taakinschatting", + "TASK_LINKED_ISSUE": "Taak gekoppeld probleem", + "TASK_PRIORITY": "Taakprioriteit", + "TASK_RELATED_ISSUE": "Taak gerelateerd probleem", + "TASK_SIZE": "Taakgrootte", + "TASK_STATUS": "Taakstatus", + "TASK_VERSION": "Taakversie", + "TASK_RELATED_ISSUE_TYPE": "Taak gerelateerd probleemtype", + "ORGANIZATION_PROJECT_EMPLOYEE": "Organisatie projectmedewerker", + "ORGANIZATION_PROJECT_MODULE": "Organisatie projectmodule", + "ORGANIZATION_PROJECT_MODULE_EMPLOYEE": "Organisatie projectmodule medewerker", + "ORGANIZATION_SPRINT_EMPLOYEE": "Organisatie sprintmedewerker", + "ORGANIZATION_SPRINT_TASK": "Organisatie sprinttaak", + "ORGANIZATION_SPRINT_TASK_HISTORY": "Organisatie sprinttaakgeschiedenis", + "ORGANIZATION_TASK_SETTING": "Organisatie taakinstelling", + "ORGANIZATION_TEAM_JOIN_REQUEST": "Organisatie teamverzoek om deel te nemen", + "ORGANIZATION_GITHUB_REPOSITORY": "Organisatie GitHub-repository", + "ORGANIZATION_GITHUB_REPOSITORY_ISSUE": "Organisatie GitHub-repository probleem", + "EMPLOYEE_AVAILABILITY": "Beschikbaarheid van medewerker", + "EMPLOYEE_NOTIFICATION": "Medewerker notificatie", + "EMPLOYEE_PHONE": "Telefoon van medewerker", + "APPOINTMENT_EMPLOYEE": "Aangestelde medewerker", + "EMPLOYEE_NOTIFICATION_SETTING": "Instelling voor medewerker notificatie", + "PRODUCT_REVIEW": "Productbeoordeling", + "TASK_LINKED_ISSUES": "Gekoppelde problemen", + "TASK_VIEW": "Taakweergave" }, "TAGS": "Tags", "LANGUAGE": "Taal.", diff --git a/packages/ui-core/i18n/assets/i18n/pl.json b/packages/ui-core/i18n/assets/i18n/pl.json index c5900ee62dd..cb56f03c51c 100644 --- a/packages/ui-core/i18n/assets/i18n/pl.json +++ b/packages/ui-core/i18n/assets/i18n/pl.json @@ -1044,7 +1044,44 @@ "FEATURE_ORGANIZATION": "Organizacja funkcji", "EXPORT_DATA": "Eksportuj dane", "IMPORT_DATA": "Importuj dane", - "ALL_ENTITIES": "WSZYSTKIE podmioty" + "ALL_ENTITIES": "WSZYSTKIE podmioty", + "ACTIVITY_LOG": "Dziennik aktywności", + "DAILY_PLAN": "Plan dnia", + "ENTITY_SUBSCRIPTION": "Subskrypcja jednostki", + "FAVORITE": "Ulubione", + "MENTION": "Wzmianka", + "REACTION": "Reakcja", + "RESOURCE_LINK": "Link do zasobu", + "SCREENING_TASK": "Zadanie przesiewowe", + "SOCIAL_ACCOUNT": "Konto społecznościowe", + "CHANGELOG": "Dziennik zmian", + "ISSUE_TYPE": "Typ zgłoszenia", + "TASK_ESTIMATION": "Szacowanie zadania", + "TASK_LINKED_ISSUE": "Powiązane zgłoszenie zadania", + "TASK_PRIORITY": "Priorytet zadania", + "TASK_RELATED_ISSUE": "Powiązane zgłoszenie zadania", + "TASK_SIZE": "Rozmiar zadania", + "TASK_STATUS": "Status zadania", + "TASK_VERSION": "Wersja zadania", + "TASK_RELATED_ISSUE_TYPE": "Typ powiązanego zgłoszenia", + "ORGANIZATION_PROJECT_EMPLOYEE": "Pracownik projektu organizacji", + "ORGANIZATION_PROJECT_MODULE": "Moduł projektu organizacji", + "ORGANIZATION_PROJECT_MODULE_EMPLOYEE": "Pracownik modułu projektu organizacji", + "ORGANIZATION_SPRINT_EMPLOYEE": "Pracownik sprintu organizacji", + "ORGANIZATION_SPRINT_TASK": "Zadanie sprintu organizacji", + "ORGANIZATION_SPRINT_TASK_HISTORY": "Historia zadań sprintu organizacji", + "ORGANIZATION_TASK_SETTING": "Ustawienia zadań organizacji", + "ORGANIZATION_TEAM_JOIN_REQUEST": "Prośba o dołączenie do zespołu organizacji", + "ORGANIZATION_GITHUB_REPOSITORY": "Repozytorium GitHub organizacji", + "ORGANIZATION_GITHUB_REPOSITORY_ISSUE": "Zgłoszenie w repozytorium GitHub organizacji", + "EMPLOYEE_AVAILABILITY": "Dostępność pracownika", + "EMPLOYEE_NOTIFICATION": "Powiadomienie pracownika", + "EMPLOYEE_PHONE": "Telefon pracownika", + "APPOINTMENT_EMPLOYEE": "Umówiony pracownik", + "EMPLOYEE_NOTIFICATION_SETTING": "Ustawienia powiadomień pracownika", + "PRODUCT_REVIEW": "Opinia o produkcie", + "TASK_LINKED_ISSUES": "Powiązane zgłoszenia", + "TASK_VIEW": "Widok zadania" }, "TAGS": "Tagi", "LANGUAGE": "Język", diff --git a/packages/ui-core/i18n/assets/i18n/pt.json b/packages/ui-core/i18n/assets/i18n/pt.json index 87a3f69bffa..00655d65fc2 100644 --- a/packages/ui-core/i18n/assets/i18n/pt.json +++ b/packages/ui-core/i18n/assets/i18n/pt.json @@ -1044,7 +1044,44 @@ "FEATURE_ORGANIZATION": "Organização de recursos.", "EXPORT_DATA": "Exportar dados", "IMPORT_DATA": "Importar Dados", - "ALL_ENTITIES": "TODAS as entidades" + "ALL_ENTITIES": "TODAS as entidades", + "ACTIVITY_LOG": "Registro de atividades", + "DAILY_PLAN": "Plano diário", + "ENTITY_SUBSCRIPTION": "Assinatura de entidade", + "FAVORITE": "Favorito", + "MENTION": "Menção", + "REACTION": "Reação", + "RESOURCE_LINK": "Link de recurso", + "SCREENING_TASK": "Tarefa de triagem", + "SOCIAL_ACCOUNT": "Conta social", + "CHANGELOG": "Registro de alterações", + "ISSUE_TYPE": "Tipo de problema", + "TASK_ESTIMATION": "Estimativa de tarefa", + "TASK_LINKED_ISSUE": "Problema vinculado à tarefa", + "TASK_PRIORITY": "Prioridade da tarefa", + "TASK_RELATED_ISSUE": "Problema relacionado à tarefa", + "TASK_SIZE": "Tamanho da tarefa", + "TASK_STATUS": "Status da tarefa", + "TASK_VERSION": "Versão da tarefa", + "TASK_RELATED_ISSUE_TYPE": "Tipo de problema relacionado", + "ORGANIZATION_PROJECT_EMPLOYEE": "Funcionário do projeto da organização", + "ORGANIZATION_PROJECT_MODULE": "Módulo do projeto da organização", + "ORGANIZATION_PROJECT_MODULE_EMPLOYEE": "Funcionário do módulo do projeto da organização", + "ORGANIZATION_SPRINT_EMPLOYEE": "Funcionário do sprint da organização", + "ORGANIZATION_SPRINT_TASK": "Tarefa do sprint da organização", + "ORGANIZATION_SPRINT_TASK_HISTORY": "Histórico de tarefas do sprint da organização", + "ORGANIZATION_TASK_SETTING": "Configuração de tarefa da organização", + "ORGANIZATION_TEAM_JOIN_REQUEST": "Solicitação para entrar na equipe da organização", + "ORGANIZATION_GITHUB_REPOSITORY": "Repositório GitHub da organização", + "ORGANIZATION_GITHUB_REPOSITORY_ISSUE": "Problema no repositório GitHub da organização", + "EMPLOYEE_AVAILABILITY": "Disponibilidade do funcionário", + "EMPLOYEE_NOTIFICATION": "Notificação do funcionário", + "EMPLOYEE_PHONE": "Telefone do funcionário", + "APPOINTMENT_EMPLOYEE": "Agendamento com funcionário", + "EMPLOYEE_NOTIFICATION_SETTING": "Configuração de notificação do funcionário", + "PRODUCT_REVIEW": "Avaliação do produto", + "TASK_LINKED_ISSUES": "Problemas vinculados", + "TASK_VIEW": "Visualização da tarefa" }, "TAGS": "Tags", "LANGUAGE": "Linguagem", diff --git a/packages/ui-core/i18n/assets/i18n/ru.json b/packages/ui-core/i18n/assets/i18n/ru.json index 32dd1654aee..ac7207c226d 100644 --- a/packages/ui-core/i18n/assets/i18n/ru.json +++ b/packages/ui-core/i18n/assets/i18n/ru.json @@ -1052,7 +1052,44 @@ "FEATURE_ORGANIZATION": "Функциональная организация", "EXPORT_DATA": "Экспорт данных", "IMPORT_DATA": "Импорт данных", - "ALL_ENTITIES": "ВСЕ сущности" + "ALL_ENTITIES": "ВСЕ сущности", + "ACTIVITY_LOG": "Журнал активности", + "DAILY_PLAN": "Дневной план", + "ENTITY_SUBSCRIPTION": "Подписка на объект", + "FAVORITE": "Избранное", + "MENTION": "Упоминание", + "REACTION": "Реакция", + "RESOURCE_LINK": "Ссылка на ресурс", + "SCREENING_TASK": "Задача проверки", + "SOCIAL_ACCOUNT": "Социальная учетная запись", + "CHANGELOG": "Журнал изменений", + "ISSUE_TYPE": "Тип задачи", + "TASK_ESTIMATION": "Оценка задачи", + "TASK_LINKED_ISSUE": "Связанная задача", + "TASK_PRIORITY": "Приоритет задачи", + "TASK_RELATED_ISSUE": "Связанная проблема задачи", + "TASK_SIZE": "Размер задачи", + "TASK_STATUS": "Статус задачи", + "TASK_VERSION": "Версия задачи", + "TASK_RELATED_ISSUE_TYPE": "Тип связанной проблемы", + "ORGANIZATION_PROJECT_EMPLOYEE": "Сотрудник проекта организации", + "ORGANIZATION_PROJECT_MODULE": "Модуль проекта организации", + "ORGANIZATION_PROJECT_MODULE_EMPLOYEE": "Сотрудник модуля проекта организации", + "ORGANIZATION_SPRINT_EMPLOYEE": "Сотрудник спринта организации", + "ORGANIZATION_SPRINT_TASK": "Задача спринта организации", + "ORGANIZATION_SPRINT_TASK_HISTORY": "История задач спринта организации", + "ORGANIZATION_TASK_SETTING": "Настройки задач организации", + "ORGANIZATION_TEAM_JOIN_REQUEST": "Запрос на присоединение к команде", + "ORGANIZATION_GITHUB_REPOSITORY": "Репозиторий GitHub организации", + "ORGANIZATION_GITHUB_REPOSITORY_ISSUE": "Задача в репозитории GitHub организации", + "EMPLOYEE_AVAILABILITY": "Доступность сотрудника", + "EMPLOYEE_NOTIFICATION": "Уведомление сотрудника", + "EMPLOYEE_PHONE": "Телефон сотрудника", + "APPOINTMENT_EMPLOYEE": "Запись к сотруднику", + "EMPLOYEE_NOTIFICATION_SETTING": "Настройки уведомлений сотрудника", + "PRODUCT_REVIEW": "Отзыв о продукте", + "TASK_LINKED_ISSUES": "Связанные задачи", + "TASK_VIEW": "Просмотр задачи" }, "TAGS": "Теги", "LANGUAGE": "Язык", diff --git a/packages/ui-core/i18n/assets/i18n/zh.json b/packages/ui-core/i18n/assets/i18n/zh.json index 1cf340e121e..8ee3abaf0cc 100644 --- a/packages/ui-core/i18n/assets/i18n/zh.json +++ b/packages/ui-core/i18n/assets/i18n/zh.json @@ -1044,7 +1044,44 @@ "FEATURE_ORGANIZATION": "特征组织", "EXPORT_DATA": "导出数据", "IMPORT_DATA": "导入数据", - "ALL_ENTITIES": "所有实体" + "ALL_ENTITIES": "所有实体", + "ACTIVITY_LOG": "活动日志", + "DAILY_PLAN": "每日计划", + "ENTITY_SUBSCRIPTION": "实体订阅", + "FAVORITE": "收藏", + "MENTION": "提及", + "REACTION": "反应", + "RESOURCE_LINK": "资源链接", + "SCREENING_TASK": "筛选任务", + "SOCIAL_ACCOUNT": "社交账户", + "CHANGELOG": "变更日志", + "ISSUE_TYPE": "问题类型", + "TASK_ESTIMATION": "任务估算", + "TASK_LINKED_ISSUE": "任务关联问题", + "TASK_PRIORITY": "任务优先级", + "TASK_RELATED_ISSUE": "任务相关问题", + "TASK_SIZE": "任务大小", + "TASK_STATUS": "任务状态", + "TASK_VERSION": "任务版本", + "TASK_RELATED_ISSUE_TYPE": "任务相关问题类型", + "ORGANIZATION_PROJECT_EMPLOYEE": "组织项目员工", + "ORGANIZATION_PROJECT_MODULE": "组织项目模块", + "ORGANIZATION_PROJECT_MODULE_EMPLOYEE": "组织项目模块员工", + "ORGANIZATION_SPRINT_EMPLOYEE": "组织冲刺员工", + "ORGANIZATION_SPRINT_TASK": "组织冲刺任务", + "ORGANIZATION_SPRINT_TASK_HISTORY": "组织冲刺任务历史", + "ORGANIZATION_TASK_SETTING": "组织任务设置", + "ORGANIZATION_TEAM_JOIN_REQUEST": "组织团队加入请求", + "ORGANIZATION_GITHUB_REPOSITORY": "组织GitHub仓库", + "ORGANIZATION_GITHUB_REPOSITORY_ISSUE": "组织GitHub仓库问题", + "EMPLOYEE_AVAILABILITY": "员工可用性", + "EMPLOYEE_NOTIFICATION": "员工通知", + "EMPLOYEE_PHONE": "员工电话", + "APPOINTMENT_EMPLOYEE": "任命员工", + "EMPLOYEE_NOTIFICATION_SETTING": "员工通知设置", + "PRODUCT_REVIEW": "产品评论", + "TASK_LINKED_ISSUES": "关联问题", + "TASK_VIEW": "任务视图" }, "TAGS": "标签", "LANGUAGE": "语言",