refactor(nestjs): currencies module

This commit is contained in:
Ahmed Bouhuolia
2025-05-17 12:14:02 +02:00
parent 4de1ef71ca
commit ce058b9416
16 changed files with 504 additions and 1 deletions

View File

@@ -0,0 +1,19 @@
import { Transformer } from "../Transformer/Transformer";
export class CurrencyTransformer extends Transformer {
/**
* Include these attributes to sale invoice object.
* @returns {Array}
*/
public includeAttributes = (): string[] => {
return ['isBaseCurrency'];
};
/**
* Detarmines whether the currency is base currency.
* @returns {boolean}
*/
public isBaseCurrency(currency): boolean {
return this.context.organization.baseCurrency === currency.currencyCode;
}
}