Skip to content

Conversation

@abishekTa-egov
Copy link
Collaborator

@abishekTa-egov abishekTa-egov commented May 26, 2025

HCMPRE-2701: Creating root boundary node

Summary by CodeRabbit

  • New Features

    • Introduced a new service for boundary and geographic data integration, supporting root boundary creation, hierarchy definition search, and ArcGIS-based boundary search via REST API endpoints.
    • Added comprehensive data models for boundaries, hierarchy, ArcGIS requests/responses, and MDMS integration.
    • Provided configuration files for service setup, database, Kafka, and external service endpoints.
    • Included Dockerfile and startup script for containerized deployment.
  • Documentation

    • Added detailed README with setup instructions and API documentation access.
  • Tests

    • Implemented initial controller and configuration tests for API endpoints and Kafka integration.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 26, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This change introduces the initial implementation of the geopode-adapter module for health services. It adds a Spring Boot application with configuration, service, utility, repository, controller, and model layers to handle boundary and geographic data integration using external services (MDMS, ArcGIS, Kafka). The update also includes Dockerization, application properties, and basic test scaffolding.

Changes

File(s) / Path(s) Change Summary
README.md, Dockerfile, application.properties, start.sh Added documentation, Docker build/run scripts, application configuration, and startup script.
pom.xml Added Maven project configuration, dependencies, and build plugins.
src/main/java/digit/Main.java Added Spring Boot application entry point.
src/main/java/digit/config/Configuration.java, ServiceConstants.java Added configuration and constants classes for service endpoints and error messages.
src/main/java/digit/kafka/Producer.java Introduced Kafka producer service for message publishing.
src/main/java/digit/repository/ServiceRequestRepository.java Added repository for making HTTP requests to external services with error handling.
src/main/java/digit/service/GeopodeAdapterService.java Implemented service logic for boundary creation, hierarchy search, and ArcGIS integration.
src/main/java/digit/util/ArcgisUtil.java, BoundaryUtil.java, MdmsUtil.java, MdmsV2Util.java Added utility classes for ArcGIS, boundary, and MDMS data operations.
src/main/java/digit/web/controllers/GeopodeApiController.java Added REST controller exposing endpoints for boundary and ArcGIS operations.
src/main/java/digit/web/models/** Introduced comprehensive data models for boundary, ArcGIS, MDMS, and related request/response structures.
src/test/java/digit/TestConfiguration.java Added test configuration with mocked KafkaTemplate bean.
src/test/java/digit/web/controllers/GeopodeApiControllerTest.java Added initial (ignored) controller tests for boundary creation endpoint.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant GeopodeApiController
    participant GeopodeAdapterService
    participant ArcgisUtil
    participant BoundaryUtil
    participant MdmsUtil
    participant ExternalServices

    Client->>GeopodeApiController: POST /boundary/setup (GeopodeBoundaryRequest)
    GeopodeApiController->>GeopodeAdapterService: createRootBoundaryData(request)
    GeopodeAdapterService->>ArcgisUtil: createRoot(request)
    ArcgisUtil->>MdmsUtil: fetchMdmsData(...)
    MdmsUtil->>ExternalServices: POST MDMS endpoint
    ExternalServices-->>MdmsUtil: MDMS data
    ArcgisUtil->>ExternalServices: GET ArcGIS endpoint
    ExternalServices-->>ArcgisUtil: ArcGIS data
    ArcgisUtil->>BoundaryUtil: createBoundaryHierarchy(...)
    BoundaryUtil->>ExternalServices: POST boundary hierarchy create endpoint
    ExternalServices-->>BoundaryUtil: Boundary hierarchy response
    ArcgisUtil-->>GeopodeAdapterService: BoundaryResponse
    GeopodeAdapterService-->>GeopodeApiController: BoundaryResponse
    GeopodeApiController-->>Client: 202 Accepted + BoundaryResponse
Loading

Suggested reviewers

  • sathishp-eGov
  • kavi-egov

Poem

In fields of code where boundaries grow,
A rabbit hops where data flows—
With ArcGIS and MDMS in hand,
It maps the world across the land.
Kafka whispers, Docker hums,
Spring Boot wakes as morning comes.
Hooray for changes, crisp and new—
The geopode rabbit thanks the crew! 🐇🌍


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@abishekTa-egov
Copy link
Collaborator Author

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 27, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@Priyanka-eGov
Copy link
Collaborator

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 28, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 100

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8e38890 and 0349a20.

📒 Files selected for processing (59)
  • health-services/geopode-adapter/README.md (1 hunks)
  • health-services/geopode-adapter/pom.xml (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/Main.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/config/Configuration.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/config/ServiceConstants.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/kafka/Producer.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/repository/ServiceRequestRepository.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/service/GeopodeAdapterService.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/util/ArcgisUtil.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/util/BoundaryUtil.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/util/MdmsUtil.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/util/MdmsV2Util.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/web/controllers/GeopodeApiController.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/web/models/Arcgis/ArcgisRequest.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/web/models/Arcgis/ArcgisResponse.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/web/models/Arcgis/Attributes.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/web/models/Arcgis/Feature.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/web/models/Arcgis/Field.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/web/models/Arcgis/Geometry.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/web/models/Arcgis/GeometryProperties.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/web/models/Arcgis/SpatialReference.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/web/models/Arcgis/UniqueIdField.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/web/models/GeopdeHierarchyLevel.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/web/models/GeopodeBoundary.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/web/models/GeopodeBoundaryRequest.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/Boundary.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/BoundaryHierarchy.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/BoundaryHierarchyDefinitionResponse.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/BoundaryHierarchyDefinitionSearchCriteria.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/BoundaryHierarchyDefinitonSearchRequest.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/BoundaryRelation.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/BoundaryRelationshipDTO.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/BoundaryRelationshipRequest.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/BoundaryRelationshipRequestDTO.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/BoundaryRelationshipResponse.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/BoundaryRelationshipSearchCriteria.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/BoundaryRequest.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/BoundaryResponse.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/BoundarySearchCriteria.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/BoundarySearchResponse.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/BoundaryType.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/BoundaryTypeHierarchy.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/BoundaryTypeHierarchyDefinition.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/BoundaryTypeHierarchyRequest.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/BoundaryTypeHierarchyResponse.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/BoundaryTypeHierarchySearchCriteria.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/BoundaryTypeHierarchySearchRequest.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/EnrichedBoundary.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/HierarchyRelation.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/HierarchyType.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/web/models/mdmsV2/Mdms.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/web/models/mdmsV2/MdmsCriteriaReqV2.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/web/models/mdmsV2/MdmsCriteriaV2.java (1 hunks)
  • health-services/geopode-adapter/src/main/java/digit/web/models/mdmsV2/MdmsResponseV2.java (1 hunks)
  • health-services/geopode-adapter/src/main/resources/Dockerfile (1 hunks)
  • health-services/geopode-adapter/src/main/resources/application.properties (1 hunks)
  • health-services/geopode-adapter/src/main/resources/start.sh (1 hunks)
  • health-services/geopode-adapter/src/test/java/digit/TestConfiguration.java (1 hunks)
  • health-services/geopode-adapter/src/test/java/digit/web/controllers/GeopodeApiControllerTest.java (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
health-services/geopode-adapter/src/main/java/digit/config/ServiceConstants.java (1)
Learnt from: Saloni-eGov
PR: egovernments/health-campaign-services#906
File: health-services/plan-service/src/main/java/digit/util/CampaignUtil.java:1-13
Timestamp: 2024-09-26T10:49:23.404Z
Learning: When importing constants from 'digit.config.ServiceConstants', it's acceptable to use static wildcard imports since all constants are static.
🧬 Code Graph Analysis (8)
health-services/geopode-adapter/src/main/java/digit/web/models/Arcgis/Feature.java (3)
health-services/geopode-adapter/src/main/java/digit/web/models/Arcgis/Attributes.java (1)
  • Data (10-19)
health-services/geopode-adapter/src/main/java/digit/web/models/Arcgis/ArcgisResponse.java (1)
  • Data (13-48)
health-services/geopode-adapter/src/main/java/digit/web/models/Arcgis/Geometry.java (1)
  • Data (12-21)
health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/BoundaryTypeHierarchy.java (3)
health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/BoundaryType.java (1)
  • Validated (14-36)
health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/BoundaryTypeHierarchyDefinition.java (1)
  • Validated (18-45)
health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/BoundaryTypeHierarchyRequest.java (1)
  • Validated (15-31)
health-services/geopode-adapter/src/main/java/digit/web/models/Arcgis/UniqueIdField.java (1)
health-services/geopode-adapter/src/main/java/digit/web/models/Arcgis/ArcgisResponse.java (1)
  • Data (13-48)
health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/BoundaryTypeHierarchyRequest.java (1)
health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/BoundaryTypeHierarchyDefinition.java (1)
  • Validated (18-45)
health-services/geopode-adapter/src/main/java/digit/web/models/Arcgis/ArcgisRequest.java (9)
health-services/geopode-adapter/src/main/java/digit/web/models/Arcgis/Attributes.java (1)
  • Data (10-19)
health-services/geopode-adapter/src/main/java/digit/web/models/Arcgis/ArcgisResponse.java (1)
  • Data (13-48)
health-services/geopode-adapter/src/main/java/digit/web/models/Arcgis/Field.java (1)
  • Data (10-37)
health-services/geopode-adapter/src/main/java/digit/web/models/Arcgis/Geometry.java (1)
  • Data (12-21)
health-services/geopode-adapter/src/main/java/digit/web/models/Arcgis/Feature.java (1)
  • Data (11-25)
health-services/geopode-adapter/src/main/java/digit/web/models/Arcgis/SpatialReference.java (1)
  • Data (10-22)
health-services/geopode-adapter/src/main/java/digit/web/models/Arcgis/GeometryProperties.java (1)
  • Data (10-25)
health-services/geopode-adapter/src/main/java/digit/web/models/Arcgis/UniqueIdField.java (1)
  • Data (10-22)
health-services/geopode-adapter/src/main/java/digit/web/models/GeopodeBoundaryRequest.java (1)
  • Validated (15-27)
health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/BoundaryResponse.java (1)
health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/Boundary.java (1)
  • Validated (17-44)
health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/BoundarySearchCriteria.java (1)
health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/BoundaryRelationshipSearchCriteria.java (1)
  • Validated (16-61)
health-services/geopode-adapter/src/test/java/digit/web/controllers/GeopodeApiControllerTest.java (1)
health-services/geopode-adapter/src/main/java/digit/Main.java (1)
  • Import (9-17)
🪛 Shellcheck (0.10.0)
health-services/geopode-adapter/src/main/resources/start.sh

[warning] 3-3: In POSIX sh, [[ ]] is undefined.

(SC3010)


[info] 11-11: Double quote to prevent globbing and word splitting.

(SC2086)


[info] 11-11: Double quote to prevent globbing and word splitting.

(SC2086)


[info] 11-11: Double quote to prevent globbing and word splitting.

(SC2086)

🪛 LanguageTool
health-services/geopode-adapter/README.md

[misspelling] ~13-~13: Use “a” instead of ‘an’ if the following word doesn’t start with a vowel sound, e.g. ‘a sentence’, ‘a university’.
Context: ...gfox/springfox) Start your server as an simple java application You can view...

(EN_A_VS_AN)


[uncategorized] ~18-~18: You might be missing the article “the” here.
Context: ...g to http://localhost:8080/ Change default port value in application.properties

(AI_EN_LECTOR_MISSING_DETERMINER_THE)

🪛 markdownlint-cli2 (0.17.2)
health-services/geopode-adapter/README.md

3-3: Trailing spaces
Expected: 0 or 2; Actual: 1

(MD009, no-trailing-spaces)


5-5: Multiple consecutive blank lines
Expected: 1; Actual: 2

(MD012, no-multiple-blanks)


6-6: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


16-16: Bare URL used
null

(MD034, no-bare-urls)


18-18: Files should end with a single newline character
null

(MD047, single-trailing-newline)

🪛 Checkov (3.2.334)
health-services/geopode-adapter/src/main/resources/Dockerfile

[LOW] 1-20: Ensure that HEALTHCHECK instructions have been added to container images

(CKV_DOCKER_2)


[LOW] 1-20: Ensure that a user for the container has been created

(CKV_DOCKER_3)

🪛 Hadolint (2.12.0)
health-services/geopode-adapter/src/main/resources/Dockerfile

[warning] 6-6: Pin versions in apk add. Instead of apk add <package> use apk add <package>=<version>

(DL3018)

🔇 Additional comments (36)
health-services/geopode-adapter/src/main/java/digit/config/ServiceConstants.java (1)

10-31: Well-organized constants structure.

The error messages and common constants are well-defined and follow consistent naming conventions. The hierarchical organization makes them easy to locate and use.

health-services/geopode-adapter/src/main/java/digit/web/models/Arcgis/SpatialReference.java (1)

1-22: Well-implemented model class following best practices.

The SpatialReference class is properly structured with:

  • Appropriate Lombok annotations for boilerplate reduction
  • Correct Jackson annotations for JSON mapping
  • Proper field types for WKID (Well-Known Identifier) values
  • @JsonIgnoreProperties(ignoreUnknown = true) for robust deserialization

This follows standard patterns for ArcGIS spatial reference data models.

health-services/geopode-adapter/src/main/resources/start.sh (1)

3-10: Well-structured startup logic with proper configuration handling.

The script properly handles:

  • Default JVM memory settings with fallback values
  • Conditional remote debugging configuration
  • Environment variable-based configuration

The logic for setting up debugging and memory options is sound.

🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 3-3: In POSIX sh, [[ ]] is undefined.

(SC3010)

health-services/geopode-adapter/src/main/java/digit/kafka/Producer.java (1)

8-19: LGTM! Well-implemented Kafka producer service.

The implementation follows good practices:

  • Clear separation of concerns with a dedicated producer service
  • Proper use of CustomKafkaTemplate for tracing integration
  • Helpful comment about KafkaTemplate alternative
  • Simple and focused API with the push method
health-services/geopode-adapter/src/main/java/digit/web/models/Arcgis/Geometry.java (1)

12-21: LGTM! Well-designed data model for ArcGIS geometry.

The implementation follows good practices for data model classes:

  • Proper use of Lombok annotations to reduce boilerplate
  • Jackson annotations for robust JSON serialization/deserialization
  • @JsonIgnoreProperties ensures compatibility with evolving APIs
  • Appropriate data structure (3-level list) for representing ring coordinates
  • Builder pattern support for flexible object creation
health-services/geopode-adapter/src/test/java/digit/TestConfiguration.java (1)

9-16: LGTM! Clean test configuration setup.

The test configuration follows Spring Boot testing best practices by providing a mocked KafkaTemplate bean. The @SuppressWarnings annotation is appropriately used to suppress the unchecked cast warning when mocking generic types.

health-services/geopode-adapter/src/main/java/digit/web/models/Arcgis/Feature.java (1)

11-25: LGTM! Well-structured ArcGIS feature model.

The Feature class is well-designed with:

  • Proper use of @Valid annotations for nested object validation
  • Clear and descriptive field names
  • Helpful inline comments explaining the purpose of each field
  • Good integration with the broader ArcGIS model hierarchy
health-services/geopode-adapter/src/main/java/digit/web/models/GeopodeBoundaryRequest.java (1)

1-27: LGTM! Well-structured request DTO.

The class follows standard DTO patterns with proper use of:

  • Lombok annotations for boilerplate code reduction
  • Jackson annotations for JSON serialization
  • Validation annotations for request validation
  • Clean and readable structure
health-services/geopode-adapter/src/main/java/digit/web/models/mdmsV2/MdmsResponseV2.java (1)

14-28: LGTM! Well-structured response DTO.

The class properly uses Lombok annotations and Jackson properties for a clean response model implementation.

health-services/geopode-adapter/src/main/java/digit/web/models/Arcgis/GeometryProperties.java (1)

1-25: LGTM! Clean and well-structured DTO.

The class follows excellent DTO patterns with:

  • Proper Lombok annotations for code generation
  • Appropriate Jackson annotations for JSON handling
  • @JsonIgnoreProperties(ignoreUnknown = true) for flexible deserialization
  • Descriptive field names following camelCase convention
health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/HierarchyType.java (1)

16-36: LGTM! Proper DTO implementation with validation.

The class correctly uses:

  • Lombok annotations for boilerplate code generation
  • Validation annotations including @NotNull on the required code field
  • Appropriate JSON property mappings
  • Clean field structure for hierarchy type representation
health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/BoundaryRelationshipRequestDTO.java (1)

18-26:

❓ Verification inconclusive

Clarify the design intent for having both single and list fields.

Having both a single BoundaryRelationshipDTO and a list of BoundaryRelationshipDTO in the same request object creates ambiguity. Consider whether both are needed or if they serve different purposes.

Please clarify the use case:

  • Is this intended for batch operations where you can send either a single item OR a list?
  • Are both fields used simultaneously for different purposes?
  • Should this be split into separate request classes?

This design pattern is not seen in other similar request classes in the codebase.


🏁 Script executed:

#!/bin/bash
# List all RequestDTO.java files and their @JsonProperty fields
find health-services/geopode-adapter/src/main/java/digit/web/models -type f -name "*RequestDTO.java" | while read file; do
  echo "== $file =="
  grep -n "@JsonProperty" "$file" || echo "  (no @JsonProperty annotations found)"
  echo
done

Length of output: 654


Clarify dual usage of BoundaryRelationshipDTO in BoundaryRelationshipRequestDTO

The presence of both a single boundaryRelationshipDTO and a list boundaryRelationshipDTOList within the same request class introduces ambiguity. Other request DTOs in this module typically accept either one or the other, but not both.

File:
health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/BoundaryRelationshipRequestDTO.java (lines 18–26)

    @JsonProperty("BoundaryRelationship")
    private BoundaryRelationshipDTO boundaryRelationshipDTO;

    @JsonProperty("RequestInfo")
    private RequestInfo requestInfo;

    @JsonProperty("BoundaryRelationshipList")
    private List<BoundaryRelationshipDTO> boundaryRelationshipDTOList;

Please clarify the intended design:

  • Should clients send either a single item or a list in this endpoint?
  • Are both fields ever populated simultaneously for distinct purposes?
  • Would it be clearer to split this into separate request classes (e.g., one for single vs. one for batch operations)?
health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/BoundaryResponse.java (1)

35-41: LGTM! Well-implemented helper method.

The addBoundaryItem method correctly handles null initialization and follows builder pattern conventions by returning this for method chaining.

health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/BoundaryType.java (1)

14-36: LGTM! Well-structured model class.

The class follows good practices with:

  • Appropriate validation (@NotNull on the code field)
  • Proper Lombok annotations for boilerplate reduction
  • Standard Jackson annotations for JSON serialization
  • Clean, minimal design suitable for a data model
health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/BoundaryTypeHierarchy.java (1)

13-30: LGTM! Appropriate design for hierarchy representation.

The class correctly models boundary type hierarchies using String references, which is suitable for JSON serialization and avoids circular dependency issues that could occur with object references.

health-services/geopode-adapter/src/main/java/digit/web/models/Arcgis/UniqueIdField.java (1)

10-22: LGTM! Well-designed ArcGIS model class.

The class demonstrates good practices:

  • Uses @JsonIgnoreProperties(ignoreUnknown = true) for robustness with external API responses
  • Primitive boolean type for isSystemMaintained is appropriate if this field always has a value in ArcGIS responses
  • Clean, focused design suitable for its purpose as part of the ArcGIS integration
health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/BoundaryRelationshipResponse.java (1)

23-32: LGTM: Well-structured response model.

The response structure follows standard patterns with proper validation annotations. The use of @Valid on the ResponseInfo and List<BoundaryRelation> fields is appropriate for nested object validation.

health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/BoundaryRelationshipDTO.java (1)

17-46: LGTM: Well-designed DTO with proper validation.

This DTO demonstrates good design practices:

  • Appropriate use of @NotNull validation on required business fields
  • Inclusion of audit details for traceability
  • The ancestralMaterializedPath field indicates proper support for hierarchical boundary structures
  • Clean field naming and structure
health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/BoundaryTypeHierarchyRequest.java (1)

21-30: LGTM: Standard request wrapper pattern.

This class follows the established eGov platform pattern for request DTOs with proper validation annotations on both the RequestInfo and business object fields.

health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/BoundaryTypeHierarchySearchCriteria.java (1)

21-38: LGTM! Well-structured search criteria class.

The implementation follows standard patterns with:

  • Proper validation on required fields (tenantId)
  • Optional hierarchyType for flexible searching
  • Standard pagination support with offset and limit
  • Appropriate size constraints and JSON property mapping
health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/BoundaryTypeHierarchyResponse.java (1)

23-36: LGTM! Properly structured response class.

The implementation follows best practices with:

  • Complete annotation set including @Validated, @Generated, and @Valid
  • Proper validation on complex objects
  • Standard response structure with ResponseInfo, totalCount, and data list
  • Consistent JSON property mapping
health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/BoundaryTypeHierarchySearchRequest.java (1)

23-29: Good use of validation annotations.

The use of @Valid annotations on the fields ensures proper validation cascading, which is a good practice for request DTOs.

health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/BoundaryRelationshipRequest.java (1)

21-32: Well-structured DTO implementation.

The class follows proper DTO patterns with appropriate annotations, validation, and field types. The implementation is clean and consistent with other boundary service models.

health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/EnrichedBoundary.java (1)

40-41:

❌ Incorrect review comment

Consider implications of @JsonIgnore on parent field.

The parent field is excluded from JSON serialization, which means:

  1. When deserializing JSON, parent relationships won't be populated
  2. Bidirectional navigation between parent-child boundaries won't work properly

If parent-child relationships are important for the domain logic, consider either including the parent in JSON or establishing parent relationships programmatically after deserialization.


🏁 Script executed:

#!/bin/bash
# Description: Check how EnrichedBoundary is used in the codebase to understand if parent field exclusion is problematic

# Search for usage of EnrichedBoundary parent field
rg -A 3 -B 3 "\.parent" --type java

# Search for parent-child relationship usage
rg -A 5 "EnrichedBoundary.*parent\|parent.*EnrichedBoundary" --type java

Length of output: 7968


No usages of parent in EnrichedBoundary – safe to ignore @JsonIgnore

A repository‐wide search for any access to EnrichedBoundary.parent (or its getter) returned no references. Since no code reads or writes that field, excluding it from JSON has no effect on existing logic.

• No .parent or getParent() calls on EnrichedBoundary found
• No serialization or deserialization paths depend on that field

You can safely remove this comment.

Likely an incorrect or invalid review comment.

health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/BoundarySearchCriteria.java (1)

22-25: LGTM on the codes field validation.

The validation constraints are appropriate - ensuring the list is not null and contains at least one element.

health-services/geopode-adapter/src/main/java/digit/web/models/Arcgis/ArcgisResponse.java (2)

13-18: Excellent use of annotations for external API integration.

The combination of @JsonIgnoreProperties(ignoreUnknown = true) and proper Lombok annotations makes this a robust response model for external ArcGIS services.


20-47: Good use of @Valid annotations for nested validation.

All complex nested objects properly use @Valid annotation, ensuring that validation cascades through the object hierarchy when this response is processed.

health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/BoundaryRelation.java (3)

43-44: Good design: parent field appropriately optional.

Correctly allowing null parent for root boundary nodes.


46-47: Excellent inclusion of audit details.

Including AuditDetails follows best practices for entity tracking and audit trails.


49-50: Well-designed internal field for hierarchy operations.

The @JsonIgnore ancestral materialized path field with empty string default is a good design choice for internal hierarchy traversal without exposing it in the API.

health-services/geopode-adapter/src/main/java/digit/web/models/GeopdeHierarchyLevel.java (2)

10-15: Clean and well-structured model class.

Good use of Lombok annotations and @JsonIgnoreProperties for flexible external data parsing.


17-27: Proper JSON property mapping with good field naming.

The mapping from snake_case JSON properties to camelCase Java fields follows conventions. Using primitive int for level is appropriate since hierarchy levels are typically non-null.

health-services/geopode-adapter/src/main/java/digit/web/models/mdmsV2/MdmsCriteriaReqV2.java (1)

18-26:

❌ Incorrect review comment

Verify MdmsCriteriaV2 import and usage.

The class references MdmsCriteriaV2 but the import is not visible in this file. Ensure that this class exists and is properly imported.


🏁 Script executed:

#!/bin/bash
# Description: Verify MdmsCriteriaV2 class exists and is properly used
# Expected: Find the MdmsCriteriaV2 class definition and its usage

# Search for MdmsCriteriaV2 class definition
echo "Searching for MdmsCriteriaV2 class definition:"
fd -e java | xargs grep -l "class MdmsCriteriaV2"

# Search for imports of MdmsCriteriaV2
echo "Searching for MdmsCriteriaV2 imports:"
rg "import.*MdmsCriteriaV2" -A 2

# Check usage patterns
echo "Checking usage patterns:"
rg "MdmsCriteriaV2" -A 2 -B 2

Length of output: 8603


No import needed for MdmsCriteriaV2 in this file
MdmsCriteriaReqV2 and MdmsCriteriaV2 both live in digit.web.models.mdmsV2, so an explicit import isn’t required. The MdmsCriteriaV2 class is present at src/main/java/digit/web/models/mdmsV2/MdmsCriteriaV2.java and is correctly referenced.

Likely an incorrect or invalid review comment.

health-services/geopode-adapter/src/main/java/digit/repository/ServiceRequestRepository.java (1)

15-15:

✅ Verification successful

Verify ServiceConstants import and usage.

The code uses constants from ServiceConstants but ensure they are properly defined for the error scenarios used.


🏁 Script executed:

#!/bin/bash
# Description: Verify ServiceConstants contains the required error constants
# Expected: Find EXTERNAL_SERVICE_EXCEPTION and SEARCHER_SERVICE_EXCEPTION definitions

echo "Searching for ServiceConstants class and error constants:"
rg "EXTERNAL_SERVICE_EXCEPTION|SEARCHER_SERVICE_EXCEPTION" -A 2 -B 2

echo "Checking ServiceConstants class definition:"
fd -name "ServiceConstants.java" | xargs cat

Length of output: 11011


ServiceConstants import and usage verified

The constants EXTERNAL_SERVICE_EXCEPTION and SEARCHER_SERVICE_EXCEPTION are present in health-services/geopode-adapter/src/main/java/digit/config/ServiceConstants.java, so the import static digit.config.ServiceConstants.*; is valid and requires no changes.

health-services/geopode-adapter/src/main/java/digit/util/ArcgisUtil.java (1)

99-99: 🧹 Nitpick (assertive)

Remove redundant parentheses.

Apply this diff:

-                .map(mdms -> mdms.getData())
+                .map(mdms -> mdms.getData())

Likely an incorrect or invalid review comment.

health-services/geopode-adapter/src/main/java/digit/web/models/boundaryService/BoundaryRelationshipSearchCriteria.java (1)

37-39: Verify null handling for the codes field.

The codes field is initialized to null. Ensure that all code accessing this field performs proper null checks to avoid NullPointerException.

Consider initializing with an empty list if the field is frequently accessed:

    @JsonProperty("codes")
-    private List<String> codes = null;
+    @Builder.Default
+    private List<String> codes = new ArrayList<>();

public static final String FORMAT_VALUE="json";
public static final String ERROR_FETCHING_FROM_BOUNDARY="Error Fetching Data from boundary";
public static final String ROOT_BOUNDARY_ALREADY_EXISTS="Root Boundary already created";
public static final String RESPONSE_FROM_GEOPODE_API = "[\n" +
Copy link
Collaborator

Choose a reason for hiding this comment

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

this will be fetched from boundary-service heirarchy

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

When call is being made to boundary, service and error comes, I use these constants in the catch

Copy link
Collaborator

Choose a reason for hiding this comment

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

why is error coming?

* @return
*/
private String extractCountryNameFromMdms(MdmsResponseV2 mdmsResponse, String targetIsoCode) {
return mdmsResponse.getMdms().stream()
Copy link
Collaborator

Choose a reason for hiding this comment

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

see if you can make this mode readable

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.

3 participants