Skip to content

MODFQMMGR-746 Use mod-settings instead of mod-config for locale settings - #1146

Merged
mweaver-ebsco merged 5 commits into
masterfrom
MODFQMMGR-746-mod-config-ets
Feb 3, 2026
Merged

MODFQMMGR-746 Use mod-settings instead of mod-config for locale settings#1146
mweaver-ebsco merged 5 commits into
masterfrom
MODFQMMGR-746-mod-config-ets

Conversation

@mweaver-ebsco

Copy link
Copy Markdown
Collaborator

No description provided.

@mweaver-ebsco
mweaver-ebsco requested a review from a team as a code owner January 30, 2026 16:30
@mweaver-ebsco mweaver-ebsco changed the title MODFQMMGR-746 Set Docker API version for testcontainers MODFQMMGR-746 Use mod-settings instead of mod-config for locale settings Jan 30, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR replaces the legacy SettingsClient/mod-configuration-based locale & currency handling with a new LocaleClient that uses the /locale API, updates all dependent services, cleans up now-unused configuration entity types, and attempts to pin the Docker API version for Testcontainers via Maven Surefire/Failsafe configuration.

Changes:

  • Introduced LocaleClient (backed by /locale) and refactored ResultSetService, EntityTypeService, DataRefreshRepository, and the V4 date migration strategy to consume it instead of SettingsClient and raw configuration entries.
  • Removed the simple_config_data entity type and related joins/permissions from order-related entity-type JSON definitions that depended on configuration entries.
  • Adjusted test code to target the new locale flow and added LocaleClientTest; updated pom.xml to set system properties intended for Testcontainers’ Docker API version and simplified test JVM arg handling.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/main/java/org/folio/fqm/client/LocaleClient.java New client for the /locale API, encapsulating locale, currency, timezone, and numbering system plus safe defaults and timezone parsing.
src/main/java/org/folio/fqm/service/ResultSetService.java Switched date localization to use LocaleClient for tenant timezone instead of SettingsClient; behavior is preserved while using /locale.
src/main/java/org/folio/fqm/service/EntityTypeService.java Simplified language localization: now pulls the UI locale directly from LocaleClient instead of manually parsing configuration entries.
src/main/java/org/folio/fqm/repository/DataRefreshRepository.java Reworked system-currency resolution to use LocaleClient rather than parsing mod-configuration; still guards unsupported currencies and uses the same exchange-rate fetch flow.
src/main/java/org/folio/fqm/migration/strategies/impl/V4DateFieldTimezoneAddition.java Updated migration to derive the tenant timezone via LocaleClient and cache the resolved ZoneId in the migration state.
src/main/java/org/folio/fqm/migration/MigrationStrategyRepository.java Updated constructor wiring to pass LocaleClient into V4DateFieldTimezoneAddition instead of SettingsClient.
src/main/java/org/folio/fqm/client/SettingsClientRaw.java Removed obsolete Feign client for mod-settings’ entries endpoint.
src/main/java/org/folio/fqm/client/SettingsClient.java Removed wrapper client now superseded by the new LocaleClient.
src/test/java/org/folio/fqm/client/SettingsClientTest.java Deleted tests tied to the removed SettingsClient.
src/test/java/org/folio/fqm/client/LocaleClientTest.java Added tests covering successful locale parsing and default/fallback behavior on Feign errors and invalid JSON.
src/main/resources/entity-types/configuration/simple_config_data.json5 Deleted the simple_config_data entity type, which previously exposed configuration entries as an entity.
src/main/resources/entity-types/orders/simple_purchase_order.json5 Removed joins from bill_to and ship_to columns to the now-deleted simple_config_data entity type; those fields remain as raw UUIDs.
src/main/resources/entity-types/orders/composite_po_instance.json5 Removed configuration.entries.collection.get from requiredPermissions, reflecting the removal of simple_config_data and configuration-based joins.
src/test/java/org/folio/fqm/service/ResultSetServiceTest.java Updated tests to mock LocaleClient and pass timezone identifiers as strings rather than ZoneId, aligning with the new API.
src/test/java/org/folio/fqm/service/EntityTypeServiceTest.java Adjusted language-related tests to use LocaleClient for locale resolution instead of an HTTP JSON payload to mod-configuration.
src/test/java/org/folio/fqm/repository/DataRefreshRepositoryTest.java Reworked exchange-rate refresh tests to rely on LocaleClient for system currency and simplified locale configuration mocking; ensured behavior for supported, unsupported, and default currency paths.
src/test/java/org/folio/fqm/migration/strategies/impl/V4DateFieldTimezoneAdditionTest.java Updated migration tests to mock LocaleClient and verify its use (or non-use) depending on whether date fields are present.
pom.xml Set a global argLine property to enforce UTF-8 and added Surefire/Failsafe systemProperties entries intended to pin the Docker API version for Testcontainers, though the property name/structure currently won’t be recognized by Testcontainers as-is.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pom.xml
Comment thread src/test/java/org/folio/fqm/repository/DataRefreshRepositoryTest.java Outdated
Comment thread src/test/java/org/folio/fqm/repository/DataRefreshRepositoryTest.java Outdated
@mweaver-ebsco
mweaver-ebsco force-pushed the MODFQMMGR-746-mod-config-ets branch 9 times, most recently from 921c444 to 8ea8da9 Compare February 3, 2026 17:01
@mweaver-ebsco
mweaver-ebsco force-pushed the MODFQMMGR-746-mod-config-ets branch 2 times, most recently from abd78f1 to 8486453 Compare February 3, 2026 18:08
* Provides raw access to the /locale API.
*/
@FeignClient(name = "locale")
interface LocaleClientRaw {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is the same basic idea as with SettingsClient and SettingsClientRaw, except I hid the raw version inside this one, to keep things a little simpler

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I suppose this should just be

Suggested change
return oldFieldName;

id: '4d626ce1-1880-48d2-9d4c-81667fdc5dbb',
name: 'simple_invoice',
private: false,
private: true,

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The migration basically just moves queries from this ET to the new composite (and adjusts references to the now-deleted bill_to field)

Comment on lines -5 to -8
requiredPermissions: [
// This inherited from simple_config_data, but is also included here because of the added columns here that also retrieve config data
'configuration.entries.collection.get',
],

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Context: There used to be some columns defined in this composite that used data from mod-config. Those are gone now, so we don't need the permission anymore

@mweaver-ebsco
mweaver-ebsco force-pushed the MODFQMMGR-746-mod-config-ets branch from 3daa74d to ada649d Compare February 3, 2026 18:50
@sonarqubecloud

sonarqubecloud Bot commented Feb 3, 2026

Copy link
Copy Markdown

This migration switches queries from simple_invoice to
composite_invoice, and moves references to the old invoice.bill_to field
to the new version in the composite. Other ETs that contain
simple_invoice will only get field warnings if they reference the
bill_to field.
@Override
public Map<UUID, Map<String, FieldWarningFactory>> getFieldWarnings() {
FieldWarningFactory billToWarning = RemovedFieldWarning.withoutAlternative();
return Map.of(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You don't need all of these enumerated anymore! Take a look at the new overridable method in the migration docs; specify the composite entity IDs and source aliases and it'll auto-resolve any composite parent changes

@mweaver-ebsco
mweaver-ebsco merged commit f4340d1 into master Feb 3, 2026
16 checks passed
@mweaver-ebsco
mweaver-ebsco deleted the MODFQMMGR-746-mod-config-ets branch February 3, 2026 20:10
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.

4 participants