Skip to content

Fix: require marketCode in mandi-price select - #98

Closed
kelvinprabhu wants to merge 2 commits into
developmentfrom
fix/97-make-marketcode-mandatory-in-mandi-price-select
Closed

kelvinprabhu wants to merge 2 commits into
developmentfrom
fix/97-make-marketcode-mandatory-in-mandi-price-select

Conversation

@kelvinprabhu

@kelvinprabhu kelvinprabhu commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #97
Closes #107

What

  • Guard: a mandi-price select whose market.marketCode is absent or empty is refused before Agmarknet is called.
  • Response: each on_select resource carries market.marketCode, in the same place catalog-ondemand.yaml puts it.

Why

Without a market code, the Agmarknet query covers the whole district, and the answer can't say which market a price belongs to.

Refusal

HTTP 400, signed NACK:

{"message":{"status":"NACK","error":{"code":"SCH_INVALID_FORMAT","message":"BAD Request: this capability needs a market code in market.marketCode, as the catalog lists it; without it the query widens to the whole district"}}}

Refuse a select whose market.marketCode is absent or empty before
Agmarknet is called; without it the query widens to the whole district.
Each on_select resource now carries market.marketCode, in the same place
catalog-ondemand.yaml puts it.
@kelvinprabhu kelvinprabhu self-assigned this Oct 29, 2026
@kelvinprabhu
kelvinprabhu requested a review from manjudr October 29, 2026 14:45
@kelvinprabhu kelvinprabhu linked an issue Oct 29, 2026 that may be closed by this pull request
@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

📊 Test Coverage: ➖ Not applicable — no non-test Go files changed vs origin/main, so there are no lines to measure and no percentage to report.

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

🛡️ Trivy security scan (CRITICAL,HIGH,MEDIUM,LOW)

View full run

Go dependencies

No findings at CRITICAL,HIGH,MEDIUM,LOW.

Container image

No findings at CRITICAL,HIGH,MEDIUM,LOW.

Base automatically changed from development to release-0.2.0 October 30, 2026 11:06
Base automatically changed from release-0.2.0 to main November 2, 2026 06:47
@kelvinprabhu
kelvinprabhu changed the base branch from main to development November 3, 2026 06:56
kelvinprabhu added a commit that referenced this pull request Nov 3, 2026
…ields [#107]

Refuse a select whose market.marketCode is absent or empty before
Agmarknet is called; without it the query widens to the whole district.
Each on_select resource carries market.marketCode, where
catalog-ondemand.yaml puts it.

Refuse a select whose supportedPriceFields lists a value outside the
pack's Minimum/Maximum/Modal enum, which would otherwise return rows
with no price.

Supersedes the marketCode change in #98.
@kelvinprabhu

Copy link
Copy Markdown
Collaborator Author

CREATED ANOTHER. PR || #119

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.

Make marketCode mandatory in mandi-price select

1 participant