Skip to content

Feat/#101 lecture lecturematerial relationship#116

Open
rmrn65 wants to merge 9 commits intodevelopmentfrom
feat/#101-lecture-lecturematerial-relationship
Open

Feat/#101 lecture lecturematerial relationship#116
rmrn65 wants to merge 9 commits intodevelopmentfrom
feat/#101-lecture-lecturematerial-relationship

Conversation

@rmrn65
Copy link
Contributor

@rmrn65 rmrn65 commented Mar 27, 2022

This pull request solves issue:

Closes: #101

Which app is this issue related to?

  • REST API
  • E-Learning React App
  • Admin Panel - Not created yet

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Wiki Updates

  • No need for updates
  • Requires an update ( not done within this issue )
  • Has been updated ( done within this issue )

Testing checklist

  • Unit tests
  • Functional tests
  • E2E tests

Security Filters - For API Only

Please make sure to add the respective Security Filters before submitting a PR

  • They have been added within this issue.

Compatibility tests - For E-Learning React App Only

  • Tested on Safari
  • Tested on Chrome
  • Tested on Mozilla Firefox

What changes have been done within this issue?

Added relationship in the Lecture class with LectureMaterial as a list of lectureMaterials . Also within the Lecture class I
implemented Lombok meaning getters setters hashCode and equals are deleted.
Modified update and add function in service so that they handle the list of lectureMaterials. This has been done by going
through the list of lectureMaterials received from the Lecture entry and updating the list after searching in the lectureMaterialRepository for the LectureMaterial entries.
There is a bug where if you want to update the lectureMaterial list of one lecture it will replace the already existent entries,
but due to the team needing the push as soon as possible, I left a comment and an issue so that it can be fixed later

The serialization issue does NOT need to be used in our situation. Later for other relationships, we will need to use DOT classes so we can display only what we need in the JSON got by the GET query

How should this be manually tested?

Use PATCH HTML query of /lecture and try adding a list of lecture materials only by adding ids, or by adding the whole object
like in the image shown below.

Screenshots or example usage

Screenshot from 2022-03-27 20-27-53

@rmrn65 rmrn65 requested a review from CristiPV March 27, 2022 17:32
@rmrn65 rmrn65 self-assigned this Mar 27, 2022
@rmrn65 rmrn65 added feat 🎸 A new feature rest-api 🛰 Changes on the Rest API labels Mar 27, 2022
@rmrn65 rmrn65 added this to the Phase I - E-Learning Platform milestone Mar 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat 🎸 A new feature rest-api 🛰 Changes on the Rest API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create Lecture-LectureMaterial Relationship

1 participant