Skip to content

Commit

Permalink
ONI-39: Filtering policies by confirmation type of family. (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
wzglinieckisoldevelo authored Nov 22, 2023
1 parent 9d0fa4e commit e3997f3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions policy/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class Query(graphene.ObjectType):
balance_gte=graphene.Float(),
showHistory=graphene.Boolean(),
showInactive=graphene.Boolean(),
confirmationType=graphene.String(),
orderBy=graphene.List(of_type=graphene.String),
)
# Note:
Expand Down Expand Up @@ -154,6 +155,8 @@ def resolve_policies(self, info, **kwargs):
query = query.filter(balance__lte=kwargs.get('balance_lte'))
if kwargs.get('balance_gte'):
query = query.filter(balance__gte=kwargs.get('balance_gte'))
if kwargs.get('confirmationType'):
query = query.filter(family__confirmation_type=kwargs.get('confirmationType'))
location_id = kwargs.get('district_id') if kwargs.get(
'district_id') else kwargs.get('region_id')
if location_id:
Expand Down

0 comments on commit e3997f3

Please sign in to comment.