Skip to content

merge backend refactor into main branch#1

Merged
RiedleroD merged 96 commits intomainfrom
LP-55-Backend-Refactor
Sep 30, 2024
Merged

merge backend refactor into main branch#1
RiedleroD merged 96 commits intomainfrom
LP-55-Backend-Refactor

Conversation

@RiedleroD
Copy link
Contributor

@RiedleroD RiedleroD commented Aug 12, 2024

TODO:

  • adjust actions to match changes

mcquenji and others added 30 commits October 28, 2023 02:37
Co-authored-by: RiedleroD <github@riedler.wien>
Co-authored-by: RiedleroD <github@riedler.wien>
* used $USER in get_all_notifications

* removed $userid in update_notification
(it was unused anyway? weird)

* fixed typo (more or less)

* fixed incorrect user property
I trust people too much to tell me the correct property name 🤔

* removed $userid in delete_feedback

* removed userid param from get_all_feedbacks
unused again! …how? how does that even happen

* removed $userid param from get_feedback
another unused one

* replaced userid param in submit_feedback

* replaced userid param in update_feedback

* removed userid from accept_invite
rebased on #50 to make this work

* removed userid REST param from add_deadline

* removed userid REST param from clear_plan

* refactored decline_invite

* removed unnecessary user access check

* removed userid from delete_deadline

* removed plan/get_access because it duplicates a feature already handled in get_plan

* refactored get_plan

* refactored invite_user

* refactored leave_plan

* refactored remove_user

* cleanup after rebase

* removed userid from update_access

* removed userid from update_deadline

* removed userid from update_invite

* removed userid and planid from update_plan

* removed userid from get_invites

* removed redundant planid REST parameter

* added todo to delete file

* codesniffer fixes

* fixed inverted check for whether the invite has already been accepted or declined

* removed get_access API point from services.php
- I wasn't even aware a file like this existed
* reduced API return bloat: feedback service

* reduced API return bloat: notifications service

* reduced API return bloat: invite subservice

* reduced API return bloat: deadline subservice

* reduced API return bloat: plan service

* added invite helper
- almost forgot. oops!

* removed return from leave_plan

* removed return from update_invite

* deleted unused service endpoints

---------

Co-authored-by: RiedleroD <github@riedler.wien>
* added Gh actions

* biete hilfe

* 147 rat auf draht

* nur maria

* adjustments to workflow

stolen from 3dc3f0510936bdacd22421701b95462c15452340, which is a tainted commit, as per usual.

* untaint commit
see b3968f83dda3f5d8d2de1194eb38904c6b307b24

* changed CI php version to 7.4, which is the same as in prod

* renamed action to just "CI"

* removed 8.1 from action php versions

---------

Co-authored-by: Muhi <muhiko68@gmail.com>
* added Gh actions

* biete hilfe

* 147 rat auf draht

* nur maria

* added a new way to retrieve user information including picture
removed deprecated code from the user_helper
get user now gets the userid from the global

* reworked register_user.php
added the profile picture string to user_helper

* bugfixing and checking testcases

* Added Return Types and better documentation

* Reworking docs

* Reworking docs and adding userid to deleteuser

* Reworking docs and bugfixing

* Reworking docs

* Adding must-have docs

* Checking Moodle PHPDoc Checker

* Checking Moodle PHPDoc Checker
fixing "Line 30: No one-line description"

* changed array[] to array

* Changed copyright from LB Planner to NecodeIT and package from local_lbplanner_services

* Changed NecodeIT to necodeIT

* Added MoodleDocs to comfort Moodle even more

* comforting Moodle Docs and changing if statements to more readable ones.

* comforting Moodle Docs
interger to int

* comforting Moodle Docs
Adding comma to multiline comments
* reworked courses and removed unnecessary code

* updated gitignore

* Added Docs for color format

* Removed unnecessary function get_course.php

* Trying moodle codeblocks

* comforting Moodle Docs and changing if statements to more readable ones.

* ecodeIT to necodeIT
Courses where able to input a too long shortname. DB doesnt like that
* reworked enums

* removed two more `->value` I forgot
* combined update_deadline and add_deadline into set_deadline

* corrected some docstrings

* fixed minor spelling mistake
* updated feedback API docs

* improved docs in notification service

* updated API docs for invite subservice

* updated API docs for deadline subservice

* updated API docs for the rest of the plan service

* api docs corrections

* changes to enum for upcoming changes to api docs

* added another helper just to list enum cases inside the API docs

* added capability to format Enum class to string

* restructured modules helper with new Enum polyfills

* restructured notification helper with Enums & fixed API docs

* replaced duplicate code with better newer implementation

* specified that the shortened module name is max. 5 chars
may god have mercy upon us all

* updated feedback API docs

* improved docs in notification service

* updated API docs for invite subservice

* updated API docs for deadline subservice

* updated API docs for the rest of the plan service

* api docs corrections

* changes to enum for upcoming changes to api docs

* added another helper just to list enum cases inside the API docs

* added capability to format Enum class to string

* restructured modules helper with new Enum polyfills

* restructured notification helper with Enums & fixed API docs

* replaced duplicate code with better newer implementation

* banished tab indents (oops)

* replaced all array(…) with […]

* hopefully convince github CI to run

* appeased the moodle linter gods

* added moodle internal checks where needed

* removed some unnecessary variable declarations

* some smaller formatting fixes

* added blocks to previously inline code branches

* renamed Enum::tryFrom to Enum::try_from

* added more space around ifs, as per the bitch called moodle code checker's request

* increase max linter warnings to 1 to allow my enum polyfill to exist

* various minor code comment fixes for phpdoc linter

* testing correct phpdoc package tag

* added crude phpdoc-compliant-ish class docstrings to helper classes

* docstringed modules helper

* docstringed notifications helper

* docstringed plan helper

* various smaller fixes

* helpers: replaced param types with shortforms

* docstring enum polyfill

* docstringed plan helper

* docstringed course helper

* docstringed feedback_helper

* some smaller docstring fixes

* added file-level docstring to settings.php

* completed docstrings of service files

* fixed some incorrect docblocks

* fixed phpdoc errors in db submodule

* Revert to normal CI

This reverts commit fe9a5f4b0e57d62a5f70a3d7ec9183f932b6326f.

* fixed CI regression from merge

* fixed docblocks in services/modules

* fixed docblocks in services/plan

* fixed docblocks in services/feedback

* fixed docblocks in services/config

* fixed docblocks in services/notifications

* fixed remaining CI errors
* Added dependency to the local_modcustomfield plugin

* Testing compatibility with customfields

* So i tried to use the customfield version from the plugin and found out that it uses the customfield from moodle itself aswell. Now it works. small tweaks needed

* added testing

* Fixed bug
Since moodle does save the plugin list as a Map in an array and i didnt know it the function never executed

* Minor Tweaks

* Further Tweaks

* tweaking the service itself

* removed function. Not necessary

* Last tweaks before merge

* Tweaking
* Fixing CI errors

* Comforting Riedler
* moved enums into their own files (plus EnumCase too)

* removed unneeded moodle internal checks

* fixed accidental tab indents

* moved more enums out of modules_helper

* lots of smaller formatting and CI fixes

* more CI fixes
code deduplication, added name lookup
…crudely. but good enough
RiedleroD and others added 27 commits August 19, 2024 22:01
parts of slot booking (and some other adjacent stuff)
yeah I'm aware this is Nya! arigato

so what? huh?
I literally just today realized that 'lbplanner courses' are user-specific while 'moodle courses' are global.
Perhaps in the future someone should rename our 'course' stuff to 'courseprefs' or something like that.
…rses()

the order was wrong. a copy-paste error on my end
amended to include fixed db/services.php
@RiedleroD RiedleroD marked this pull request as ready for review September 30, 2024 17:51
@RiedleroD RiedleroD merged commit 3efc694 into main Sep 30, 2024
@RiedleroD RiedleroD deleted the LP-55-Backend-Refactor branch September 30, 2024 17:51
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