mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
refactor(nestjs): exportable modules
This commit is contained in:
@@ -1,46 +1,41 @@
|
||||
// import { Inject, Service } from 'typedi';
|
||||
// import { Knex } from 'knex';
|
||||
// import { IExpenseCreateDTO } from '@/interfaces';
|
||||
// import { Importable } from '../Import/Importable';
|
||||
// import { CreateExpense } from './CRUD/CreateExpense.service';
|
||||
// import { ExpensesSampleData } from './constants';
|
||||
import { Knex } from 'knex';
|
||||
import { Importable } from '../Import/Importable';
|
||||
import { ExpensesSampleData } from './constants';
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { CreateExpense } from './commands/CreateExpense.service';
|
||||
import { CreateExpenseDto } from './dtos/Expense.dto';
|
||||
|
||||
// @Service()
|
||||
// export class ExpensesImportable extends Importable {
|
||||
// @Inject()
|
||||
// private createExpenseService: CreateExpense;
|
||||
@Injectable()
|
||||
export class ExpensesImportable extends Importable {
|
||||
constructor(private readonly createExpenseService: CreateExpense) {
|
||||
super();
|
||||
}
|
||||
|
||||
// /**
|
||||
// * Importing to account service.
|
||||
// * @param {number} tenantId
|
||||
// * @param {IAccountCreateDTO} createAccountDTO
|
||||
// * @returns
|
||||
// */
|
||||
// public importable(
|
||||
// tenantId: number,
|
||||
// createAccountDTO: IExpenseCreateDTO,
|
||||
// trx?: Knex.Transaction
|
||||
// ) {
|
||||
// return this.createExpenseService.newExpense(
|
||||
// tenantId,
|
||||
// createAccountDTO,
|
||||
// {},
|
||||
// trx
|
||||
// );
|
||||
// }
|
||||
/**
|
||||
* Importing to account service.
|
||||
* @param {number} tenantId
|
||||
* @param {IAccountCreateDTO} createAccountDTO
|
||||
* @returns
|
||||
*/
|
||||
public importable(
|
||||
createAccountDTO: CreateExpenseDto,
|
||||
trx?: Knex.Transaction,
|
||||
) {
|
||||
return this.createExpenseService.newExpense(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 ExpensesSampleData;
|
||||
// }
|
||||
// }
|
||||
/**
|
||||
* Retrieves the sample data that used to download accounts sample sheet.
|
||||
*/
|
||||
public sampleData(): any[] {
|
||||
return ExpensesSampleData;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user