Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unified qa #2758

Open
wants to merge 971 commits into
base: DEV
Choose a base branch
from
Open

Unified qa #2758

wants to merge 971 commits into from

Conversation

Shreya-egov
Copy link
Collaborator

@Shreya-egov Shreya-egov commented Oct 11, 2023

adding pqm persister yaml file

Summary by CodeRabbit

  • New Features

    • Introduced multiple new configuration files for various health management services, enhancing data persistence and indexing capabilities.
    • Added mappings for plan configurations, employee assignments, census records, stock indexing, household data, referral management, contract services, estimate services, expense bills, individual data, attendance records, project staff indexing, and project tasks.
    • Launched a new service mapping for persisting and updating service definitions and details within the health management system.
    • Added a new role "NationalSupervisor" with access to specific health dashboards.
  • Improvements

    • Enhanced transaction support and conflict resolution strategies across various mappings to ensure data integrity and accurate updates.

@Shreya-egov Shreya-egov requested review from GhanshyamRawat-eGov and removed request for a team October 11, 2023 06:05
Copy link
Collaborator

@jagankumar-egov jagankumar-egov left a comment

Choose a reason for hiding this comment

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

@Shreya-egov create.a new PR with required changes
it shows lot of other changes which is not required

Copy link

coderabbitai bot commented Feb 28, 2024

Walkthrough

The pull request introduces several new YAML configuration files and updates existing ones to define mappings for various health-related services. Key changes include detailed configurations for persisting and updating health management plans, census records, stock indexing, household data, referral management, contract services, estimate services, expense bills, individual data, attendance, and project staff. Each configuration specifies operations, JSON paths for data extraction, and SQL queries for database interactions, supporting transactions and bulk operations where applicable.

Changes

File Path Change Summary
health/egov-persister/plan-service-persister.yml New mappings for persisting and updating plan configurations, employee assignments, plans, and facilities.
health/egov-persister/census-service-persister.yml New configuration for census service with mappings for creating and updating census records.
health/egov-indexer/stock-indexer.yml New configuration for stock indexing with mappings for stock and user synchronization.
health/egov-indexer/household-indexer.yml New configuration for household data processing with multiple mappings for different topics.
health/egov-indexer/referral-management-indexer.yml New configuration for referral management with mappings for various referral and side-effect data.
egov-indexer/mukta-contractservices-indexer.yml New configuration for contract services with mappings for saving and updating contract data.
egov-indexer/mukta-estimateservices-indexer.yml New configuration for estimate services with mappings for various estimate-related topics.
egov-indexer/mukta-expensebill-indexer.yml New configuration for expense bill indexing with mappings for processing expense bill data.
egov-indexer/mukta-individual-indexer.yml New configuration for individual data with mappings for saving, updating, and deleting individuals.
health/egov-indexer/attendance-service-indexer.yml New configuration for attendance service with mappings for attendance records and related entities.
health/egov-indexer/project-staff-indexer.yml New configuration for project staff indexing with mappings for staff data processing.
health/egov-persister/service-request-persister.yml New mappings for persisting service definitions and details in the health management system.
egov-dss-dashboards/dashboard-analytics/RoleDashboardMappingsConf.json New role added for "NationalSupervisor" with specific dashboards.
egov-indexer/service-request-indexer.yml New configuration for service requests with mappings for processing and indexing service-related data.
health/egov-indexer/project-task-indexer.yml New configuration for project tasks with mappings for indexing task and user synchronization data.
health/egov-persister/project-factory-persister.yml New mappings for creating and updating resource and campaign details in various tables.
health/egov-indexer/census-service-indexer.yml New configuration for census service with mappings for handling census data operations.
health/egov-indexer/plan-service-indexer.yml New configuration for plan service with mappings for saving and updating plans.
health/egov-persister/household-persister.yml New mappings for persisting, updating, and deleting household and household member records.

Possibly related PRs

Poem

In fields of data, we hop and play,
New mappings sprout, brightening the day.
With plans and stats, we weave our tale,
Health and service, we shall not fail!
So here’s to the changes, fresh and bold,
A rabbit's cheer for stories untold! 🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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. (Beta)
  • @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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

Copy link

@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.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 6e206ca and 7ff0ac7.
Files ignored due to path filters (177)
  • egov-dss-dashboards/dashboard-analytics/ChartApiConfig.json is excluded by: !**/*.json
  • egov-dss-dashboards/dashboard-analytics/MasterDashboardConfig.json is excluded by: !**/*.json
  • egov-indexer/billingservices-indexer.yml is excluded by: !**/*.yml
  • egov-indexer/chatbot-telemetry-v2.yaml is excluded by: !**/*.yaml
  • egov-indexer/citizen-feedback-indexer.yml is excluded by: !**/*.yml
  • egov-indexer/collection-indexer.yml is excluded by: !**/*.yml
  • egov-indexer/covid-chatbot-telemetry.yaml is excluded by: !**/*.yaml
  • egov-indexer/egov-bpa-indexer.yml is excluded by: !**/*.yml
  • egov-indexer/egov-echallan.yml is excluded by: !**/*.yml
  • egov-indexer/egov-error-queue-indexer.yml is excluded by: !**/*.yml
  • egov-indexer/egov-fsm.yml is excluded by: !**/*.yml
  • egov-indexer/egov-noc-services.yml is excluded by: !**/*.yml
  • egov-indexer/egov-url-shortening-indexer.yaml is excluded by: !**/*.yaml
  • egov-indexer/egov-vehicle.yaml is excluded by: !**/*.yaml
  • egov-indexer/egov-vendor.yaml is excluded by: !**/*.yaml
  • egov-indexer/facility-indexer.yml is excluded by: !**/*.yml
  • egov-indexer/finance-rolloutadotpion-indexer.yml is excluded by: !**/*.yml
  • egov-indexer/fire-noc-service.yml is excluded by: !**/*.yml
  • egov-indexer/household-indexer.yml is excluded by: !**/*.yml
  • egov-indexer/individual-indexer.yml is excluded by: !**/*.yml
  • egov-indexer/mukta-contractservices-indexer.yml is excluded by: !**/*.yml
  • egov-indexer/mukta-estimateservices-indexer.yml is excluded by: !**/*.yml
  • egov-indexer/mukta-expensebill-indexer.yml is excluded by: !**/*.yml
  • egov-indexer/mukta-individual-indexer.yml is excluded by: !**/*.yml
  • egov-indexer/pgr-migration-batch-indexer.yml is excluded by: !**/*.yml
  • egov-indexer/pgr-services.yml is excluded by: !**/*.yml
  • egov-indexer/product-indexer.yml is excluded by: !**/*.yml
  • egov-indexer/project-indexer.yml is excluded by: !**/*.yml
  • egov-indexer/project-staff-indexer.yml is excluded by: !**/*.yml
  • egov-indexer/project-task-indexer.yml is excluded by: !**/*.yml
  • egov-indexer/property-services.yml is excluded by: !**/*.yml
  • egov-indexer/rainmaker-birth-indexer.yml is excluded by: !**/*.yml
  • egov-indexer/rainmaker-death-indexer.yml is excluded by: !**/*.yml
  • egov-indexer/rainmaker-pgr-indexer.yml is excluded by: !**/*.yml
  • egov-indexer/rainmaker-tl-indexer.yml is excluded by: !**/*.yml
  • egov-indexer/referral-management-indexer.yml is excluded by: !**/*.yml
  • egov-indexer/sample.yml is excluded by: !**/*.yml
  • egov-indexer/service-request-indexer.yml is excluded by: !**/*.yml
  • egov-indexer/sewerage-service.yml is excluded by: !**/*.yml
  • egov-indexer/stock-indexer.yml is excluded by: !**/*.yml
  • egov-indexer/ws-event-indexer.yml is excluded by: !**/*.yml
  • egov-persister/facility-persister.yml is excluded by: !**/*.yml
  • egov-persister/fsm-persister.yaml is excluded by: !**/*.yaml
  • egov-persister/household-persister.yml is excluded by: !**/*.yml
  • egov-persister/individual-persister.yml is excluded by: !**/*.yml
  • egov-persister/mdms-persister.yml is excluded by: !**/*.yml
  • egov-persister/mukta-contract-service-persister.yml is excluded by: !**/*.yml
  • egov-persister/mukta-estimate-service.yml is excluded by: !**/*.yml
  • egov-persister/mukta-expense-bill-payment-persister.yaml is excluded by: !**/*.yaml
  • egov-persister/mukta-expensebilling-service-persister.yml is excluded by: !**/*.yml
  • egov-persister/mukta-hrms-employee-persister.yml is excluded by: !**/*.yml
  • egov-persister/mukta-individual-persister.yml is excluded by: !**/*.yml
  • egov-persister/pgr-services-persister.yml is excluded by: !**/*.yml
  • egov-persister/pqm-persister.yaml is excluded by: !**/*.yaml
  • egov-persister/product-persister.yml is excluded by: !**/*.yml
  • egov-persister/project-persister.yml is excluded by: !**/*.yml
  • egov-persister/project-task-persister.yml is excluded by: !**/*.yml
  • egov-persister/referral-management-persister.yml is excluded by: !**/*.yml
  • egov-persister/service-request-persister.yml is excluded by: !**/*.yml
  • egov-persister/stock-persister.yml is excluded by: !**/*.yml
  • egov-persister/vehicle-persister.yaml is excluded by: !**/*.yaml
  • egov-persister/vendor-persister.yaml is excluded by: !**/*.yaml
  • health/egov-indexer/facility-indexer.yml is excluded by: !**/*.yml
  • health/egov-indexer/household-indexer.yml is excluded by: !**/*.yml
  • health/egov-indexer/individual-indexer.yml is excluded by: !**/*.yml
  • health/egov-indexer/product-indexer.yml is excluded by: !**/*.yml
  • health/egov-indexer/project-indexer.yml is excluded by: !**/*.yml
  • health/egov-indexer/project-staff-indexer.yml is excluded by: !**/*.yml
  • health/egov-indexer/project-task-indexer.yml is excluded by: !**/*.yml
  • health/egov-indexer/referral-management-indexer.yml is excluded by: !**/*.yml
  • health/egov-indexer/stock-indexer.yml is excluded by: !**/*.yml
  • health/egov-persister/attendance-service-persister.yml is excluded by: !**/*.yml
  • health/egov-persister/facility-persister.yml is excluded by: !**/*.yml
  • health/egov-persister/household-persister.yml is excluded by: !**/*.yml
  • health/egov-persister/hrms-employee-persister.yml is excluded by: !**/*.yml
  • health/egov-persister/individual-persister.yml is excluded by: !**/*.yml
  • health/egov-persister/product-persister.yml is excluded by: !**/*.yml
  • health/egov-persister/project-persister.yml is excluded by: !**/*.yml
  • health/egov-persister/project-task-persister.yml is excluded by: !**/*.yml
  • health/egov-persister/referral-management-persister.yml is excluded by: !**/*.yml
  • health/egov-persister/service-request-persister.yml is excluded by: !**/*.yml
  • health/egov-persister/stock-persister.yml is excluded by: !**/*.yml
  • pdf-service/data-config/detailed-estimate.json is excluded by: !**/*.json
  • pdf-service/data-config/deviation-statement.json is excluded by: !**/*.json
  • pdf-service/data-config/fsm-receipt.json is excluded by: !**/*.json
  • pdf-service/data-config/measurement-book.json is excluded by: !**/*.json
  • pdf-service/data-config/pqm-adhoctest.json is excluded by: !**/*.json
  • pdf-service/format-config/detailed-estimate.json is excluded by: !**/*.json
  • pdf-service/format-config/deviation-statement.json is excluded by: !**/*.json
  • pdf-service/format-config/fsm-receipt.json is excluded by: !**/*.json
  • pdf-service/format-config/measurement-book.json is excluded by: !**/*.json
  • pdf-service/format-config/pqm-adhoctest.json is excluded by: !**/*.json
  • reports/config/fsm-reports.yml is excluded by: !**/*.yml
  • reports/config/rainmaker-wns-reports.yml is excluded by: !**/*.yml
  • sanitation/egov-dss-dashboard/dashboard-analytics/ChartApiConfig.json is excluded by: !**/*.json
  • sanitation/egov-indexer/egov-fsm.yaml is excluded by: !**/*.yaml
  • sanitation/egov-indexer/egov-pqm-service.yml is excluded by: !**/*.yml
  • sanitation/egov-indexer/egov-vehicle.yaml is excluded by: !**/*.yaml
  • sanitation/egov-indexer/egov-vendor.yaml is excluded by: !**/*.yaml
  • sanitation/egov-indexer/fsm-inbox-indexer.yml is excluded by: !**/*.yml
  • sanitation/egov-indexer/payment-indexer.yml is excluded by: !**/*.yml
  • sanitation/egov-indexer/pqm-anomaly-finder-indexer.yml is excluded by: !**/*.yml
  • sanitation/egov-indexer/pqm-service-indexer.yml is excluded by: !**/*.yml
  • sanitation/egov-perister/fsm-calculator-persister.yaml is excluded by: !**/*.yaml
  • sanitation/egov-perister/fsm-persister.yaml is excluded by: !**/*.yaml
  • sanitation/egov-persister/fsm-calculator-persister.yaml is excluded by: !**/*.yaml
  • sanitation/egov-persister/fsm-persister.yaml is excluded by: !**/*.yaml
  • sanitation/egov-persister/pqm-anomaly-finder-persister.yaml is excluded by: !**/*.yaml
  • sanitation/egov-persister/pqm-persister.yaml is excluded by: !**/*.yaml
  • sanitation/egov-persister/vehicle-persister.yaml is excluded by: !**/*.yaml
  • sanitation/egov-persister/vendor-persister.yaml is excluded by: !**/*.yaml
  • sanitation/pdf-service/data-config/fsm-receipt.json is excluded by: !**/*.json
  • sanitation/pdf-service/format-config/fsm-receipt.json is excluded by: !**/*.json
  • sanitation/reports/config/fsm-reports.yml is excluded by: !**/*.yml
  • works/egov-dss-dashboard/dashboard-analytics/ChartApiConfig.json is excluded by: !**/*.json
  • works/egov-dss-dashboard/dashboard-analytics/MasterDashboardConfig.json is excluded by: !**/*.json
  • works/egov-dss-dashboard/dashboard-analytics/RoleDashboardConfig.json is excluded by: !**/*.json
  • works/egov-dss-dashboard/dashboard-analytics/RoleDashboardMappingsConf.json is excluded by: !**/*.json
  • works/egov-dss-dashboard/dashboard-analytics/TenantCodeNameMappings.json is excluded by: !**/*.json
  • works/egov-dss-dashboard/dashboard-analytics/getchart.json is excluded by: !**/*.json
  • works/egov-indexer/contractservices-indexer.yml is excluded by: !**/*.yml
  • works/egov-indexer/estimateservices-indexer.yml is excluded by: !**/*.yml
  • works/egov-indexer/expensebill-indexer.yml is excluded by: !**/*.yml
  • works/egov-indexer/individual-indexer.yml is excluded by: !**/*.yml
  • works/egov-indexer/loiservices-indexer.yml is excluded by: !**/*.yml
  • works/egov-indexer/measurement-indexer.yml is excluded by: !**/*.yml
  • works/egov-indexer/musterservices-indexer.yml is excluded by: !**/*.yml
  • works/egov-indexer/organisationservices-indexer.yml is excluded by: !**/*.yml
  • works/egov-indexer/project-indexer.yml is excluded by: !**/*.yml
  • works/egov-indexer/projectmanagementsystem-indexer.yml is excluded by: !**/*.yml
  • works/egov-persister/attendance-service-persister.yml is excluded by: !**/*.yml
  • works/egov-persister/audit-service-persister.yml is excluded by: !**/*.yml
  • works/egov-persister/bankaccounts-persister.yml is excluded by: !**/*.yml
  • works/egov-persister/btr-persister.yml is excluded by: !**/*.yml
  • works/egov-persister/contract-service-persister.yml is excluded by: !**/*.yml
  • works/egov-persister/egov-workflow-v2-persister.yml is excluded by: !**/*.yml
  • works/egov-persister/estimate-service.yml is excluded by: !**/*.yml
  • works/egov-persister/expence-calculator-service-persister.yml is excluded by: !**/*.yml
  • works/egov-persister/expense-bill-payment-persister.yaml is excluded by: !**/*.yaml
  • works/egov-persister/expense-billarray-payment-persister.yaml is excluded by: !**/*.yaml
  • works/egov-persister/expensebilling-service-persister.yml is excluded by: !**/*.yml
  • works/egov-persister/hrms-employee-persister.yml is excluded by: !**/*.yml
  • works/egov-persister/individual-persister.yml is excluded by: !**/*.yml
  • works/egov-persister/loi-service.yml is excluded by: !**/*.yml
  • works/egov-persister/measurement-persister.yml is excluded by: !**/*.yml
  • works/egov-persister/measurement-service-persister.yml is excluded by: !**/*.yml
  • works/egov-persister/muster-service-persister.yml is excluded by: !**/*.yml
  • works/egov-persister/organisation-persister.yml is excluded by: !**/*.yml
  • works/egov-persister/project-management-system-persister.yml is excluded by: !**/*.yml
  • works/egov-persister/project-persister.yml is excluded by: !**/*.yml
  • works/egov-persister/service-request-persister.yml is excluded by: !**/*.yml
  • works/egov-searcher/inboxestimatesearch.yml is excluded by: !**/*.yml
  • works/pdf-service/data-config/estimate.json is excluded by: !**/*.json
  • works/pdf-service/data-config/nominal-muster-roll.json is excluded by: !**/*.json
  • works/pdf-service/data-config/project-detail.json is excluded by: !**/*.json
  • works/pdf-service/data-config/purchase-bill.json is excluded by: !**/*.json
  • works/pdf-service/data-config/supervision-bill.json is excluded by: !**/*.json
  • works/pdf-service/data-config/wage-bill.json is excluded by: !**/*.json
  • works/pdf-service/data-config/work-order-hindi.json is excluded by: !**/*.json
  • works/pdf-service/data-config/work-order.json is excluded by: !**/*.json
  • works/pdf-service/data-config/works-estimate.json is excluded by: !**/*.json
  • works/pdf-service/format-config/estimate.json is excluded by: !**/*.json
  • works/pdf-service/format-config/nominal-muster-roll.json is excluded by: !**/*.json
  • works/pdf-service/format-config/project-detail.json is excluded by: !**/*.json
  • works/pdf-service/format-config/purchase-bill.json is excluded by: !**/*.json
  • works/pdf-service/format-config/supervision-bill.json is excluded by: !**/*.json
  • works/pdf-service/format-config/wage-bill.json is excluded by: !**/*.json
  • works/pdf-service/format-config/work-order-hindi.json is excluded by: !**/*.json
  • works/pdf-service/format-config/work-order.json is excluded by: !**/*.json
  • works/pdf-service/format-config/works-estimate.json is excluded by: !**/*.json
  • works/workflow-configs/Estimate-Approval.json is excluded by: !**/*.json
  • works/workflow-configs/Expense-Purchase.json is excluded by: !**/*.json
  • works/workflow-configs/Expense-Supervision.json is excluded by: !**/*.json
  • works/workflow-configs/Expense-Wage.json is excluded by: !**/*.json
  • works/workflow-configs/MB.json is excluded by: !**/*.json
  • works/workflow-configs/Muster-Approval.json is excluded by: !**/*.json
  • works/workflow-configs/Workorder-Approval.json is excluded by: !**/*.json
Files selected for processing (1)
  • CODEOWNERS (1 hunks)
Additional comments: 2
CODEOWNERS (2)
  • 1-1: The addition of @AmanKumar-eGov to the list of reviewers is a significant update, ensuring that changes to the project are reviewed by all relevant stakeholders. This change appears to be correctly implemented.
  • 3-4: The introduction of a new section for works/ with @egovernments/works-dev-pr-reviewers as the designated reviewers is a strategic move to ensure specialized review for changes in this directory. It's important to verify that all team members of @egovernments/works-dev-pr-reviewers are aware of their new responsibilities and that the works/ directory structure is correctly set up to reflect the areas of the project they will be reviewing.

Copy link

@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: 0

Review Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 7ff0ac7 and 4e544e9.
Files selected for processing (4)
  • egov-persister/boundary-persister.yml (1 hunks)
  • health/egov-persister/plan-service-persister.yml (1 hunks)
  • health/egov-persister/project-factory-persister.yml (1 hunks)
  • ifix/egov-indexer/digit-exchange-indexer.yml (1 hunks)
Additional comments not posted (4)
ifix/egov-indexer/digit-exchange-indexer.yml (1)

1-22: The configuration for the digit-exchange service appears correctly structured and follows standard practices for defining service mappings and indexes. Ensure that the JSON paths used for mapping and the structure of the custom JSON mapping accurately reflect the data structure expected by the digit-exchange service.

egov-persister/boundary-persister.yml (1)

1-106: The configuration for the boundary-Service appears correctly structured and follows standard practices for defining service mappings, database queries, and JSON mappings. Ensure that the JSON paths used for mapping and the structure of the database queries accurately reflect the data structure expected by the boundary-Service.

health/egov-persister/project-factory-persister.yml (1)

1-130: The configuration for the API Resource Service appears correctly structured and follows standard practices for defining service mappings, database queries, and JSON mappings. Ensure that the JSON paths used for mapping and the structure of the database queries accurately reflect the data structure expected by the API Resource Service.

health/egov-persister/plan-service-persister.yml (1)

1-410: The configuration for the plan-service appears correctly structured and follows standard practices for defining service mappings, database queries, and JSON mappings. The use of ON CONFLICT clauses for upsert operations is noted and appreciated. Ensure that the JSON paths used for mapping and the structure of the database queries accurately reflect the data structure expected by the plan-service.

Copy link

@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: 0

Review Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 4e544e9 and 2c3fadd.
Files selected for processing (8)
  • health/egov-persister/facility-persister.yml (1 hunks)
  • health/egov-persister/household-persister.yml (1 hunks)
  • health/egov-persister/individual-persister.yml (1 hunks)
  • health/egov-persister/product-persister.yml (1 hunks)
  • health/egov-persister/project-persister.yml (1 hunks)
  • health/egov-persister/project-task-persister.yml (1 hunks)
  • health/egov-persister/referral-management-persister.yml (1 hunks)
  • health/egov-persister/stock-persister.yml (1 hunks)
Additional comments not posted (32)
health/egov-persister/product-persister.yml (4)

1-33: The service definition and insert operation for products are well-defined. However, ensure that the objecIdJsonPath and tenantIdJsonPath correctly reference the JSON paths within your data structure. Also, verify that the auditAttributeBasePath is correctly set to capture all necessary audit attributes.


34-61: For the update operation of products, the query correctly updates the product details based on the ID. Ensure that the isDeleted flag is appropriately used to prevent updates on deleted records. Additionally, validate that the JSON paths used in jsonMaps accurately map to the data structure of the product.


62-91: The insert operation for product variants is correctly defined. It's important to ensure that the productId field is correctly populated and references an existing product. The use of JSONB for additionalFields is appropriate for storing JSON objects. Confirm that all fields are correctly mapped and necessary validations are in place for data integrity.


92-118: In the update operation for product variants, similar to the product update operation, ensure that updates are not applied to deleted records by correctly using the isDeleted flag. Additionally, validate the JSON paths and ensure that the productId references an existing product in the database.

health/egov-persister/facility-persister.yml (4)

1-36: The insert operation for facilities is well-defined. Ensure that the objecIdJsonPath and tenantIdJsonPath correctly reference the JSON paths within your data structure. Also, verify that the auditAttributeBasePath is correctly set to capture all necessary audit attributes. The inclusion of an addressId requires validation to ensure it references an existing address in the database.


37-56: The insert operation for addresses associated with facilities is correctly defined. It's crucial to ensure that addresses are validated for completeness and accuracy before insertion. Consider adding constraints or validations for fields like latitude and longitude to ensure they fall within valid ranges.


57-86: For the update operation of facilities, ensure that the isDeleted flag is appropriately used to prevent updates on deleted records. Additionally, validate that the JSON paths used in jsonMaps accurately map to the data structure of the facility. The ON CONFLICT clause in the address update operation is a good practice for handling potential duplicate entries.


87-121: The delete operation for facilities is correctly defined, using the isDeleted flag to mark records as deleted instead of physically removing them. This soft delete approach is beneficial for audit and historical data analysis. Ensure that the additionalDetails field is correctly handled during deletion to maintain any necessary information.

health/egov-persister/stock-persister.yml (6)

1-47: The insert operation for stock is well-defined. Ensure that the objecIdJsonPath and tenantIdJsonPath correctly reference the JSON paths within your data structure. Also, verify that the auditAttributeBasePath is correctly set to capture all necessary audit attributes. The use of JSONB for additionalFields is appropriate for storing JSON objects. Confirm that all fields are correctly mapped and necessary validations are in place for data integrity.


48-84: For the update operation of stock, ensure that updates are not applied to deleted records by correctly using the isDeleted flag. Additionally, validate the JSON paths and ensure that the productVariantId references an existing product variant in the database. The handling of clientAuditDetails is important for tracking changes made by clients.


85-110: The delete operation for stock is correctly defined, using the isDeleted flag to mark records as deleted instead of physically removing them. This soft delete approach is beneficial for audit and historical data analysis. Ensure that the additionalDetails field is correctly handled during deletion to maintain any necessary information.


113-151: The insert operation for stock reconciliation is well-defined. Ensure that the objecIdJsonPath and tenantIdJsonPath correctly reference the JSON paths within your data structure. Also, verify that the auditAttributeBasePath is correctly set to capture all necessary audit attributes. The use of JSONB for additionalFields is appropriate for storing JSON objects. Confirm that all fields are correctly mapped and necessary validations are in place for data integrity.


153-185: For the update operation of stock reconciliation, ensure that updates are not applied to deleted records by correctly using the isDeleted flag. Additionally, validate the JSON paths and ensure that the productVariantId references an existing product variant in the database. The handling of clientAuditDetails is important for tracking changes made by clients.


187-211: The delete operation for stock reconciliation is correctly defined, using the isDeleted flag to mark records as deleted instead of physically removing them. This soft delete approach is beneficial for audit and historical data analysis. Ensure that the additionalDetails field is correctly handled during deletion to maintain any necessary information.

health/egov-persister/household-persister.yml (7)

1-36: The insert operation for households is well-defined. Ensure that the objecIdJsonPath and tenantIdJsonPath correctly reference the JSON paths within your data structure. Also, verify that the auditAttributeBasePath is correctly set to capture all necessary audit attributes. The inclusion of an addressId requires validation to ensure it references an existing address in the database.


37-55: The insert operation for addresses associated with households is correctly defined. It's crucial to ensure that addresses are validated for completeness and accuracy before insertion. Consider adding constraints or validations for fields like latitude and longitude to ensure they fall within valid ranges.


57-85: For the update operation of households, ensure that the isDeleted flag is appropriately used to prevent updates on deleted records. Additionally, validate that the JSON paths used in jsonMaps accurately map to the data structure of the household. The ON CONFLICT clause in the address update operation is a good practice for handling potential duplicate entries.


87-119: The delete operation for households is correctly defined, using the isDeleted flag to mark records as deleted instead of physically removing them. This soft delete approach is beneficial for audit and historical data analysis. Ensure that the additionalDetails field is correctly handled during deletion to maintain any necessary information.


146-181: The insert operation for household members is well-defined. Ensure that the objecIdJsonPath and tenantIdJsonPath correctly reference the JSON paths within your data structure. Also, verify that the auditAttributeBasePath is correctly set to capture all necessary audit attributes. The use of JSONB for additionalFields is appropriate for storing JSON objects. Confirm that all fields are correctly mapped and necessary validations are in place for data integrity.


183-209: For the update operation of household members, ensure that updates are not applied to deleted records by correctly using the isDeleted flag. Additionally, validate the JSON paths and ensure that the householdId references an existing household in the database. The handling of clientAuditDetails is important for tracking changes made by clients.


211-234: The delete operation for household members is correctly defined, using the isDeleted flag to mark records as deleted instead of physically removing them. This soft delete approach is beneficial for audit and historical data analysis. Ensure that the additionalDetails field is correctly handled during deletion to maintain any necessary information.

health/egov-persister/project-task-persister.yml (1)

1-277: The YAML configuration for persisting project tasks and related entities appears comprehensive and well-structured. However, there are a few areas that could benefit from improvements or clarifications:

  1. Consistency in Naming: Ensure consistency in naming conventions across the file. For example, table names like health.PROJECT_TASK, health.ADDRESS, and health.TASK_RESOURCE should follow a consistent naming convention, either all uppercase or all lowercase.

  2. Error Handling: Consider adding configurations or comments on how errors during the persistence operations are handled, especially for transactions marked with isTransaction: true.

  3. Security and PII: Ensure that any personally identifiable information (PII) stored in the database is handled according to security best practices, such as encryption at rest and in transit.

  4. Performance Considerations: For bulk operations or operations expected to handle a large volume of data, consider adding comments or documentation on performance considerations, such as indexing on frequently queried columns.

  5. Audit Details: The use of auditDetails and clientAuditDetails is noted. Ensure that these fields are populated correctly and that there is a mechanism to track changes to the entities over time for auditing purposes.

  6. Use of JSONB: The use of JSONB for additionalFields and other similar fields is appropriate for storing unstructured or semi-structured data. Ensure that the application querying this data is equipped to handle JSONB efficiently.

  7. Documentation: Consider adding more detailed comments or documentation within the YAML file to describe the purpose of each query and the structure of the data being persisted. This can be helpful for future maintainers of the file.

Overall, the configuration seems to align with the objectives of persisting project-related data efficiently. Addressing the above points can further enhance the clarity, security, and performance of the persistence operations.

health/egov-persister/referral-management-persister.yml (1)

1-296: The YAML configuration for persisting referral management related entities is well-organized and covers a wide range of operations. Here are some suggestions for further improvement:

  1. Validation of Input Data: Ensure that there is a mechanism in place to validate the input data before persisting it to the database. This is crucial for maintaining data integrity and preventing issues related to malformed data.

  2. Handling of Sensitive Information: If any of the persisted data includes sensitive information, ensure that it is handled according to best practices for data security, such as encryption and access control.

  3. Optimization for Bulk Operations: If the system expects to handle bulk operations frequently, consider optimizations such as batch inserts or updates to improve performance.

  4. Documentation and Comments: Adding more detailed comments or documentation within the YAML file can provide valuable context for the purpose and expected behavior of each query. This is especially helpful for complex operations or when special handling is required.

  5. Audit Trails: The configurations make use of audit details similar to the previous file. Ensure that the audit trails are comprehensive and allow for effective tracking of changes over time.

  6. Error Handling and Transaction Management: Given the critical nature of referral management, robust error handling and transaction management are essential. Ensure that failures in one part of a transaction do not leave the system in an inconsistent state.

  7. Use of JSONB Fields: The use of JSONB for fields like additionalFields and symptoms is noted. Make sure that the application logic is optimized for querying and manipulating JSONB data.

By addressing these points, the configurations can be further refined to ensure robustness, security, and efficiency in handling referral management data.

health/egov-persister/individual-persister.yml (1)

1-315: The YAML configuration for persisting individual and related entities is detailed and covers various operations. Here are some areas for potential refinement:

  1. Data Validation: Ensure comprehensive validation of input data to maintain data integrity. This includes checks for required fields, data formats (e.g., dates), and value constraints.

  2. Security Considerations: Pay special attention to the handling of sensitive data, such as personal information and contact details. Implement appropriate security measures like data encryption and access controls.

  3. Performance Optimization: For operations that might involve large datasets, consider performance optimizations. This could include batch processing and optimizing database queries for efficiency.

  4. Clear Documentation: Enhance the YAML file with detailed comments or documentation explaining the purpose of each operation and any specific considerations. This is particularly important for complex queries or those with significant side effects.

  5. Audit and Change Tracking: Ensure that the audit details are correctly captured and that there is a reliable mechanism for tracking changes to individual records over time.

  6. Error Handling and Transactions: Robust error handling and transaction management are crucial to prevent data corruption or inconsistencies, especially in operations marked as transactions.

  7. Handling of JSONB and Date Fields: The use of JSONB for additionalFields and date types for fields like dateOfBirth is appropriate. Ensure that the application logic is well-equipped to handle these data types effectively.

Addressing these suggestions can enhance the clarity, security, and efficiency of the persistence operations for individual and related entities.

health/egov-persister/project-persister.yml (8)

16-33: The INSERT query for project staff includes a wide range of fields, ensuring comprehensive data capture. However, it's crucial to ensure that all fields, especially additionalDetails (line 25), are properly sanitized and validated before insertion to prevent SQL injection and ensure data integrity.

Ensure that upstream data passed to this query is sanitized and validated. Consider adding a comment or documentation indicating the expected format and validation rules for additionalDetails.


47-61: The UPDATE query for project staff correctly targets specific records by their id and updates relevant fields. It's good practice to ensure that isDeleted and rowVersion fields are handled correctly to maintain data integrity and support soft delete operations.

Ensure that the logic for handling isDeleted and rowVersion is implemented correctly in the application logic to prevent accidental data loss or inconsistencies.


75-85: For the DELETE operation on project staff, the query updates the isDeleted flag and modifies audit details. This approach supports soft deletion, which is a best practice for maintaining historical data. However, ensure that the additionalDetails field (line 82) is not misused to store sensitive information that should be permanently erased.

Review the use of additionalDetails in the context of deletion to ensure it aligns with data retention policies and privacy regulations.


99-122: The INSERT query for project beneficiaries is comprehensive, capturing a wide range of details. Pay special attention to the handling of additionalFields (line 109) and clientAuditDetails (lines 118-121), ensuring they are properly structured and sanitized to prevent data integrity issues.

Confirm that additionalFields and clientAuditDetails are validated against a schema or set of rules to ensure they contain expected data formats and values.


136-154: The UPDATE query for project beneficiaries includes a condition AND isDeleted=false (line 136), which is a good practice to prevent updating records that are meant to be "deleted." Ensure that all update operations across the system consistently check the isDeleted flag to maintain data integrity.

Consistently use the isDeleted flag check in all update and delete operations to support soft deletion and data integrity.


168-180: For the DELETE operation on project beneficiaries, the approach of updating the isDeleted flag and audit details is consistent with best practices for soft deletion. Ensure that the handling of additionalFields (line 177) during deletion does not inadvertently retain sensitive information.

Review the content of additionalFields in deletion contexts to ensure compliance with data retention and privacy policies.


195-245: The INSERT query for projects includes a comprehensive set of fields, capturing detailed project information. Ensure that additionalDetails (line 230) and audit details (lines 238-244) are properly validated and sanitized to maintain data integrity and security.

Verify that additionalDetails and audit details are subject to strict validation rules to prevent injection attacks and ensure only valid data is stored.


350-388: The UPDATE query for projects demonstrates good practice by specifying all fields to be updated and using the project id for targeting specific records. Ensure that additionalDetails (line 376) is handled with care, especially regarding data validation and sanitization.

Implement rigorous validation for additionalDetails to ensure data integrity and prevent potential security vulnerabilities.

Copy link

@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: 0

Review Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 2c3fadd and a0aa2a8.
Files selected for processing (1)
  • health/egov-persister/project-factory-persister.yml (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • health/egov-persister/project-factory-persister.yml

Copy link

@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: 0

Review Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between a0aa2a8 and c5e5dcc.
Files selected for processing (1)
  • health/egov-persister/plan-service-persister.yml (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • health/egov-persister/plan-service-persister.yml

Copy link

@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: 0

Review Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between c5e5dcc and 6473be5.
Files selected for processing (1)
  • health/egov-persister/project-factory-persister.yml (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • health/egov-persister/project-factory-persister.yml

Copy link

@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: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 52aba6e and 65979a7.
Files selected for processing (1)
  • health/egov-persister/project-factory-persister.yml (1 hunks)
Additional comments not posted (7)
health/egov-persister/project-factory-persister.yml (7)

1-27: The configuration for CreateResourceDetails is well-defined and correctly sets up the transactional insert operation for resource details.


31-47: The configuration for UpdateResourceDetails correctly defines the update operation with appropriate JSON mappings and transactional settings.


50-78: The configuration for CreateResourceActivity is correctly set up for handling multiple activity records with proper JSON mappings and transactional settings.


81-103: The configuration for CreateForGenerateApiResources is well-defined, ensuring correct data insertion with transactional integrity.


108-125: The configuration for UpdateForGenerateApiResources correctly sets up the update operation with proper JSON mappings and transactional settings.


128-158: The configuration for CreateCampaignDetails is comprehensive, correctly mapping all necessary fields for campaign details creation with transactional integrity.


161-187: The configuration for UpdateCampaignDetails correctly sets up the update operation with proper JSON mappings and transactional settings.

Copy link

@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: 1

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 65979a7 and 8afa269.
Files selected for processing (1)
  • health/egov-persister/plan-service-persister.yml (1 hunks)
Additional comments not posted (3)
health/egov-persister/plan-service-persister.yml (3)

1-1: Ensure the root key serviceMaps is correctly used in the context of the application.

Verification successful

The root key serviceMaps is used consistently across multiple YAML configuration files within the health/egov-persister directory. This suggests a standardized approach to configuration, which aligns with best practices.

  • health/egov-persister/stock-persister.yml
  • health/egov-persister/service-request-persister.yml
  • health/egov-persister/referral-management-persister.yml
  • health/egov-persister/project-task-persister.yml
  • health/egov-persister/project-persister.yml
  • health/egov-persister/project-factory-persister.yml
  • health/egov-persister/product-persister.yml
  • health/egov-persister/plan-service-persister.yml
  • health/egov-persister/individual-persister.yml
  • health/egov-persister/hrms-employee-persister.yml
  • health/egov-persister/household-persister.yml
  • health/egov-persister/facility-persister.yml
  • health/egov-persister/attendance-service-persister.yml
Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that the root key `serviceMaps` is used consistently across similar YAML configuration files.

# Test: Search for `serviceMaps` usage in other YAML files. Expect: Consistent usage.
rg --type yaml 'serviceMaps' health/egov-persister/

Length of output: 851


2-14: Review the configuration blocks for each operation to ensure they are complete and correctly specify all required attributes.

Also applies to: 88-99, 192-221, 318-334

Verification successful

The verification script successfully extracted the configuration block and confirmed that all required attributes are present. Therefore, the configuration block appears to be complete and correctly specified.

  • The configuration block includes all the required attributes: serviceName, version, name, description, fromTopic, isTransaction, isAuditEnabled, module, objecIdJsonPath, tenantIdJsonPath, userUuidJsonPath, and transactionCodeJsonPath.
Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that each configuration block is complete and matches the specifications required for the operations.

# Test: Compare configuration blocks against a schema or checklist to ensure all necessary attributes are included and correctly set.
echo "Check configuration blocks against a predefined schema or checklist."

Length of output: 146



Script:

#!/bin/bash
# Define the required attributes for a configuration block
required_attributes=("serviceName" "version" "name" "description" "fromTopic" "isTransaction" "isAuditEnabled" "module" "objecIdJsonPath" "tenantIdJsonPath" "userUuidJsonPath" "transactionCodeJsonPath")

# Extract the configuration blocks from the YAML file
config_blocks=$(yq e '.mappings[]' health/egov-persister/plan-service-persister.yml)

# Check each configuration block for the required attributes
for attribute in "${required_attributes[@]}"; do
  if ! echo "$config_blocks" | grep -q "$attribute"; then
    echo "Missing attribute: $attribute"
  fi
done

Length of output: 2201



Script:

#!/bin/bash
# Define the required attributes for a configuration block
required_attributes=("serviceName" "version" "name" "description" "fromTopic" "isTransaction" "isAuditEnabled" "module" "objecIdJsonPath" "tenantIdJsonPath" "userUuidJsonPath" "transactionCodeJsonPath")

# Extract the configuration blocks from the YAML file
config_blocks=$(grep -A 12 'serviceName: plan-service' health/egov-persister/plan-service-persister.yml)

# Check each configuration block for the required attributes
for attribute in "${required_attributes[@]}"; do
  if ! echo "$config_blocks" | grep -q "$attribute"; then
    echo "Missing attribute: $attribute"
  fi
done

Length of output: 6553


17-17: Ensure SQL queries are correctly formatted and optimized for performance.

Also applies to: 30-30, 45-45, 58-58, 73-73, 101-101, 112-112, 132-132, 150-150, 172-172, 197-197, 222-222, 249-249, 272-272, 293-293, 323-323, 336-336, 363-363, 386-386, 407-407

Comment on lines 20 to 28
- jsonPath: $.PlanConfiguration.id
- jsonPath: $.PlanConfiguration.tenantId
- jsonPath: $.PlanConfiguration.name
- jsonPath: $.PlanConfiguration.executionPlanId
- jsonPath: $.PlanConfiguration.status
- jsonPath: $.PlanConfiguration.auditDetails.createdBy
- jsonPath: $.PlanConfiguration.auditDetails.createdTime
- jsonPath: $.PlanConfiguration.auditDetails.lastModifiedBy
- jsonPath: $.PlanConfiguration.auditDetails.lastModifiedTime
Copy link

Choose a reason for hiding this comment

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

Tip

Codebase Verification

The JSON paths specified in the plan-service-persister.yml file do not match any of the JSON structures found in the repository. Each attempt to locate PlanConfiguration within the JSON files resulted in null, indicating that the expected structure is not present in the sample data.

  • Please review the JSON path mappings in the plan-service-persister.yml file to ensure they align with the actual data structure used in your application.
  • Verify that the JSON paths are correct and that the data structure they reference exists in the repository.
Analysis chain

Review JSON path mappings for correctness and ensure they match the expected data structure.

Also applies to: 33-42, 48-56, 61-71, 76-85, 104-110, 115-130, 135-148, 153-170, 175-190, 200-220, 225-247, 252-270, 275-291, 296-316, 326-334, 339-361, 366-384, 389-405, 410-430

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that JSON paths in the mappings correspond to the actual JSON structure expected from the source data.

# Test: Fetch sample JSON data and test each JSON path to ensure they correctly extract the expected data.
echo "Test JSON paths against sample data to ensure correct mappings."

Length of output: 136



Script:

#!/bin/bash
# Description: Verify that JSON paths in the mappings correspond to the actual JSON structure expected from the source data.

# Step 1: Find a sample JSON data file in the repository.
sample_json_file=$(fd -e json | head -n 1)

# Step 2: Define the JSON paths to be tested.
json_paths=(
  '$.PlanConfiguration.id'
  '$.PlanConfiguration.tenantId'
  '$.PlanConfiguration.name'
  '$.PlanConfiguration.executionPlanId'
  '$.PlanConfiguration.status'
  '$.PlanConfiguration.auditDetails.createdBy'
  '$.PlanConfiguration.auditDetails.createdTime'
  '$.PlanConfiguration.auditDetails.lastModifiedBy'
  '$.PlanConfiguration.auditDetails.lastModifiedTime'
)

# Step 3: Test each JSON path against the sample data using jq.
for path in "${json_paths[@]}"; do
  echo "Testing JSON path: $path"
  jq "$path" "$sample_json_file"
done

Length of output: 4387



Script:

#!/bin/bash
# Description: Verify that JSON paths in the mappings correspond to the actual JSON structure expected from the source data.

# Step 1: Find a sample JSON data file in the repository.
sample_json_file=$(fd -e json | head -n 1)

# Step 2: Define the corrected JSON paths to be tested.
json_paths=(
  '.PlanConfiguration.id'
  '.PlanConfiguration.tenantId'
  '.PlanConfiguration.name'
  '.PlanConfiguration.executionPlanId'
  '.PlanConfiguration.status'
  '.PlanConfiguration.auditDetails.createdBy'
  '.PlanConfiguration.auditDetails.createdTime'
  '.PlanConfiguration.auditDetails.lastModifiedBy'
  '.PlanConfiguration.auditDetails.lastModifiedTime'
)

# Step 3: Test each JSON path against the sample data using jq.
for path in "${json_paths[@]}"; do
  echo "Testing JSON path: $path"
  jq "$path" "$sample_json_file"
done

Length of output: 2756



Script:

#!/bin/bash
# Description: Search for JSON files that might contain PlanConfiguration and verify their structure.

# Step 1: Find JSON files in the repository that might contain PlanConfiguration.
json_files=$(fd -e json)

# Step 2: Check each JSON file for the presence of PlanConfiguration.
for file in $json_files; do
  echo "Checking file: $file"
  if jq '.PlanConfiguration' "$file" > /dev/null 2>&1; then
    echo "Found PlanConfiguration in: $file"
    jq '.PlanConfiguration' "$file"
  fi
done

Length of output: 95425

Copy link

@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: 1

Outside diff range and nitpick comments (1)
egov-persister/rate-analysis-service-persister.yml (1)

37-60: Check for potential redundancy in service configuration.

The service configuration for RateAnalysisService is defined twice with the same version and name but different topics (lines 4-6 and 37-39). If these configurations are meant to be identical, consider merging them to reduce redundancy and potential confusion.

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 8afa269 and 9a0be50.

Files selected for processing (1)
  • egov-persister/rate-analysis-service-persister.yml (1 hunks)
Additional comments not posted (2)
egov-persister/rate-analysis-service-persister.yml (2)

1-35: Ensure consistency in JSON path references.

The JSON paths used in the INSERT queries (lines 14-22, 27-33) should consistently refer to the base path defined in line 12 and 25. Currently, line 29 incorrectly refers to $.ScheduledJobs.id instead of $.ScheduledJobs.sorDetails.*.id. This might lead to incorrect data being inserted due to path mismatches.

- jsonPath: $.ScheduledJobs.id
+ jsonPath: $.ScheduledJobs.sorDetails.*.id

Likely invalid or redundant comment.


1-60: Validate transactional integrity and error handling.

The configuration specifies isTransaction: true for both INSERT and UPDATE operations (lines 8, 41). It's crucial to ensure that the transaction settings are correctly implemented in the backend to maintain data integrity, especially given the complex operations described.

Comment on lines 34 to 35
type: JSON
dbType: JSONB
Copy link

Choose a reason for hiding this comment

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

Clarify the use of custom database types.

The custom database types JSON and JSONB are specified for certain fields (lines 34-35, 58-59). It's important to ensure that these types are supported by the database and correctly handled by the application logic to prevent runtime errors or data corruption.

#!/bin/bash
# Description: Verify database support for JSON and JSONB types.

# Test: Check database schema for JSON and JSONB type support. Expect: Schema definitions including JSON and JSONB.
rg 'JSONB' -- 'database/schema.sql'

Also applies to: 58-59

Copy link

@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: 0

Outside diff range and nitpick comments (1)
egov-indexer/referral-management-indexer.yml (1)

1-41: The configuration for user-sync-index-v1 is comprehensive and well-structured. However, consider adding a brief comment describing each field's purpose for better maintainability.

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 9a0be50 and 1f55703.

Files selected for processing (1)
  • egov-indexer/referral-management-indexer.yml (1 hunks)
Additional comments not posted (3)
egov-indexer/referral-management-indexer.yml (3)

43-71: Ensure that the referral-index-v1 under save-referral-topic, update-referral-topic, and delete-referral-topic consistently uses the same index name and type. This consistency is crucial for maintaining data integrity across different operations.


103-131: The configurations for hf-referral-index-v1 are consistent across save, update, and delete operations. This consistency helps in maintaining a uniform approach to handling high-frequency referrals. Good job on ensuring this uniformity.


73-101: The indexing configuration for side effects (side-effect-index-v1) appears correct. However, verify that the jsonPath used ($.*) correctly captures all necessary fields from the JSON data for indexing.

Copy link

@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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 1f55703 and 555a8dc.

Files selected for processing (1)
  • health/egov-indexer/referral-management-indexer.yml (1 hunks)
Additional comments not posted (5)
health/egov-indexer/referral-management-indexer.yml (5)

1-18: Configuration for bulk indexing of referral management data appears correct and well-structured.


73-101: CRUD operations on side effects are well-configured and consistent with referral operations.


103-131: CRUD operations on high-frequency referrals are consistently configured and appropriate for high-volume data.


19-41: User data indexing configuration is comprehensive and detailed, covering essential user attributes.

Verification successful

All fields mapped in user-sync-index-v1 are present and used in the referral-management-indexer.yml file.

  • lastModifiedBy
  • createdTime
  • province
  • district
  • administrativeProvince
  • locality
  • village
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that all fields mapped in user-sync-index-v1 are used and necessary.

# Test: Search for usage of each field in the application logic.
rg --type yaml -e 'lastModifiedBy' -e 'createdTime' -e 'province' -e 'district' -e 'administrativeProvince' -e 'locality' -e 'village' 'health/egov-indexer/referral-management-indexer.yml'

Length of output: 954


43-71: CRUD operations on referrals are consistently configured. Ensure correct mapping and usage of timestamp fields.

Verification successful

The timestamp fields for CRUD operations on referrals are correctly mapped and used.

  • createdTime is used for creation operations.
  • lastModifiedTime is used for update and delete operations.
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify correct mapping and usage of timestamp fields for CRUD operations on referrals.

# Test: Search for the correct application of timestamp fields in the CRUD operations.
rg --type yaml -e 'auditDetails.createdTime' -e 'auditDetails.lastModifiedTime' 'health/egov-indexer/referral-management-indexer.yml'

Length of output: 636

Copy link

@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: 2

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 555a8dc and 3523d81.

Files selected for processing (2)
  • egov-persister/statement-persister.yml (1 hunks)
  • health/egov-indexer/referral-management-indexer.yml (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • health/egov-indexer/referral-management-indexer.yml
Additional context used
yamllint
egov-persister/statement-persister.yml

[error] 47-47: trailing spaces (trailing-spaces)


[error] 62-62: trailing spaces (trailing-spaces)


[error] 78-78: trailing spaces (trailing-spaces)


[error] 79-79: trailing spaces (trailing-spaces)


[error] 81-81: trailing spaces (trailing-spaces)


[error] 96-96: trailing spaces (trailing-spaces)


[error] 108-108: trailing spaces (trailing-spaces)


[error] 114-114: trailing spaces (trailing-spaces)


[error] 115-115: no new line character at the end of file (new-line-at-end-of-file)


[error] 115-115: trailing spaces (trailing-spaces)

Additional comments not posted (1)
egov-persister/statement-persister.yml (1)

16-16: All SQL queries appear to be correctly parameterized to prevent SQL injection. Good practice!

Also applies to: 35-35, 49-49, 72-72, 84-84, 98-98

Comment on lines +1 to +12
serviceMaps:
serviceName: statement
mappings:
- version: 1.0
name: statement
description: Persists statement details in eg_statement table
fromTopic: save-analysis-statement
isTransaction: true
isAuditEnabled: true
module: STATEMENT
objecIdJsonPath: $.id
tenantIdJsonPath: $.tenantId
Copy link

Choose a reason for hiding this comment

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

Ensure consistency in indentation and alignment for better readability and to avoid parsing errors in YAML files.

Copy link

@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: 2

Outside diff range and nitpick comments (2)
egov-persister/project-task-persister.yml (1)

1-247: The YAML configuration for project tasks and adverse events appears comprehensive, covering various operations like insertions and updates. It's crucial to ensure that the JSON paths and database field mappings are correctly aligned with the actual database schema and incoming JSON structure to avoid runtime errors. Also, consider adding explicit error handling or logging mechanisms for the database operations to improve maintainability and debuggability of the system.

Tools
yamllint

[error] 247-247: no new line character at the end of file (new-line-at-end-of-file)

health/egov-persister/project-task-persister.yml (1)

1-289: The configuration in this YAML file is detailed and well-structured, mapping various operations related to project tasks and adverse events within the health module. It includes comprehensive mappings and database interactions. It's important to ensure that the database schema and JSON input structure are in sync with these mappings. Additionally, enabling auditing is a good practice, but ensure that it does not impact performance significantly, perhaps by monitoring the system post-deployment.

Tools
yamllint

[error] 289-289: no new line character at the end of file (new-line-at-end-of-file)

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 3523d81 and 1966f43.

Files selected for processing (2)
  • egov-persister/project-task-persister.yml (1 hunks)
  • health/egov-persister/project-task-persister.yml (1 hunks)
Additional context used
yamllint
egov-persister/project-task-persister.yml

[error] 247-247: no new line character at the end of file (new-line-at-end-of-file)

health/egov-persister/project-task-persister.yml

[error] 289-289: no new line character at the end of file (new-line-at-end-of-file)

- jsonPath: $.*.clientAuditDetails.lastModifiedTime
- jsonPath: $.*.rowVersion
- jsonPath: $.*.isDeleted
- jsonPath: $.*.id
Copy link

Choose a reason for hiding this comment

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

Please add a newline at the end of the file to comply with common coding standards and to avoid potential parsing issues in some tools that expect a newline at the end.

+ 
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- jsonPath: $.*.id
- jsonPath: $.*.id
Tools
yamllint

[error] 247-247: no new line character at the end of file (new-line-at-end-of-file)

- jsonPath: $.*.clientAuditDetails.lastModifiedTime
- jsonPath: $.*.rowVersion
- jsonPath: $.*.isDeleted
- jsonPath: $.*.id
Copy link

Choose a reason for hiding this comment

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

Please add a newline at the end of the file to adhere to YAML file formatting standards and avoid issues with parsers that may expect this newline.

+ 
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- jsonPath: $.*.id
- jsonPath: $.*.id
Tools
yamllint

[error] 289-289: no new line character at the end of file (new-line-at-end-of-file)

Copy link

@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: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 1966f43 and 9d8bf5b.

Files selected for processing (1)
  • health/egov-persister/project-factory-persister.yml (1 hunks)
Additional comments not posted (6)
health/egov-persister/project-factory-persister.yml (6)

1-27: The YAML configuration for CreateResourceDetails looks well-structured and follows the specified format. However, ensure that the placeholders (?) in the SQL query are correctly mapped to the fields specified in jsonMaps.


49-77: The configuration for CreateResourceActivity includes multiple JSON paths with wildcards, which is appropriate for handling lists of activities. Ensure that the database schema supports the JSONB type for the specified fields to take full advantage of JSON operations.


129-165: The CreateCampaignDetails service mapping is well-defined and includes audit details. Verify that all JSON paths are correct and align with the data model, especially for complex nested structures.


168-200: The update service for campaign details includes comprehensive mappings and audit capabilities. Ensure that the campaignDetails field, which appears to be a complex JSON structure, is handled correctly in all cases.


109-126: The update mapping for generated API resources seems correct. Ensure that all fields being updated are non-null and the id field is indexed for performance.


30-46: The UpdateResourceDetails service mapping is transactional, which is good for consistency. However, check if the lastModifiedBy and lastModifiedTime fields are always available as they are crucial for tracking changes.

Comment on lines 80 to 104
- version: 1.0
name: CreateForGenerateApiResources
description: Create Api resource in the eg_cm_generated_resource_details table
fromTopic: create-generated-resource-details
isTransaction: true
queryMaps:
- query: INSERT INTO health.eg_cm_generated_resource_details (id,filestoreid, type,"status",count,tenantid,hierarchyType, createdby, createdtime, lastmodifiedby, lastmodifiedtime, additionaldetails,campaignid,auditid) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?);
basePath: generatedResource.*
jsonMaps:
- jsonPath: $.generatedResource.*.id
- jsonPath: $.generatedResource.*.fileStoreid
- jsonPath: $.generatedResource.*.type
- jsonPath: $.generatedResource.*.status
- jsonPath: $.generatedResource.*.count
- jsonPath: $.generatedResource.*.tenantId
- jsonPath: $.generatedResource.*.hierarchyType
- jsonPath: $.generatedResource.*.auditDetails.createdBy
- jsonPath: $.generatedResource.*.auditDetails.createdTime
- jsonPath: $.generatedResource.*.auditDetails.lastModifiedBy
- jsonPath: $.generatedResource.*.auditDetails.lastModifiedTime
- jsonPath: $.generatedResource.*.additionalDetails
type: JSON
dbType: JSONB
- jsonPath: $.generatedResource.*.campaignId
- jsonPath: $.generatedResource.*.auditId
Copy link

Choose a reason for hiding this comment

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

The CreateForGenerateApiResources mapping looks comprehensive. However, consider adding explicit error handling for cases where the INSERT might fail due to unique constraints or other SQL errors.

-        - query: INSERT INTO health.eg_cm_generated_resource_details (id,filestoreid, type,"status",count,tenantid,hierarchyType, createdby, createdtime, lastmodifiedby, lastmodifiedtime, additionaldetails,campaignid,auditid) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?);
+        - query: INSERT INTO health.eg_cm_generated_resource_details (id,filestoreid, type,"status",count,tenantid,hierarchyType, createdby, createdtime, lastmodifiedby, lastmodifiedtime, additionaldetails,campaignid,auditid) ON CONFLICT (id) DO NOTHING;
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- version: 1.0
name: CreateForGenerateApiResources
description: Create Api resource in the eg_cm_generated_resource_details table
fromTopic: create-generated-resource-details
isTransaction: true
queryMaps:
- query: INSERT INTO health.eg_cm_generated_resource_details (id,filestoreid, type,"status",count,tenantid,hierarchyType, createdby, createdtime, lastmodifiedby, lastmodifiedtime, additionaldetails,campaignid,auditid) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?);
basePath: generatedResource.*
jsonMaps:
- jsonPath: $.generatedResource.*.id
- jsonPath: $.generatedResource.*.fileStoreid
- jsonPath: $.generatedResource.*.type
- jsonPath: $.generatedResource.*.status
- jsonPath: $.generatedResource.*.count
- jsonPath: $.generatedResource.*.tenantId
- jsonPath: $.generatedResource.*.hierarchyType
- jsonPath: $.generatedResource.*.auditDetails.createdBy
- jsonPath: $.generatedResource.*.auditDetails.createdTime
- jsonPath: $.generatedResource.*.auditDetails.lastModifiedBy
- jsonPath: $.generatedResource.*.auditDetails.lastModifiedTime
- jsonPath: $.generatedResource.*.additionalDetails
type: JSON
dbType: JSONB
- jsonPath: $.generatedResource.*.campaignId
- jsonPath: $.generatedResource.*.auditId
- version: 1.0
name: CreateForGenerateApiResources
description: Create Api resource in the eg_cm_generated_resource_details table
fromTopic: create-generated-resource-details
isTransaction: true
queryMaps:
- query: INSERT INTO health.eg_cm_generated_resource_details (id,filestoreid, type,"status",count,tenantid,hierarchyType, createdby, createdtime, lastmodifiedby, lastmodifiedtime, additionaldetails,campaignid,auditid) ON CONFLICT (id) DO NOTHING;
basePath: generatedResource.*
jsonMaps:
- jsonPath: $.generatedResource.*.id
- jsonPath: $.generatedResource.*.fileStoreid
- jsonPath: $.generatedResource.*.type
- jsonPath: $.generatedResource.*.status
- jsonPath: $.generatedResource.*.count
- jsonPath: $.generatedResource.*.tenantId
- jsonPath: $.generatedResource.*.hierarchyType
- jsonPath: $.generatedResource.*.auditDetails.createdBy
- jsonPath: $.generatedResource.*.auditDetails.createdTime
- jsonPath: $.generatedResource.*.auditDetails.lastModifiedBy
- jsonPath: $.generatedResource.*.auditDetails.lastModifiedTime
- jsonPath: $.generatedResource.*.additionalDetails
type: JSON
dbType: JSONB
- jsonPath: $.generatedResource.*.campaignId
- jsonPath: $.generatedResource.*.auditId

Copy link

@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: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 9d8bf5b and 32e80cc.

Files selected for processing (1)
  • egov-persister/statement-persister.yml (1 hunks)
Additional context used
yamllint
egov-persister/statement-persister.yml

[error] 47-47: trailing spaces (trailing-spaces)


[error] 48-48: trailing spaces (trailing-spaces)


[error] 77-77: trailing spaces (trailing-spaces)


[error] 93-93: trailing spaces (trailing-spaces)


[error] 94-94: trailing spaces (trailing-spaces)


[error] 96-96: trailing spaces (trailing-spaces)


[error] 112-112: trailing spaces (trailing-spaces)


[error] 126-126: trailing spaces (trailing-spaces)


[error] 129-129: trailing spaces (trailing-spaces)


[error] 141-141: trailing spaces (trailing-spaces)


[error] 151-151: trailing spaces (trailing-spaces)


[error] 154-154: trailing spaces (trailing-spaces)


[error] 157-157: trailing spaces (trailing-spaces)


[error] 160-160: trailing spaces (trailing-spaces)


[error] 163-163: trailing spaces (trailing-spaces)


[error] 164-164: no new line character at the end of file (new-line-at-end-of-file)


[error] 164-164: trailing spaces (trailing-spaces)

Additional comments not posted (6)
egov-persister/statement-persister.yml (6)

1-12: Ensure consistency in indentation and alignment for better readability and to avoid parsing errors in YAML files.


16-32: Ensure that the SQL query and JSON mappings are correctly aligned with the database schema and application requirements.


35-56: Review and verify the correctness of the JSON paths and their mappings to ensure accurate data handling.

Tools
yamllint

[error] 47-47: trailing spaces (trailing-spaces)


[error] 48-48: trailing spaces (trailing-spaces)


87-96: Confirm that the fields being updated are correct and align with the intended business logic.

Tools
yamllint

[error] 93-93: trailing spaces (trailing-spaces)


[error] 94-94: trailing spaces (trailing-spaces)


[error] 96-96: trailing spaces (trailing-spaces)


99-164: Ensure that the upsert operations are thoroughly tested to prevent any data inconsistencies.

Tools
yamllint

[error] 112-112: trailing spaces (trailing-spaces)


[error] 126-126: trailing spaces (trailing-spaces)


[error] 129-129: trailing spaces (trailing-spaces)


[error] 141-141: trailing spaces (trailing-spaces)


[error] 151-151: trailing spaces (trailing-spaces)


[error] 154-154: trailing spaces (trailing-spaces)


[error] 157-157: trailing spaces (trailing-spaces)


[error] 160-160: trailing spaces (trailing-spaces)


[error] 163-163: trailing spaces (trailing-spaces)


[error] 164-164: no new line character at the end of file (new-line-at-end-of-file)


[error] 164-164: trailing spaces (trailing-spaces)


47-47: Remove trailing spaces to adhere to best YAML practices and prevent parsing issues.

- dbType: JSONB  
+ dbType: JSONB

Likely invalid or redundant comment.

Tools
yamllint

[error] 47-47: trailing spaces (trailing-spaces)

Copy link

@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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 32e80cc and 4b3acf6.

Files selected for processing (1)
  • egov-persister/statement-persister.yml (1 hunks)
Additional context used
yamllint
egov-persister/statement-persister.yml

[error] 47-47: trailing spaces (trailing-spaces)


[error] 48-48: trailing spaces (trailing-spaces)


[error] 77-77: trailing spaces (trailing-spaces)


[error] 93-93: trailing spaces (trailing-spaces)


[error] 94-94: trailing spaces (trailing-spaces)


[error] 96-96: trailing spaces (trailing-spaces)


[error] 112-112: trailing spaces (trailing-spaces)


[error] 126-126: trailing spaces (trailing-spaces)


[error] 129-129: trailing spaces (trailing-spaces)


[error] 141-141: trailing spaces (trailing-spaces)


[error] 151-151: trailing spaces (trailing-spaces)


[error] 154-154: trailing spaces (trailing-spaces)


[error] 157-157: trailing spaces (trailing-spaces)


[error] 160-160: trailing spaces (trailing-spaces)


[error] 163-163: trailing spaces (trailing-spaces)


[error] 164-164: no new line character at the end of file (new-line-at-end-of-file)


[error] 164-164: trailing spaces (trailing-spaces)

Additional comments not posted (4)
egov-persister/statement-persister.yml (4)

1-12: Ensure consistency in indentation and alignment for better readability and to avoid parsing errors in YAML files.


47-47: Remove trailing spaces and ensure there's a newline at the end of the file to adhere to best YAML practices and to prevent parsing issues.

Also applies to: 77-77, 93-93, 94-94, 96-96, 112-112, 126-126, 129-129, 141-141, 151-151, 154-154, 157-157, 160-160, 163-163

Tools
yamllint

[error] 47-47: trailing spaces (trailing-spaces)


164-164: Ensure there's a newline at the end of the file to adhere to best YAML practices and to prevent parsing issues.

Tools
yamllint

[error] 164-164: no new line character at the end of file (new-line-at-end-of-file)


[error] 164-164: trailing spaces (trailing-spaces)


16-16: Ensure that your SQL queries are protected against SQL injection. Consider using parameterized queries if not already handled by the underlying framework.

Also applies to: 35-35, 57-57, 87-87, 99-99, 131-131

Verification successful

The SQL queries in egov-persister/statement-persister.yml are using placeholders for parameters, indicating that they are parameterized and thus protected against SQL injection.

  • Lines: 16, 35, 57, 87, 99, 131
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify if parameterized queries are used to prevent SQL injection.

# Test: Search for SQL query usage. Expect: Only occurances of parameterized queries.
rg --type yaml $'query: INSERT INTO|query: UPDATE' egov-persister/statement-persister.yml

Length of output: 1483

Copy link

@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: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 4b3acf6 and 284aa94.

Files selected for processing (1)
  • egov-persister/statement-persister.yml (1 hunks)
Additional context used
yamllint
egov-persister/statement-persister.yml

[error] 47-47: trailing spaces (trailing-spaces)


[error] 48-48: trailing spaces (trailing-spaces)


[error] 77-77: trailing spaces (trailing-spaces)


[error] 93-93: trailing spaces (trailing-spaces)


[error] 94-94: trailing spaces (trailing-spaces)


[error] 96-96: trailing spaces (trailing-spaces)


[error] 112-112: trailing spaces (trailing-spaces)


[error] 126-126: trailing spaces (trailing-spaces)


[error] 127-127: trailing spaces (trailing-spaces)


[error] 130-130: trailing spaces (trailing-spaces)


[error] 142-142: trailing spaces (trailing-spaces)


[error] 152-152: trailing spaces (trailing-spaces)


[error] 155-155: trailing spaces (trailing-spaces)


[error] 158-158: trailing spaces (trailing-spaces)


[error] 161-161: trailing spaces (trailing-spaces)


[error] 164-164: trailing spaces (trailing-spaces)


[error] 165-165: no new line character at the end of file (new-line-at-end-of-file)


[error] 165-165: trailing spaces (trailing-spaces)

Additional comments not posted (3)
egov-persister/statement-persister.yml (3)

1-12: Ensure consistency in indentation and alignment for better readability and to avoid parsing errors in YAML files.


16-165: Review the newly added database queries and JSON mappings for statement details, ensuring they are correctly formed and follow best practices for security and performance.

Tools
yamllint

[error] 47-47: trailing spaces (trailing-spaces)


[error] 48-48: trailing spaces (trailing-spaces)


[error] 77-77: trailing spaces (trailing-spaces)


[error] 93-93: trailing spaces (trailing-spaces)


[error] 94-94: trailing spaces (trailing-spaces)


[error] 96-96: trailing spaces (trailing-spaces)


[error] 112-112: trailing spaces (trailing-spaces)


[error] 126-126: trailing spaces (trailing-spaces)


[error] 127-127: trailing spaces (trailing-spaces)


[error] 130-130: trailing spaces (trailing-spaces)


[error] 142-142: trailing spaces (trailing-spaces)


[error] 152-152: trailing spaces (trailing-spaces)


[error] 155-155: trailing spaces (trailing-spaces)


[error] 158-158: trailing spaces (trailing-spaces)


[error] 161-161: trailing spaces (trailing-spaces)


[error] 164-164: trailing spaces (trailing-spaces)


[error] 165-165: no new line character at the end of file (new-line-at-end-of-file)


[error] 165-165: trailing spaces (trailing-spaces)


165-165: Ensure there's a newline at the end of the file to adhere to best YAML practices and to prevent parsing issues.

Tools
yamllint

[error] 165-165: no new line character at the end of file (new-line-at-end-of-file)


[error] 165-165: trailing spaces (trailing-spaces)

Copy link

@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: 2

Outside diff range and nitpick comments (1)
egov-persister/statement-persister.yml (1)

1-165: Ensure consistent use of spaces around colons and alignment of properties.

In YAML, consistency in formatting such as spaces around colons and alignment of properties is crucial for readability and to avoid parsing errors. Consider applying a formatter or linter to maintain this consistency throughout the file.

Tools
yamllint

[error] 47-47: trailing spaces (trailing-spaces)


[error] 48-48: trailing spaces (trailing-spaces)


[error] 77-77: trailing spaces (trailing-spaces)


[error] 93-93: trailing spaces (trailing-spaces)


[error] 94-94: trailing spaces (trailing-spaces)


[error] 96-96: trailing spaces (trailing-spaces)


[error] 112-112: trailing spaces (trailing-spaces)


[error] 126-126: trailing spaces (trailing-spaces)


[error] 127-127: trailing spaces (trailing-spaces)


[error] 130-130: trailing spaces (trailing-spaces)


[error] 142-142: trailing spaces (trailing-spaces)


[error] 152-152: trailing spaces (trailing-spaces)


[error] 155-155: trailing spaces (trailing-spaces)


[error] 158-158: trailing spaces (trailing-spaces)


[error] 161-161: trailing spaces (trailing-spaces)


[error] 164-164: trailing spaces (trailing-spaces)


[error] 165-165: no new line character at the end of file (new-line-at-end-of-file)


[error] 165-165: trailing spaces (trailing-spaces)

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 284aa94 and 78b802c.

Files selected for processing (1)
  • egov-persister/statement-persister.yml (1 hunks)
Additional context used
yamllint
egov-persister/statement-persister.yml

[error] 47-47: trailing spaces (trailing-spaces)


[error] 48-48: trailing spaces (trailing-spaces)


[error] 77-77: trailing spaces (trailing-spaces)


[error] 93-93: trailing spaces (trailing-spaces)


[error] 94-94: trailing spaces (trailing-spaces)


[error] 96-96: trailing spaces (trailing-spaces)


[error] 112-112: trailing spaces (trailing-spaces)


[error] 126-126: trailing spaces (trailing-spaces)


[error] 127-127: trailing spaces (trailing-spaces)


[error] 130-130: trailing spaces (trailing-spaces)


[error] 142-142: trailing spaces (trailing-spaces)


[error] 152-152: trailing spaces (trailing-spaces)


[error] 155-155: trailing spaces (trailing-spaces)


[error] 158-158: trailing spaces (trailing-spaces)


[error] 161-161: trailing spaces (trailing-spaces)


[error] 164-164: trailing spaces (trailing-spaces)


[error] 165-165: no new line character at the end of file (new-line-at-end-of-file)


[error] 165-165: trailing spaces (trailing-spaces)

Additional comments not posted (3)
egov-persister/statement-persister.yml (3)

35-55: Ensure the JSON path wildcards correctly capture all necessary fields.

The use of wildcards in JSON paths must be carefully managed to ensure that they capture all necessary fields without missing any. Confirm that the wildcard usage aligns with the expected data structure.

Verification successful

The JSON path wildcards and static paths are correctly capturing all necessary fields, and the query structure matches the JSON paths. No issues were found.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the correct use of wildcards in JSON paths.
# Expect: Wildcards to capture all necessary fields.
cat egov-persister/statement-persister.yml | grep -A 20 "INSERT INTO eg_statement_sor_details"

Length of output: 1989

Tools
yamllint

[error] 47-47: trailing spaces (trailing-spaces)


[error] 48-48: trailing spaces (trailing-spaces)


16-32: Confirm the accuracy of JSON paths and SQL parameters.

The JSON paths and SQL parameters should match the structure expected by the database schema and the incoming JSON data. Verify that all fields are correctly mapped and that the SQL query uses the correct placeholders.

Verification successful

The JSON paths and SQL parameters in the provided snippet are correctly mapped and use the appropriate placeholders. The structure and data types are consistent with the expected database schema and incoming JSON data.

  • Lines in egov-persister/statement-persister.yml:
    • id, tenantid, target_id, statement_type, basic_sor_details, createdby, lastmodifiedby, createdtime, lastmodifiedtime are correctly mapped.
    • JSON paths are accurate and follow a consistent pattern.
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the JSON paths and SQL parameters match the expected database schema and incoming JSON data.
# Expect: Correct mappings and placeholders in the SQL query.
cat egov-persister/statement-persister.yml | grep -A 20 "INSERT INTO eg_statement"

Length of output: 4586


87-95: Verify the correctness of the UPDATE operation for statements.

Ensure that the UPDATE operation correctly targets the intended fields and uses appropriate where clauses to prevent unintended updates.

Verification successful

The verification results indicate that the UPDATE operation in egov-persister/statement-persister.yml correctly targets the intended fields and uses an appropriate WHERE clause to prevent unintended updates. The JSON paths in jsonMaps also correctly map to the fields being updated.

  • The fields basic_sor_details, lastmodifiedby, lastmodifiedtime, and id are referenced correctly.
  • The JSON paths used in jsonMaps correctly map to the fields being updated.
  • The id field is correctly used in the WHERE clause.

No issues were found with the UPDATE operation.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the correctness of the UPDATE operation for statements.
# Expect: Correct targeting of fields and appropriate where clauses.
cat egov-persister/statement-persister.yml | grep -A 10 "UPDATE eg_statement SET"

Length of output: 490



Script:

#!/bin/bash
# Check for the existence of fields in the eg_statement table schema
# 1. Find the schema definition file for the eg_statement table
# 2. Verify the existence of the fields: basic_sor_details, lastmodifiedby, lastmodifiedtime, and id

# Find the schema definition files
fd -e sql -e yml -e yaml

# Check the schema for the eg_statement table
grep -i -E 'basic_sor_details|lastmodifiedby|lastmodifiedtime|id' $(fd -e sql -e yml -e yaml | grep -i 'eg_statement')

Length of output: 10234


Script:

#!/bin/bash
# Verify the correctness of JSON paths in `jsonMaps`
# 1. Ensure that the JSON paths used in the jsonMaps correctly map to the fields being updated.

# Find all JSON path references in the statement-persister.yml file
grep -o -E '\$.statement\.[a-zA-Z0-9.]+' egov-persister/statement-persister.yml

Length of output: 1439


Script:

#!/bin/bash
# Ensure the `id` field is correctly used in the WHERE clause
# 1. Confirm that the WHERE clause uses the `id` field correctly to prevent unintended updates.

# Extract the WHERE clause from the statement-persister.yml file
grep -o -P '(?<=WHERE ).*(?=;)' egov-persister/statement-persister.yml

Length of output: 79

Tools
yamllint

[error] 93-93: trailing spaces (trailing-spaces)


[error] 94-94: trailing spaces (trailing-spaces)

Comment on lines +99 to +131
- query: INSERT INTO eg_statement_sor_details(id,tenantid,statement_id,sorid,basic_sor_details,additional_details,is_active,createdby,lastmodifiedby,createdtime,lastmodifiedtime) VALUES (?,?,?,?,?,?,?,?,?,?,?) ON CONFLICT (id) DO UPDATE SET basic_sor_details=?, additional_details=?,is_active=?,lastmodifiedby = ?, lastmodifiedtime = ?;
basePath: $.statement.sorDetails.*
jsonMaps:
- jsonPath: $.sorDetails.*.id
- jsonPath: $.sorDetails.*.tenantId
- jsonPath: $.statement.id
- jsonPath: $.sorDetails.*.sorId
- jsonPath: $.sorDetails.*.basicSorDetails
type: JSON
dbType: JSONB
- jsonPath: $.sorDetails.*.additionalDetails
type: JSON
dbType: JSONB
- jsonPath: $.sorDetails.*.isActive
- jsonPath: $.statement.auditDetails.lastModifiedBy

- jsonPath: $.statement.auditDetails.lastModifiedBy

- jsonPath: $.statement.auditDetails.lastModifiedTime

- jsonPath: $.statement.auditDetails.lastModifiedTime

- jsonPath: $.sorDetails.*.basicSorDetails
type: JSON
dbType: JSONB
- jsonPath: $.sorDetails.*.additionalDetails
type: JSON
dbType: JSONB
- jsonPath: $.sorDetails.*.isActive
- jsonPath: $.statement.auditDetails.lastModifiedBy

- jsonPath: $.statement.auditDetails.lastModifiedTime

Copy link

Choose a reason for hiding this comment

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

Tip

Codebase Verification

The recent script outputs provide valuable insights into the handling of JSON fields and the presence of repeated jsonPath entries.

Observations:

  1. JSON and JSONB Types:

    • The type: JSON and dbType: JSONB are correctly used in the configuration to handle JSON data types, ensuring proper storage and retrieval in the database.
  2. Repeated jsonPath Entries:

    • There are multiple repeated jsonPath entries, such as:
      • $.statement.auditDetails.lastModifiedBy
      • $.statement.auditDetails.lastModifiedTime
      • $.sorDetails.*.additionalDetails
      • $.sorDetails.*.basicSorDetails
    • These repetitions could lead to potential issues or unintended behavior during the processing of these paths.

Actionable Follow-Up:

To ensure the correctness and avoid potential issues, the repeated jsonPath entries should be reviewed and resolved. Each jsonPath should be unique within its context to prevent conflicts and ensure accurate data mapping.

  • Review and resolve the repeated jsonPath entries:
    • $.statement.auditDetails.lastModifiedBy
    • $.statement.auditDetails.lastModifiedTime
    • $.sorDetails.*.additionalDetails
    • $.sorDetails.*.basicSorDetails

Category:

Analysis chain

Ensure correct handling of conflict resolution in INSERT/UPDATE operations.

The conditional INSERT/UPDATE operations should correctly handle conflicts to ensure data consistency. Verify the conflict resolution logic and the fields involved in conflict checks.


The provided output shows the conditional INSERT/UPDATE operations for two tables: eg_statement_sor_details and eg_statement_sor_line_items. Both queries use the ON CONFLICT clause to handle conflicts on the id field by updating specific columns.

Observations:

  1. Conflict Resolution Logic:

    • For eg_statement_sor_details, the conflict resolution updates basic_sor_details, additional_details, is_active, lastmodifiedby, and lastmodifiedtime.
    • For eg_statement_sor_line_items, the conflict resolution updates basic_sor_details, additional_details, lastmodifiedby, and lastmodifiedtime.
  2. Fields Involved in Conflict Checks:

    • The conflict check is based on the id field for both tables.
  3. Data Consistency:

    • The fields updated in case of conflict ensure that the essential details (basic_sor_details, additional_details, is_active for sor_details, and lastmodifiedby, lastmodifiedtime for both) are kept current.

Next Steps:

To ensure there are no overlooked issues, let's verify the handling of JSON fields and their types, as well as the correctness of the repeated jsonPath entries.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify correct handling of conflict resolution in INSERT/UPDATE operations.
# Expect: Correct conflict resolution logic and fields involved.
cat egov-persister/statement-persister.yml | grep -A 30 "ON CONFLICT"

Length of output: 2695



Script:

#!/bin/bash
# Verify the use of JSON and JSONB types in the statement-persister.yml
grep -A 5 "type: JSON" egov-persister/statement-persister.yml

# Verify if there are any repeated jsonPath entries
grep -E "jsonPath:" egov-persister/statement-persister.yml | sort | uniq -d

Length of output: 3137

Tools
yamllint

[error] 112-112: trailing spaces (trailing-spaces)


[error] 126-126: trailing spaces (trailing-spaces)


[error] 127-127: trailing spaces (trailing-spaces)


[error] 130-130: trailing spaces (trailing-spaces)

Copy link

@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: 6

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 78b802c and 4262138.

Files selected for processing (1)
  • egov-persister/statement-persister.yml (1 hunks)
Additional context used
yamllint
egov-persister/statement-persister.yml

[error] 48-48: trailing spaces (trailing-spaces)


[error] 49-49: trailing spaces (trailing-spaces)


[error] 78-78: trailing spaces (trailing-spaces)


[error] 94-94: trailing spaces (trailing-spaces)


[error] 95-95: trailing spaces (trailing-spaces)


[error] 97-97: trailing spaces (trailing-spaces)


[error] 113-113: trailing spaces (trailing-spaces)


[error] 127-127: trailing spaces (trailing-spaces)


[error] 128-128: trailing spaces (trailing-spaces)


[error] 131-131: trailing spaces (trailing-spaces)


[error] 143-143: trailing spaces (trailing-spaces)


[error] 153-153: trailing spaces (trailing-spaces)


[error] 156-156: trailing spaces (trailing-spaces)


[error] 159-159: trailing spaces (trailing-spaces)


[error] 162-162: trailing spaces (trailing-spaces)


[error] 165-165: trailing spaces (trailing-spaces)


[error] 166-166: no new line character at the end of file (new-line-at-end-of-file)


[error] 166-166: trailing spaces (trailing-spaces)

Additional comments not posted (1)
egov-persister/statement-persister.yml (1)

100-100: The ON CONFLICT clause is used correctly here to handle potential duplicate entries. Ensure the fields listed in the DO UPDATE SET are the ones intended to be updated in case of conflict.


- jsonPath: $.statement.auditDetails.createdTime

- jsonPath: $.statement.auditDetails.lastModifiedTime
Copy link

Choose a reason for hiding this comment

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

Remove trailing spaces to adhere to best YAML practices and prevent parsing issues.

- lastModifiedTime    
+ lastModifiedTime
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- jsonPath: $.statement.auditDetails.lastModifiedTime
- jsonPath: $.statement.auditDetails.lastModifiedTime
Tools
yamllint

[error] 78-78: trailing spaces (trailing-spaces)

transactionCodeJsonPath: $.id
auditAttributeBasePath: $.statement
queryMaps:
- query: INSERT INTO eg_statement(id,tenantid,target_id,statement_type,basic_sor_details,additional_details,createdby,lastmodifiedby,createdtime,lastmodifiedtime) VALUES (?,?,?,?,?,?,?,?,?);
Copy link

Choose a reason for hiding this comment

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

Ensure consistency in SQL query formatting for better readability.

- INSERT INTO eg_statement(id,tenantid,target_id,statement_type,basic_sor_details,additional_details,createdby,lastmodifiedby,createdtime,lastmodifiedtime) VALUES (?,?,?,?,?,?,?,?,?);
+ INSERT INTO eg_statement (id, tenantid, target_id, statement_type, basic_sor_details, additional_details, createdby, lastmodifiedby, createdtime, lastmodifiedtime) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?);
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- query: INSERT INTO eg_statement(id,tenantid,target_id,statement_type,basic_sor_details,additional_details,createdby,lastmodifiedby,createdtime,lastmodifiedtime) VALUES (?,?,?,?,?,?,?,?,?);
- query: INSERT INTO eg_statement (id, tenantid, target_id, statement_type, basic_sor_details, additional_details, createdby, lastmodifiedby, createdtime, lastmodifiedtime) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?);

Comment on lines +94 to +95
- jsonPath: $.statement.auditDetails.lastModifiedBy
- jsonPath: $.statement.auditDetails.lastModifiedTime
Copy link

Choose a reason for hiding this comment

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

Remove trailing spaces to adhere to best YAML practices and prevent parsing issues.

- lastModifiedBy 
+ lastModifiedBy
- lastModifiedTime 
+ lastModifiedTime
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- jsonPath: $.statement.auditDetails.lastModifiedBy
- jsonPath: $.statement.auditDetails.lastModifiedTime
- jsonPath: $.statement.auditDetails.lastModifiedBy
- jsonPath: $.statement.auditDetails.lastModifiedTime
Tools
yamllint

[error] 94-94: trailing spaces (trailing-spaces)


[error] 95-95: trailing spaces (trailing-spaces)

Copy link

@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: 5

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 4262138 and 4c1a31f.

Files selected for processing (1)
  • egov-persister/statement-persister.yml (1 hunks)
Additional context used
yamllint
egov-persister/statement-persister.yml

[error] 48-48: trailing spaces (trailing-spaces)


[error] 49-49: trailing spaces (trailing-spaces)


[error] 78-78: trailing spaces (trailing-spaces)


[error] 94-94: trailing spaces (trailing-spaces)


[error] 95-95: trailing spaces (trailing-spaces)


[error] 97-97: trailing spaces (trailing-spaces)


[error] 113-113: trailing spaces (trailing-spaces)


[error] 127-127: trailing spaces (trailing-spaces)


[error] 128-128: trailing spaces (trailing-spaces)


[error] 131-131: trailing spaces (trailing-spaces)


[error] 143-143: trailing spaces (trailing-spaces)


[error] 153-153: trailing spaces (trailing-spaces)


[error] 156-156: trailing spaces (trailing-spaces)


[error] 159-159: trailing spaces (trailing-spaces)


[error] 162-162: trailing spaces (trailing-spaces)


[error] 165-165: trailing spaces (trailing-spaces)


[error] 166-166: no new line character at the end of file (new-line-at-end-of-file)


[error] 166-166: trailing spaces (trailing-spaces)

Additional comments not posted (1)
egov-persister/statement-persister.yml (1)

94-95: Remove trailing spaces to adhere to YAML best practices.

- lastModifiedBy 
+ lastModifiedBy
- lastModifiedTime 
+ lastModifiedTime

Likely invalid or redundant comment.

Tools
yamllint

[error] 94-94: trailing spaces (trailing-spaces)


[error] 95-95: trailing spaces (trailing-spaces)

transactionCodeJsonPath: $.id
auditAttributeBasePath: $.statement
queryMaps:
- query: INSERT INTO eg_statement(id,tenantid,target_id,statement_type,basic_sor_details,additional_details,createdby,lastmodifiedby,createdtime,lastmodifiedtime) VALUES (?,?,?,?,?,?,?,?,?,?);
Copy link

Choose a reason for hiding this comment

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

Ensure SQL query formatting adheres to best practices for readability and avoid potential parsing errors.

- INSERT INTO eg_statement(id,tenantid,target_id,statement_type,basic_sor_details,additional_details,createdby,lastmodifiedby,createdtime,lastmodifiedtime) VALUES (?,?,?,?,?,?,?,?,?,?);
+ INSERT INTO eg_statement (id, tenantid, target_id, statement_type, basic_sor_details, additional_details, createdby, lastmodifiedby, createdtime, lastmodifiedtime) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?);
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- query: INSERT INTO eg_statement(id,tenantid,target_id,statement_type,basic_sor_details,additional_details,createdby,lastmodifiedby,createdtime,lastmodifiedtime) VALUES (?,?,?,?,?,?,?,?,?,?);
- query: INSERT INTO eg_statement (id, tenantid, target_id, statement_type, basic_sor_details, additional_details, createdby, lastmodifiedby, createdtime, lastmodifiedtime) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?);

dbType: JSONB
- jsonPath: $.sorDetails.*.additionalDetails
type: JSON
dbType: JSONB
Copy link

Choose a reason for hiding this comment

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

Remove trailing spaces to adhere to YAML best practices and prevent parsing issues.

- dbType: JSONB  
+ dbType: JSONB
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
dbType: JSONB
dbType: JSONB
Tools
yamllint

[error] 48-48: trailing spaces (trailing-spaces)





Copy link

Choose a reason for hiding this comment

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

Ensure there's a newline at the end of the file to adhere to YAML best practices and to prevent parsing issues.

- 
+ 

Committable suggestion was skipped due to low confidence.

Tools
yamllint

[error] 166-166: no new line character at the end of file (new-line-at-end-of-file)


[error] 166-166: trailing spaces (trailing-spaces)

Comment on lines +116 to +120
- jsonPath: $.statement.auditDetails.lastModifiedBy

- jsonPath: $.statement.auditDetails.lastModifiedTime

- jsonPath: $.statement.auditDetails.lastModifiedTime
Copy link

Choose a reason for hiding this comment

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

Duplicate entries for lastModifiedBy and lastModifiedTime need to be addressed. This could lead to data integrity issues.

- - jsonPath: $.statement.auditDetails.lastModifiedBy
- - jsonPath: $.statement.auditDetails.lastModifiedBy
- - jsonPath: $.statement.auditDetails.lastModifiedTime
- - jsonPath: $.statement.auditDetails.lastModifiedTime
+ - jsonPath: $.statement.auditDetails.lastModifiedBy
+ - jsonPath: $.statement.auditDetails.lastModifiedTime
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- jsonPath: $.statement.auditDetails.lastModifiedBy
- jsonPath: $.statement.auditDetails.lastModifiedTime
- jsonPath: $.statement.auditDetails.lastModifiedTime
- jsonPath: $.statement.auditDetails.lastModifiedBy
- jsonPath: $.statement.auditDetails.lastModifiedTime

Comment on lines +58 to +77
- query: INSERT INTO eg_statement_sor_line_items(id,tenantid,sorid,sortype,reference_id,basic_sor_details,additional_details,createdby,lastmodifiedby,createdtime,lastmodifiedtime) VALUES (?,?,?,?,?,?,?,?,?,?,?);
basePath: $.statement.sorDetails.*.lineItems.*
jsonMaps:
- jsonPath: $.lineItems.*.id
- jsonPath: $.statement.tenantId
- jsonPath: $.lineItems.*.sorId
- jsonPath: $.lineItems.*.sorType
- jsonPath: $.lineItems.*.referenceId
- jsonPath: $.lineItems.*.basicSorDetails
type: JSON
dbType: JSONB
- jsonPath: $.lineItems.*.additionalDetails
type: JSON
dbType: JSONB
- jsonPath: $.statement.auditDetails.createdBy

- jsonPath: $.statement.auditDetails.lastModifiedBy

- jsonPath: $.statement.auditDetails.createdTime

Copy link

Choose a reason for hiding this comment

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

Address duplicate mappings for lastModifiedBy and lastModifiedTime to ensure data integrity.

- - jsonPath: $.statement.auditDetails.lastModifiedBy
- - jsonPath: $.statement.auditDetails.lastModifiedBy
- - jsonPath: $.statement.auditDetails.lastModifiedTime
- - jsonPath: $.statement.auditDetails.lastModifiedTime
+ - jsonPath: $.statement.auditDetails.lastModifiedBy
+ - jsonPath: $.statement.auditDetails.lastModifiedTime
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- query: INSERT INTO eg_statement_sor_line_items(id,tenantid,sorid,sortype,reference_id,basic_sor_details,additional_details,createdby,lastmodifiedby,createdtime,lastmodifiedtime) VALUES (?,?,?,?,?,?,?,?,?,?,?);
basePath: $.statement.sorDetails.*.lineItems.*
jsonMaps:
- jsonPath: $.lineItems.*.id
- jsonPath: $.statement.tenantId
- jsonPath: $.lineItems.*.sorId
- jsonPath: $.lineItems.*.sorType
- jsonPath: $.lineItems.*.referenceId
- jsonPath: $.lineItems.*.basicSorDetails
type: JSON
dbType: JSONB
- jsonPath: $.lineItems.*.additionalDetails
type: JSON
dbType: JSONB
- jsonPath: $.statement.auditDetails.createdBy
- jsonPath: $.statement.auditDetails.lastModifiedBy
- jsonPath: $.statement.auditDetails.createdTime
- query: INSERT INTO eg_statement_sor_line_items(id,tenantid,sorid,sortype,reference_id,basic_sor_details,additional_details,createdby,lastmodifiedby,createdtime,lastmodifiedtime) VALUES (?,?,?,?,?,?,?,?,?,?,?);
basePath: $.statement.sorDetails.*.lineItems.*
jsonMaps:
- jsonPath: $.lineItems.*.id
- jsonPath: $.statement.tenantId
- jsonPath: $.lineItems.*.sorId
- jsonPath: $.lineItems.*.sorType
- jsonPath: $.lineItems.*.referenceId
- jsonPath: $.lineItems.*.basicSorDetails
type: JSON
dbType: JSONB
- jsonPath: $.lineItems.*.additionalDetails
type: JSON
dbType: JSONB
- jsonPath: $.statement.auditDetails.createdBy
- jsonPath: $.statement.auditDetails.lastModifiedBy
- jsonPath: $.statement.auditDetails.createdTime
- jsonPath: $.statement.auditDetails.lastModifiedTime

Copy link

@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: 2

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 4c1a31f and 0d1a696.

Files selected for processing (1)
  • egov-persister/statement-persister.yml (1 hunks)
Additional context used
yamllint
egov-persister/statement-persister.yml

[error] 50-50: trailing spaces (trailing-spaces)


[error] 51-51: trailing spaces (trailing-spaces)


[error] 80-80: trailing spaces (trailing-spaces)


[error] 96-96: trailing spaces (trailing-spaces)


[error] 97-97: trailing spaces (trailing-spaces)


[error] 99-99: trailing spaces (trailing-spaces)


[error] 115-115: trailing spaces (trailing-spaces)


[error] 129-129: trailing spaces (trailing-spaces)


[error] 130-130: trailing spaces (trailing-spaces)


[error] 133-133: trailing spaces (trailing-spaces)


[error] 145-145: trailing spaces (trailing-spaces)


[error] 155-155: trailing spaces (trailing-spaces)


[error] 158-158: trailing spaces (trailing-spaces)


[error] 161-161: trailing spaces (trailing-spaces)


[error] 164-164: trailing spaces (trailing-spaces)


[error] 167-167: trailing spaces (trailing-spaces)


[error] 168-168: no new line character at the end of file (new-line-at-end-of-file)


[error] 168-168: trailing spaces (trailing-spaces)

Additional comments not posted (3)
egov-persister/statement-persister.yml (3)

1-12: Ensure proper YAML structure and correct key-value associations.

The YAML structure appears correctly formatted with proper indentation, ensuring that the service maps are well-defined and logically organized.


84-99: Ensure SQL update operation is correctly defined and mappings are accurate.

The SQL update operation is well-defined, targeting specific fields for update based on the statement ID. Ensure that the JSON mappings are accurate and correspond to the fields being updated.

Tools
yamllint

[error] 96-96: trailing spaces (trailing-spaces)


[error] 97-97: trailing spaces (trailing-spaces)


[error] 99-99: trailing spaces (trailing-spaces)


16-35: Review SQL query and JSON mappings for correctness and efficiency.

The SQL query for inserting statement details is correctly formatted. However, ensure that all JSON paths used in the mappings are correctly specified and match the expected structure of the input JSON.

Verification successful

Review JSON paths in the provided snippet for consistency and correctness.

The provided snippet includes the following JSON paths:

  • $.statement.id
  • $.statement.tenantId
  • $.statement.targetId
  • $.statement.statementType
  • $.statement.basicSorDetails
  • $.statement.additionalDetails
  • $.statement.auditDetails.createdBy
  • $.statement.auditDetails.lastModifiedBy
  • $.statement.auditDetails.createdTime
  • $.statement.auditDetails.lastModifiedTime

From the output of the script, these paths are present and their counts are as follows:

  • $.statement.id (4 occurrences)
  • $.statement.tenantId (3 occurrences)
  • $.statement.targetId (1 occurrence)
  • $.statement.statementType (1 occurrence)
  • $.statement.basicSorDetails (2 occurrences)
  • $.statement.additionalDetails (1 occurrence)
  • $.statement.auditDetails.createdBy (3 occurrences)
  • $.statement.auditDetails.lastModifiedBy (9 occurrences)
  • $.statement.auditDetails.createdTime (3 occurrences)
  • $.statement.auditDetails.lastModifiedTime (5 occurrences)

All the JSON paths in the snippet are present in the output and appear to be used consistently.

Conclusion: The JSON paths used in the provided snippet are correctly specified and match the expected structure of the input JSON.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify all JSON paths match the expected input JSON structure.
grep -E 'jsonPath:' egov-persister/statement-persister.yml | sort | uniq -c

Length of output: 1572

Comment on lines +50 to +168
type: JSON
dbType: JSONB
- jsonPath: $.lineItems.*.additionalDetails
type: JSON
dbType: JSONB
- jsonPath: $.statement.auditDetails.createdBy

- jsonPath: $.statement.auditDetails.lastModifiedBy

- jsonPath: $.statement.auditDetails.createdTime

- jsonPath: $.statement.auditDetails.lastModifiedTime

- version: 1.0
name: statement
description: Update statement details in eg_statement table
fromTopic: update-analysis-statement
isTransaction: true
isAuditEnabled: true
module: STATEMENT
queryMaps:
- query: UPDATE eg_statement SET basic_sor_details = ?, lastmodifiedby = ?, lastmodifiedtime = ? WHERE id = ?;
basePath: $.statement
jsonMaps:
- jsonPath: $.statement.basicSorDetails
type: JSON
dbType: JSONB
- jsonPath: $.statement.auditDetails.lastModifiedBy
- jsonPath: $.statement.auditDetails.lastModifiedTime
- jsonPath: $.statement.id



- query: INSERT INTO eg_statement_sor_details(id,tenantid,statement_id,sorid,basic_sor_details,additional_details,is_active,createdby,lastmodifiedby,createdtime,lastmodifiedtime) VALUES (?,?,?,?,?,?,?,?,?,?,?) ON CONFLICT (id) DO UPDATE SET basic_sor_details=?, additional_details=?,is_active=?,lastmodifiedby = ?, lastmodifiedtime = ?;
basePath: $.statement.sorDetails.*
jsonMaps:
- jsonPath: $.sorDetails.*.id
- jsonPath: $.sorDetails.*.tenantId
- jsonPath: $.statement.id
- jsonPath: $.sorDetails.*.sorId
- jsonPath: $.sorDetails.*.basicSorDetails
type: JSON
dbType: JSONB
- jsonPath: $.sorDetails.*.additionalDetails
type: JSON
dbType: JSONB
- jsonPath: $.sorDetails.*.isActive
- jsonPath: $.statement.auditDetails.lastModifiedBy

- jsonPath: $.statement.auditDetails.lastModifiedBy

- jsonPath: $.statement.auditDetails.lastModifiedTime

- jsonPath: $.statement.auditDetails.lastModifiedTime

- jsonPath: $.sorDetails.*.basicSorDetails
type: JSON
dbType: JSONB
- jsonPath: $.sorDetails.*.additionalDetails
type: JSON
dbType: JSONB
- jsonPath: $.sorDetails.*.isActive
- jsonPath: $.statement.auditDetails.lastModifiedBy

- jsonPath: $.statement.auditDetails.lastModifiedTime

- query: INSERT INTO eg_statement_sor_line_items(id,tenantid,sorid,sortype,reference_id,basic_sor_details,additional_details,createdby,lastmodifiedby,createdtime,lastmodifiedtime) VALUES (?,?,?,?,?,?,?,?,?,?,?) ON CONFLICT (id) DO UPDATE SET basic_sor_details=?, additional_details=?,lastmodifiedby = ?, lastmodifiedtime = ?;
basePath: $.statement.sorDetails.*.lineItems.*
jsonMaps:
- jsonPath: $.lineItems.*.id
- jsonPath: $.statement.tenantId
- jsonPath: $.lineItems.*.sorId
- jsonPath: $.lineItems.*.sorType
- jsonPath: $.lineItems.*.referenceId
- jsonPath: $.lineItems.*.basicSorDetails
type: JSON
dbType: JSONB
- jsonPath: $.lineItems.*.additionalDetails
type: JSON
dbType: JSONB
- jsonPath: $.statement.auditDetails.lastModifiedBy

- jsonPath: $.statement.auditDetails.lastModifiedBy

- jsonPath: $.statement.auditDetails.lastModifiedTime

- jsonPath: $.statement.auditDetails.lastModifiedTime
- jsonPath: $.lineItems.*.basicSorDetails
type: JSON
dbType: JSONB
- jsonPath: $.lineItems.*.additionalDetails
type: JSON
dbType: JSONB
- jsonPath: $.statement.auditDetails.lastModifiedBy

- jsonPath: $.statement.auditDetails.lastModifiedTime




Copy link

Choose a reason for hiding this comment

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

Remove trailing spaces and ensure newline at end of file.

Trailing spaces can cause issues in YAML parsing and should be removed for cleaner code. Also, ensure there is a newline at the end of the file to comply with POSIX standards.

- dbType: JSONB  
+ dbType: JSONB
- dbType: JSONB    
+ dbType: JSONB
- lastModifiedTime    
+ lastModifiedTime
- lastModifiedBy 
+ lastModifiedBy
- lastModifiedTime 
+ lastModifiedTime
- lastModifiedTime    
+ lastModifiedTime
- dbType: JSONB  
+ dbType: JSONB
- lastModifiedTime 
+ lastModifiedTime
- dbType: JSONB  
+ dbType: JSONB
- dbType: JSONB  
+ dbType: JSONB
- lastModifiedTime  
+ lastModifiedTime
- lastModifiedTime  
+ lastModifiedTime
- 
+ 
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
dbType: JSONB
- jsonPath: $.sorDetails.*.isActive
- jsonPath: $.statement.auditDetails.createdBy
- jsonPath: $.statement.auditDetails.lastModifiedBy
- jsonPath: $.statement.auditDetails.createdTime
- jsonPath: $.statement.auditDetails.lastModifiedTime
- query: INSERT INTO eg_statement_sor_line_items(id,tenantid,sorid,sortype,reference_id,basic_sor_details,additional_details,createdby,lastmodifiedby,createdtime,lastmodifiedtime) VALUES (?,?,?,?,?,?,?,?,?,?,?);
basePath: $.statement.sorDetails.*.lineItems.*
jsonMaps:
- jsonPath: $.lineItems.*.id
- jsonPath: $.statement.tenantId
- jsonPath: $.lineItems.*.sorId
- jsonPath: $.lineItems.*.sorType
- jsonPath: $.lineItems.*.referenceId
- jsonPath: $.lineItems.*.basicSorDetails
type: JSON
dbType: JSONB
- jsonPath: $.lineItems.*.additionalDetails
type: JSON
dbType: JSONB
- jsonPath: $.statement.auditDetails.createdBy
- jsonPath: $.statement.auditDetails.lastModifiedBy
- jsonPath: $.statement.auditDetails.createdTime
- jsonPath: $.statement.auditDetails.lastModifiedTime
- version: 1.0
name: statement
description: Update statement details in eg_statement table
fromTopic: update-analysis-statement
isTransaction: true
isAuditEnabled: true
module: STATEMENT
queryMaps:
- query: UPDATE eg_statement SET basic_sor_details = ?, lastmodifiedby = ?, lastmodifiedtime = ? WHERE id = ?;
basePath: $.statement
jsonMaps:
- jsonPath: $.statement.basicSorDetails
type: JSON
dbType: JSONB
- jsonPath: $.statement.auditDetails.lastModifiedBy
- jsonPath: $.statement.auditDetails.lastModifiedTime
- jsonPath: $.statement.id
- query: INSERT INTO eg_statement_sor_details(id,tenantid,statement_id,sorid,basic_sor_details,additional_details,is_active,createdby,lastmodifiedby,createdtime,lastmodifiedtime) VALUES (?,?,?,?,?,?,?,?,?,?,?) ON CONFLICT (id) DO UPDATE SET basic_sor_details=?, additional_details=?,is_active=?,lastmodifiedby = ?, lastmodifiedtime = ?;
basePath: $.statement.sorDetails.*
jsonMaps:
- jsonPath: $.sorDetails.*.id
- jsonPath: $.sorDetails.*.tenantId
- jsonPath: $.statement.id
- jsonPath: $.sorDetails.*.sorId
- jsonPath: $.sorDetails.*.basicSorDetails
type: JSON
dbType: JSONB
- jsonPath: $.sorDetails.*.additionalDetails
type: JSON
dbType: JSONB
- jsonPath: $.sorDetails.*.isActive
- jsonPath: $.statement.auditDetails.lastModifiedBy
- jsonPath: $.statement.auditDetails.lastModifiedBy
- jsonPath: $.statement.auditDetails.lastModifiedTime
- jsonPath: $.statement.auditDetails.lastModifiedTime
- jsonPath: $.sorDetails.*.basicSorDetails
type: JSON
dbType: JSONB
- jsonPath: $.sorDetails.*.additionalDetails
type: JSON
dbType: JSONB
- jsonPath: $.sorDetails.*.isActive
- jsonPath: $.statement.auditDetails.lastModifiedBy
- jsonPath: $.statement.auditDetails.lastModifiedTime
- query: INSERT INTO eg_statement_sor_line_items(id,tenantid,sorid,sortype,reference_id,basic_sor_details,additional_details,createdby,lastmodifiedby,createdtime,lastmodifiedtime) VALUES (?,?,?,?,?,?,?,?,?,?,?) ON CONFLICT (id) DO UPDATE SET basic_sor_details=?, additional_details=?,lastmodifiedby = ?, lastmodifiedtime = ?;
basePath: $.statement.sorDetails.*.lineItems.*
jsonMaps:
- jsonPath: $.lineItems.*.id
- jsonPath: $.statement.tenantId
- jsonPath: $.lineItems.*.sorId
- jsonPath: $.lineItems.*.sorType
- jsonPath: $.lineItems.*.referenceId
- jsonPath: $.lineItems.*.basicSorDetails
type: JSON
dbType: JSONB
- jsonPath: $.lineItems.*.additionalDetails
type: JSON
dbType: JSONB
- jsonPath: $.statement.auditDetails.lastModifiedBy
- jsonPath: $.statement.auditDetails.lastModifiedBy
- jsonPath: $.statement.auditDetails.lastModifiedTime
- jsonPath: $.statement.auditDetails.lastModifiedTime
- jsonPath: $.lineItems.*.basicSorDetails
type: JSON
dbType: JSONB
- jsonPath: $.lineItems.*.additionalDetails
type: JSON
dbType: JSONB
- jsonPath: $.statement.auditDetails.lastModifiedBy
- jsonPath: $.statement.auditDetails.lastModifiedTime
dbType: JSONB
- jsonPath: $.sorDetails.*.isActive
- jsonPath: $.statement.auditDetails.createdBy
- jsonPath: $.statement.auditDetails.lastModifiedBy
- jsonPath: $.statement.auditDetails.createdTime
- jsonPath: $.statement.auditDetails.lastModifiedTime
- query: INSERT INTO eg_statement_sor_line_items(id,tenantid,sorid,sortype,reference_id,basic_sor_details,additional_details,createdby,lastmodifiedby,createdtime,lastmodifiedtime) VALUES (?,?,?,?,?,?,?,?,?,?,?);
basePath: $.statement.sorDetails.*.lineItems.*
jsonMaps:
- jsonPath: $.lineItems.*.id
- jsonPath: $.statement.tenantId
- jsonPath: $.lineItems.*.sorId
- jsonPath: $.lineItems.*.sorType
- jsonPath: $.lineItems.*.referenceId
- jsonPath: $.lineItems.*.basicSorDetails
type: JSON
dbType: JSONB
- jsonPath: $.lineItems.*.additionalDetails
type: JSON
dbType: JSONB
- jsonPath: $.statement.auditDetails.createdBy
- jsonPath: $.statement.auditDetails.lastModifiedBy
- jsonPath: $.statement.auditDetails.createdTime
- jsonPath: $.statement.auditDetails.lastModifiedTime
- version: 1.0
name: statement
description: Update statement details in eg_statement table
fromTopic: update-analysis-statement
isTransaction: true
isAuditEnabled: true
module: STATEMENT
queryMaps:
- query: UPDATE eg_statement SET basic_sor_details = ?, lastmodifiedby = ?, lastmodifiedtime = ? WHERE id = ?;
basePath: $.statement
jsonMaps:
- jsonPath: $.statement.basicSorDetails
type: JSON
dbType: JSONB
- jsonPath: $.statement.auditDetails.lastModifiedBy
- jsonPath: $.statement.auditDetails.lastModifiedTime
- jsonPath: $.statement.id
- query: INSERT INTO eg_statement_sor_details(id,tenantid,statement_id,sorid,basic_sor_details,additional_details,is_active,createdby,lastmodifiedby,createdtime,lastmodifiedtime) VALUES (?,?,?,?,?,?,?,?,?,?,?) ON CONFLICT (id) DO UPDATE SET basic_sor_details=?, additional_details=?,is_active=?,lastmodifiedby = ?, lastmodifiedtime = ?;
basePath: $.statement.sorDetails.*
jsonMaps:
- jsonPath: $.sorDetails.*.id
- jsonPath: $.sorDetails.*.tenantId
- jsonPath: $.statement.id
- jsonPath: $.sorDetails.*.sorId
- jsonPath: $.sorDetails.*.basicSorDetails
type: JSON
dbType: JSONB
- jsonPath: $.sorDetails.*.additionalDetails
type: JSON
dbType: JSONB
- jsonPath: $.sorDetails.*.isActive
- jsonPath: $.statement.auditDetails.lastModifiedBy
- jsonPath: $.statement.auditDetails.lastModifiedBy
- jsonPath: $.statement.auditDetails.lastModifiedTime
- jsonPath: $.statement.auditDetails.lastModifiedTime
- jsonPath: $.sorDetails.*.basicSorDetails
type: JSON
dbType: JSONB
- jsonPath: $.sorDetails.*.additionalDetails
type: JSON
dbType: JSONB
- jsonPath: $.sorDetails.*.isActive
- jsonPath: $.statement.auditDetails.lastModifiedBy
- jsonPath: $.statement.auditDetails.lastModifiedTime
- query: INSERT INTO eg_statement_sor_line_items(id,tenantid,sorid,sortype,reference_id,basic_sor_details,additional_details,createdby,lastmodifiedby,createdtime,lastmodifiedtime) VALUES (?,?,?,?,?,?,?,?,?,?,?) ON CONFLICT (id) DO UPDATE SET basic_sor_details=?, additional_details=?,lastmodifiedby = ?, lastmodifiedtime = ?;
basePath: $.statement.sorDetails.*.lineItems.*
jsonMaps:
- jsonPath: $.lineItems.*.id
- jsonPath: $.statement.tenantId
- jsonPath: $.lineItems.*.sorId
- jsonPath: $.lineItems.*.sorType
- jsonPath: $.lineItems.*.referenceId
- jsonPath: $.lineItems.*.basicSorDetails
type: JSON
dbType: JSONB
- jsonPath: $.lineItems.*.additionalDetails
type: JSON
dbType: JSONB
- jsonPath: $.statement.auditDetails.lastModifiedBy
- jsonPath: $.statement.auditDetails.lastModifiedBy
- jsonPath: $.statement.auditDetails.lastModifiedTime
- jsonPath: $.statement.auditDetails.lastModifiedTime
- jsonPath: $.lineItems.*.basicSorDetails
type: JSON
dbType: JSONB
- jsonPath: $.lineItems.*.additionalDetails
type: JSON
dbType: JSONB
- jsonPath: $.statement.auditDetails.lastModifiedBy
- jsonPath: $.statement.auditDetails.lastModifiedTime
Tools
yamllint

[error] 50-50: trailing spaces (trailing-spaces)


[error] 51-51: trailing spaces (trailing-spaces)


[error] 80-80: trailing spaces (trailing-spaces)


[error] 96-96: trailing spaces (trailing-spaces)


[error] 97-97: trailing spaces (trailing-spaces)


[error] 99-99: trailing spaces (trailing-spaces)


[error] 115-115: trailing spaces (trailing-spaces)


[error] 129-129: trailing spaces (trailing-spaces)


[error] 130-130: trailing spaces (trailing-spaces)


[error] 133-133: trailing spaces (trailing-spaces)


[error] 145-145: trailing spaces (trailing-spaces)


[error] 155-155: trailing spaces (trailing-spaces)


[error] 158-158: trailing spaces (trailing-spaces)


[error] 161-161: trailing spaces (trailing-spaces)


[error] 164-164: trailing spaces (trailing-spaces)


[error] 167-167: trailing spaces (trailing-spaces)


[error] 168-168: no new line character at the end of file (new-line-at-end-of-file)


[error] 168-168: trailing spaces (trailing-spaces)

Comment on lines +38 to +59
- query: INSERT INTO eg_statement_sor_details(id,tenantid,statement_id,sorid,basic_sor_details,additional_details,is_active,createdby,lastmodifiedby,createdtime,lastmodifiedtime) VALUES (?,?,?,?,?,?,?,?,?,?,?);
basePath: $.statement.sorDetails.*
jsonMaps:
- jsonPath: $.sorDetails.*.id
- jsonPath: $.sorDetails.*.tenantId
- jsonPath: $.statement.id
- jsonPath: $.sorDetails.*.sorId
- jsonPath: $.sorDetails.*.basicSorDetails
type: JSON
dbType: JSONB
- jsonPath: $.sorDetails.*.additionalDetails
type: JSON
dbType: JSONB
- jsonPath: $.sorDetails.*.isActive
- jsonPath: $.statement.auditDetails.createdBy

- jsonPath: $.statement.auditDetails.lastModifiedBy

- jsonPath: $.statement.auditDetails.createdTime

- jsonPath: $.statement.auditDetails.lastModifiedTime

Copy link

Choose a reason for hiding this comment

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

Tip

Codebase Verification

Identify and remove redundant JSON paths in statement-persister.yml.

The statement-persister.yml file contains multiple redundant occurrences of JSON paths such as $.statement.auditDetails.lastModifiedBy and $.statement.auditDetails.lastModifiedTime. These redundancies should be removed to ensure clarity and maintainability.

  • Lines with redundant JSON paths should be consolidated or removed to avoid confusion and potential errors.

Locations of redundant JSON paths:

  • $.statement.auditDetails.lastModifiedBy
    • Lines: 31, 54, 76, 96, 116, 118, 131, 149, 151, 162
  • $.statement.auditDetails.lastModifiedTime
    • Lines: 35, 58, 80, 97, 120, 122, 133, 153, 155, 164
Analysis chain

Check SQL query and JSON mappings for conflict resolution logic.

The conflict resolution logic in the SQL query appears robust, ensuring data consistency. However, ensure that the JSON mappings are accurately reflecting the database schema and that the JSON paths are correctly defined.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that JSON mappings accurately reflect the database schema.
grep -E 'jsonPath:' egov-persister/statement-persister.yml | sort | uniq -c

Length of output: 1572



Script:

#!/bin/bash
# Description: List all occurrences of JSON paths in the statement-persister.yml file to identify inconsistencies or redundancies.
grep -n 'jsonPath:' egov-persister/statement-persister.yml

Length of output: 3552



Script:

#!/bin/bash
# Description: Extract and display the context (surrounding lines) of each occurrence of the JSON paths to identify any unnecessary duplication or incorrect usage.
grep -C 2 'jsonPath:' egov-persister/statement-persister.yml

Length of output: 4889

Tools
yamllint

[error] 50-50: trailing spaces (trailing-spaces)


[error] 51-51: trailing spaces (trailing-spaces)

Copy link

@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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 0d1a696 and cfc1f86.

Files selected for processing (1)
  • health/egov-persister/project-factory-persister.yml (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • health/egov-persister/project-factory-persister.yml

Copy link

@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: 12

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between cfc1f86 and ddb19db.

Files selected for processing (1)
  • health/egov-persister/project-factory-persister.yml (1 hunks)
Additional context used
yamllint
health/egov-persister/project-factory-persister.yml

[warning] 30-30: too many blank lines

(3 > 2) (empty-lines)


[error] 105-105: trailing spaces

(trailing-spaces)


[warning] 109-109: too many blank lines

(4 > 2) (empty-lines)

type: JSON
dbType: JSONB
- jsonPath: $.generatedResource.*.campaignId
- jsonPath: $.generatedResource.*.auditId
Copy link

Choose a reason for hiding this comment

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

Remove trailing spaces.

There are trailing spaces on this line.

-            - jsonPath: $.generatedResource.*.auditId  
+            - jsonPath: $.generatedResource.*.auditId
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- jsonPath: $.generatedResource.*.auditId
- jsonPath: $.generatedResource.*.auditId
Tools
yamllint

[error] 105-105: trailing spaces

(trailing-spaces)

Comment on lines +32 to +37
name: UpdateResourceDetails
description: Update resource details in the eg_cm_resource_details table
fromTopic: update-resource-details
isTransaction: true
queryMaps:
- query: UPDATE health.eg_cm_resource_details SET "status" = ?, processedFileStoreId = ?, lastModifiedBy = ?, lastModifiedTime = ?,additionalDetails = ? WHERE id = ?;
Copy link

Choose a reason for hiding this comment

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

Consider adding error handling for SQL operations.

The UpdateResourceDetails mapping looks comprehensive. However, consider adding explicit error handling for cases where the UPDATE might fail due to constraints or other SQL errors.

-        - query: UPDATE health.eg_cm_resource_details SET "status" = ?, processedFileStoreId = ?, lastModifiedBy = ?, lastModifiedTime = ?,additionalDetails = ? WHERE id = ?;
+        - query: UPDATE health.eg_cm_resource_details SET "status" = ?, processedFileStoreId = ?, lastModifiedBy = ?, lastModifiedTime = ?,additionalDetails = ? WHERE id = ? ON CONFLICT (id) DO NOTHING;

Committable suggestion was skipped due to low confidence.

Comment on lines +111 to +116
name: UpdateForGenerateApiResources
description: Update Api resource in the eg_cm_generated_resource_details table
fromTopic: update-generated-resource-details
isTransaction: true
queryMaps:
- query: UPDATE health.eg_cm_generated_resource_details SET status = ?,count=?, lastModifiedby =? , lastModifiedtime = ? , fileStoreid= ?, additionalDetails= ? WHERE id= ?;
Copy link

Choose a reason for hiding this comment

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

Consider adding error handling for SQL operations.

The UpdateForGenerateApiResources mapping looks comprehensive. However, consider adding explicit error handling for cases where the UPDATE might fail due to constraints or other SQL errors.

-        - query: UPDATE health.eg_cm_generated_resource_details SET status = ?,count=?, lastModifiedby =? , lastModifiedtime = ? , fileStoreid= ?, additionalDetails= ? WHERE id= ?;
+        - query: UPDATE health.eg_cm_generated_resource_details SET status = ?,count=?, lastModifiedby =? , lastModifiedtime = ? , fileStoreid= ?, additionalDetails= ? WHERE id= ? ON CONFLICT (id) DO NOTHING;

Committable suggestion was skipped due to low confidence.

Comment on lines +226 to +231
name: UpdateProcessTrack
description: Update process track in the eg_cm_campaign_process table
fromTopic: update-process-track
isTransaction: true
queryMaps:
- query: UPDATE health.eg_cm_campaign_process SET campaignId = ?, "type" = ?, "status" = ?,details = ?,createdtime = ?,lastmodifiedtime = ?,additionaldetails = ? WHERE id = ?;
Copy link

Choose a reason for hiding this comment

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

Consider adding error handling for SQL operations.

The UpdateProcessTrack mapping looks comprehensive. However, consider adding explicit error handling for cases where the UPDATE might fail due to constraints or other SQL errors.

-        - query: UPDATE health.eg_cm_campaign_process SET campaignId = ?, "type" = ?, "status" = ?,details = ?,createdtime = ?,lastmodifiedtime = ?,additionaldetails = ? WHERE id = ?;
+        - query: UPDATE health.eg_cm_campaign_process SET campaignId = ?, "type" = ?, "status" = ?,details = ?,createdtime = ?,lastmodifiedtime = ?,additionaldetails = ? WHERE id = ? ON CONFLICT (id) DO NOTHING;

Committable suggestion was skipped due to low confidence.


Consider adding error handling for SQL operations.

The UpdateProcessTrack mapping looks comprehensive. However, consider adding explicit error handling for cases where the UPDATE might fail due to constraints or other SQL errors.

-        - query: UPDATE health.eg_cm_campaign_process SET campaignId = ?, "type" = ?, "status" = ?,details = ?,createdtime = ?,lastmodifiedtime = ?,additionaldetails = ? WHERE id = ?;
+        - query: UPDATE health.eg_cm_campaign_process SET campaignId = ?, "type" = ?, "status" = ?,details = ?,createdtime = ?,lastmodifiedtime = ?,additionaldetails = ? WHERE id = ? ON CONFLICT (id) DO NOTHING;

Committable suggestion was skipped due to low confidence.

Comment on lines 82 to 87
name: CreateForGenerateApiResources
description: Create Api resource in the eg_cm_generated_resource_details table
fromTopic: create-generated-resource-details
isTransaction: true
queryMaps:
- query: INSERT INTO health.eg_cm_generated_resource_details (id,filestoreid, type,"status",count,tenantid,hierarchyType, createdby, createdtime, lastmodifiedby, lastmodifiedtime, additionaldetails,campaignid,auditid) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?);
Copy link

Choose a reason for hiding this comment

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

Consider adding error handling for SQL operations.

The CreateForGenerateApiResources mapping looks comprehensive. However, consider adding explicit error handling for cases where the INSERT might fail due to unique constraints or other SQL errors.

-        - query: INSERT INTO health.eg_cm_generated_resource_details (id,filestoreid, type,"status",count,tenantid,hierarchyType, createdby, createdtime, lastmodifiedby, lastmodifiedtime, additionaldetails,campaignid,auditid) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?);
+        - query: INSERT INTO health.eg_cm_generated_resource_details (id,filestoreid, type,"status",count,tenantid,hierarchyType, createdby, createdtime, lastmodifiedby, lastmodifiedtime, additionaldetails,campaignid,auditid) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?) ON CONFLICT (id) DO NOTHING;
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
name: CreateForGenerateApiResources
description: Create Api resource in the eg_cm_generated_resource_details table
fromTopic: create-generated-resource-details
isTransaction: true
queryMaps:
- query: INSERT INTO health.eg_cm_generated_resource_details (id,filestoreid, type,"status",count,tenantid,hierarchyType, createdby, createdtime, lastmodifiedby, lastmodifiedtime, additionaldetails,campaignid,auditid) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?);
name: CreateForGenerateApiResources
description: Create Api resource in the eg_cm_generated_resource_details table
fromTopic: create-generated-resource-details
isTransaction: true
queryMaps:
- query: INSERT INTO health.eg_cm_generated_resource_details (id,filestoreid, type,"status",count,tenantid,hierarchyType, createdby, createdtime, lastmodifiedby, lastmodifiedtime, additionaldetails,campaignid,auditid) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?) ON CONFLICT (id) DO NOTHING;

Comment on lines 170 to 181
name: UpdateCampaignDetails
description: Update campaign details in the eg_cm_campaign_details table
fromTopic: update-project-campaign-details
isTransaction: true
isAuditEnabled: true
module: HCM
objecIdJsonPath: $.id
tenantIdJsonPath: $.tenantId
transactionCodeJsonPath: $.campaignNumber
auditAttributeBasePath: $.CampaignDetails
queryMaps:
- query: UPDATE health.eg_cm_campaign_details SET campaignName = ?, "status" = ?, action = ?, projectType = ?, hierarchyType = ?, boundaryCode = ?, projectId = ?,startDate=?,endDate=?, lastModifiedBy = ?, lastModifiedTime = ?, additionalDetails = ?, campaignDetails = ? WHERE id = ?;
Copy link

Choose a reason for hiding this comment

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

Consider adding error handling for SQL operations.

The UpdateCampaignDetails mapping looks comprehensive. However, consider adding explicit error handling for cases where the UPDATE might fail due to constraints or other SQL errors.

-        - query: UPDATE health.eg_cm_campaign_details SET campaignName = ?, "status" = ?, action = ?, projectType = ?, hierarchyType = ?, boundaryCode = ?, projectId = ?,startDate=?,endDate=?, lastModifiedBy = ?, lastModifiedTime = ?, additionalDetails = ?, campaignDetails = ? WHERE id = ?;
+        - query: UPDATE health.eg_cm_campaign_details SET campaignName = ?, "status" = ?, action = ?, projectType = ?, hierarchyType = ?, boundaryCode = ?, projectId = ?,startDate=?,endDate=?, lastModifiedBy = ?, lastModifiedTime = ?, additionalDetails = ?, campaignDetails = ? WHERE id = ? ON CONFLICT (id) DO NOTHING;

Committable suggestion was skipped due to low confidence.

Comment on lines +204 to +209
name: CreateProcessTrack
description: Create process track in the eg_cm_campaign_process table
fromTopic: save-process-track
isTransaction: true
queryMaps:
- query: INSERT INTO health.eg_cm_campaign_process(id, campaignId, "type","status",details,createdtime, lastmodifiedtime,additionaldetails) VALUES (?,?,?,?,?,?,?,?);
Copy link

Choose a reason for hiding this comment

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

Consider adding error handling for SQL operations.

The CreateProcessTrack mapping looks comprehensive. However, consider adding explicit error handling for cases where the INSERT might fail due to unique constraints or other SQL errors.

-        - query: INSERT INTO health.eg_cm_campaign_process(id, campaignId, "type","status",details,createdtime, lastmodifiedtime,additionaldetails) VALUES (?,?,?,?,?,?,?,?);
+        - query: INSERT INTO health.eg_cm_campaign_process(id, campaignId, "type","status",details,createdtime, lastmodifiedtime,additionaldetails) VALUES (?,?,?,?,?,?,?,?) ON CONFLICT (id) DO NOTHING;
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
name: CreateProcessTrack
description: Create process track in the eg_cm_campaign_process table
fromTopic: save-process-track
isTransaction: true
queryMaps:
- query: INSERT INTO health.eg_cm_campaign_process(id, campaignId, "type","status",details,createdtime, lastmodifiedtime,additionaldetails) VALUES (?,?,?,?,?,?,?,?);
name: CreateProcessTrack
description: Create process track in the eg_cm_campaign_process table
fromTopic: save-process-track
isTransaction: true
queryMaps:
- query: INSERT INTO health.eg_cm_campaign_process(id, campaignId, "type","status",details,createdtime, lastmodifiedtime,additionaldetails) VALUES (?,?,?,?,?,?,?,?) ON CONFLICT (id) DO NOTHING;

Consider adding error handling for SQL operations.

The CreateProcessTrack mapping looks comprehensive. However, consider adding explicit error handling for cases where the INSERT might fail due to unique constraints or other SQL errors.

-        - query: INSERT INTO health.eg_cm_campaign_process(id, campaignId, "type","status",details,createdtime, lastmodifiedtime,additionaldetails) VALUES (?,?,?,?,?,?,?,?);
+        - query: INSERT INTO health.eg_cm_campaign_process(id, campaignId, "type","status",details,createdtime, lastmodifiedtime,additionaldetails) VALUES (?,?,?,?,?,?,?,?) ON CONFLICT (id) DO NOTHING;
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
name: CreateProcessTrack
description: Create process track in the eg_cm_campaign_process table
fromTopic: save-process-track
isTransaction: true
queryMaps:
- query: INSERT INTO health.eg_cm_campaign_process(id, campaignId, "type","status",details,createdtime, lastmodifiedtime,additionaldetails) VALUES (?,?,?,?,?,?,?,?);
name: CreateProcessTrack
description: Create process track in the eg_cm_campaign_process table
fromTopic: save-process-track
isTransaction: true
queryMaps:
- query: INSERT INTO health.eg_cm_campaign_process(id, campaignId, "type","status",details,createdtime, lastmodifiedtime,additionaldetails) VALUES (?,?,?,?,?,?,?,?) ON CONFLICT (id) DO NOTHING;

Comment on lines +51 to +56
name: CreateResourceActivity
description: Create resource activity in the eg_cm_resource_activity table
fromTopic: create-resource-activity
isTransaction: true
queryMaps:
- query: INSERT INTO health.eg_cm_resource_activity (id, "status", retryCount,tenantId, type, url, requestPayload, responsePayload, createdBy, createdTime, lastModifiedBy, lastModifiedTime, additionalDetails, resourceDetailsId) VALUES (?, ?,?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?);
Copy link

Choose a reason for hiding this comment

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

Consider adding error handling for SQL operations.

The CreateResourceActivity mapping looks comprehensive. However, consider adding explicit error handling for cases where the INSERT might fail due to unique constraints or other SQL errors.

-        - query: INSERT INTO health.eg_cm_resource_activity (id, "status", retryCount,tenantId, type, url, requestPayload, responsePayload, createdBy, createdTime, lastModifiedBy, lastModifiedTime, additionalDetails, resourceDetailsId) VALUES (?, ?,?, ?, ?,  ?, ?, ?, ?, ?, ?, ?, ?,?);
+        - query: INSERT INTO health.eg_cm_resource_activity (id, "status", retryCount,tenantId, type, url, requestPayload, responsePayload, createdBy, createdTime, lastModifiedBy, lastModifiedTime, additionalDetails, resourceDetailsId) VALUES (?, ?,?, ?, ?,  ?, ?, ?, ?, ?, ?, ?, ?,?) ON CONFLICT (id) DO NOTHING;
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
name: CreateResourceActivity
description: Create resource activity in the eg_cm_resource_activity table
fromTopic: create-resource-activity
isTransaction: true
queryMaps:
- query: INSERT INTO health.eg_cm_resource_activity (id, "status", retryCount,tenantId, type, url, requestPayload, responsePayload, createdBy, createdTime, lastModifiedBy, lastModifiedTime, additionalDetails, resourceDetailsId) VALUES (?, ?,?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?);
name: CreateResourceActivity
description: Create resource activity in the eg_cm_resource_activity table
fromTopic: create-resource-activity
isTransaction: true
queryMaps:
- query: INSERT INTO health.eg_cm_resource_activity (id, "status", retryCount,tenantId, type, url, requestPayload, responsePayload, createdBy, createdTime, lastModifiedBy, lastModifiedTime, additionalDetails, resourceDetailsId) VALUES (?, ?,?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?) ON CONFLICT (id) DO NOTHING;

Comment on lines 131 to 142
name: CreateCampaignDetails
description: Create campaign details in the eg_cm_campaign_details table
fromTopic: save-project-campaign-details
isTransaction: true
isAuditEnabled: true
module: HCM
objecIdJsonPath: $.id
tenantIdJsonPath: $.tenantId
transactionCodeJsonPath: $.campaignNumber
auditAttributeBasePath: $.CampaignDetails
queryMaps:
- query: INSERT INTO health.eg_cm_campaign_details(id, tenantId, "status","action",campaignName,projectType, campaignNumber,hierarchyType,boundaryCode, projectId,startDate,endDate, createdBy, createdTime, lastModifiedBy, lastModifiedTime, additionalDetails,campaignDetails) VALUES (?,?,?,?,?, ?,?, ?,?, ?, ?, ?, ?, ?, ?, ?,?,?);
Copy link

Choose a reason for hiding this comment

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

Consider adding error handling for SQL operations.

The CreateCampaignDetails mapping looks comprehensive. However, consider adding explicit error handling for cases where the INSERT might fail due to unique constraints or other SQL errors.

-        - query: INSERT INTO health.eg_cm_campaign_details(id, tenantId, "status","action",campaignName,projectType, campaignNumber,hierarchyType,boundaryCode, projectId,startDate,endDate, createdBy, createdTime, lastModifiedBy, lastModifiedTime, additionalDetails,campaignDetails) VALUES (?,?,?,?,?, ?,?, ?,?, ?, ?, ?, ?, ?, ?, ?,?,?);
+        - query: INSERT INTO health.eg_cm_campaign_details(id, tenantId, "status","action",campaignName,projectType, campaignNumber,hierarchyType,boundaryCode, projectId,startDate,endDate, createdBy, createdTime, lastModifiedBy, lastModifiedTime, additionalDetails,campaignDetails) VALUES (?,?,?,?,?, ?,?, ?,?, ?, ?, ?, ?, ?, ?, ?,?,?) ON CONFLICT (id) DO NOTHING;
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
name: CreateCampaignDetails
description: Create campaign details in the eg_cm_campaign_details table
fromTopic: save-project-campaign-details
isTransaction: true
isAuditEnabled: true
module: HCM
objecIdJsonPath: $.id
tenantIdJsonPath: $.tenantId
transactionCodeJsonPath: $.campaignNumber
auditAttributeBasePath: $.CampaignDetails
queryMaps:
- query: INSERT INTO health.eg_cm_campaign_details(id, tenantId, "status","action",campaignName,projectType, campaignNumber,hierarchyType,boundaryCode, projectId,startDate,endDate, createdBy, createdTime, lastModifiedBy, lastModifiedTime, additionalDetails,campaignDetails) VALUES (?,?,?,?,?, ?,?, ?,?, ?, ?, ?, ?, ?, ?, ?,?,?);
name: CreateCampaignDetails
description: Create campaign details in the eg_cm_campaign_details table
fromTopic: save-project-campaign-details
isTransaction: true
isAuditEnabled: true
module: HCM
objecIdJsonPath: $.id
tenantIdJsonPath: $.tenantId
transactionCodeJsonPath: $.campaignNumber
auditAttributeBasePath: $.CampaignDetails
queryMaps:
- query: INSERT INTO health.eg_cm_campaign_details(id, tenantId, "status","action",campaignName,projectType, campaignNumber,hierarchyType,boundaryCode, projectId,startDate,endDate, createdBy, createdTime, lastModifiedBy, lastModifiedTime, additionalDetails,campaignDetails) VALUES (?,?,?,?,?, ?,?, ?,?, ?, ?, ?, ?, ?, ?, ?,?,?) ON CONFLICT (id) DO NOTHING;

Comment on lines 5 to 10
name: CreateResourceDetails
description: Create resource details in the eg_cm_resource_details table
fromTopic: create-resource-details
isTransaction: true
queryMaps:
- query: INSERT INTO health.eg_cm_resource_details(id, "status", tenantId, fileStoreId,processedFileStoreId,"action", campaignId,"type", createdBy, createdTime, lastModifiedBy, lastModifiedTime, additionalDetails) VALUES (?, ?,?, ?,?,?, ?, ?, ?, ?, ?, ?, ?);
Copy link

Choose a reason for hiding this comment

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

Consider adding error handling for SQL operations.

The CreateResourceDetails mapping looks comprehensive. However, consider adding explicit error handling for cases where the INSERT might fail due to unique constraints or other SQL errors.

-        - query: INSERT INTO health.eg_cm_resource_details(id, "status", tenantId, fileStoreId,processedFileStoreId,"action", campaignId,"type", createdBy, createdTime, lastModifiedBy, lastModifiedTime, additionalDetails) VALUES (?, ?,?, ?,?,?, ?, ?, ?, ?, ?, ?, ?);
+        - query: INSERT INTO health.eg_cm_resource_details(id, "status", tenantId, fileStoreId,processedFileStoreId,"action", campaignId,"type", createdBy, createdTime, lastModifiedBy, lastModifiedTime, additionalDetails) VALUES (?, ?,?, ?,?,?, ?, ?, ?, ?, ?, ?, ?) ON CONFLICT (id) DO NOTHING;

Committable suggestion was skipped due to low confidence.

Ramkrishna-egov and others added 22 commits December 12, 2024 10:44
Added administeredByGenderDistrictPercent master config
Added percentage charts for administered by age, gender
Added drill charts for children not administered by reason
Seperated drill charts for children not administered by reason
Removed unused chart childrenNotAdministeredProvinceSMC
Fixed time filter for heatmap for households
Fixed heatmap for households and administration coverage
Removed date filter for heat maps in national page
Copy link

@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: 3

🧹 Nitpick comments (2)
health/egov-persister/household-persister.yml (2)

38-56: Consider adding foreign key constraints for address records

The address insertion query doesn't establish a foreign key relationship with the household table. This could lead to orphaned address records if household creation fails.

Consider adding foreign key constraints and CASCADE options in your database schema:

ALTER TABLE health.ADDRESS
ADD CONSTRAINT fk_address_household
FOREIGN KEY (id) REFERENCES health.HOUSEHOLD(addressId)
ON DELETE CASCADE;

223-235: Align member delete query with update query pattern

The delete operation uses ID-based lookup while update uses individualId and householdId. This inconsistency could lead to maintenance issues.

Consider aligning the delete query with the update pattern:

- WHERE ID = ?;
+ WHERE individualId = ? AND householdId = ? AND tenantId = ?;
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 98d2572 and 3a88f82.

📒 Files selected for processing (1)
  • health/egov-persister/household-persister.yml (1 hunks)
🔇 Additional comments (2)
health/egov-persister/household-persister.yml (2)

1-3: LGTM! Service definition follows standard pattern

The service configuration follows the standard persister configuration pattern.


1-235: Verify data migration impact

These persistence configurations introduce new constraints and patterns. Existing data might need migration to comply with the new structure.

✅ Verification successful

No data migration concerns identified

Based on the verification results:

  1. The persister configuration shows this is version 1.0 for all operations (save, update, delete) for both household and household members, indicating these are new configurations rather than modifications to existing ones.
  2. The SQL operations use standard INSERT, UPDATE with proper WHERE clauses and ON CONFLICT handling, which safely handles both new and existing records.
  3. No existing schema migrations or DDL scripts were found that could conflict with these persistence patterns.
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for potential data inconsistencies in existing records

# Check for orphaned addresses
rg -l "CREATE TABLE.*health\.ADDRESS" | xargs cat | grep -A 10 "CREATE TABLE"

# Check for household member constraints
rg -l "CREATE TABLE.*health\.HOUSEHOLD_MEMBER" | xargs cat | grep -A 10 "CREATE TABLE"

# Look for existing migration scripts
fd -e sql -e yaml "migrate|flyway|liquibase"

Length of output: 215


Script:

#!/bin/bash
# Let's try a different approach to find schema definitions and migrations

# Look for SQL files in the repository
fd -e sql

# Look for database schema files
rg -l "CREATE TABLE|ALTER TABLE" --type sql --type yaml

# Look specifically for household related tables
rg -l "household|HOUSEHOLD" --type sql --type yaml

# Check for any DDL statements in yaml files
rg "CREATE TABLE|ALTER TABLE" --type yaml

Length of output: 431


Script:

#!/bin/bash
# Let's check the content of the persister files to understand the schema evolution

# Check all versions of household persister
rg -A 5 "version:" health/egov-persister/household-persister.yml

# Look for any database related configurations
rg -l "database|schema|health\." 

# Check for any existing table definitions or migrations in health module
fd . health/ -t f | rg "schema|ddl|sql|migration"

Length of output: 2954

Comment on lines +70 to +86
- query: UPDATE health.HOUSEHOLD SET tenantId = ?, clientReferenceId = ?, numberOfMembers = ?, addressId = ?, additionalDetails = ?, lastModifiedBy = ?, lastModifiedTime = ?, rowVersion = ?, isDeleted = ?, clientLastModifiedTime = ?, clientLastModifiedBy = ? WHERE ID = ?;
basePath: $.*
jsonMaps:
- jsonPath: $.*.tenantId
- jsonPath: $.*.clientReferenceId
- jsonPath: $.*.memberCount
- jsonPath: $.*.address.id
- jsonPath: $.*.additionalFields
type: JSON
dbType: JSONB
- jsonPath: $.*.auditDetails.lastModifiedBy
- jsonPath: $.*.auditDetails.lastModifiedTime
- jsonPath: $.*.rowVersion
- jsonPath: $.*.isDeleted
- jsonPath: $.*.clientAuditDetails.lastModifiedTime
- jsonPath: $.*.clientAuditDetails.lastModifiedBy
- jsonPath: $.*.id
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Add existence check before household update

The update query doesn't verify if the household exists before updating. This could mask errors where invalid household IDs are provided.

Consider modifying the query to include an existence check:

- UPDATE health.HOUSEHOLD SET tenantId = ?, clientReferenceId = ?, 
+ UPDATE health.HOUSEHOLD SET tenantId = ?, clientReferenceId = ?,
+ WHERE ID = ? AND isDeleted = false
+ RETURNING id;

Committable suggestion skipped: line range outside the PR's diff.

Comment on lines +133 to +145
- query: UPDATE health.HOUSEHOLD SET lastModifiedBy = ?, lastModifiedTime = ?, clientLastModifiedTime = ?, clientLastModifiedBy = ?, rowVersion = ?, isDeleted = ?, additionalDetails=? WHERE ID = ?;
basePath: $.*
jsonMaps:
- jsonPath: $.*.auditDetails.lastModifiedBy
- jsonPath: $.*.auditDetails.lastModifiedTime
- jsonPath: $.*.clientAuditDetails.lastModifiedTime
- jsonPath: $.*.clientAuditDetails.lastModifiedBy
- jsonPath: $.*.rowVersion
- jsonPath: $.*.isDeleted
- jsonPath: $.*.additionalFields
type: JSON
dbType: JSONB
- jsonPath: $.*.id
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Consider cascading soft delete to related records

The delete operation only marks the household as deleted but doesn't handle related address records. This could lead to data inconsistency.

Consider either:

  1. Cascading the soft delete to address records
  2. Implementing a transaction that handles both tables

Example implementation:

- UPDATE health.HOUSEHOLD SET lastModifiedBy = ?, lastModifiedTime = ?,
+ WITH deleted_household AS (
+   UPDATE health.HOUSEHOLD SET lastModifiedBy = ?, lastModifiedTime = ?,
+   clientLastModifiedTime = ?, clientLastModifiedBy = ?,
+   rowVersion = ?, isDeleted = ?, additionalDetails = ?
+   WHERE ID = ?
+   RETURNING addressId
+ )
+ UPDATE health.ADDRESS SET isDeleted = true
+ WHERE id IN (SELECT addressId FROM deleted_household);

Committable suggestion skipped: line range outside the PR's diff.

Comment on lines +195 to +210
- query: UPDATE health.HOUSEHOLD_MEMBER SET isHeadOfHousehold=?, clientReferenceId = ?, additionalDetails=?, lastModifiedBy=?, lastModifiedTime=?, rowVersion=?, isDeleted=?, clientLastModifiedTime = ?, clientLastModifiedBy = ? WHERE individualId=? AND householdId=? AND isDeleted=false;
basePath: $.*
jsonMaps:
- jsonPath: $.*.isHeadOfHousehold
- jsonPath: $.*.clientReferenceId
- jsonPath: $.*.additionalFields
type: JSON
dbType: JSONB
- jsonPath: $.*.auditDetails.lastModifiedBy
- jsonPath: $.*.auditDetails.lastModifiedTime
- jsonPath: $.*.rowVersion
- jsonPath: $.*.isDeleted
- jsonPath: $.*.clientAuditDetails.lastModifiedTime
- jsonPath: $.*.clientAuditDetails.lastModifiedBy
- jsonPath: $.*.individualId
- jsonPath: $.*.householdId
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Improve household member update query conditions

The update query uses isDeleted=false in WHERE clause but doesn't validate tenant ID, which could lead to cross-tenant data modification.

Consider adding tenant validation:

- WHERE individualId=? AND householdId=? AND isDeleted=false;
+ WHERE individualId=? AND householdId=? AND tenantId=? AND isDeleted=false;

Committable suggestion skipped: line range outside the PR's diff.

Copy link

@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: 2

🧹 Nitpick comments (3)
egov-indexer/mukta-estimateservices-indexer.yml (3)

8-8: Standardize index naming convention

The configuration uses various index naming patterns:

  • estimate-inbox-v3
  • estimate-inbox-legacyindex
  • estimate-inbox-v3-migrate
  • estimate-inbox-reindex-temp

This inconsistency could make index management and migrations more difficult.

Consider adopting a standardized naming convention:

{service}-{entity}-{version}-{purpose}

For example:

  • estimate-inbox-v3-primary
  • estimate-inbox-v3-legacy
  • estimate-inbox-v3-migration

Also applies to: 70-70, 129-129, 193-193, 255-255


16-58: Reduce duplication in field mappings

The configuration contains identical field mapping structures repeated across different sections. This violates the DRY principle and makes maintenance more difficult.

Consider:

  1. Using YAML anchors and aliases to reuse common mappings
  2. Creating a base template that can be extended

Example refactor:

# Define common mappings
common_mappings: &base_mappings
  - inJsonPath: $.id
    outJsonPath: $.Data.id
  - inJsonPath: $.tenantId
    outJsonPath: $.Data.tenantId
  # ... other common mappings

# Use in specific sections
fieldMapping:
  <<: *base_mappings
  # Add section-specific mappings here

Also applies to: 77-117, 137-175, 201-243, 264-306


319-319: Add newline at end of file

The file is missing a newline character at the end.

Add a newline character at the end of the file to follow YAML best practices.

🧰 Tools
🪛 yamllint (1.35.1)

[error] 319-319: no new line character at the end of file

(new-line-at-end-of-file)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3a88f82 and 5df3298.

📒 Files selected for processing (1)
  • egov-indexer/mukta-estimateservices-indexer.yml (1 hunks)
🧰 Additional context used
🪛 Gitleaks (8.21.2)
egov-indexer/mukta-estimateservices-indexer.yml

62-62: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


121-121: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


179-179: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


185-185: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


247-247: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


310-310: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


316-316: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

🪛 yamllint (1.35.1)
egov-indexer/mukta-estimateservices-indexer.yml

[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 76-76: too few spaces after comma

(commas)


[warning] 76-76: too few spaces after comma

(commas)


[warning] 76-76: too few spaces after comma

(commas)


[warning] 76-76: too few spaces after comma

(commas)


[warning] 76-76: too few spaces after comma

(commas)


[warning] 76-76: too few spaces after comma

(commas)


[warning] 76-76: too few spaces after comma

(commas)


[warning] 76-76: too few spaces after comma

(commas)


[warning] 76-76: too few spaces after comma

(commas)


[warning] 76-76: too few spaces after comma

(commas)


[warning] 76-76: too few spaces after comma

(commas)


[warning] 76-76: too few spaces after comma

(commas)


[warning] 76-76: too few spaces after comma

(commas)


[warning] 76-76: too few spaces after comma

(commas)


[warning] 76-76: too few spaces after comma

(commas)


[warning] 76-76: too few spaces after comma

(commas)


[warning] 76-76: too few spaces after comma

(commas)


[warning] 76-76: too few spaces after comma

(commas)


[warning] 76-76: too few spaces after comma

(commas)


[warning] 76-76: too few spaces after comma

(commas)


[warning] 121-121: too few spaces after comma

(commas)


[warning] 121-121: too few spaces after comma

(commas)


[warning] 121-121: too few spaces after comma

(commas)


[warning] 121-121: too few spaces after comma

(commas)


[warning] 121-121: too few spaces after comma

(commas)


[warning] 121-121: too few spaces after comma

(commas)


[warning] 121-121: too few spaces after comma

(commas)


[warning] 121-121: too few spaces after comma

(commas)


[warning] 121-121: too few spaces after comma

(commas)


[warning] 121-121: too few spaces after comma

(commas)


[warning] 121-121: too few spaces after comma

(commas)


[warning] 121-121: too few spaces after comma

(commas)


[warning] 121-121: too few spaces after comma

(commas)


[warning] 121-121: too few spaces after comma

(commas)


[warning] 121-121: too few spaces after comma

(commas)


[warning] 136-136: too few spaces after comma

(commas)


[warning] 136-136: too few spaces after comma

(commas)


[warning] 136-136: too few spaces after comma

(commas)


[warning] 136-136: too few spaces after comma

(commas)


[warning] 136-136: too few spaces after comma

(commas)


[warning] 136-136: too few spaces after comma

(commas)


[warning] 136-136: too few spaces after comma

(commas)


[warning] 136-136: too few spaces after comma

(commas)


[warning] 136-136: too few spaces after comma

(commas)


[warning] 136-136: too few spaces after comma

(commas)


[warning] 136-136: too few spaces after comma

(commas)


[warning] 136-136: too few spaces after comma

(commas)


[warning] 136-136: too few spaces after comma

(commas)


[warning] 136-136: too few spaces after comma

(commas)


[warning] 136-136: too few spaces after comma

(commas)


[warning] 136-136: too few spaces after comma

(commas)


[warning] 136-136: too few spaces after comma

(commas)


[warning] 136-136: too few spaces after comma

(commas)


[warning] 136-136: too few spaces after comma

(commas)


[warning] 136-136: too few spaces after comma

(commas)


[warning] 179-179: too few spaces after comma

(commas)


[warning] 179-179: too few spaces after comma

(commas)


[warning] 179-179: too few spaces after comma

(commas)


[warning] 179-179: too few spaces after comma

(commas)


[warning] 179-179: too few spaces after comma

(commas)


[warning] 179-179: too few spaces after comma

(commas)


[warning] 179-179: too few spaces after comma

(commas)


[warning] 179-179: too few spaces after comma

(commas)


[warning] 179-179: too few spaces after comma

(commas)


[warning] 179-179: too few spaces after comma

(commas)


[warning] 179-179: too few spaces after comma

(commas)


[warning] 179-179: too few spaces after comma

(commas)


[warning] 179-179: too few spaces after comma

(commas)


[warning] 179-179: too few spaces after comma

(commas)


[warning] 179-179: too few spaces after comma

(commas)


[warning] 185-185: too few spaces after comma

(commas)


[warning] 185-185: too few spaces after comma

(commas)


[warning] 185-185: too few spaces after comma

(commas)


[warning] 185-185: too few spaces after comma

(commas)


[warning] 185-185: too few spaces after comma

(commas)


[warning] 185-185: too few spaces after comma

(commas)


[warning] 185-185: too few spaces after comma

(commas)


[warning] 185-185: too few spaces after comma

(commas)


[warning] 185-185: too few spaces after comma

(commas)


[warning] 185-185: too few spaces after comma

(commas)


[warning] 185-185: too few spaces after comma

(commas)


[warning] 185-185: too few spaces after comma

(commas)


[warning] 185-185: too few spaces after comma

(commas)


[warning] 185-185: too few spaces after comma

(commas)


[warning] 185-185: too few spaces after comma

(commas)


[warning] 200-200: too few spaces after comma

(commas)


[warning] 200-200: too few spaces after comma

(commas)


[warning] 200-200: too few spaces after comma

(commas)


[warning] 200-200: too few spaces after comma

(commas)


[warning] 200-200: too few spaces after comma

(commas)


[warning] 200-200: too few spaces after comma

(commas)


[warning] 200-200: too few spaces after comma

(commas)


[warning] 200-200: too few spaces after comma

(commas)


[warning] 200-200: too few spaces after comma

(commas)


[warning] 200-200: too few spaces after comma

(commas)


[warning] 200-200: too few spaces after comma

(commas)


[warning] 200-200: too few spaces after comma

(commas)


[warning] 200-200: too few spaces after comma

(commas)


[warning] 200-200: too few spaces after comma

(commas)


[warning] 200-200: too few spaces after comma

(commas)


[warning] 200-200: too few spaces after comma

(commas)


[warning] 200-200: too few spaces after comma

(commas)


[warning] 200-200: too few spaces after comma

(commas)


[warning] 200-200: too few spaces after comma

(commas)


[warning] 200-200: too few spaces after comma

(commas)


[warning] 200-200: too few spaces after comma

(commas)


[warning] 200-200: too few spaces after comma

(commas)


[warning] 247-247: too few spaces after comma

(commas)


[warning] 247-247: too few spaces after comma

(commas)


[warning] 247-247: too few spaces after comma

(commas)


[warning] 247-247: too few spaces after comma

(commas)


[warning] 247-247: too few spaces after comma

(commas)


[warning] 247-247: too few spaces after comma

(commas)


[warning] 247-247: too few spaces after comma

(commas)


[warning] 247-247: too few spaces after comma

(commas)


[warning] 247-247: too few spaces after comma

(commas)


[warning] 247-247: too few spaces after comma

(commas)


[warning] 247-247: too few spaces after comma

(commas)


[warning] 247-247: too few spaces after comma

(commas)


[warning] 247-247: too few spaces after comma

(commas)


[warning] 247-247: too few spaces after comma

(commas)


[warning] 247-247: too few spaces after comma

(commas)


[warning] 310-310: too few spaces after comma

(commas)


[warning] 310-310: too few spaces after comma

(commas)


[warning] 310-310: too few spaces after comma

(commas)


[warning] 310-310: too few spaces after comma

(commas)


[warning] 310-310: too few spaces after comma

(commas)


[warning] 310-310: too few spaces after comma

(commas)


[warning] 310-310: too few spaces after comma

(commas)


[warning] 310-310: too few spaces after comma

(commas)


[warning] 310-310: too few spaces after comma

(commas)


[warning] 310-310: too few spaces after comma

(commas)


[warning] 310-310: too few spaces after comma

(commas)


[warning] 310-310: too few spaces after comma

(commas)


[warning] 310-310: too few spaces after comma

(commas)


[warning] 310-310: too few spaces after comma

(commas)


[warning] 310-310: too few spaces after comma

(commas)


[warning] 316-316: too few spaces after comma

(commas)


[warning] 316-316: too few spaces after comma

(commas)


[warning] 316-316: too few spaces after comma

(commas)


[warning] 316-316: too few spaces after comma

(commas)


[warning] 316-316: too few spaces after comma

(commas)


[warning] 316-316: too few spaces after comma

(commas)


[warning] 316-316: too few spaces after comma

(commas)


[warning] 316-316: too few spaces after comma

(commas)


[warning] 316-316: too few spaces after comma

(commas)


[warning] 316-316: too few spaces after comma

(commas)


[warning] 316-316: too few spaces after comma

(commas)


[warning] 316-316: too few spaces after comma

(commas)


[warning] 316-316: too few spaces after comma

(commas)


[warning] 316-316: too few spaces after comma

(commas)


[warning] 316-316: too few spaces after comma

(commas)


[error] 319-319: no new line character at the end of file

(new-line-at-end-of-file)

🔇 Additional comments (2)
egov-indexer/mukta-estimateservices-indexer.yml (2)

1-3: LGTM: Service configuration is well-defined

The service name and version are appropriately specified.


60-65: Verify workflow service integration

The configuration makes multiple calls to the workflow service. Ensure:

  1. The workflow service is available and accessible
  2. The required endpoints exist
  3. The service has appropriate permissions

Also applies to: 119-124, 177-182, 245-250, 308-313

✅ Verification successful

Based on the search results, I can generate the final response since I have enough information to verify the workflow service integration. The results show that the process/_search endpoint is consistently used across multiple services in the same way as in the file under review, with the same structure for query parameters and response mapping.

Workflow service integration is properly configured

The endpoint configuration follows the established pattern used across multiple services in the codebase:

  • The endpoint path /egov-workflow-v2/egov-wf/process/_search is consistently used
  • Query parameters format businessIds=<ID>,history=true,tenantId=<TENANT> is standard
  • Response mapping from $.ProcessInstances to $.Data.history is uniform
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if workflow service endpoints are defined in the API documentation
rg -A 5 "process/_search" --type yaml

Length of output: 71351

🧰 Tools
🪛 Gitleaks (8.21.2)

62-62: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

🪛 yamllint (1.35.1)

[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)

- inJsonPath: $.ProcessInstances
outJsonPath: $.Data.currentProcessInstance
externalUriMapping:
- path: http://egov-workflow-v2.egov:8080/egov-workflow-v2/egov-wf/process/_search
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Standardize service URLs across environments

The configuration contains inconsistent service URLs:

  • Some using localhost:8092
  • Others using internal service names like egov-workflow-v2.egov:8080

This could cause connectivity issues across different environments.

Consider:

  1. Using environment variables for service URLs
  2. Standardizing URL patterns
  3. Using service discovery if available

Example refactor:

-path: http://localhost:8092/egov-workflow-v2/egov-wf/process/_search
+path: ${WORKFLOW_SERVICE_HOST}/egov-workflow-v2/egov-wf/process/_search

Also applies to: 119-119, 177-177, 183-183, 245-245, 308-308, 314-314

externalUriMapping:
- path: http://egov-workflow-v2.egov:8080/egov-workflow-v2/egov-wf/process/_search
queryParam: businessIds=$.estimateNumber,history=true,tenantId=$.tenantId
apiRequest: {"RequestInfo":{"apiId":"org.egov.pt","ver":"1.0","ts":1502890899493,"action":"asd","did":"4354648646","key":"xyz","msgId":"654654","requesterId":"61","authToken":"d9994555-7656-4a67-ab3a-a952a0d4dfc8","userInfo":{"id":1,"uuid":"1fec8102-0e02-4d0a-b283-cd80d5dab067","type":"EMPLOYEE","tenantId":"pb.jalandhar","roles":[{"name":"Employee","code":"EMPLOYEE","tenantId":"pb.jalandhar"}]}}}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Critical: Remove hardcoded authentication tokens

The configuration contains hardcoded API keys and authentication tokens in multiple apiRequest sections. This is a significant security risk as these credentials could be compromised if the configuration file is exposed.

Consider:

  1. Using environment variables or a secure secret management system
  2. Implementing token rotation mechanisms
  3. Using service-to-service authentication

Example refactor for one section:

 apiRequest: {
   "RequestInfo": {
     "apiId": "org.egov.pt",
     "ver": "1.0",
     "ts": 1502890899493,
     "action": "asd",
     "did": "4354648646",
     "key": "xyz",
     "msgId": "654654",
     "requesterId": "61",
-    "authToken": "d9994555-7656-4a67-ab3a-a952a0d4dfc8",
+    "authToken": "${AUTH_TOKEN}",
     "userInfo": {
       "id": 1,
-      "uuid": "1fec8102-0e02-4d0a-b283-cd80d5dab067",
+      "uuid": "${USER_UUID}",
       "type": "EMPLOYEE",
-      "tenantId": "pb.jalandhar",
+      "tenantId": "${TENANT_ID}",
       "roles": [{
         "name": "Employee",
         "code": "EMPLOYEE",
-        "tenantId": "pb.jalandhar"
+        "tenantId": "${TENANT_ID}"
       }]
     }
   }
 }

Also applies to: 121-121, 179-179, 185-185, 247-247, 310-310, 316-316

🧰 Tools
🪛 Gitleaks (8.21.2)

62-62: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

🪛 yamllint (1.35.1)

[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)

Copy link

@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: 2

♻️ Duplicate comments (3)
egov-indexer/mukta-estimateservices-indexer.yml (2)

62-62: ⚠️ Potential issue

Critical: Remove hardcoded authentication tokens

The configuration contains hardcoded API keys and authentication tokens in multiple apiRequest sections. This is a security risk as these credentials could be compromised.

Consider using environment variables or a secure secret management system. Example refactor:

 apiRequest: {
   "RequestInfo": {
     "apiId": "org.egov.pt",
     "ver": "1.0",
     "ts": 1502890899493,
     "action": "asd",
     "did": "4354648646",
     "key": "xyz",
     "msgId": "654654",
     "requesterId": "61",
-    "authToken": "d9994555-7656-4a67-ab3a-a952a0d4dfc8",
+    "authToken": "${AUTH_TOKEN}",
     "userInfo": {
       "id": 1,
-      "uuid": "1fec8102-0e02-4d0a-b283-cd80d5dab067",
+      "uuid": "${USER_UUID}",
       "type": "EMPLOYEE",
-      "tenantId": "pb.jalandhar",
+      "tenantId": "${TENANT_ID}",
       "roles": [{
         "name": "Employee",
         "code": "EMPLOYEE",
-        "tenantId": "pb.jalandhar"
+        "tenantId": "${TENANT_ID}"
       }]
     }
   }
 }

Also applies to: 121-121, 179-179, 185-185, 247-247, 310-310, 316-316

🧰 Tools
🪛 Gitleaks (8.21.2)

62-62: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

🪛 yamllint (1.35.1)

[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


60-60: 🛠️ Refactor suggestion

Standardize service URLs across environments

The configuration contains inconsistent service URLs using internal service names. This could cause connectivity issues across different environments.

Consider using environment variables for service URLs:

-path: http://egov-workflow-v2.egov:8080/egov-workflow-v2/egov-wf/process/_search
+path: ${WORKFLOW_SERVICE_HOST}/egov-workflow-v2/egov-wf/process/_search

Also applies to: 119-119, 177-177, 183-183, 245-245, 308-308, 314-314

egov-indexer/mukta-contractservices-indexer.yml (1)

60-60: ⚠️ Potential issue

Critical: Remove hardcoded authentication tokens and API keys

The configuration contains hardcoded sensitive information in multiple apiRequest sections, which poses a security risk.

Replace hardcoded values with environment variables:

 apiRequest: {
   "RequestInfo": {
-    "apiId": "org.egov.pt",
-    "key": "xyz",
-    "authToken": "d9994555-7656-4a67-ab3a-a952a0d4dfc8",
+    "apiId": "${API_ID}",
+    "key": "${API_KEY}",
+    "authToken": "${AUTH_TOKEN}",
     ...
   }
 }

Also applies to: 119-119, 180-180, 251-251

🧰 Tools
🪛 Gitleaks (8.21.2)

60-60: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

🪛 yamllint (1.35.1)

[warning] 60-60: too few spaces after comma

(commas)


[warning] 60-60: too few spaces after comma

(commas)


[warning] 60-60: too few spaces after comma

(commas)


[warning] 60-60: too few spaces after comma

(commas)


[warning] 60-60: too few spaces after comma

(commas)


[warning] 60-60: too few spaces after comma

(commas)


[warning] 60-60: too few spaces after comma

(commas)


[warning] 60-60: too few spaces after comma

(commas)


[warning] 60-60: too few spaces after comma

(commas)


[warning] 60-60: too few spaces after comma

(commas)


[warning] 60-60: too few spaces after comma

(commas)


[warning] 60-60: too few spaces after comma

(commas)


[warning] 60-60: too few spaces after comma

(commas)


[warning] 60-60: too few spaces after comma

(commas)


[warning] 60-60: too few spaces after comma

(commas)

🧹 Nitpick comments (4)
egov-indexer/mukta-estimateservices-indexer.yml (2)

8-8: Consider versioning strategy for index names

The configuration uses different index names across mappings:

  • estimate-inbox-v3
  • estimate-inbox-legacyindex
  • estimate-inbox-v3-migrate
  • estimate-inbox-reindex-temp

Consider:

  1. Documenting the purpose of each index
  2. Implementing a consistent versioning strategy
  3. Adding cleanup procedures for temporary indices

Also applies to: 70-70, 129-129, 193-193, 255-255


319-319: Add newline at end of file

The file is missing a newline character at the end.

Add a newline character at the end of the file to follow YAML best practices.

🧰 Tools
🪛 yamllint (1.35.1)

[error] 319-319: no new line character at the end of file

(new-line-at-end-of-file)

egov-indexer/mukta-contractservices-indexer.yml (2)

185-185: Fix: Remove trailing whitespace

Line 185 contains trailing whitespace.

🧰 Tools
🪛 yamllint (1.35.1)

[error] 185-185: trailing spaces

(trailing-spaces)


254-254: Fix: Add newline at end of file

Add a newline character at the end of the file to comply with YAML best practices.

🧰 Tools
🪛 yamllint (1.35.1)

[error] 254-254: no new line character at the end of file

(new-line-at-end-of-file)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5df3298 and ef42c04.

📒 Files selected for processing (2)
  • egov-indexer/mukta-contractservices-indexer.yml (1 hunks)
  • egov-indexer/mukta-estimateservices-indexer.yml (1 hunks)
🧰 Additional context used
🪛 Gitleaks (8.21.2)
egov-indexer/mukta-estimateservices-indexer.yml

62-62: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


121-121: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


179-179: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


185-185: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


247-247: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


310-310: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


316-316: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

egov-indexer/mukta-contractservices-indexer.yml

60-60: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


119-119: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


251-251: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

🪛 yamllint (1.35.1)
egov-indexer/mukta-estimateservices-indexer.yml

[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 62-62: too few spaces after comma

(commas)


[warning] 76-76: too few spaces after comma

(commas)


[warning] 76-76: too few spaces after comma

(commas)


[warning] 76-76: too few spaces after comma

(commas)


[warning] 76-76: too few spaces after comma

(commas)


[warning] 76-76: too few spaces after comma

(commas)


[warning] 76-76: too few spaces after comma

(commas)


[warning] 76-76: too few spaces after comma

(commas)


[warning] 76-76: too few spaces after comma

(commas)


[warning] 76-76: too few spaces after comma

(commas)


[warning] 76-76: too few spaces after comma

(commas)


[warning] 76-76: too few spaces after comma

(commas)


[warning] 76-76: too few spaces after comma

(commas)


[warning] 76-76: too few spaces after comma

(commas)


[warning] 76-76: too few spaces after comma

(commas)


[warning] 76-76: too few spaces after comma

(commas)


[warning] 76-76: too few spaces after comma

(commas)


[warning] 76-76: too few spaces after comma

(commas)


[warning] 76-76: too few spaces after comma

(commas)


[warning] 76-76: too few spaces after comma

(commas)


[warning] 76-76: too few spaces after comma

(commas)


[warning] 121-121: too few spaces after comma

(commas)


[warning] 121-121: too few spaces after comma

(commas)


[warning] 121-121: too few spaces after comma

(commas)


[warning] 121-121: too few spaces after comma

(commas)


[warning] 121-121: too few spaces after comma

(commas)


[warning] 121-121: too few spaces after comma

(commas)


[warning] 121-121: too few spaces after comma

(commas)


[warning] 121-121: too few spaces after comma

(commas)


[warning] 121-121: too few spaces after comma

(commas)


[warning] 121-121: too few spaces after comma

(commas)


[warning] 121-121: too few spaces after comma

(commas)


[warning] 121-121: too few spaces after comma

(commas)


[warning] 121-121: too few spaces after comma

(commas)


[warning] 121-121: too few spaces after comma

(commas)


[warning] 121-121: too few spaces after comma

(commas)


[warning] 136-136: too few spaces after comma

(commas)


[warning] 136-136: too few spaces after comma

(commas)


[warning] 136-136: too few spaces after comma

(commas)


[warning] 136-136: too few spaces after comma

(commas)


[warning] 136-136: too few spaces after comma

(commas)


[warning] 136-136: too few spaces after comma

(commas)


[warning] 136-136: too few spaces after comma

(commas)


[warning] 136-136: too few spaces after comma

(commas)


[warning] 136-136: too few spaces after comma

(commas)


[warning] 136-136: too few spaces after comma

(commas)


[warning] 136-136: too few spaces after comma

(commas)


[warning] 136-136: too few spaces after comma

(commas)


[warning] 136-136: too few spaces after comma

(commas)


[warning] 136-136: too few spaces after comma

(commas)


[warning] 136-136: too few spaces after comma

(commas)


[warning] 136-136: too few spaces after comma

(commas)


[warning] 136-136: too few spaces after comma

(commas)


[warning] 136-136: too few spaces after comma

(commas)


[warning] 136-136: too few spaces after comma

(commas)


[warning] 136-136: too few spaces after comma

(commas)


[warning] 179-179: too few spaces after comma

(commas)


[warning] 179-179: too few spaces after comma

(commas)


[warning] 179-179: too few spaces after comma

(commas)


[warning] 179-179: too few spaces after comma

(commas)


[warning] 179-179: too few spaces after comma

(commas)


[warning] 179-179: too few spaces after comma

(commas)


[warning] 179-179: too few spaces after comma

(commas)


[warning] 179-179: too few spaces after comma

(commas)


[warning] 179-179: too few spaces after comma

(commas)


[warning] 179-179: too few spaces after comma

(commas)


[warning] 179-179: too few spaces after comma

(commas)


[warning] 179-179: too few spaces after comma

(commas)


[warning] 179-179: too few spaces after comma

(commas)


[warning] 179-179: too few spaces after comma

(commas)


[warning] 179-179: too few spaces after comma

(commas)


[warning] 185-185: too few spaces after comma

(commas)


[warning] 185-185: too few spaces after comma

(commas)


[warning] 185-185: too few spaces after comma

(commas)


[warning] 185-185: too few spaces after comma

(commas)


[warning] 185-185: too few spaces after comma

(commas)


[warning] 185-185: too few spaces after comma

(commas)


[warning] 185-185: too few spaces after comma

(commas)


[warning] 185-185: too few spaces after comma

(commas)


[warning] 185-185: too few spaces after comma

(commas)


[warning] 185-185: too few spaces after comma

(commas)


[warning] 185-185: too few spaces after comma

(commas)


[warning] 185-185: too few spaces after comma

(commas)


[warning] 185-185: too few spaces after comma

(commas)


[warning] 185-185: too few spaces after comma

(commas)


[warning] 185-185: too few spaces after comma

(commas)


[warning] 200-200: too few spaces after comma

(commas)


[warning] 200-200: too few spaces after comma

(commas)


[warning] 200-200: too few spaces after comma

(commas)


[warning] 200-200: too few spaces after comma

(commas)


[warning] 200-200: too few spaces after comma

(commas)


[warning] 200-200: too few spaces after comma

(commas)


[warning] 200-200: too few spaces after comma

(commas)


[warning] 200-200: too few spaces after comma

(commas)


[warning] 200-200: too few spaces after comma

(commas)


[warning] 200-200: too few spaces after comma

(commas)


[warning] 200-200: too few spaces after comma

(commas)


[warning] 200-200: too few spaces after comma

(commas)


[warning] 200-200: too few spaces after comma

(commas)


[warning] 200-200: too few spaces after comma

(commas)


[warning] 200-200: too few spaces after comma

(commas)


[warning] 200-200: too few spaces after comma

(commas)


[warning] 200-200: too few spaces after comma

(commas)


[warning] 200-200: too few spaces after comma

(commas)


[warning] 200-200: too few spaces after comma

(commas)


[warning] 200-200: too few spaces after comma

(commas)


[warning] 200-200: too few spaces after comma

(commas)


[warning] 200-200: too few spaces after comma

(commas)


[warning] 247-247: too few spaces after comma

(commas)


[warning] 247-247: too few spaces after comma

(commas)


[warning] 247-247: too few spaces after comma

(commas)


[warning] 247-247: too few spaces after comma

(commas)


[warning] 247-247: too few spaces after comma

(commas)


[warning] 247-247: too few spaces after comma

(commas)


[warning] 247-247: too few spaces after comma

(commas)


[warning] 247-247: too few spaces after comma

(commas)


[warning] 247-247: too few spaces after comma

(commas)


[warning] 247-247: too few spaces after comma

(commas)


[warning] 247-247: too few spaces after comma

(commas)


[warning] 247-247: too few spaces after comma

(commas)


[warning] 247-247: too few spaces after comma

(commas)


[warning] 247-247: too few spaces after comma

(commas)


[warning] 247-247: too few spaces after comma

(commas)


[warning] 310-310: too few spaces after comma

(commas)


[warning] 310-310: too few spaces after comma

(commas)


[warning] 310-310: too few spaces after comma

(commas)


[warning] 310-310: too few spaces after comma

(commas)


[warning] 310-310: too few spaces after comma

(commas)


[warning] 310-310: too few spaces after comma

(commas)


[warning] 310-310: too few spaces after comma

(commas)


[warning] 310-310: too few spaces after comma

(commas)


[warning] 310-310: too few spaces after comma

(commas)


[warning] 310-310: too few spaces after comma

(commas)


[warning] 310-310: too few spaces after comma

(commas)


[warning] 310-310: too few spaces after comma

(commas)


[warning] 310-310: too few spaces after comma

(commas)


[warning] 310-310: too few spaces after comma

(commas)


[warning] 310-310: too few spaces after comma

(commas)


[warning] 316-316: too few spaces after comma

(commas)


[warning] 316-316: too few spaces after comma

(commas)


[warning] 316-316: too few spaces after comma

(commas)


[warning] 316-316: too few spaces after comma

(commas)


[warning] 316-316: too few spaces after comma

(commas)


[warning] 316-316: too few spaces after comma

(commas)


[warning] 316-316: too few spaces after comma

(commas)


[warning] 316-316: too few spaces after comma

(commas)


[warning] 316-316: too few spaces after comma

(commas)


[warning] 316-316: too few spaces after comma

(commas)


[warning] 316-316: too few spaces after comma

(commas)


[warning] 316-316: too few spaces after comma

(commas)


[warning] 316-316: too few spaces after comma

(commas)


[warning] 316-316: too few spaces after comma

(commas)


[warning] 316-316: too few spaces after comma

(commas)


[error] 319-319: no new line character at the end of file

(new-line-at-end-of-file)

egov-indexer/mukta-contractservices-indexer.yml

[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 60-60: too few spaces after comma

(commas)


[warning] 60-60: too few spaces after comma

(commas)


[warning] 60-60: too few spaces after comma

(commas)


[warning] 60-60: too few spaces after comma

(commas)


[warning] 60-60: too few spaces after comma

(commas)


[warning] 60-60: too few spaces after comma

(commas)


[warning] 60-60: too few spaces after comma

(commas)


[warning] 60-60: too few spaces after comma

(commas)


[warning] 60-60: too few spaces after comma

(commas)


[warning] 60-60: too few spaces after comma

(commas)


[warning] 60-60: too few spaces after comma

(commas)


[warning] 60-60: too few spaces after comma

(commas)


[warning] 60-60: too few spaces after comma

(commas)


[warning] 60-60: too few spaces after comma

(commas)


[warning] 60-60: too few spaces after comma

(commas)


[warning] 74-74: too few spaces after comma

(commas)


[warning] 74-74: too few spaces after comma

(commas)


[warning] 74-74: too few spaces after comma

(commas)


[warning] 74-74: too few spaces after comma

(commas)


[warning] 74-74: too few spaces after comma

(commas)


[warning] 74-74: too few spaces after comma

(commas)


[warning] 74-74: too few spaces after comma

(commas)


[warning] 74-74: too few spaces after comma

(commas)


[warning] 74-74: too few spaces after comma

(commas)


[warning] 74-74: too few spaces after comma

(commas)


[warning] 74-74: too few spaces after comma

(commas)


[warning] 74-74: too few spaces after comma

(commas)


[warning] 74-74: too few spaces after comma

(commas)


[warning] 74-74: too few spaces after comma

(commas)


[warning] 74-74: too few spaces after comma

(commas)


[warning] 74-74: too few spaces after comma

(commas)


[warning] 74-74: too few spaces after comma

(commas)


[warning] 74-74: too few spaces after comma

(commas)


[warning] 74-74: too few spaces after comma

(commas)


[warning] 74-74: too few spaces after comma

(commas)


[warning] 74-74: too few spaces after comma

(commas)


[warning] 119-119: too few spaces after comma

(commas)


[warning] 119-119: too few spaces after comma

(commas)


[warning] 119-119: too few spaces after comma

(commas)


[warning] 119-119: too few spaces after comma

(commas)


[warning] 119-119: too few spaces after comma

(commas)


[warning] 119-119: too few spaces after comma

(commas)


[warning] 119-119: too few spaces after comma

(commas)


[warning] 119-119: too few spaces after comma

(commas)


[warning] 119-119: too few spaces after comma

(commas)


[warning] 119-119: too few spaces after comma

(commas)


[warning] 119-119: too few spaces after comma

(commas)


[warning] 119-119: too few spaces after comma

(commas)


[warning] 119-119: too few spaces after comma

(commas)


[warning] 119-119: too few spaces after comma

(commas)


[warning] 119-119: too few spaces after comma

(commas)


[warning] 135-135: too few spaces after comma

(commas)


[warning] 135-135: too few spaces after comma

(commas)


[warning] 135-135: too few spaces after comma

(commas)


[warning] 135-135: too few spaces after comma

(commas)


[warning] 135-135: too few spaces after comma

(commas)


[warning] 135-135: too few spaces after comma

(commas)


[warning] 135-135: too few spaces after comma

(commas)


[warning] 135-135: too few spaces after comma

(commas)


[warning] 135-135: too few spaces after comma

(commas)


[warning] 135-135: too few spaces after comma

(commas)


[warning] 135-135: too few spaces after comma

(commas)


[warning] 135-135: too few spaces after comma

(commas)


[warning] 135-135: too few spaces after comma

(commas)


[warning] 135-135: too few spaces after comma

(commas)


[warning] 135-135: too few spaces after comma

(commas)


[warning] 135-135: too few spaces after comma

(commas)


[warning] 135-135: too few spaces after comma

(commas)


[warning] 135-135: too few spaces after comma

(commas)


[warning] 135-135: too few spaces after comma

(commas)


[warning] 135-135: too few spaces after comma

(commas)


[warning] 135-135: too few spaces after comma

(commas)


[warning] 180-180: too few spaces after comma

(commas)


[warning] 180-180: too few spaces after comma

(commas)


[warning] 180-180: too few spaces after comma

(commas)


[warning] 180-180: too few spaces after comma

(commas)


[warning] 180-180: too few spaces after comma

(commas)


[warning] 180-180: too few spaces after comma

(commas)


[warning] 180-180: too few spaces after comma

(commas)


[warning] 180-180: too few spaces after comma

(commas)


[warning] 180-180: too few spaces after comma

(commas)


[warning] 180-180: too few spaces after comma

(commas)


[warning] 180-180: too few spaces after comma

(commas)


[warning] 180-180: too few spaces after comma

(commas)


[warning] 180-180: too few spaces after comma

(commas)


[warning] 180-180: too few spaces after comma

(commas)


[warning] 180-180: too few spaces after comma

(commas)


[error] 185-185: trailing spaces

(trailing-spaces)


[warning] 251-251: too few spaces after comma

(commas)


[warning] 251-251: too few spaces after comma

(commas)


[warning] 251-251: too few spaces after comma

(commas)


[warning] 251-251: too few spaces after comma

(commas)


[warning] 251-251: too few spaces after comma

(commas)


[warning] 251-251: too few spaces after comma

(commas)


[warning] 251-251: too few spaces after comma

(commas)


[warning] 251-251: too few spaces after comma

(commas)


[warning] 251-251: too few spaces after comma

(commas)


[warning] 251-251: too few spaces after comma

(commas)


[warning] 251-251: too few spaces after comma

(commas)


[warning] 251-251: too few spaces after comma

(commas)


[warning] 251-251: too few spaces after comma

(commas)


[warning] 251-251: too few spaces after comma

(commas)


[warning] 251-251: too few spaces after comma

(commas)


[error] 254-254: no new line character at the end of file

(new-line-at-end-of-file)

🔇 Additional comments (5)
egov-indexer/mukta-estimateservices-indexer.yml (3)

1-4: LGTM: Service configuration is well-defined

The service name and version are clearly specified, providing good configuration metadata.


84-85: ⚠️ Potential issue

Remove duplicate field mapping

The estimateNumber field is mapped twice in the mukta-update-estimate section.

   - inJsonPath: $.estimateNumber
     outJsonPath: $.Data.estimateNumber
-  - inJsonPath: $.estimateNumber
-    outJsonPath: $.Data.estimateNumber

Likely invalid or redundant comment.


132-132: Verify bulk indexing configuration

The isBulk flag is set to true for legacy indexing operations. Ensure that:

  1. The system has sufficient resources to handle bulk operations
  2. Error handling and retry mechanisms are in place
  3. Monitoring is configured to track bulk indexing progress

Also applies to: 257-257

egov-indexer/mukta-contractservices-indexer.yml (2)

1-4: LGTM: Service definition is clear and well-structured

The service name and version are clearly defined.


131-132: Verify bulk indexing configuration

The bulk indexing paths differ between legacy index ($.contract.*) and reindex ($.contracts.*). This inconsistency might cause issues.

Also applies to: 191-193

✅ Verification successful

Let me check the content of these files to verify the indexing paths.


Let me check the content of the mukta-contractservices-indexer.yml file specifically to verify the paths.


Bulk indexing paths are correctly configured

The bulk indexing paths in mukta-contractservices-indexer.yml are intentionally different:

  • Legacy indexing uses $.contract.* for existing data
  • Reindexing uses $.contracts.* for migrated/new data

This is a valid configuration as they serve different purposes:

  • Legacy indexing (topic: mukta-contract-legacyIndex) handles existing contract data
  • Reindexing (topic: mukta-contract-legacyReIndex) handles bulk reindexing of migrated contracts with additional fields like supplementNumber, versionNumber etc.
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other contract-related indexers to verify the correct path
rg -l "contract.*" --type yaml

Length of output: 499


Script:

#!/bin/bash
# Check the content of contract-related indexer files for jsonPath patterns
rg "jsonPath.*contract" --type yaml -A 2 -B 2

Length of output: 58516


Script:

#!/bin/bash
# Check the content of mukta-contractservices-indexer.yml
cat egov-indexer/mukta-contractservices-indexer.yml

Length of output: 13939

Comment on lines +14 to +63
customJsonMapping:
indexMapping: { "Data":{"id":"","tenantId":"","contractStatus":"","contractNumber":"","executingAuthority":"","contractType":"","totalContractedAmount":"","securityDeposit":"","agreementDate":"","issueDate":"","defectLiabilityPeriod":"","orgId":"","startDate":"","endDate":"","completionPeriod":"","status":"","lineItems":[],"@timestamp":"timestamp","auditDetails":{},"additionalDetails":{},"currentProcessInstance":{},"history":{}}}
fieldMapping:
- inJsonPath: $.id
outJsonPath: $.Data.id
- inJsonPath: $.tenantId
outJsonPath: $.Data.tenantId
- inJsonPath: $.wfStatus
outJsonPath: $.Data.contractStatus
- inJsonPath: $.contractNumber
outJsonPath: $.Data.contractNumber
- inJsonPath: $.executingAuthority
outJsonPath: $.Data.executingAuthority
- inJsonPath: $.contractType
outJsonPath: $.Data.contractType
- inJsonPath: $.totalContractedAmount
outJsonPath: $.Data.totalContractedAmount
- inJsonPath: $.securityDeposit
outJsonPath: $.Data.securityDeposit
- inJsonPath: $.agreementDate
outJsonPath: $.Data.agreementDate
- inJsonPath: $.issueDate
outJsonPath: $.Data.issueDate
- inJsonPath: $.defectLiabilityPeriod
outJsonPath: $.Data.defectLiabilityPeriod
- inJsonPath: $.orgId
outJsonPath: $.Data.orgId
- inJsonPath: $.startDate
outJsonPath: $.Data.startDate
- inJsonPath: $.endDate
outJsonPath: $.Data.endDate
- inJsonPath: $.completionPeriod
outJsonPath: $.Data.completionPeriod
- inJsonPath: $.status
outJsonPath: $.Data.status
- inJsonPath: $.lineItems
outJsonPath: $.Data.lineItems
- inJsonPath: $.auditDetails
outJsonPath: $.Data.auditDetails
- inJsonPath: $.additionalDetails
outJsonPath: $.Data.additionalDetails
- inJsonPath: $.processInstance
outJsonPath: $.Data.currentProcessInstance
externalUriMapping:
- path: http://egov-workflow-v2.egov:8080/egov-workflow-v2/egov-wf/process/_search
queryParam: businessIds=$.contractNumber,history=true,tenantId=$.tenantId
apiRequest: { "RequestInfo": { "apiId": "org.egov.pt","ver": "1.0","ts": 1502890899493,"action": "asd","did": "4354648646","key": "xyz","msgId": "654654","requesterId": "61","authToken": "d9994555-7656-4a67-ab3a-a952a0d4dfc8","userInfo": { "id": 1,"uuid": "1fec8102-0e02-4d0a-b283-cd80d5dab067","type": "EMPLOYEE","tenantId": "pb.jalandhar","roles": [ { "name": "Employee","code": "EMPLOYEE","tenantId": "pb.jalandhar" } ] } } }
uriResponseMapping:
- inJsonPath: $.ProcessInstances
outJsonPath: $.Data.history
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Refactor: Reduce configuration duplication using YAML anchors

The field mappings and API configurations are repeated across all topics with minimal differences.

Consider using YAML anchors and aliases to reduce duplication:

# Define common field mappings
common_field_mapping: &common_fields
  - inJsonPath: $.id
    outJsonPath: $.Data.id
  - inJsonPath: $.tenantId
    outJsonPath: $.Data.tenantId
  # ... other common fields

# Define common API request
common_api_request: &common_api
  path: http://egov-workflow-v2.egov:8080/egov-workflow-v2/egov-wf/process/_search
  queryParam: businessIds=$.contractNumber,history=true,tenantId=$.tenantId
  apiRequest:
    RequestInfo:
      apiId: ${API_ID}
      # ... other fields

# Use in topics
mappings:
  - topic: mukta-save-contract
    fieldMapping:
      - *common_fields
      # Add topic-specific fields
    externalUriMapping:
      - <<: *common_api

Also applies to: 73-122, 134-183, 195-254

🧰 Tools
🪛 Gitleaks (8.21.2)

60-60: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

🪛 yamllint (1.35.1)

[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 15-15: too few spaces after comma

(commas)


[warning] 60-60: too few spaces after comma

(commas)


[warning] 60-60: too few spaces after comma

(commas)


[warning] 60-60: too few spaces after comma

(commas)


[warning] 60-60: too few spaces after comma

(commas)


[warning] 60-60: too few spaces after comma

(commas)


[warning] 60-60: too few spaces after comma

(commas)


[warning] 60-60: too few spaces after comma

(commas)


[warning] 60-60: too few spaces after comma

(commas)


[warning] 60-60: too few spaces after comma

(commas)


[warning] 60-60: too few spaces after comma

(commas)


[warning] 60-60: too few spaces after comma

(commas)


[warning] 60-60: too few spaces after comma

(commas)


[warning] 60-60: too few spaces after comma

(commas)


[warning] 60-60: too few spaces after comma

(commas)


[warning] 60-60: too few spaces after comma

(commas)

- inJsonPath: $.processInstance
outJsonPath: $.Data.currentProcessInstance
externalUriMapping:
- path: http://egov-workflow-v2.egov:8080/egov-workflow-v2/egov-wf/process/_search
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

Hardcoded service endpoints require standardization across configurations

Based on the verification:

  • The hardcoded workflow service endpoint egov-workflow-v2.egov:8080 is used in 35+ configuration files across different modules
  • There's no existing pattern of using environment variables for service URLs in the configurations
  • This represents a systemic architectural pattern that needs to be addressed globally

This is a valid architectural concern that:

  1. Makes environment-specific deployments rigid
  2. Requires manual updates to configurations for each environment
  3. Goes against the principle of configuration externalization

The suggested approach to use environment variables is correct and should be implemented as part of a broader standardization effort across all configurations.

🔗 Analysis chain

Verify service endpoint configuration

The workflow service endpoint is hardcoded. This might cause issues in different environments.

Consider:

  1. Making the service URL configurable via environment variables
  2. Using service discovery if available in your infrastructure
-path: http://egov-workflow-v2.egov:8080/egov-workflow-v2/egov-wf/process/_search
+path: ${WORKFLOW_SERVICE_URL}/egov-wf/process/_search

Also applies to: 117-117, 178-178, 249-249


The results show that the hardcoded workflow service endpoint is used across multiple indexer configurations and other service configurations. Let me verify if there are any existing environment variable based configurations to understand the standard practice.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Verify workflow service configuration across environments
rg -l "egov-workflow-v2.egov:8080" 

Length of output: 1520


Script:

#!/bin/bash
# Check for environment variable based configurations
rg -l '\$\{.*_URL\}' 

# Also check for any documentation about configuration practices
fd README.md --exec cat {}

Length of output: 66

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.