mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +00:00
WIP: dynamic list filtering.
This commit is contained in:
@@ -30,6 +30,8 @@ export default class DynamicListService implements IDynamicListService {
|
||||
|
||||
/**
|
||||
* Parses filter DTO.
|
||||
* @param {IMode} model -
|
||||
* @param {} filterDTO -
|
||||
*/
|
||||
private parseFilterObject = (model, filterDTO) => {
|
||||
return {
|
||||
|
||||
@@ -268,8 +268,7 @@ export default class InventoryAdjustmentService {
|
||||
|
||||
/**
|
||||
* Parses inventory adjustments list filter DTO.
|
||||
* @param filterDTO
|
||||
* @returns
|
||||
* @param filterDTO -
|
||||
*/
|
||||
private parseListFilterDTO(filterDTO) {
|
||||
return R.compose(
|
||||
@@ -282,7 +281,7 @@ export default class InventoryAdjustmentService {
|
||||
* @param {number} tenantId
|
||||
* @param {IInventoryAdjustmentsFilter} adjustmentsFilter
|
||||
*/
|
||||
async getInventoryAdjustments(
|
||||
public async getInventoryAdjustments(
|
||||
tenantId: number,
|
||||
filterDTO: IInventoryAdjustmentsFilter
|
||||
): Promise<{
|
||||
|
||||
@@ -412,6 +412,7 @@ export default class ItemCategoriesService implements IItemCategoriesService {
|
||||
filter
|
||||
);
|
||||
|
||||
// Items categories.
|
||||
const itemCategories = await ItemCategory.query().onBuild((query) => {
|
||||
// Subquery to calculate sumation of assocaited items to the item category.
|
||||
query.select('*', ItemCategory.relatedQuery('items').count().as('count'));
|
||||
|
||||
Reference in New Issue
Block a user