Rebase master - #1408
Merged
Merged
Conversation
* Add count API to mdms-v2 service reusing search criteria models Adds POST /v2/_count, taking the same MdmsCriteriaReqV2/MdmsCriteriaV2 request models as /v2/_search. Refactors MdmsDataQueryBuilderV2 to share its WHERE-clause building between the search and count queries, and unifies the tenant-fallback resolution used by search() and count() so both agree on the same tenant tier for identical criteria. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * Use Long for mdms-v2 count contract to match PostgreSQL BIGINT COUNT(*) returns bigint in Postgres; mapping it to Integer would throw on counts above 2,147,483,647. Addresses CodeRabbit review comment on PR #1405. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * Document the mdms-v2 count API in README and add a Swagger contract Adds core-services/docs/mdms-v2-contract.yml covering _search, _count, _create and _update for the mdms-v2 service, and extends the module README with a "MDMS V2 API Details" section describing each endpoint, emphasizing that /_count reuses the exact same MdmsCriteriaReqV2 request contract and tenant-fallback resolution as /_search. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * Add missing schema-definition APIs to mdms-v2 contract The contract only covered the master-data endpoints on MDMSControllerV2. Adds /schema/v1/_create, _search and _update (SchemaDefinitionController) with their SchemaDefinition/SchemaDefCriteria models, and updates the README pointer to mention them. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * Fix uniqueIdentifiers constraint and clarify MdmsCriteria requiredness @SiZe(min=1, max=64) on MdmsCriteriaV2.uniqueIdentifiers constrains the Set's element count, not each string's length - the contract had this backwards (minLength/maxLength on items instead of minItems/maxItems on the array). Also documents that MdmsCriteriaReqV2.MdmsCriteria is functionally required but not enforced by bean validation. Found via an adversarial verification pass cross-checking the contract against the mdms-v2 model classes field-by-field. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * Add DB UML diagram for mdms-v2 to README Adds a Mermaid ER diagram covering eg_mdms_schema_definition and eg_mdms_data, derived from the Flyway migrations under src/main/resources/db/migration/main/ and cross-checked against the live schema in the local stack. Notes that there is no enforced FK between the two tables - schemacode/code linkage is validated at the application layer only. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * Address CodeRabbit findings: declare JSON media type, fix heading levels - mdms-v2-contract.yml: add root-level consumes/produces: application/json, since all POST operations use body parameters and JSON response schemas. - README.md: fix "##### Method" (H5) to "#### Method" (H4) under both the v1 and v2 API Details sections (H3), keeping the heading outline valid. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
…1401) * fix(egov-user): resolve countryCode from MDMS default entry, not just properties fallback MobileNumberValidator previously echoed back the incoming countryCode as-is, falling to the application.properties default only when the caller omitted it entirely. When MDMS resolves a rule via its own "default" entry (no incoming countryCode, or no exact match), that entry's countryCode should win over the properties fallback since MDMS is authoritative whenever it has an answer. Introduces MobileValidationRule (regex + countryCode) so the cache and MDMS resolution paths carry both fields together instead of a bare regex string. * fix(user-otp): propagate MDMS-resolved countryCode back onto OtpRequest OtpRequestValidator resolved a MobileValidationConfig (including that entry's own countryCode) but never wrote it back onto the OtpRequest. OtpSMSRepository.send() forwards otpRequest.getCountryCode() as-is into the Kafka SMSRequest, so a request that omits countryCode reached egov-notification-sms with countryCode still null — which then fell back to its own static sms.mobile.prefix instead of the MDMS default, the same properties-wins-over-MDMS bug just fixed in egov-user. Backfill the countryCode from the resolved config (cache hit or fresh MDMS fetch) whenever the caller didn't supply one, so the SMS request carries the country code MDMS is actually configured for. * fix: address code review findings on countryCode/regex resolution egov-user: - Replace the ad-hoc U+0001-separated cache value encoding with JSON (via ObjectMapper), matching the approach user-otp's equivalent cache repository already uses for the same (regex, countryCode) pair. - Version the cache key prefix (mobile-val: -> mobile-val:v2:) so a pod still running the pre-JSON jar during a rolling deploy can't read a value written by an upgraded pod as a bare regex — which would never match anything and reject every valid mobile number until TTL expiry. user-otp: - OtpRequestValidator.resolveCountryCode() now only backfills countryCode from a resolved MDMS config when that config also carries a non-blank mobileNumberRegex. A default=true entry with countryCode set but no regex was flipping isMobileNumberValid()'s branch from "fall back to the application.properties default regex" to "reject as country-specific misconfiguration", rejecting requests that should have passed. * fix(egov-user): drop mobile-val cache key versioning The v2 prefix guarded against a rolling-deploy mismatch between old (bare regex) and new (JSON) cache values. Since this feature hasn't shipped yet, there's no old format in the wild to guard against, so the versioning is unnecessary. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
vinothrallapalli-eGov
requested a review
from GhanshyamRawat-eGov
as a code owner
August 20, 2026 09:29
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.
No description provided.