Open ddfridley opened 2 months ago
@ldgze How is this going?
@ldgze How is this going?
Hi David,
I’m still working on the issue and plan to commit the code later today.
Hi David @ddfridley,
I have a question about when we should call randomWhys
for each mostId
and leastId
. Specifically, do we need to call randomWhys
only when an ID
has no existing "why
," or should we ensure that each ID
has at least 5 "whys
" by calling randomWhys
to make up any shortfall?
Just want to make sure I align with the requirements. Thanks for clarifying!
There may not be 5, then just get all there are.
Get BlueMail for Android
On Nov 5, 2024, 12:51 PM, at 12:51 PM, Dongze Li @.***> wrote:
Hi David @ddfridley,
I have a question about when we should call randomWhys for each mostId and leastId. Specifically, do we need to call randomWhys only when an ID has no existing "why," or should we ensure that each ID has at least 5 "whys" by calling randomWhys to make up any shortfall?
Just want to make sure I align with the requirements. Thanks for clarifying!
-- Reply to this email directly or view it on GitHub: https://github.com/EnCiv/civil-pursuit/issues/207#issuecomment-2458127894 You are receiving this because you were mentioned.
Message ID: @.***>
Hi David,
I’ve implemented the getWhyRanksAndPoints
API based on my understanding of the requirements and have created a PR for it. However, I still need some clarifications to ensure everything aligns correctly.
Fetch Ranks
:
Query ranks
matching userId
, discussionId
, stage: 'why'
, and round
.
Extract Parent IDs
from Ranks
:
Gather parentId
values from the fetched ranks
.
Fetch Points
Based on Parent IDs
:
Query the Points
collection for why-points
where parentId
matches any of the parentIds
from the ranks
.
Check if All mostIds
and leastIds
Have Corresponding Why-Points
:
mostIds
and leastIds
have corresponding why-points
:
ranks
and points
(Currently, I’m returning the why-points
fetched based on ranks
, not specifically those matching mostIds
and leastIds
). mostIds
and leastIds
have corresponding why-points
:
Fetch Missing Whys
Using getRandomWhys
:
For any missing mostIds
or leastIds
, fetch random whys using getRandomWhys
.
For Step 4 and Step 5:
why-points
fetched based on ranks
? why-points
matching the mostIds
and leastIds
? Test Case Relationship:
why-points
fetched according to the ranks
and those matching the mostIds
/leastIds
? Thanks for your time and guidance!
see https://docs.google.com/spreadsheets/d/1hVsobuGFElsuzuKR0Hx4-htCmAQ-POFkHHt9ZGLcmZY/edit?gid=1364079177#gid=1364079177&range=C32:D32
getWhyRanksAndPoints(discussionId,round, mostIds, leastIds, cb( {ranks: [], whys: [] })
from rank, match userId, discussionId, stage: why, round.
If some found, fetch the correspoding why-points by the parentId in the rank.
if there is a why-point for all mostIds and leastIds then return ranks and whys
else get randomWhys for each mostId and leastId and return ranks and whys