feat(KUI-1876): use ladok instead of kopps for memo statistics form #437
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR updates the memo statistics logic. Previously, course offerings for each semester were retrieved from KOPPS and then filtered using fields like first_yearsemester, first_period, and offered_semesters. These offerings were matched to memos using the course_round_application_code, and statistics were generated based on memo presence, publication timing, and course data. In the new implementation, offerings are retrieved from Ladok instead, using startperiod as the basis for selecting relevant data. While startperiod may not always reflect the exact teaching start date, it is assumed to be the most reliable and consistent way to retrieve all offerings for a given semester. Using förstaUndervisningsdatum and attempting to map it to a Ladok period is not feasible, particularly for summer courses that don't fit cleanly into VT or HT formats (I would be grateful to know your opinion about it, please let me know if you think startPeriod is not a good property to get all offerings for a semester 🙏). Memo matching now uses tillfälleskod. The result is a set of course offerings for the selected semesters and periods, matched with their respective memos, which is then aggregated into statistics per school; such as total number of offerings, how many had memos, and how many memos were published before course start or deadline.