From 20c24efb644cff4308b8693d1def24b206466731 Mon Sep 17 00:00:00 2001 From: Hadi Jafar Date: Tue, 3 Feb 2026 14:14:45 -0500 Subject: [PATCH 1/2] Remove return reason orphan test This test will be added in a follow-up PR that also links the orphan return reasons. --- dev/test/integration/orphan_detection_test.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dev/test/integration/orphan_detection_test.rb b/dev/test/integration/orphan_detection_test.rb index 5fcce71ac..97b7bed79 100644 --- a/dev/test/integration/orphan_detection_test.rb +++ b/dev/test/integration/orphan_detection_test.rb @@ -37,5 +37,16 @@ class OrphanDetectionTest < ActiveSupport::TestCase assert_empty orphan_ids, message end + + test "All return reasons belong to at least one category" do + all_category_return_reasons = Category.all.flat_map(&:return_reasons).uniq + orphan_return_reasons = ReturnReason.all.reject { |rr| all_category_return_reasons.include?(rr) } + + orphan_ids = orphan_return_reasons.map(&:friendly_id).sort + message = "Found #{orphan_ids.size} orphan return reason(s) not assigned to any category:\n" \ + " #{orphan_ids.join("\n ")}" + + assert_empty orphan_ids, message + end end end From c571cd8f1acd5c1e555e738f6e1a9d2440aafd7b Mon Sep 17 00:00:00 2001 From: Hadi Jafar Date: Mon, 2 Feb 2026 10:51:29 -0500 Subject: [PATCH 2/2] fixing orphan return reasons --- data/categories/aa_apparel_accessories.yml | 109 ++++++++++++++++++ data/categories/ap_animals_pet_supplies.yml | 3 + data/categories/bi_business_industrial.yml | 4 + data/categories/bt_baby_toddler.yml | 5 + data/categories/el_electronics.yml | 14 +++ data/categories/fb_food_beverages_tobacco.yml | 13 +++ data/categories/fr_furniture.yml | 11 ++ data/categories/ha_hardware.yml | 3 + data/categories/hb_health_beauty.yml | 28 +++++ data/categories/hg_home_garden.yml | 19 +++ data/categories/lb_luggage_bags.yml | 5 + data/categories/me_media.yml | 2 + data/categories/os_office_supplies.yml | 2 + data/categories/se_services.yml | 5 + data/categories/sg_sporting_goods.yml | 4 + data/categories/tg_toys_games.yml | 10 ++ data/categories/vp_vehicles_parts.yml | 6 + 17 files changed, 243 insertions(+) diff --git a/data/categories/aa_apparel_accessories.yml b/data/categories/aa_apparel_accessories.yml index 16174d968..43fb6c2b9 100644 --- a/data/categories/aa_apparel_accessories.yml +++ b/data/categories/aa_apparel_accessories.yml @@ -25,6 +25,8 @@ - damaged_or_defective - unknown - other_reason + - color_too_bright + - color_too_muted - id: aa-1 name: Clothing children: @@ -71,6 +73,60 @@ - damaged_or_defective - unknown - other_reason + - sleeves_too_long + - sleeves_too_loose + - sleeves_too_short + - sleeves_too_tight + - collar_too_loose + - collar_too_tight + - chest_too_big + - chest_too_small + - inseam_too_long + - inseam_too_short + - waist_too_high + - waist_too_loose + - waist_too_low + - waist_too_tight + - legs_too_loose + - legs_too_tight + - tight_around_ankles + - tight_around_thighs + - loose_around_ankle + - loose_around_thighs + - no_pockets + - pockets_too_deep + - pockets_too_shallow + - material_not_breathable + - material_not_durable + - material_too_see_through + - material_too_stiff + - material_too_stretchy + - damaged_after_washing + - damaged_after_wear + - dye_transferred + - embellishment_fell_off + - fabric + - logo_peeling + - loose_seams + - loose_threads + - poor_stitching + - pulls_in_fabric + - seams_splitting + - shedding + - straps_too_long + - straps_too_short + - straps_too_thick + - straps_too_thin + - restrictive + - not_enough_support + - too_much_support + - padding_not_removable + - rubbing + - pressure_points + - stained + - stains_easily + - tangles_easily + - difficult_to_fasten - id: aa-1-1 name: Activewear children: @@ -3137,6 +3193,30 @@ - damaged_or_defective - unknown - other_reason + - band_rolls_up + - band_too_loose + - band_too_thick + - band_too_thin + - band_too_tight + - cups_gaping + - cups_too_loose + - cups_too_thick + - cups_too_thin + - cups_too_tight + - bust_too_big + - bust_too_loose + - bust_too_small + - bust_too_tight + - underwire + - not_enough_support + - too_much_support + - straps_too_long + - straps_too_short + - straps_too_thick + - straps_too_thin + - padding_not_removable + - rubbing + - pressure_points - id: aa-1-6-4 name: Camisoles children: [] @@ -9174,6 +9254,18 @@ - damaged_or_defective - unknown - other_reason + - frame_color + - frame_crooked + - frame_needs_adjustments + - frame_too_small + - lens_popped_out_of_frame + - lens_scratched + - refraction + - field_of_view_too_narrow + - magnification_too_strong + - magnification_too_weak + - uncomfortable + - pressure_points - id: aa-2-28 name: Suspenders children: [] @@ -10355,6 +10447,9 @@ - damaged_or_defective - unknown - other_reason + - stone_setting + - tarnished + - tangles_easily - id: aa-6-1 name: Anklets children: [] @@ -11008,6 +11103,20 @@ - damaged_or_defective - unknown - other_reason + - heel_too_high + - heel_too_low + - heel_too_thick + - heel_too_thin + - sole_too_thick + - sole_too_thin + - footbed_too_deep + - footbed_too_narrow + - footbed_too_shallow + - footbed_too_wide + - slippery + - squeaks + - rubbing + - pressure_points - id: aa-8-1 name: Athletic Shoes children: [] diff --git a/data/categories/ap_animals_pet_supplies.yml b/data/categories/ap_animals_pet_supplies.yml index 42a02e1df..95a1c6da8 100644 --- a/data/categories/ap_animals_pet_supplies.yml +++ b/data/categories/ap_animals_pet_supplies.yml @@ -88,6 +88,9 @@ - damaged_or_defective - unknown - other_reason + - pet_didnt_like + - pet_refused + - animal_didnt_like - id: ap-2-1 name: Bird Supplies children: diff --git a/data/categories/bi_business_industrial.yml b/data/categories/bi_business_industrial.yml index f7543b359..4d43c7a2c 100644 --- a/data/categories/bi_business_industrial.yml +++ b/data/categories/bi_business_industrial.yml @@ -39,6 +39,10 @@ - damaged_or_defective - unknown - other_reason + - budget + - sourcing + - lacks_required_certification + - method - id: bi-1 name: Advertising & Marketing children: diff --git a/data/categories/bt_baby_toddler.yml b/data/categories/bt_baby_toddler.yml index 16c5d5d97..efdab3054 100644 --- a/data/categories/bt_baby_toddler.yml +++ b/data/categories/bt_baby_toddler.yml @@ -24,6 +24,11 @@ - damaged_or_defective - unknown - other_reason + - baby_refused + - difficult_to_fold + - difficult_to_clean + - difficult_to_assemble + - assembly - id: bt-1 name: Baby Bathing children: diff --git a/data/categories/el_electronics.yml b/data/categories/el_electronics.yml index 77d2bc69a..eab4b9e3b 100644 --- a/data/categories/el_electronics.yml +++ b/data/categories/el_electronics.yml @@ -33,6 +33,20 @@ - damaged_or_defective - unknown - other_reason + - low_resolution + - product_overheats + - product_leaks + - difficult_to_use + - difficult_to_install + - mounting_difficulty + - doesnt_fit_phone + - doesnt_fit_tv + - detection_range + - fails_to_detect_threats + - lacks_security_features + - vibration + - unstable + - eye_strain - id: el-1 name: Arcade Equipment children: diff --git a/data/categories/fb_food_beverages_tobacco.yml b/data/categories/fb_food_beverages_tobacco.yml index 248076e10..7d75e5518 100644 --- a/data/categories/fb_food_beverages_tobacco.yml +++ b/data/categories/fb_food_beverages_tobacco.yml @@ -14,6 +14,19 @@ - damaged_or_defective - unknown - other_reason + - bitterness + - carbonation + - sweetness + - too_bitter + - too_rich + - too_sticky + - too_sweet + - artificial_tasting + - ripeness + - cook_time + - damaged_packaging + - packaging_not_sealed + - dried_out - id: fb-1 name: Beverages children: diff --git a/data/categories/fr_furniture.yml b/data/categories/fr_furniture.yml index bd1456e8e..a90c617ff 100644 --- a/data/categories/fr_furniture.yml +++ b/data/categories/fr_furniture.yml @@ -40,6 +40,17 @@ - damaged_or_defective - unknown - other_reason + - doesnt_fit_bed_frame + - doesnt_fit_mattress + - difficult_to_assemble + - assembly + - unstable + - sturdiness + - uncomfortable + - squeaks + - wheels_stick + - scratched + - surface_damage - id: fr-1 name: Baby & Toddler Furniture children: diff --git a/data/categories/ha_hardware.yml b/data/categories/ha_hardware.yml index c5f781110..0348bb7c1 100644 --- a/data/categories/ha_hardware.yml +++ b/data/categories/ha_hardware.yml @@ -29,6 +29,9 @@ - damaged_or_defective - unknown - other_reason + - temperature_range + - lacks_required_certification + - difficult_to_install - id: ha-1 name: Building Consumables children: diff --git a/data/categories/hb_health_beauty.yml b/data/categories/hb_health_beauty.yml index 2ca27fff0..076aacc9d 100644 --- a/data/categories/hb_health_beauty.yml +++ b/data/categories/hb_health_beauty.yml @@ -15,6 +15,23 @@ - damaged_or_defective - unknown - other_reason + - side_effects + - caused_allergic_reaction + - caused_irritation + - skin_tone + - reaction + - effectiveness + - drying + - messy + - smears + - smudges + - difficult_to_blend + - doesnt_blend_well + - prescription_processed_incorrectly + - absorption + - accuracy + - sample_method + - test_method - id: hb-1 name: Health Care children: @@ -61,6 +78,8 @@ - damaged_or_defective - unknown - other_reason + - wrong_amount + - wrong_dosage - id: hb-1-1 name: Acupuncture children: @@ -17192,6 +17211,10 @@ - damaged_or_defective - unknown - other_reason + - whitening_results + - caused_irritation + - taste + - effectiveness - id: hb-3-12-1 name: Breath Sprays children: [] @@ -20518,6 +20541,11 @@ - damaged_or_defective - unknown - other_reason + - base_curve + - uncomfortable + - painful + - caused_irritation + - eye_strain - id: hb-3-19-1-4-1 name: Biweekly Contact Lenses children: [] diff --git a/data/categories/hg_home_garden.yml b/data/categories/hg_home_garden.yml index 2b84e5695..2b7b4ecab 100644 --- a/data/categories/hg_home_garden.yml +++ b/data/categories/hg_home_garden.yml @@ -34,6 +34,25 @@ - damaged_or_defective - unknown - other_reason + - breaks_easily + - scratched + - stained + - stains_easily + - damaged_after_use + - surface_damage + - quality + - difficult_to_clean + - cleaning + - difficult_to_assemble + - assembly + - difficult_to_use + - doesnt_stay_closed + - hard_to_inflate + - heat + - suction_strength + - unstable + - sturdiness + - difficult_to_refill - id: hg-1 name: Bathroom Accessories children: diff --git a/data/categories/lb_luggage_bags.yml b/data/categories/lb_luggage_bags.yml index 8a9f93401..9d2e12ec5 100644 --- a/data/categories/lb_luggage_bags.yml +++ b/data/categories/lb_luggage_bags.yml @@ -31,6 +31,11 @@ - damaged_or_defective - unknown - other_reason + - lock + - doesnt_stay_closed + - wheels_stick + - straps_too_long + - straps_too_short - id: lb-1 name: Backpacks children: diff --git a/data/categories/me_media.yml b/data/categories/me_media.yml index 83815f357..337054831 100644 --- a/data/categories/me_media.yml +++ b/data/categories/me_media.yml @@ -18,6 +18,8 @@ - damaged_or_defective - unknown - other_reason + - wrong_format + - volume - id: me-1 name: Books children: diff --git a/data/categories/os_office_supplies.yml b/data/categories/os_office_supplies.yml index 92ecb3b85..f83265e4f 100644 --- a/data/categories/os_office_supplies.yml +++ b/data/categories/os_office_supplies.yml @@ -26,6 +26,8 @@ - damaged_or_defective - unknown - other_reason + - type_too_big + - type_too_small - id: os-1 name: Book Accessories children: diff --git a/data/categories/se_services.yml b/data/categories/se_services.yml index 7a98890f1..adf29816b 100644 --- a/data/categories/se_services.yml +++ b/data/categories/se_services.yml @@ -21,6 +21,11 @@ - damaged_or_defective - unknown - other_reason + - duplicate_order + - ordered_multiple + - ordered_wrong_format + - ordered_wrong_item + - trial_period_ending - id: se-1 name: Automotive Services children: diff --git a/data/categories/sg_sporting_goods.yml b/data/categories/sg_sporting_goods.yml index 0daca53f6..b43c71954 100644 --- a/data/categories/sg_sporting_goods.yml +++ b/data/categories/sg_sporting_goods.yml @@ -19,6 +19,10 @@ - damaged_or_defective - unknown - other_reason + - terrain + - uncomfortable + - too_stiff + - difficult_to_use - id: sg-1 name: Athletics children: diff --git a/data/categories/tg_toys_games.yml b/data/categories/tg_toys_games.yml index f1b2049bd..fb2272bc0 100644 --- a/data/categories/tg_toys_games.yml +++ b/data/categories/tg_toys_games.yml @@ -21,6 +21,16 @@ - damaged_or_defective - unknown - other_reason + - breaks_easily + - age_restriction + - age + - piece_count + - realism + - articulation + - difficult_to_assemble + - assembly + - too_complex + - too_simple - id: tg-1 name: Game Timers children: [] diff --git a/data/categories/vp_vehicles_parts.yml b/data/categories/vp_vehicles_parts.yml index cedf600a1..48418d593 100644 --- a/data/categories/vp_vehicles_parts.yml +++ b/data/categories/vp_vehicles_parts.yml @@ -14,6 +14,12 @@ - damaged_or_defective - unknown - other_reason + - fuel_capacity + - fuel_efficiency + - mileage + - terrain + - lifting_capacity + - optic_didnt_fit - id: vp-1 name: Vehicle Parts & Accessories children: