Skip to content

Conversation

@dhenkel92
Copy link
Member

No description provided.

@realmayus realmayus had a problem deploying to backend-feat-derived-ac-ah7edr May 23, 2024 15:35 Failure
@dhenkel92 dhenkel92 force-pushed the feat/derived-achievements-in-important-information branch 3 times, most recently from aab1189 to d52992e Compare May 29, 2024 18:22
// Thus, the line below ensures that only the current or subsequent achievement steps are created, while others are automatically bypassed.
// Note: +1 is added because the index is 0-based, while the groupOrder is 1-based.
if (nextStepIndex + 1 < currentTemplate.groupOrder) {
if (templatesForGroup[nextStepIndex].groupOrder + 1 < currentTemplate.groupOrder) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea if this will break anything. Need to check.

@dhenkel92 dhenkel92 force-pushed the feat/derived-achievements-in-important-information branch from c6e3d33 to 0cfdc3f Compare June 2, 2024 21:59
@dhenkel92 dhenkel92 force-pushed the feat/derived-achievements-in-important-information branch 2 times, most recently from e3200d3 to b1e29e1 Compare June 18, 2024 18:04
@dhenkel92 dhenkel92 force-pushed the feat/derived-achievements-in-important-information branch from b1e29e1 to 32415fc Compare August 16, 2024 11:59
@dhenkel92 dhenkel92 force-pushed the feat/derived-achievements-in-important-information branch from 32415fc to 8ad1771 Compare September 8, 2024 13:49
@dhenkel92 dhenkel92 temporarily deployed to backend-feat-derived-ac-mqgaot September 8, 2024 14:21 Inactive
@dhenkel92 dhenkel92 had a problem deploying to backend-feat-derived-ac-mqgaot September 8, 2024 16:49 Failure
@dhenkel92 dhenkel92 force-pushed the feat/derived-achievements-in-important-information branch from af9e8d0 to 723cc50 Compare September 8, 2024 17:55
@dhenkel92 dhenkel92 had a problem deploying to backend-feat-derived-ac-mqgaot September 8, 2024 17:55 Failure
@dhenkel92 dhenkel92 force-pushed the feat/derived-achievements-in-important-information branch from 723cc50 to 8f67f13 Compare September 8, 2024 17:58
@dhenkel92 dhenkel92 had a problem deploying to backend-feat-derived-ac-mqgaot September 8, 2024 17:58 Failure
@dhenkel92 dhenkel92 force-pushed the feat/derived-achievements-in-important-information branch from 8f67f13 to bc9af4a Compare September 8, 2024 18:04
@dhenkel92 dhenkel92 temporarily deployed to backend-feat-derived-ac-mqgaot September 8, 2024 18:04 Inactive
@dhenkel92 dhenkel92 force-pushed the feat/derived-achievements-in-important-information branch from bc9af4a to 5150828 Compare September 8, 2024 18:15
@dhenkel92 dhenkel92 temporarily deployed to backend-feat-derived-ac-mqgaot September 8, 2024 18:16 Inactive
@dhenkel92 dhenkel92 force-pushed the feat/derived-achievements-in-important-information branch from 5150828 to 3e254be Compare September 11, 2024 10:13
@dhenkel92 dhenkel92 temporarily deployed to backend-feat-derived-ac-mqgaot September 11, 2024 10:14 Inactive
@dhenkel92 dhenkel92 force-pushed the feat/derived-achievements-in-important-information branch from 3e254be to f1252a5 Compare September 11, 2024 18:07
@dhenkel92 dhenkel92 temporarily deployed to backend-feat-derived-ac-mqgaot September 11, 2024 18:08 Inactive
@dhenkel92 dhenkel92 force-pushed the feat/derived-achievements-in-important-information branch from f1252a5 to dbfb1f0 Compare September 11, 2024 18:28
@dhenkel92 dhenkel92 temporarily deployed to backend-feat-derived-ac-mqgaot September 11, 2024 18:28 Inactive
@dhenkel92
Copy link
Member Author

You can test it here

https://user-app-revert-achieve-m8qo7z.herokuapp.com/start

This is the frontend PR

corona-school/user-app#546

@Jonasdoubleyou Jonasdoubleyou marked this pull request as ready for review September 11, 2024 19:01
Copy link
Member

@Jonasdoubleyou Jonasdoubleyou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall!

context: ctx,
recordValue: null,
achievedAt: new Date(),
// achievedAt: hasRequest || achievement ? new Date() : null,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the comment looks correct?


async function derivePupilMatching(user: User, pupil: Pupil, result: achievement_with_template[], userAchievements: achievement_with_template[]) {
const hasRequest = pupil.openMatchRequestCount > 0;
const successfulScreenings = await prisma.pupil_screening.findMany({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.count(...) might be faster.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!


async function deriveStudentMatching(user: User, student: Student, result: achievement_with_template[], userAchievements: achievement_with_template[]) {
const hasRequest = student.openMatchRequestCount > 0;
const successfulScreenings = await prisma.screening.findMany({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

});
const derivedTemplates = deriveAchievementTemplates(userAchievements[currentAchievementIndex].template.group);
achievementTemplates.push(...derivedTemplates);
achievementTemplates.sort((left, right) => left.groupOrder - right.groupOrder);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks strange - shouldn't it sort by group AND groupOrder? Or why by groupOrder?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because in this case all achievements in the list are of the same group

@dhenkel92 dhenkel92 force-pushed the feat/derived-achievements-in-important-information branch from dbfb1f0 to 550600b Compare September 14, 2024 13:13
@dhenkel92 dhenkel92 temporarily deployed to backend-feat-derived-ac-mqgaot September 14, 2024 13:13 Inactive
@dhenkel92 dhenkel92 force-pushed the feat/derived-achievements-in-important-information branch from 550600b to a816211 Compare October 20, 2024 13:37
@dhenkel92 dhenkel92 force-pushed the feat/derived-achievements-in-important-information branch 2 times, most recently from 2b8e559 to 16669e1 Compare December 30, 2024 19:26
@dhenkel92 dhenkel92 force-pushed the feat/derived-achievements-in-important-information branch from 16669e1 to 308bdaa Compare December 30, 2024 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants