From fb6b54f9bde08ba33f0283da5e5bfa8446188da3 Mon Sep 17 00:00:00 2001 From: Erik Date: Wed, 15 Jul 2026 08:05:03 +0200 Subject: [PATCH] feat(inventory-go): min_od/max_od search filters + od sort Co-Authored-By: Claude Sonnet 5 --- go-services/inventory-go/search.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/go-services/inventory-go/search.go b/go-services/inventory-go/search.go index 1090e8d7..ffa55a3d 100644 --- a/go-services/inventory-go/search.go +++ b/go-services/inventory-go/search.go @@ -23,6 +23,7 @@ import ( const cteSelect = ` SELECT DISTINCT i.id AS db_item_id, i.character_name, i.name, i.icon, i.object_class, i.value, i.burden, + i.od_rating, i.current_wielded_location, i.bonded, i.attuned, i."unique", i.stack_size, i.max_stack_size, i.structure, i.max_structure, i.rare_id, i.timestamp AS last_updated, COALESCE(cs.max_damage, -1) AS max_damage, @@ -133,6 +134,7 @@ var sortMapping = map[string]string{ "crit_damage_resist_rating": "crit_damage_resist_rating", "item_set": "item_set", "coverage": "coverage_mask", "item_type_name": "object_class", "last_updated": "last_updated", "spell_names": "computed_spell_names", + "od": "od_rating", } // argBuilder accumulates positional ($N) query args. @@ -219,6 +221,7 @@ func (s *Server) runSearch(ctx context.Context, q url.Values) (map[string]any, e {"min_pk_damage_resist_rating", "pk_damage_resist_rating"}, {"min_gear_pk_damage_rating", "gear_pk_damage_rating"}, {"min_gear_pk_damage_resist_rating", "gear_pk_damage_resist_rating"}, {"min_tinks", "tinks"}, {"min_value", "value"}, {"min_workmanship", "workmanship"}, + {"min_od", "od_rating"}, } for _, f := range geFilters { if v := q.Get(f.param); v != "" { @@ -241,6 +244,11 @@ func (s *Server) runSearch(ctx context.Context, q url.Values) (map[string]any, e conds = append(conds, "attack_bonus >= "+ab.add(n)) } } + if v := q.Get("max_od"); v != "" { + if n, err := strconv.ParseFloat(v, 64); err == nil { + conds = append(conds, "od_rating <= "+ab.add(n)) + } + } // --- requirements (wield level) --- if v, ok := qInt(q, "max_level"); ok {