#845-new-energy-endpoints #994

Merged
a24julot merged 5 commits from #845-new-energy-endpoints into team_1_week_6 2026-05-20 07:53:28 +00:00
Collaborator

Created new Endpoints for getting total energy used during a month from one sensor or all sensors combined

csproj.lscache files are created automatically, they are safe to remove but they get created again anyway when running. They contain no code just descriptions and i don't know why they started appearing if not for a vscode update, as the C# dev kit in vscode keeps creating it.

to test the endpoints use
/energy/total/{sensorid}/{year}/{month}
and
/energy/total/{year}/{month}

There seems to be something wonky with the PostgreSQL as i have multiple times on this branch and on the week 6 team branch gotten a dependency error of the PostgreSQL being unhealthy, this dosent always happen but it still occurs frequently. This is most likely an error of the PostgreSQL building out of order to early. if this happens during testing cd into DockerCompose/ and run:
sudo docker compose up -d entryPoint
or
docker compose up -d entryPoint
or start the entryPoint container again through Docker desktop if you want to.

Either of these three work as they just do the same thing. The first one always works for me.

related issue #845

Created new Endpoints for getting total energy used during a month from one sensor or all sensors combined csproj.lscache files are created automatically, they are safe to remove but they get created again anyway when running. They contain no code just descriptions and i don't know why they started appearing if not for a vscode update, as the C# dev kit in vscode keeps creating it. to test the endpoints use /energy/total/{sensorid}/{year}/{month} and /energy/total/{year}/{month} There seems to be something wonky with the PostgreSQL as i have multiple times on this branch and on the week 6 team branch gotten a dependency error of the PostgreSQL being unhealthy, this dosent always happen but it still occurs frequently. This is most likely an error of the PostgreSQL building out of order to early. if this happens during testing cd into DockerCompose/ and run: sudo docker compose up -d entryPoint or docker compose up -d entryPoint or start the entryPoint container again through Docker desktop if you want to. Either of these three work as they just do the same thing. The first one always works for me. related issue #845
Can now get the total energy from a sensor over from teh specific month of a year
new endpoint added to fetch total from all sensor from a specific month in a year
a24julot 2026-05-18 11:52:56 +00:00
Collaborator

Review on #845

Whats done

Looked over code and tested the endpoints in terminal

Tested on Windows 11 using Chrome

  • Endpoints work

Inspected following files [IMPORTANT!, Don't forget to inspect for unapproved dependencies in package.json ]

  • DatabaseQueries.cs
  • EnergyEndpoints.cs
  • IDatabaseQueries.cs
  • EnergyService.cs
  • IEnergyService.cs
    • Indentation/code styling is correct except for "DatabaseQueries.cs" and "IDatabaseQueries.cs" that just needs to get formatted ( When I save the files they change formatting )
    • Naming convention is good
    • Comments are good
    • General code quality is good!

What needs to be done

Format DatabaseQueries.cs and IDatabaseQueries.cs

Conclusion

Endpoints work and everything looks good so it can be merged as soon as formatting is done.

# Review on #845 ## Whats done Looked over code and tested the endpoints in terminal ### Tested on Windows 11 using Chrome + Endpoints work ### Inspected following files [IMPORTANT!, Don't forget to inspect for unapproved dependencies in **package.json** ] + DatabaseQueries.cs + EnergyEndpoints.cs + IDatabaseQueries.cs + EnergyService.cs + IEnergyService.cs + Indentation/code styling is correct except for "**DatabaseQueries.cs**" and "**IDatabaseQueries.cs**" that just needs to get formatted ( When I save the files they change formatting ) + Naming convention is good + Comments are good + General code quality is good! ## What needs to be done Format DatabaseQueries.cs and IDatabaseQueries.cs ## Conclusion Endpoints work and everything looks good so it can be merged as soon as formatting is done.
Author
Collaborator

Fixed the formatting of IDatabaseQueries and DatabaseQueries to match those in other services

Fixed the formatting of IDatabaseQueries and DatabaseQueries to match those in other services
Collaborator

@b24hugst Is this ready to be merged?

@b24hugst Is this ready to be merged?
Collaborator

It still change formatting when I save the file. I'll show what I mean exactly.
That is one example from DatabaseQueries.cs:

Pre-save
image

After-save
image

Do you maybe not have the correct format-on-save option for c#?

It still change formatting when I save the file. I'll show what I mean exactly. That is one example from DatabaseQueries.cs: Pre-save ![image](/attachments/69774595-cf99-417e-9fdb-51738658216b) After-save ![image](/attachments/5ccc83be-8771-4164-a777-3991ea29a64a) Do you maybe not have the correct format-on-save option for c#?
2.9 KiB
4.4 KiB
Collaborator

I experienced the same problem as @b24hugst . Check the wiki here for the correct formatter: https://git.webug.se/Andras/BoundlessFlowCampus2K/wiki/Formatter. Also, is there a way to remove the cache files från the pull request? They do not need to be merged with the PR.

I experienced the same problem as @b24hugst . Check the wiki here for the correct formatter: https://git.webug.se/Andras/BoundlessFlowCampus2K/wiki/Formatter. Also, is there a way to remove the cache files från the pull request? They do not need to be merged with the PR.
Author
Collaborator

Formatter borde nu vara fixad och korrekt formatterad och alla lscache filer har tagits bort

Formatter borde nu vara fixad och korrekt formatterad och alla lscache filer har tagits bort
a24sakma approved these changes 2026-05-20 07:52:12 +00:00
a24sakma left a comment
Collaborator

Looks good!

  1. the indentations seems fine
  2. the cache is removed
  3. the endpoints functions
Looks good! 1. the indentations seems fine 2. the cache is removed 3. the endpoints functions
a24julot merged commit 04463ba9fb into team_1_week_6 2026-05-20 07:53:28 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
4 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!994
No description provided.