mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 04:40:32 +00:00
refactor(nestjs): exportable modules
This commit is contained in:
@@ -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 {}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user