#535-Create-service-to-fetch-and-save-layout-config-from/to-user-database #623

Closed
a22erigr wants to merge 0 commits from #535-Create-service-to-fetch-and-save-layout-config-from/to-user-database into team_2_week_3
Collaborator
  • The service contains a number of endpoints that may be used to get/fatch layouts from the database
    • getSpecificLayout: Fetches specific layout
      • Requires input:
      • UserID
      • ID
    • getFavoriteLayout: Gets the favorite layout of a user (lovers number in layout order)
      • Requires input:
      • UserID
    • getLayoutNameAndID. Retrieves all of the Name and id
      • Requires input:
      • UserID
      • Gets: Json array
    • saveSpecificLayout: saves pre existing layout
      • Requires input:
      • UserID
      • ID
      • JsonPayload (string)
      • Gets
      • Successful/fail
    • saveNewLayout
    • Requires input:
      • Requires input:
      • UserID
      • NameOfLayout
  • Tested on my computer using bruno. All of the endpoints works.
    • 172.18.0.14:8080/layout/getSpecificLayout
    • {
      "userID":1,
      "id": 2
      }
    • 172.18.0.14:8080/layout/getFavoriteLayout?userID=2
    • 172.18.0.14:8080/layout/saveSpecificLayout
    • {
      "userID": 1,
      "id": 2,
      "jsonPayload": "[{"Name":"HemsidaStandard","ID":1},{"Name":"DashboardVy","D":2}]"}
    • 172.18.0.14:8080/layout/saveNewLayout
    • {
      "userID": 1,
      "name": "My Layout",
      "jsonPayload": "[{"Name":"HemsidaStandard","ID":1},{"Name":"DashboardVy","D":2}]"
      }
    • 172.18.0.14:8080/layout/getLayoutNameAndID?userID=1
- The service contains a number of endpoints that may be used to get/fatch layouts from the database - getSpecificLayout: Fetches specific layout - Requires input: - UserID - ID - getFavoriteLayout: Gets the favorite layout of a user (lovers number in layout order) - Requires input: - UserID - getLayoutNameAndID. Retrieves all of the Name and id - Requires input: - UserID - Gets: Json array - saveSpecificLayout: saves pre existing layout - Requires input: - UserID - ID - JsonPayload (string) - Gets - Successful/fail - saveNewLayout - Requires input: - Requires input: - UserID - NameOfLayout + Tested on my computer using bruno. All of the endpoints works. + 172.18.0.14:8080/layout/getSpecificLayout + { "userID":1, "id": 2 } + 172.18.0.14:8080/layout/getFavoriteLayout?userID=2 + 172.18.0.14:8080/layout/saveSpecificLayout + { "userID": 1, "id": 2, "jsonPayload": "[{\"Name\":\"HemsidaStandard\",\"ID\":1},{\"Name\":\"DashboardVy\",\"D\":2}]"} + 172.18.0.14:8080/layout/saveNewLayout + { "userID": 1, "name": "My Layout", "jsonPayload": "[{\"Name\":\"HemsidaStandard\",\"ID\":1},{\"Name\":\"DashboardVy\",\"D\":2}]" } + 172.18.0.14:8080/layout/getLayoutNameAndID?userID=1
removed artifacts that came with it after copying from loginService
+ All endpoints are now created
+ Models for transporting data implemented
+ Service recive request. No logic implemented
+ All of the database functions are now implemented
  + Not tested with database but get the result "Name or service not
known" when using bruno
+ Updated the service
+ Uses more modern npgsql standard
+ it is now possible to both reach all endpoints and get  desired result
+ Implemented database logic
+ Implemented the ability to fech layouts
+ Implemented the ability to save layouts
+ Implemented GetlayoutNameAndID.
  + Returns a json array containing Name and ID
Collaborator

Review on #523

Tested on windows using chrome

  • App starts.
  • Did not manage to figure out how to test the endpoints using bruno.

Inspected following files:

  • Checked all files changed
    • Indendentation:
      • Follows prettier
    • Naming convention:
      • Follows naming convention, some places need changes though.
    • Comments:
      • Code is commented in the necessary places, though some seem like old notes or for future references.
    • General code quality:
      • Code quality is generally well

What needs to be done:

  • /scripts/UnixRebuild.sh & /scripts/UnixRebuildDebug.sh
    • The name of the docker build is "tempservice" when I assume it should be layoutService?
  • /service/layoutService/layoutService.Test/UnitTest1.cs
    • There is an invis unicode character at the start of the file, unsure if it should be there, but code still works.
  • /service/layoutService/layoutService/DatabaseLogic/DatabaseQueries.cs
    • Some variable names are shortened (conn could be connection or something more obvious for example)
    • There are some comments that can be cleaned up
  • /service/layoutService/layoutService/README.md
    • The readme is not updated (copy of loginservice)
  • /service/layoutService/layoutService/Services/LayoutService.cs
    • Note saying to move line to service
  • /service/layoutService/layoutService/Program.cs
    • The "important" line is commented out, either remove comment or uncomment
  • Should a test be implemented for this? And should bruno be part of the testing standard for endpoints?

Conclusion

There are some small fixes left, like renaming some variables and after that it should be ready to be merged.
Side note, but it could be good to create a wikipage with information about bruno.
Should week3 really be merged into this branch? Do not know when we merge branch into weekly and viceversa.
This was a fast review since a merge is happening soon.

### Review on #523 ### Tested on windows using chrome - App starts. - Did not manage to figure out how to test the endpoints using bruno. ### Inspected following files: - Checked all files changed - Indendentation: - Follows prettier - Naming convention: - Follows naming convention, some places need changes though. - Comments: - Code is commented in the necessary places, though some seem like old notes or for future references. - General code quality: - Code quality is generally well ## What needs to be done: - /scripts/UnixRebuild.sh & /scripts/UnixRebuildDebug.sh - The name of the docker build is "tempservice" when I assume it should be layoutService? - /service/layoutService/layoutService.Test/UnitTest1.cs - There is an invis unicode character at the start of the file, unsure if it should be there, but code still works. - /service/layoutService/layoutService/DatabaseLogic/DatabaseQueries.cs - Some variable names are shortened (conn could be connection or something more obvious for example) - There are some comments that can be cleaned up - /service/layoutService/layoutService/README.md - The readme is not updated (copy of loginservice) - /service/layoutService/layoutService/Services/LayoutService.cs - Note saying to move line to service - /service/layoutService/layoutService/Program.cs - The "important" line is commented out, either remove comment or uncomment - Should a test be implemented for this? And should bruno be part of the testing standard for endpoints? ## Conclusion There are some small fixes left, like renaming some variables and after that it should be ready to be merged. Side note, but it could be good to create a wikipage with information about bruno. Should week3 really be merged into this branch? Do not know when we merge branch into weekly and viceversa. This was a fast review since a merge is happening soon.
Collaborator

Merged Manually!

Merged Manually!
a24vinla closed this pull request 2026-04-29 07:54:27 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Andras/BoundlessFlowCampus2K!623
No description provided.