Skip to content

Commit

Permalink
MERGING release/23.10 into main (#32)
Browse files Browse the repository at this point in the history
* CM-17 Added module, Individual + gql

* CM-17 Added missing filters for Individual gql

* CM-17 Added service tests

* CM-17 Updated Readme

* CM-17 Added service signals

* CM-17 routed gql mutations through service

* CM-17 Update github workflow

* CM-17 Added IndividualDataSource

* hotfix: fixed gql schema - fk reference (#2)

* Added automatic deployment

* Rename workflow

* CM-113: add group to django orm (#3)

* CM-113: add group to django orm

* CM-113: fix tests

* CM-113: add missing imports

* CM-113: add CreateGroupFromMultipleIndividualsMutation

* CM-113: add group perms to admin migration

* CM-113: add update group individuals

* CM-113: add locale

* Fixed CD

* CM-108: update schema gor group detail view (#4)

* CM-105: add export groups (#6)

* CM-29: add individual export (#7)

* CM-108: fix filtering individuals by groupId (#8)

* CM-108: return only distinct results of query (#10)

* CM-108: update schema gor group detail view

* CM-108: fix fitlering individuals by groupId

* CM-108: return only distinct query results

* CM-162: added custom filters for individual (#9)

* CM-105: add default value for json_ext in individual module (#11)

* CM-105: add export groups

* CM-105: add default value for json_ext

* CM-105: remove json_ext from input type

* CM-19: Create an endpoint for "Beneficiary" import using unstructured CSV/XLSX files (#12)

* CM-19 Added IndividualDataSourceUpload, moved source_name and source_type

* CM-19 Updated gql query models

* CM-19 Added status and error fields to IndividualDataSourceUpload

* Fixed migration issues

* CM-48: add roles management to group_individuals (#13)

* C-235: Added postgres tests execution (#14)

* CM-134: add jsonExt to create/update individual mutation (#15)

* CM-134: add jsonExt to create/update individual mutation

* CM-134: removal of redundant declaration

* CM-250: remove individual field from beneficiar upload model (#16)

* Update README.md (#17)

* CM-256: Add sonar-project.properties (#18)

* CM-256: Added report (#19)

* CM-256: Added report

* CM-256: Updated CI workflow

* CM-256: Restored psql db engine

* CM-256: Changed coverage execution command (#20)

* Changes sources for coverage and flake8

* Changed command for coverage run

* Removed dir from sonar cloud scan

* Changed paths for sonar

* Changed module report paths to match requiremenst

* Test Commit

* Persist coverage and flake report

* Used sed to replace site-package paths

* Used sed to replace site-package paths

* Used sed to replace site-package paths

* Changed pattern in coverage.xml report

* Fixed cat path

* Fixed cat path

* Fixed cat path

* Fixed cat path

* Fixed cat path

* Fixed cat path

* Fixed cat path

* MERGING RELEASE branches (#26)

* CI Update for openimis-be-individual_py (#22)

* CI update

* CI update 2

* CI Update 2

* CM-295: get head of the group (#24)

Co-authored-by: Jan <j.dolkowski@soldevelo.com>

* CM-296: add cusotm filters for individuals and groups (#25)

Co-authored-by: Jan <j.dolkowski@soldevelo.com>

---------

Co-authored-by: Damian Borowiecki <dborowiecki7@gmail.com>
Co-authored-by: Jan <jdolkowski@soldevelo.com>
Co-authored-by: Jan <j.dolkowski@soldevelo.com>

* MERGING RELEASE branches (#27)

* CI Update for openimis-be-individual_py (#22)

* CI update

* CI update 2

* CI Update 2

* CM-295: get head of the group (#24)

Co-authored-by: Jan <j.dolkowski@soldevelo.com>

* CM-296: add cusotm filters for individuals and groups (#25)

Co-authored-by: Jan <j.dolkowski@soldevelo.com>

---------

Co-authored-by: Damian Borowiecki <dborowiecki7@gmail.com>
Co-authored-by: Jan <jdolkowski@soldevelo.com>
Co-authored-by: Jan <j.dolkowski@soldevelo.com>

* MERGING RELEASE branches (#29)

* Develop (#21)

* CM-17 Added module, Individual + gql

* CM-17 Added missing filters for Individual gql

* CM-17 Added service tests

* CM-17 Updated Readme

* CM-17 Added service signals

* CM-17 routed gql mutations through service

* CM-17 Update github workflow

* CM-17 Added IndividualDataSource

* hotfix: fixed gql schema - fk reference (#2)

* Added automatic deployment

* Rename workflow

* CM-113: add group to django orm (#3)

* CM-113: add group to django orm

* CM-113: fix tests

* CM-113: add missing imports

* CM-113: add CreateGroupFromMultipleIndividualsMutation

* CM-113: add group perms to admin migration

* CM-113: add update group individuals

* CM-113: add locale

* Fixed CD

* CM-108: update schema gor group detail view (#4)

* CM-105: add export groups (#6)

* CM-29: add individual export (#7)

* CM-108: fix filtering individuals by groupId (#8)

* CM-108: return only distinct results of query (#10)

* CM-108: update schema gor group detail view

* CM-108: fix fitlering individuals by groupId

* CM-108: return only distinct query results

* CM-162: added custom filters for individual (#9)

* CM-105: add default value for json_ext in individual module (#11)

* CM-105: add export groups

* CM-105: add default value for json_ext

* CM-105: remove json_ext from input type

* CM-19: Create an endpoint for "Beneficiary" import using unstructured CSV/XLSX files (#12)

* CM-19 Added IndividualDataSourceUpload, moved source_name and source_type

* CM-19 Updated gql query models

* CM-19 Added status and error fields to IndividualDataSourceUpload

* Fixed migration issues

* CM-48: add roles management to group_individuals (#13)

* C-235: Added postgres tests execution (#14)

* CM-134: add jsonExt to create/update individual mutation (#15)

* CM-134: add jsonExt to create/update individual mutation

* CM-134: removal of redundant declaration

* CM-250: remove individual field from beneficiar upload model (#16)

* Update README.md (#17)

* CM-256: Add sonar-project.properties (#18)

* CM-256: Added report (#19)

* CM-256: Added report

* CM-256: Updated CI workflow

* CM-256: Restored psql db engine

* CM-256: Changed coverage execution command (#20)

* Changes sources for coverage and flake8

* Changed command for coverage run

* Removed dir from sonar cloud scan

* Changed paths for sonar

* Changed module report paths to match requiremenst

* Test Commit

---------

Co-authored-by: Kamil Malinowski <kmalinowski@soldevelo.com>
Co-authored-by: sniedzielski <52816247+sniedzielski@users.noreply.github.com>
Co-authored-by: Jan <jdolkowski@soldevelo.com>
Co-authored-by: Kamil Malinowski <malinowskikam96@gmail.com>
Co-authored-by: olewandowski1 <109145288+olewandowski1@users.noreply.github.com>

* Sonar Added (#23)

---------

Co-authored-by: Damian Borowiecki <dborowiecki7@gmail.com>
Co-authored-by: Kamil Malinowski <kmalinowski@soldevelo.com>
Co-authored-by: sniedzielski <52816247+sniedzielski@users.noreply.github.com>
Co-authored-by: Jan <jdolkowski@soldevelo.com>
Co-authored-by: Kamil Malinowski <malinowskikam96@gmail.com>
Co-authored-by: olewandowski1 <109145288+olewandowski1@users.noreply.github.com>
Co-authored-by: Patrick Delcroix <delcroip@gmail.com>

* MERGING develop into release/23.10 (#30)

* CI Update for openimis-be-individual_py (#22)

* CI update

* CI update 2

* CI Update 2

* CM-295: get head of the group (#24)

Co-authored-by: Jan <j.dolkowski@soldevelo.com>

* CM-296: add cusotm filters for individuals and groups (#25)

Co-authored-by: Jan <j.dolkowski@soldevelo.com>

* MERGING RELEASE branches (#28)

* MERGING RELEASE branches (#26)

* CI Update for openimis-be-individual_py (#22)

* CI update

* CI update 2

* CI Update 2

* CM-295: get head of the group (#24)

Co-authored-by: Jan <j.dolkowski@soldevelo.com>

* CM-296: add cusotm filters for individuals and groups (#25)

Co-authored-by: Jan <j.dolkowski@soldevelo.com>

---------

Co-authored-by: Damian Borowiecki <dborowiecki7@gmail.com>
Co-authored-by: Jan <jdolkowski@soldevelo.com>
Co-authored-by: Jan <j.dolkowski@soldevelo.com>

* MERGING RELEASE branches (#27)

* CI Update for openimis-be-individual_py (#22)

* CI update

* CI update 2

* CI Update 2

* CM-295: get head of the group (#24)

Co-authored-by: Jan <j.dolkowski@soldevelo.com>

* CM-296: add cusotm filters for individuals and groups (#25)

Co-authored-by: Jan <j.dolkowski@soldevelo.com>

---------

Co-authored-by: Damian Borowiecki <dborowiecki7@gmail.com>
Co-authored-by: Jan <jdolkowski@soldevelo.com>
Co-authored-by: Jan <j.dolkowski@soldevelo.com>

---------

Co-authored-by: Damian Borowiecki <dborowiecki7@gmail.com>
Co-authored-by: Jan <jdolkowski@soldevelo.com>
Co-authored-by: Jan <j.dolkowski@soldevelo.com>
Co-authored-by: Patrick Delcroix <delcroip@gmail.com>

---------

Co-authored-by: Damian Borowiecki <dborowiecki7@gmail.com>
Co-authored-by: Jan <jdolkowski@soldevelo.com>
Co-authored-by: Jan <j.dolkowski@soldevelo.com>
Co-authored-by: Dragos DOBRE <dragos.dobre@swisstph.ch>

* MERGING develop into release/23.10 (#31)

* CI Update for openimis-be-individual_py (#22)

* CM-295: get head of the group (#24)

Co-authored-by: Jan <j.dolkowski@soldevelo.com>

* CM-296: add cusotm filters for individuals and groups (#25)

Co-authored-by: Jan <j.dolkowski@soldevelo.com>

* MERGING RELEASE branches (#28)

* MERGING RELEASE branches (#26)

* CI Update for openimis-be-individual_py (#22)

* CM-295: get head of the group (#24)

Co-authored-by: Jan <j.dolkowski@soldevelo.com>

* CM-296: add cusotm filters for individuals and groups (#25)

Co-authored-by: Jan <j.dolkowski@soldevelo.com>

---------

Co-authored-by: Damian Borowiecki <dborowiecki7@gmail.com>
Co-authored-by: Jan <jdolkowski@soldevelo.com>
Co-authored-by: Jan <j.dolkowski@soldevelo.com>

* MERGING RELEASE branches (#27)

* CI Update for openimis-be-individual_py (#22)

* CI update

* CI update 2

* CI Update 2

* CM-295: get head of the group (#24)

Co-authored-by: Jan <j.dolkowski@soldevelo.com>

* CM-296: add cusotm filters for individuals and groups (#25)

Co-authored-by: Jan <j.dolkowski@soldevelo.com>

---------

Co-authored-by: Damian Borowiecki <dborowiecki7@gmail.com>
Co-authored-by: Jan <jdolkowski@soldevelo.com>
Co-authored-by: Jan <j.dolkowski@soldevelo.com>

---------

Co-authored-by: Damian Borowiecki <dborowiecki7@gmail.com>
Co-authored-by: Jan <jdolkowski@soldevelo.com>
Co-authored-by: Jan <j.dolkowski@soldevelo.com>
Co-authored-by: Patrick Delcroix <delcroip@gmail.com>

---------

Co-authored-by: Damian Borowiecki <dborowiecki7@gmail.com>
Co-authored-by: Jan <jdolkowski@soldevelo.com>
Co-authored-by: Jan <j.dolkowski@soldevelo.com>
Co-authored-by: Dragos DOBRE <dragos.dobre@swisstph.ch>

---------

Co-authored-by: Kamil Malinowski <kmalinowski@soldevelo.com>
Co-authored-by: Damian Borowiecki <dborowiecki7@gmail.com>
Co-authored-by: sniedzielski <52816247+sniedzielski@users.noreply.github.com>
Co-authored-by: Damian Borowiecki <dborowiecki@soldevelo.com>
Co-authored-by: Jan <jdolkowski@soldevelo.com>
Co-authored-by: Kamil Malinowski <malinowskikam96@gmail.com>
Co-authored-by: olewandowski1 <109145288+olewandowski1@users.noreply.github.com>
Co-authored-by: Dragos DOBRE <dragos.dobre@swisstph.ch>
Co-authored-by: Jan <j.dolkowski@soldevelo.com>
  • Loading branch information
10 people authored Dec 16, 2023
1 parent d49cb62 commit edcfe31
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
15 changes: 15 additions & 0 deletions individual/gql_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,21 @@ class Meta:

class GroupGQLType(DjangoObjectType):
uuid = graphene.String(source='uuid')
head = graphene.Field(IndividualGQLType)

def resolve_head(self, info):
return Individual.objects.filter(
groupindividual__group__id=self.id,
groupindividual__role=GroupIndividual.Role.HEAD
).first()

head = graphene.Field(IndividualGQLType)

def resolve_head(self, info):
return Individual.objects.filter(
groupindividual__group__id=self.id,
groupindividual__role=GroupIndividual.Role.HEAD
).first()

class Meta:
model = Group
Expand Down
15 changes: 15 additions & 0 deletions individual/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ class Query(ExportableQueryMixin, graphene.ObjectType):
module_name = "social_protection"
object_type = "BenefitPlan"
related_field = "beneficiary"
related_field_groupbeneficiary = "groupbeneficiary"

related_field_groupbeneficiary = "groupbeneficiary"


individual = OrderedDjangoFilterConnectionField(
IndividualGQLType,
Expand Down Expand Up @@ -156,6 +160,17 @@ def resolve_group(self, info, **kwargs):
filters.append(Q(groupindividual__individual__last_name__icontains=last_name))

query = Group.objects.filter(*filters).distinct()

custom_filters = kwargs.get("customFilters", None)
if custom_filters:
query = CustomFilterWizardStorage.build_custom_filters_queryset(
Query.module_name,
Query.object_type,
custom_filters,
query,
relation=Query.related_field_groupbeneficiary
)

return gql_optimizer.query(query, info)

def resolve_group_individual(self, info, **kwargs):
Expand Down

0 comments on commit edcfe31

Please sign in to comment.