Repository navigation
MODEXPS-323 - Add endpoint to return the effective export configurations - #389
Merged
Merged
Conversation
Clients pass the PO line's vendor, acquisition method and account to GET /configs and get the matching integrations, so the worker's rule no longer has to be repeated in the UI. Calls without these params are unchanged.
The matching works on export config criteria, so the names no longer refer to PO lines. This includes the two new error codes, which are unreleased.
The PO line parameters describe a line rather than filter configs, so they get their own endpoint with its own permission, and GET /configs goes back to query and limit only. The endpoint requires vendorId, returns all matches, and accepts the shared export type.
…configs The parameter now uses the enum from the vendor config schema instead of its own copy of the values. Also rename the criteria record to ConfigCriteria and the generated enum and its converter to TransmissionMethod.
There is no default type anymore, so a missing or empty type returns 400, and the query and matcher handle a single type. ConfigsController goes back to its state on master.
The shared export type schema brings a Bursar default, which would turn a missing type into a valid request. Only types with a matching rule are accepted now, so other types return 400. Also rename ConfigMatchRule to EffectiveConfigMatchRule.
A Claims config with selected methods applies only to those, and one without selected methods applies to the methods no other Claims config of the vendor selects. Without an acquisition method, every Claims config of the vendor matches.
An absent vendorAccount now applies no account filter, so every Ordering config with the acquisition method matches. An empty vendorAccount means a PO line without an account number, which absent meant before.
SerhiiNosko
approved these changes
Nov 9, 2026
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



MODEXPS-323 - Add endpoint to return the effective export configurations
Purpose
This PR adds an endpoint that returns the integrations of one export type that match the given criteria. The criteria are field values rather than a PO line id, so unsaved form values and new lines work, and no call to mod-orders is needed.
Current use cases
Usage in PO line
ui-orders (UIOR-1556, PR #1890) shows which integration will pick up a PO line. It currently re-implements the worker's selection on the client, so every backend rule change has to be repeated in the UI.
Manual ordering export
POST /data-export-spring/configs/{id}/execute(MODEXPS-316) needs a config id, so the caller has to know first which integration applies to the PO line.Claims in mod-orders
POST /orders/pieces/claimfinds integrations by theCLAIMS_<vendorId>name prefix and sends every claimed piece to all of them. With this endpoint, it routes by acquisition method without its own copy of the rule, and creates one job per integration with only its pieces.Single-piece claim in ui-receiving
ui-receiving checks
configName==CLAIMS_<organizationId>*to choose between a claim job and a manualClaim sent. With routing by acquisition method, it could offer a job that mod-orders rejects with 422 instead of the manual claim. This endpoint gives it the same answer as mod-orders.Approach
Matching (
EffectiveConfigMatcher, with oneEffectiveConfigMatchRuleper type). All configs of the type and vendor are loaded, because the rules need them. Matches are sorted byconfigName, and there is nolimit.EDIFACT_ORDERS_EXPORT(OrderingMatchRule) uses the worker's rule fromMapToEdifactOrdersTasklet#getPoLineQuery/#getVendorAccountFilter:acquisitionMethodmust be indefaultAcquisitionMethods, so without it no config matches.vendorAccountapplies no account filter. An emptyvendorAccount=means a line without an account number.CLAIMS(ClaimsMatchRule) ignoresvendorAccountandisDefaultConfig:acquisitionMethod, every config of the vendor matches.transmissionMethodandschedulednarrow the result after matching. Configs they filter out still count for the rules above. A config is scheduled ifenableScheduledExportistrueandschedulePeriodis set and notNONE.API and data
typeis a local enum (effectiveConfigType), because theBURSAR_FEES_FINESdefault of the sharedexportType.jsonwould turn a missingtypeinto a valid request.transmissionMethodreferences the vendor config schema's enum.TransmissionMethodConverterbinds it by API value (File download).vendorIdortype, any othertype, an unknowntransmissionMethod, a non-booleanscheduledand non-UUID ids.data-export.effective-configs.collection.get, part ofdata-export.config.all. It is separate because a permission may protect only one endpoint.(type, vendorEdiOrdersExportConfig.vendorId), backing the native query inExportConfigRepository.data-export-springis already 2.1 through the unreleased MODEXPS-316 - Add endpoint to execute an orders export configuration for given PO lines #385, so both ship under 2.1.Tests:
EffectiveConfigMatcherTest(rules) andEffectiveConfigsControllerTest(API, status codes).Notes for review