mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
refactor(nestjs): add importable service to other modules
This commit is contained in:
@@ -18,6 +18,7 @@ import { BankAccount } from '../BankingTransactions/models/BankAccount';
|
||||
import { GetAccountsService } from './GetAccounts.service';
|
||||
import { DynamicListModule } from '../DynamicListing/DynamicList.module';
|
||||
import { AccountsExportable } from './AccountsExportable.service';
|
||||
import { AccountsImportable } from './AccountsImportable.service';
|
||||
|
||||
const models = [RegisterTenancyModel(BankAccount)];
|
||||
|
||||
@@ -39,12 +40,14 @@ const models = [RegisterTenancyModel(BankAccount)];
|
||||
GetAccountTransactionsService,
|
||||
GetAccountsService,
|
||||
AccountsExportable,
|
||||
AccountsImportable
|
||||
],
|
||||
exports: [
|
||||
AccountRepository,
|
||||
CreateAccountService,
|
||||
...models,
|
||||
AccountsExportable,
|
||||
AccountsImportable
|
||||
],
|
||||
})
|
||||
export class AccountsModule {}
|
||||
|
||||
@@ -4,8 +4,11 @@ import { Importable } from '../Import/Importable';
|
||||
import { AccountsSampleData } from './AccountsImportable.SampleData';
|
||||
import { CreateAccountDTO } from './CreateAccount.dto';
|
||||
import { CreateAccountService } from './CreateAccount.service';
|
||||
import { ImportableService } from '../Import/decorators/Import.decorator';
|
||||
import { Account } from './models/Account.model';
|
||||
|
||||
@Injectable()
|
||||
@ImportableService({ name: Account.name })
|
||||
export class AccountsImportable extends Importable {
|
||||
constructor(private readonly createAccountService: CreateAccountService) {
|
||||
super();
|
||||
|
||||
@@ -13,8 +13,10 @@ import { flatToNestedArray } from '@/utils/flat-to-nested-array';
|
||||
import { ExportableModel } from '../../Export/decorators/ExportableModel.decorator';
|
||||
import { AccountMeta } from './Account.meta';
|
||||
import { InjectModelMeta } from '@/modules/Tenancy/TenancyModels/decorators/InjectModelMeta.decorator';
|
||||
import { ImportableModel } from '@/modules/Import/decorators/Import.decorator';
|
||||
|
||||
@ExportableModel()
|
||||
@ImportableModel()
|
||||
@InjectModelMeta(AccountMeta)
|
||||
export class Account extends TenantBaseModel {
|
||||
public name!: string;
|
||||
|
||||
Reference in New Issue
Block a user