mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +00:00
refactor(nestjs): exportable modules
This commit is contained in:
@@ -36,6 +36,7 @@ import { SendSaleReceiptMailProcess } from './processes/SendSaleReceiptMail.proc
|
||||
import { MailModule } from '../Mail/Mail.module';
|
||||
import { SendSaleReceiptMailQueue } from './constants';
|
||||
import { SaleReceiptsExportable } from './commands/SaleReceiptsExportable';
|
||||
import { SaleReceiptsImportable } from './commands/SaleReceiptsImportable';
|
||||
|
||||
@Module({
|
||||
controllers: [SaleReceiptsController],
|
||||
@@ -76,7 +77,8 @@ import { SaleReceiptsExportable } from './commands/SaleReceiptsExportable';
|
||||
SaleReceiptInventoryTransactions,
|
||||
SaleReceiptInventoryTransactionsSubscriber,
|
||||
SendSaleReceiptMailProcess,
|
||||
SaleReceiptsExportable
|
||||
SaleReceiptsExportable,
|
||||
SaleReceiptsImportable,
|
||||
],
|
||||
})
|
||||
export class SaleReceiptsModule {}
|
||||
|
||||
@@ -1,45 +1,44 @@
|
||||
// import { Inject, Service } from 'typedi';
|
||||
// import { Knex } from 'knex';
|
||||
// import { IAccountCreateDTO, ISaleReceiptDTO } from '@/interfaces';
|
||||
// import { CreateSaleReceipt } from './commands/CreateSaleReceipt.service';
|
||||
// import { Importable } from '@/services/Import/Importable';
|
||||
// import { SaleReceiptsSampleData } from './constants';
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Knex } from 'knex';
|
||||
import { CreateSaleReceipt } from './CreateSaleReceipt.service';
|
||||
import { Importable } from '@/modules/Import/Importable';
|
||||
import { CreateSaleReceiptDto } from '../dtos/SaleReceipt.dto';
|
||||
import { SaleReceiptsSampleData } from '../constants';
|
||||
|
||||
// @Service()
|
||||
// export class SaleReceiptsImportable extends Importable {
|
||||
// @Inject()
|
||||
// private createReceiptService: CreateSaleReceipt;
|
||||
@Injectable()
|
||||
export class SaleReceiptsImportable extends Importable {
|
||||
constructor(private readonly createReceiptService: CreateSaleReceipt) {
|
||||
super();
|
||||
}
|
||||
|
||||
// /**
|
||||
// * Importing to sale receipts service.
|
||||
// * @param {number} tenantId
|
||||
// * @param {IAccountCreateDTO} createAccountDTO
|
||||
// * @returns
|
||||
// */
|
||||
// public importable(
|
||||
// tenantId: number,
|
||||
// createAccountDTO: ISaleReceiptDTO,
|
||||
// trx?: Knex.Transaction
|
||||
// ) {
|
||||
// return this.createReceiptService.createSaleReceipt(
|
||||
// tenantId,
|
||||
// createAccountDTO,
|
||||
// trx
|
||||
// );
|
||||
// }
|
||||
/**
|
||||
* Importing to sale receipts service.
|
||||
* @param {number} tenantId
|
||||
* @param {IAccountCreateDTO} createAccountDTO
|
||||
* @returns
|
||||
*/
|
||||
public importable(
|
||||
createAccountDTO: CreateSaleReceiptDto,
|
||||
trx?: Knex.Transaction,
|
||||
) {
|
||||
return this.createReceiptService.createSaleReceipt(
|
||||
createAccountDTO,
|
||||
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 SaleReceiptsSampleData;
|
||||
// }
|
||||
// }
|
||||
/**
|
||||
* Retrieves the sample data that used to download accounts sample sheet.
|
||||
*/
|
||||
public sampleData(): any[] {
|
||||
return SaleReceiptsSampleData;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user