-
Notifications
You must be signed in to change notification settings - Fork 5
[MODEXPS-296] Introduce table to store configs and adjust ConfigsController to use it #352
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
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
c210a96
[MODEXPS-296] Replace converters with simpler mappers
Saba-Zedginidze-EPAM 73704be
[MODEXPS-296] Update configuration
Saba-Zedginidze-EPAM ad13b3f
[MODEXPS-296] Add export config entity
Saba-Zedginidze-EPAM 497710b
[MODEXPS-296] Update services
Saba-Zedginidze-EPAM 548af9d
[MODEXPS-296] Add mapstruct
Saba-Zedginidze-EPAM 9af119a
[MODEXPS-296] Remove configuration schema usage
Saba-Zedginidze-EPAM 99ae8ca
[MODEXPS-296] Improve mapper validations
Saba-Zedginidze-EPAM 3bfecd3
[MODEXPS-296] Add mapper tests
Saba-Zedginidze-EPAM 6c3de75
[MODEXPS-296] Update services with own mappers
Saba-Zedginidze-EPAM 32216d9
[MODEXPS-296] Update migration script
Saba-Zedginidze-EPAM 9273e6c
[MODEXPS-296] Remove configuration client from tests
Saba-Zedginidze-EPAM 8a1ec75
[MODEXPS-296] Update and simplify export service tests
Saba-Zedginidze-EPAM 74cff15
[MODEXPS-296] Update export config manager test to use DB
Saba-Zedginidze-EPAM 70c0df2
[MODEXPS-296] Update configs controller test
Saba-Zedginidze-EPAM 7fea442
[MODEXPS-296] Address copilot suggestions
Saba-Zedginidze-EPAM 409549d
[MODEXPS-296] Remove mod-configuration verification from InstallUpgra…
Saba-Zedginidze-EPAM 16829ae
[MODEXPS-296] Fix sonar issues
Saba-Zedginidze-EPAM 32b315d
[MODEXPS-296] Fix TestUtils indentation
Saba-Zedginidze-EPAM 2613e3f
[MODEXPS-296] Address comments and fix filtering
Saba-Zedginidze-EPAM 87f968f
[MODEXPS-296] Fix failing tests
Saba-Zedginidze-EPAM dddf74c
[MODEXPS-296] Use correct schema
Saba-Zedginidze-EPAM 12f2da7
Merge branch 'master' into MODEXPS-296
Saba-Zedginidze-EPAM File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| package org.folio.de.entity; | ||
|
|
||
| import java.util.List; | ||
| import java.util.UUID; | ||
|
|
||
| import org.folio.de.entity.base.AuditableEntity; | ||
| import org.hibernate.annotations.Type; | ||
|
|
||
| import io.hypersistence.utils.hibernate.type.json.JsonBinaryType; | ||
| import jakarta.persistence.Column; | ||
| import jakarta.persistence.Entity; | ||
| import jakarta.persistence.Id; | ||
| import jakarta.persistence.Table; | ||
| import lombok.Data; | ||
| import lombok.EqualsAndHashCode; | ||
| import lombok.experimental.Accessors; | ||
|
|
||
| @Entity | ||
| @Table(name = "export_config") | ||
| @Data | ||
| @Accessors(chain = true) | ||
| @EqualsAndHashCode(callSuper = true) | ||
| public class ExportConfigEntity extends AuditableEntity { | ||
|
|
||
| @Id | ||
| @Column(name = "id", updatable = false, nullable = false) | ||
| private UUID id; | ||
|
|
||
| @Column(name = "config_name", nullable = false) | ||
| private String configName; | ||
|
|
||
| @Column(name = "type", nullable = false) | ||
| private String type; | ||
|
|
||
| @Column(name = "tenant", nullable = false) | ||
| private String tenant; | ||
|
|
||
| @Type(JsonBinaryType.class) | ||
| @Column(name = "export_type_specific_parameters", columnDefinition = "jsonb", nullable = false) | ||
| private Object exportTypeSpecificParameters; | ||
|
|
||
| @Column(name = "schedule_frequency") | ||
| private Integer scheduleFrequency; | ||
|
|
||
| @Column(name = "schedule_period") | ||
| private String schedulePeriod; | ||
|
|
||
| @Column(name = "schedule_time") | ||
| private String scheduleTime; | ||
|
|
||
| @Type(JsonBinaryType.class) | ||
| @Column(name = "week_days", columnDefinition = "jsonb") | ||
| private List<String> weekDays; | ||
|
|
||
| } |
42 changes: 42 additions & 0 deletions
42
src/main/java/org/folio/de/entity/base/AuditableEntity.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| package org.folio.de.entity.base; | ||
|
|
||
| import java.time.LocalDateTime; | ||
| import java.util.UUID; | ||
|
|
||
| import org.springframework.data.annotation.CreatedBy; | ||
| import org.springframework.data.annotation.CreatedDate; | ||
| import org.springframework.data.annotation.LastModifiedBy; | ||
| import org.springframework.data.annotation.LastModifiedDate; | ||
| import org.springframework.data.jpa.domain.support.AuditingEntityListener; | ||
|
|
||
| import jakarta.persistence.Column; | ||
| import jakarta.persistence.EntityListeners; | ||
| import jakarta.persistence.MappedSuperclass; | ||
| import lombok.Getter; | ||
| import lombok.Setter; | ||
| import lombok.ToString; | ||
|
|
||
| @Getter | ||
| @Setter | ||
| @ToString | ||
| @MappedSuperclass | ||
| @EntityListeners(AuditingEntityListener.class) | ||
| public abstract class AuditableEntity { | ||
|
|
||
| @CreatedDate | ||
| @Column(name = "created_date", nullable = false, updatable = false) | ||
| private LocalDateTime createdDate; | ||
|
|
||
| @CreatedBy | ||
| @Column(name = "created_by", updatable = false) | ||
| private UUID createdBy; | ||
|
|
||
| @LastModifiedDate | ||
| @Column(name = "updated_date", nullable = false) | ||
| private LocalDateTime updatedDate; | ||
|
|
||
| @LastModifiedBy | ||
| @Column(name = "updated_by") | ||
| private UUID updatedBy; | ||
|
|
||
| } |
33 changes: 0 additions & 33 deletions
33
src/main/java/org/folio/des/client/ConfigurationClient.java
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| package org.folio.des.config; | ||
|
|
||
| import java.util.Optional; | ||
| import java.util.UUID; | ||
|
|
||
| import org.folio.spring.FolioExecutionContext; | ||
| import org.springframework.context.annotation.Configuration; | ||
| import org.springframework.data.domain.AuditorAware; | ||
| import org.springframework.data.jpa.repository.config.EnableJpaAuditing; | ||
|
|
||
| import lombok.RequiredArgsConstructor; | ||
|
|
||
| /** | ||
| * FolioAuditorAware class is being used for populating "createdBy" field automatically while performing any DB operation. | ||
| * getCurrentAuditor() is needed to get current logged in user. | ||
| */ | ||
| @Configuration | ||
| @EnableJpaAuditing | ||
| @RequiredArgsConstructor | ||
| public class FolioAuditorAware implements AuditorAware<UUID> { | ||
|
|
||
| private final FolioExecutionContext folioExecutionContext; | ||
|
|
||
| @Override | ||
| public Optional<UUID> getCurrentAuditor() { | ||
| return Optional.ofNullable(folioExecutionContext.getUserId()); | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.