mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 20:30:33 +00:00
add server to monorepo.
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
import { Transformer } from '@/lib/Transformer/Transformer';
|
||||
import { formatMinutes } from 'utils/formatMinutes';
|
||||
|
||||
export class TaskTransformer extends Transformer {
|
||||
/**
|
||||
* Include these attributes to sale invoice object.
|
||||
* @returns {Array}
|
||||
*/
|
||||
public includeAttributes = (): string[] => {
|
||||
return [
|
||||
'estimateHoursFormatted',
|
||||
'actualHoursFormatted',
|
||||
'invoicedHoursFormatted',
|
||||
'billableHoursFormatted',
|
||||
];
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieves the formatted estimate hours.
|
||||
* @returns {string}
|
||||
*/
|
||||
public estimateHoursFormatted = (task): string => {
|
||||
return formatMinutes(task.estimateHours);
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieves the formatted actual hours.
|
||||
* @returns {string}
|
||||
*/
|
||||
public actualHoursFormatted = (task): string => {
|
||||
return formatMinutes(task.actualHours);
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieves the formatted billable hours.
|
||||
* @returns {string}
|
||||
*/
|
||||
public billableHoursFormatted = (task): string => {
|
||||
return formatMinutes(task.billableHours);
|
||||
};
|
||||
|
||||
/**
|
||||
* Retreives the formatted invoiced hours.
|
||||
* @returns {string}
|
||||
*/
|
||||
public invoicedHoursFormatted = (task): string => {
|
||||
return formatMinutes(task.invoicedHours);
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user