refactor(nestjs): exportable modules

This commit is contained in:
Ahmed Bouhuolia
2025-04-08 22:44:24 +02:00
parent 04c25bd31a
commit e8f1fedf35
21 changed files with 408 additions and 408 deletions

View File

@@ -36,6 +36,7 @@ import { SaleEstimatePdfTemplate } from '../SaleInvoices/queries/SaleEstimatePdf
import { PdfTemplatesModule } from '../PdfTemplate/PdfTemplates.module';
import { SendSaleEstimateMailQueue } from './types/SaleEstimates.types';
import { SaleEstimatesExportable } from './SaleEstimatesExportable';
import { SaleEstimatesImportable } from './SaleEstimatesImportable';
@Module({
imports: [
@@ -76,7 +77,8 @@ import { SaleEstimatesExportable } from './SaleEstimatesExportable';
SendSaleEstimateMail,
GetSaleEstimatePdf,
SaleEstimatePdfTemplate,
SaleEstimatesExportable
SaleEstimatesExportable,
SaleEstimatesImportable
],
})
export class SaleEstimatesModule {}

View File

@@ -1,45 +1,45 @@
// import { Inject, Service } from 'typedi';
// import { Knex } from 'knex';
// import { ISaleEstimateDTO } from '@/interfaces';
// import { CreateSaleEstimate } from './commands/CreateSaleEstimate.service';
// import { Importable } from '@/services/Import/Importable';
// import { SaleEstimatesSampleData } from './constants';
import { Knex } from 'knex';
import { CreateSaleEstimate } from './commands/CreateSaleEstimate.service';
import { SaleEstimatesSampleData } from './constants';
import { Injectable } from '@nestjs/common';
import { CreateSaleEstimateDto } from './dtos/SaleEstimate.dto';
import { Importable } from '../Import/Importable';
// @Service()
// export class SaleEstimatesImportable extends Importable {
// @Inject()
// private createEstimateService: CreateSaleEstimate;
@Injectable()
export class SaleEstimatesImportable extends Importable{
constructor(
private readonly createEstimateService: CreateSaleEstimate
) {
super();
}
// /**
// * Importing to account service.
// * @param {number} tenantId
// * @param {IAccountCreateDTO} createAccountDTO
// * @returns
// */
// public importable(
// tenantId: number,
// createEstimateDTO: ISaleEstimateDTO,
// trx?: Knex.Transaction
// ) {
// return this.createEstimateService.createEstimate(
// tenantId,
// createEstimateDTO,
// trx
// );
// }
/**
* Importing to account service.
* @param {CreateSaleEstimateDto} createAccountDTO
* @returns
*/
public importable(
createEstimateDTO: CreateSaleEstimateDto,
trx?: Knex.Transaction
) {
return this.createEstimateService.createEstimate(
createEstimateDTO,
trx
);
}
// /**
// * Concurrrency controlling of the importing process.
// * @returns {number}
// */
// public get concurrency() {
// return 1;
// }
/**
* Concurrrency controlling of the importing process.
* @returns {number}
*/
public get concurrency() {
return 1;
}
// /**
// * Retrieves the sample data that used to download accounts sample sheet.
// */
// public sampleData(): any[] {
// return SaleEstimatesSampleData;
// }
// }
/**
* Retrieves the sample data that used to download accounts sample sheet.
*/
public sampleData(): any[] {
return SaleEstimatesSampleData;
}
}