mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
refactor: accounts module to Nestjs
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { Transformer } from '../Transformer/Transformer';
|
||||
import { Item } from './models/Item';
|
||||
// import { GetItemWarehouseTransformer } from '@/services/Warehouses/Items/GettItemWarehouseTransformer';
|
||||
|
||||
export class ItemTransformer extends Transformer {
|
||||
@@ -20,7 +21,7 @@ export class ItemTransformer extends Transformer {
|
||||
* @param {IItem} item
|
||||
* @returns {string}
|
||||
*/
|
||||
public typeFormatted(item): string {
|
||||
public typeFormatted(item: Item): string {
|
||||
return this.context.i18n.t(`item.field.type.${item.type}`);
|
||||
}
|
||||
|
||||
@@ -29,7 +30,7 @@ export class ItemTransformer extends Transformer {
|
||||
* @param item
|
||||
* @returns {string}
|
||||
*/
|
||||
public sellPriceFormatted(item): string {
|
||||
public sellPriceFormatted(item: Item): string {
|
||||
return this.formatNumber(item.sellPrice, {
|
||||
currencyCode: this.context.organization.baseCurrency,
|
||||
});
|
||||
@@ -40,7 +41,7 @@ export class ItemTransformer extends Transformer {
|
||||
* @param item
|
||||
* @returns {string}
|
||||
*/
|
||||
public costPriceFormatted(item): string {
|
||||
public costPriceFormatted(item: Item): string {
|
||||
return this.formatNumber(item.costPrice, {
|
||||
currencyCode: this.context.organization.baseCurrency,
|
||||
});
|
||||
|
||||
@@ -8,13 +8,13 @@ import { ServiceError } from './ServiceError';
|
||||
import { IItem, IItemDTO } from '@/interfaces/Item';
|
||||
import { ERRORS } from './Items.constants';
|
||||
import { Item } from './models/Item';
|
||||
import { Account } from '../Accounts/models/Account';
|
||||
import { AccountModel } from '../Accounts/models/Account.model';
|
||||
|
||||
@Injectable()
|
||||
export class ItemsValidators {
|
||||
constructor(
|
||||
@Inject(Item.name) private itemModel: typeof Item,
|
||||
@Inject(Account.name) private accountModel: typeof Account,
|
||||
@Inject(AccountModel.name) private accountModel: typeof AccountModel,
|
||||
@Inject(Item.name) private taxRateModel: typeof Item,
|
||||
@Inject(Item.name) private itemEntryModel: typeof Item,
|
||||
@Inject(Item.name) private itemCategoryModel: typeof Item,
|
||||
|
||||
Reference in New Issue
Block a user