Skip to content

Commit

Permalink
VCST-1924: Ability to search for orders by the product
Browse files Browse the repository at this point in the history
feat: Added the ability to search for orders by the included product
  • Loading branch information
Ljutyj committed Oct 9, 2024
1 parent 080c802 commit 2b4ec46
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,10 @@ public string[] OrganizationIds
_organizationIds = value;
}
}

/// <summary>
/// Search orders with a certain product
/// </summary>
public string ProductId { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ protected override IQueryable<CustomerOrderEntity> BuildQuery(IRepository reposi

query = WithSubscriptionConditions(query, criteria);

if (!string.IsNullOrEmpty(criteria.ProductId))
{
query = query.Where(o => o.Items.Any(i => i.ProductId == criteria.ProductId));
}

return query;
}

Expand Down

0 comments on commit 2b4ec46

Please sign in to comment.