mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 04:40:32 +00:00
refactor(nestjs): export module
This commit is contained in:
@@ -21,6 +21,7 @@ import { WriteTaxTransactionsItemEntries } from './WriteTaxTransactionsItemEntri
|
||||
import { SyncItemTaxRateOnEditTaxRate } from './SyncItemTaxRateOnEditTaxRate';
|
||||
import { RegisterTenancyModel } from '../Tenancy/TenancyModels/Tenancy.module';
|
||||
import { TaxRateTransaction } from './models/TaxRateTransaction.model';
|
||||
import { TaxRatesExportable } from './TaxRatesExportable';
|
||||
|
||||
const models = [RegisterTenancyModel(TaxRateTransaction)];
|
||||
|
||||
@@ -47,6 +48,7 @@ const models = [RegisterTenancyModel(TaxRateTransaction)];
|
||||
SyncItemTaxRateOnEditTaxSubscriber,
|
||||
WriteTaxTransactionsItemEntries,
|
||||
SyncItemTaxRateOnEditTaxRate,
|
||||
TaxRatesExportable
|
||||
],
|
||||
exports: [ItemEntriesTaxTransactions, ...models],
|
||||
})
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
// import { Inject, Service } from 'typedi';
|
||||
// import { Exportable } from '../Export/Exportable';
|
||||
// import { TaxRatesApplication } from './TaxRate.application';
|
||||
import { ExportableService } from '../Export/decorators/ExportableModel.decorator';
|
||||
import { Exportable } from '../Export/Exportable';
|
||||
import { TaxRateModel } from './models/TaxRate.model';
|
||||
import { TaxRatesApplication } from './TaxRate.application';
|
||||
import { Injectable } from '@nestjs/common';
|
||||
|
||||
// @Service()
|
||||
// export class TaxRatesExportable extends Exportable {
|
||||
// @Inject()
|
||||
// private taxRatesApplication: TaxRatesApplication;
|
||||
@Injectable()
|
||||
@ExportableService({ name: TaxRateModel.name })
|
||||
export class TaxRatesExportable extends Exportable {
|
||||
constructor(private readonly taxRatesApplication: TaxRatesApplication) {
|
||||
super();
|
||||
}
|
||||
|
||||
// /**
|
||||
// * Retrieves the accounts data to exportable sheet.
|
||||
// * @param {number} tenantId
|
||||
// * @returns
|
||||
// */
|
||||
// public exportable(tenantId: number) {
|
||||
// return this.taxRatesApplication.getTaxRates(tenantId);
|
||||
// }
|
||||
// }
|
||||
/**
|
||||
* Retrieves the accounts data to exportable sheet.
|
||||
*/
|
||||
public exportable() {
|
||||
return this.taxRatesApplication.getTaxRates();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,9 @@ import { mixin, Model, raw } from 'objection';
|
||||
// import TaxRateMeta from './TaxRate.settings';
|
||||
// import ModelSetting from './ModelSetting';
|
||||
import { BaseModel } from '@/models/Model';
|
||||
import { ExportableModel } from '@/modules/Export/decorators/ExportableModel.decorator';
|
||||
|
||||
@ExportableModel()
|
||||
export class TaxRateModel extends BaseModel {
|
||||
active!: boolean;
|
||||
code!: string;
|
||||
|
||||
Reference in New Issue
Block a user