FINERACT-2683: Fix date filters and add username filter on Maker-Checker inbox endpoin#6120
Open
aya-abdallah-FOO wants to merge 1 commit into
Conversation
…ker inbox endpoint The GET /v1/makercheckers date-range filters had two issues: 1. The filters compared against made_on_date but records created since the UTC migration are stored in made_on_date_utc. Fix applies the same OR-pattern already used by AuditsApiResource (check both columns) so filtering works regardless of which column a given record uses. 2. The date getter in MakerCheckerRequest delegated entirely to DateUtils.convertDateTimeStringToOffsetDateTime, which requires the caller to pass dateFormat and locale query params. Clients that send dates in "dd MMMM yyyy" format without those params got a 500. Fix adds a tryParseDayMonthYear fallback that handles this format before delegating to DateUtils for ISO and other formats. Also adds a username query parameter to filter entries by the maker's username via a LIKE match against mk.username, which is already joined in the underlying query.
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.
Description
Fixes two issues with the
GET /v1/makercheckersendpoint:1. Date filters non-functional
The
makerDateTimeFrom/makerDateTimeTofilters compared againstmade_on_date, but records created after the UTC-offset migration are stored inmade_on_date_utc. Thismade date-range filtering silently return no results for those records.
Fix applies the same OR-pattern already used by
AuditsApiResource: check bothmade_on_dateandmade_on_date_utcso filtering works correctly regardless of which column arecord uses.
Also adds a fallback date parser in
MakerCheckerRequestfor the"dd MMMM yyyy"format (e.g.02 June 2026), which the existingDateUtils.convertDateTimeStringToOffsetDateTimedoes not support whendateFormat/localeparams are absent, causing a 500.2. Username filter missing
The
mk(appuser) table is already joined in the underlying query. This adds a?username=query parameter that filters entries by the maker's username via aLIKEprefixmatch against
mk.username.Changes
MakercheckersApiResource.java— date filter uses OR-pattern on both columns; username LIKE filter addedMakerCheckerRequest.java—usernamequery param added;getMakerDateTimeFrom/To()gainsdd MMMM yyyyfallback parsingTesting
developwith JDK 21org.apache.fineract.commands.*passRelated