mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 05:10:31 +00:00
fix(server): add formatted values to responses transformers
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { Service } from 'typedi';
|
||||
import { ISaleEstimate } from '@/interfaces';
|
||||
import { Transformer } from '@/lib/Transformer/Transformer';
|
||||
import { formatNumber } from 'utils';
|
||||
import { ItemEntryTransformer } from '../Invoices/ItemEntryTransformer';
|
||||
|
||||
export class SaleEstimateTransfromer extends Transformer {
|
||||
/**
|
||||
@@ -16,6 +16,7 @@ export class SaleEstimateTransfromer extends Transformer {
|
||||
'formattedDeliveredAtDate',
|
||||
'formattedApprovedAtDate',
|
||||
'formattedRejectedAtDate',
|
||||
'entries',
|
||||
];
|
||||
};
|
||||
|
||||
@@ -74,4 +75,15 @@ export class SaleEstimateTransfromer extends Transformer {
|
||||
currencyCode: estimate.currencyCode,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieves the entries of the sale estimate.
|
||||
* @param {ISaleEstimate} estimate
|
||||
* @returns {}
|
||||
*/
|
||||
protected entries = (estimate) => {
|
||||
return this.item(estimate.entries, new ItemEntryTransformer(), {
|
||||
currencyCode: estimate.currencyCode,
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user