-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: reverse dependency between jooq and core module #74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -18,19 +18,20 @@ | |||||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||||||
| package de.rwth.idsg.steve.repository; | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| import de.rwth.idsg.steve.repository.dto.WebUser; | ||||||||||||||||||||||||||||||||||
| import de.rwth.idsg.steve.service.dto.WebUserOverview; | ||||||||||||||||||||||||||||||||||
| import de.rwth.idsg.steve.web.dto.WebUserQueryForm; | ||||||||||||||||||||||||||||||||||
| import jooq.steve.db.tables.records.WebUserRecord; | ||||||||||||||||||||||||||||||||||
| import org.jooq.JSON; | ||||||||||||||||||||||||||||||||||
| import org.jooq.Record4; | ||||||||||||||||||||||||||||||||||
| import org.jooq.Result; | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| import java.util.List; | ||||||||||||||||||||||||||||||||||
| import java.util.Optional; | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
|
Comment on lines
+21
to
27
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Layering breach: repository imports a service DTO.
Example fix: -import de.rwth.idsg.steve.service.dto.WebUserOverview;
+import de.rwth.idsg.steve.repository.dto.WebUserOverview;Also ensure the class is relocated accordingly. 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||
| public interface WebUserRepository { | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| void createUser(WebUserRecord user); | ||||||||||||||||||||||||||||||||||
| void createUser(WebUser user); | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| void updateUser(WebUserRecord user); | ||||||||||||||||||||||||||||||||||
| void updateUser(WebUser user); | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| void updateUserByPk(WebUserRecord user); | ||||||||||||||||||||||||||||||||||
| void updateUserByPk(WebUser user); | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| void deleteUser(String username); | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
|
|
@@ -48,9 +49,9 @@ public interface WebUserRepository { | |||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| boolean userExists(String username); | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| WebUserRecord loadUserByUserPk(Integer webUserPk); | ||||||||||||||||||||||||||||||||||
| Optional<WebUser> loadUserByUserPk(Integer webUserPk); | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| WebUserRecord loadUserByUsername(String username); | ||||||||||||||||||||||||||||||||||
| Optional<WebUser> loadUserByUsername(String username); | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| Result<Record4<Integer, String, Boolean, JSON>> getOverview(WebUserQueryForm form); | ||||||||||||||||||||||||||||||||||
| List<WebUserOverview> getOverview(WebUserQueryForm form); | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -18,12 +18,11 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| package de.rwth.idsg.steve.repository.dto; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import jooq.steve.db.tables.records.ChargingProfileRecord; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import jooq.steve.db.tables.records.ChargingSchedulePeriodRecord; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import lombok.Builder; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import lombok.Getter; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import lombok.RequiredArgsConstructor; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import java.math.BigDecimal; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import java.time.Instant; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import java.util.List; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -58,9 +57,29 @@ public static final class Overview { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @Getter | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @RequiredArgsConstructor | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @Builder | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| public static final class Details { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private final ChargingProfileRecord profile; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private final List<ChargingSchedulePeriodRecord> periods; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // from ChargingProfileRecord | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private final int chargingProfilePk; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private final int stackLevel; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private final String chargingProfilePurpose; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private final String chargingProfileKind; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private final String recurrencyKind; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private final Instant validFrom; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private final Instant validTo; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private final Integer durationInSeconds; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private final Instant startSchedule; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private final String chargingRateUnit; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private final BigDecimal minChargingRate; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // from ChargingSchedulePeriodRecord | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private final List<ChargingSchedulePeriod> periods; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
60
to
+78
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Include description and note in Details to prevent data loss in edit flows.
@Getter
@Builder
public static final class Details {
- // from ChargingProfileRecord
+ // from ChargingProfileRecord
private final int chargingProfilePk;
private final int stackLevel;
+ private final String description;
+ private final String note;
private final String chargingProfilePurpose;
private final String chargingProfileKind;
private final String recurrencyKind;
private final Instant validFrom;
private final Instant validTo;
private final Integer durationInSeconds;
private final Instant startSchedule;
private final String chargingRateUnit;
private final BigDecimal minChargingRate;
// from ChargingSchedulePeriodRecord
private final List<ChargingSchedulePeriod> periods;
}Follow-up: update the mapper and 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @Getter | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @RequiredArgsConstructor | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| public static final class ChargingSchedulePeriod { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private final int startPeriodInSeconds; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private final BigDecimal powerLimit; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private final Integer numberPhases; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.