Skip to content

Conversation

@Huber1
Copy link
Contributor

@Huber1 Huber1 commented Apr 21, 2025

Calendar elements are now lowercase and wrapped in an object

@Huber1 Huber1 requested a review from Copilot April 21, 2025 17:46
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request updates calendar-related code to use lowercase property names and wraps calendar elements in a wrapper object for a more consistent API response. Key changes include:

  • Renaming calendar element properties (e.g., ID → id, Name → name) in the model, service, controller, and YAML configuration.
  • Introducing a new CalendarWrapper model to encapsulate calendar elements.
  • Adjusting log messages and method calls in related services to reflect the new naming convention.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/main/java/app/betterhm/backend/v1/services/CapacityService.java Updated error messages to use lowercase for 'url' consistently.
src/main/java/app/betterhm/backend/v1/services/CalendarService.java Updated variable names in filtering and comments to lowercase.
src/main/java/app/betterhm/backend/v1/models/CalendarWrapper.java Added a new wrapper class for calendar elements.
src/main/java/app/betterhm/backend/v1/models/CalendarElement.java Renamed record components from uppercase to lowercase.
src/main/java/app/betterhm/backend/v1/controller/CalendarController.java Adjusted response type and Javadoc comments to use the new wrapper.
src/main/java/app/betterhm/backend/v1/component/StaticUpdater.java Updated method calls to use the new, lowercase property names.
resources/yaml/config.yml Modified calendar configuration keys to lowercase for consistency.

Comment on lines +116 to +117
logger.error("Could not Split LRZ Api url Provided by the config", e);
throw new PatternSyntaxException("Could not Split LRZ Api url Provided by the config", lrzApiUrl, -1);
Copy link

Copilot AI Apr 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider revising the error message for clarity and consistency (e.g., 'Could not split LRZ API URL from configuration').

Suggested change
logger.error("Could not Split LRZ Api url Provided by the config", e);
throw new PatternSyntaxException("Could not Split LRZ Api url Provided by the config", lrzApiUrl, -1);
logger.error("Could not split LRZ API URL from configuration", e);
throw new PatternSyntaxException("Could not split LRZ API URL from configuration", lrzApiUrl, -1);

Copilot uses AI. Check for mistakes.
Comment on lines +119 to +120
logger.error("Could not Generate a valid url for the LRZ Wifi Api", e);
throw new IllegalStateException("Could not Generate a valid url for the LRZ Wifi Api", e);
Copy link

Copilot AI Apr 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider revising the error message for clarity and consistency (e.g., 'Could not generate a valid URL for the LRZ WiFi API').

Suggested change
logger.error("Could not Generate a valid url for the LRZ Wifi Api", e);
throw new IllegalStateException("Could not Generate a valid url for the LRZ Wifi Api", e);
logger.error("Could not generate a valid URL for the LRZ WiFi API", e);
throw new IllegalStateException("Could not generate a valid URL for the LRZ WiFi API", e);

Copilot uses AI. Check for mistakes.
@Huber1 Huber1 merged commit 9e03b40 into main Apr 21, 2025
1 check passed
@Huber1 Huber1 deleted the fix-calendar-format branch April 21, 2025 17:53
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.

2 participants