ELTE-Clean / Clean-Administration-Platform

2 stars 1 forks source link

Main Endpoints creation #52

Closed Abdulla-Alkhulaqui closed 2 years ago

Abdulla-Alkhulaqui commented 2 years ago

Required API Endpoints

(for now this is all what I can think of)

Mohido commented 2 years ago

@Abdulla-Alkhulaqui Regarding adding a student by the admin, should a random password be generated? or what is the deal there exactly? In a more sophisticated application, we need to send an email. However, since no emails will be included in the platform, creating a new student must generate a new random password, then the student can update it...?

Mohido commented 2 years ago

Moreover, regarding changing a user from a student to a teacher will not be implemented in the backend! Me and @the4t4 discussed this issue few days ago, and settled on not doing that. We will have demonstrators, students, admin roles only and they are assigned when the users are created in KeyCloak. Therefore, for a beginning, we assume that the admin created the users and assigned them to roles beforehand (Using the Keycloak UI at localhost:8081) . And later we can integrate that into the platform when creating a user. So when creating a user through the React Platform, the admin needs to give the user a role. And maybe later, the admin can also have the ability to change the user role. But the user roles are not group dependent

the4t4 commented 2 years ago

UPDATE

All of the endpoints (except get) require most if not all parameters of the respective tables. None of the endpoints handle authorization yet.

Mohido commented 2 years ago

I just want to clarify some stuff: @Abdulla-Alkhulaqui @RealGorandos @the4t4

For now, we assume that the one who deploys our project will create the users manually through the keycloak UI and in the DB through the pgadmin. Therefore, we always assume that they exist and they are equivalent. The connection between the Keycloak DB and the CAP DB is the user's "username". I would highly recommend focusing on the management part of the project rather than spending time on the user creation part. Therefore, we assume that "users" exist in both our keycloak and CAP database!

the4t4 commented 2 years ago

[PUT] api/section/edit does not only change the name, you can change anything, you can even make it a completely new section. In both cases the old section which is being edited will be deleted.

[PUT] api/student/add is it really not possible to call some keycloak api to add a new user?

Mohido commented 2 years ago

@the4t4

1) Regarding the section edit... What part of the section we would need to edit rather than the name? the section resembles only a category tag. Or that is what I think of it. Maybe also the maximum grade? I don't remember if sections holds the grade data...

2) The problem not adding the student, the problem comes from handling the creation and distribution of passwords the right way. As discussed in the "teams" private channel, we can do it the easiest way in which we create users on the fly and return their usernames and their correspondence passwords. The admin needs to handle the distribution of these passwords and deliver them to students.

the4t4 commented 2 years ago

@Mohido correct, only a name change is needed for our use case but I'm just pointing out that anything can be changed. In the request, all of the parameters need to be given still even if we want to just change the name.

Mohido commented 2 years ago

@Abdulla-Alkhulaqui @the4t4 @RealGorandos : User endpoints are done for now. We only don't have users/update/password endpoint yet. I will rather focus on handling the database functionalities a bit with @the4t4. And maybe file uploading and handling.

Mohido commented 2 years ago

@Abdulla-Alkhulaqui @the4t4 @RealGorandos I think this issue can be closed since all the discussed features have been added in { #55 #58 #54 } Pull Requests. Maybe changing the students' password is still missing.

Abdulla-Alkhulaqui commented 2 years ago

@Abdulla-Alkhulaqui @the4t4 @RealGorandos I think this issue can be closed since all the discussed features have been added in { #55 #58 #54 } Pull Requests. Maybe changing the students' password is still missing.

@Mohido after testing all the endpoints, this issue will be closed.

Mohido commented 2 years ago

This task should be closed. If any bug appears regarding a certain endpoint, it should be in a separate issue.