Skip to content

Conversation

@5Amogh
Copy link
Member

@5Amogh 5Amogh commented Dec 30, 2025

📋 Description

JIRA ID: AMM-1937

Root Cause:
A Strength field was added to the ExpiryReport model in PR #104, which changed the constructor signature from 7 parameters to 8 parameters:

New constructor signature :
ExpiryReport(facilityName, itemName, itemCategory, strength, batchNo, unitCostPrice, expiryDate, quantityInHand)
However, the SQL queries in ItemStockReportRepo.java for getExpiryReport() and getExpiryReportByFacilityID() were not updated to include the Strength column. This caused a parameter mismatch where:

  • The database returned 7 columns (without Strength)
  • The code tried to map them to an 8-parameter constructor
  • This shifted all parameters by one position
  • The ExpiryDate value (e.g., "2025-04-01") was passed to the unitCostPrice parameter (Double type)
    Result: NumberFormatException: For input string: "2025-04-01"

Fix
Updated the SQL queries in ItemStockReportRepo.java to include the Strength column:

getExpiryReport() - Added Strength to SELECT clause
getExpiryReportByFacilityID() - Added Strength to SELECT clause

All queries now return 8 columns that correctly map to the updated ExpiryReport constructor parameters.

✅ Type of Change

  • 🐞 Bug fix (non-breaking change which resolves an issue.

@coderabbitai
Copy link

coderabbitai bot commented Dec 30, 2025

Important

Review skipped

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

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

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


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

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link

@5Amogh 5Amogh merged commit cc994f1 into release-3.6.0 Dec 30, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants