You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make marketCode mandatory in mandi-price select #97
A mandi-price select without market.marketCode is currently sent to Agmarknet without a marketcode. The query then covers the whole district, and the on_select resources have no marketCode, so the caller can't tell which market a price belongs to.
New guard: refuse a select whose market.marketCode is absent or empty, before Agmarknet is called.
on_select resources carry market.marketCode (the requested code), in the same place catalog-ondemand.yaml puts it.
Guards can set their own error code. Add an optional code field to mapping guards (requirement in pkg/plugin/implementation/jsonmapper/jsonmapper.go) and pass it to NewBadReqErr; without one, the default SCH_INVALID_FORMAT is unchanged. The missing marketCode and missing validity guards use SCH_REQUIRED_FIELD_MISSING.
Refusal returned to the caller
HTTP 400, signed NACK:
{"message":{"status":"NACK","error":{"code":"SCH_REQUIRED_FIELD_MISSING","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"}}}
Activity
[-]Let mapping guards set their own error code[/-][+]Make marketCode mandatory in mandi-price select[/+]feat: require marketCode in mandi-price select [#97]
feat: make mandi-price marketCode optional, district-wide without it [#…
feat: require state, district, commodity and validity dates in mandi-…
feat: match mandi-price marketName against the district's markets [#107]
revert: keep jsonmapper unchanged; report the unplaceable marketName …
fix: refuse mandi-price marketName without marketCode; shorten commen…