bcgov / hcap

Application supporting access to the Health Career Access Program (HCAP) for employers and participants.
Apache License 2.0
2 stars 1 forks source link

HCAP-1349: modification to cohort participants query #851

Closed alva-fresh closed 2 years ago

alva-fresh commented 2 years ago

https://freshworks.atlassian.net/browse/HCAP-1349

In test db the query was selecting multiple entries for the same participant possibly due to JOIN. After setting SELECT COUNT(DISTINCT "participants"."id")" the number of available seats became correct for both queries. This request is for filtering out duplicates which causing incorrect count. Yet I don't like this solution, so happy to hear thoughts on this

Including 2 possible solutions here as separate commits based on further findings: https://teams.microsoft.com/l/message/19:IUaAmNEwTGmcqt3CjlNCrc_j7pTI3rB5QRpVrTFxNHQ1@thread.tacv2/1663206188323?tenantId=5b973f99-77df-4beb-b27d-aa0c70b8482c&groupId=3f22a178-b2af-4d1a-99cd-bc1781c11210&parentMessageId=1663204501914&teamName=HCAP&channelName=General&createdTime=1663206188323&allowXTenantAccess=false

Screen Shot 2022-09-14 at 7 10 45 PM
arranfw commented 2 years ago

Does this mean the earlier query was fine and the larger number was incorrect?

alva-fresh commented 2 years ago

@arranfw you're totally right - the previous query was fine, although it did fix some inconsistencies in dev. Now this issue is not happening in dev anymore, but still present in test

sonarcloud[bot] commented 2 years ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

alva-fresh commented 2 years ago

closing this pull request as per discussion: https://teams.microsoft.com/l/message/19:IUaAmNEwTGmcqt3CjlNCrc_j7pTI3rB5QRpVrTFxNHQ1@thread.tacv2/1663281487060?tenantId=5b973f99-77df-4beb-b27d-aa0c70b8482c&groupId=3f22a178-b2af-4d1a-99cd-bc1781c11210&parentMessageId=1663194560543&teamName=HCAP&channelName=General&createdTime=1663281487060&allowXTenantAccess=false