Skip to content

Expand queries for courses and programs#72

Merged
losalo merged 10 commits intomainfrom
expand-queries
Apr 21, 2026
Merged

Expand queries for courses and programs#72
losalo merged 10 commits intomainfrom
expand-queries

Conversation

@remvee
Copy link
Copy Markdown
Contributor

@remvee remvee commented Apr 7, 2026

First part of #12.

@remvee remvee requested a review from losalo April 7, 2026 07:44
Comment thread src/main/java/oeapi/controller/ProgramController.java Outdated
Comment thread src/main/java/oeapi/controller/ProgramController.java Outdated
Comment thread src/main/java/oeapi/service/ProgramService.java Outdated
Comment thread src/main/java/oeapi/model/Program.java Outdated
Comment thread src/main/java/oeapi/model/Course.java Outdated
Comment thread src/main/java/oeapi/payload/CourseDTO.java
Comment thread src/main/java/oeapi/model/Program.java Outdated
Comment thread src/main/java/oeapi/model/Program.java Outdated
this.courses = courses;
}

// parent and children
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

These attributes were left unimplemented because we considered it necessary also to have a control mechanism to avoid circular references. For example, in course A you could declare B as its child, and in course B you could also declare A as its child. When requesting the children of A, this could lead to an infinite loop A → B → A → B → A… which would need to be handled. This example is very simple, but in tree‑like structures the control logic becomes much more complex in order to prevent circular references anywhere in the hierarchy, that can easily go out of control

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I need if for eduxchange because it requires the ability to expand the parent property.

As for the circular references, yes they could introduce problems but only when clients are trying to traverse the entire graph. In that case, it's the clients problem to keep track of which programs they already seen.

Can I add an issue for this here on gh, to point out this should be added as a constraint when adding a program?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ok

Comment thread src/main/java/oeapi/controller/OfferingController.java Outdated
Comment thread src/main/java/oeapi/controller/OfferingController.java Outdated
Copy link
Copy Markdown
Contributor

@losalo losalo left a comment

Choose a reason for hiding this comment

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

I’ve completed a visual review of the code and added comments with suggested changes. I’ll now run tests with real data to validate a few of the updates.

@remvee remvee marked this pull request as ready for review April 19, 2026 08:51
@remvee remvee requested a review from losalo April 19, 2026 12:48
@losalo losalo merged commit d03b34c into main Apr 21, 2026
2 checks passed
@losalo losalo deleted the expand-queries branch April 21, 2026 08:59
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.

2 participants