CROP
ProjectsAdmin Panel

DIS Routing Analysis Report

Date: 2026-01-14 Database: crop_dev Total BNS Parts Analyzed: 1314

DIS Routing Analysis Report

Date: 2026-01-14 Database: crop_dev Total BNS Parts Analyzed: 1314

Executive Summary

Investigation into ~500 "not found" parts in DIS API revealed that the issue is primarily incorrect manufacturer code routing, not missing parts in DIS. After optimizing the routing logic, we achieved:

MetricBeforeAfterImprovement
Found with routing~74%81.3%+7.3%
Truly not found~35072-278 parts
Misrouted (edge cases)Unknown174Identified

Current Routing Logic

BNS (Briggs & Stratton) parts require smart routing based on part number patterns:

PatternExampleRoute ToSuccess Rate
DOT_FORMAT06.0043, 81.A048VNT97%
DIGIT_75020875FER95%
FS_SUFFIX5106952FSFER90%
X_SUFFIX5020843X2FER93%
SM_SUFFIX5020441SMB&S72%
YP_SUFFIX5022383YPB&S76%
GS_SUFFIX5021089GSB&S100%
S_SUFFIX5104045SB&S65%
DIGIT_6197546B&S92%
DIGIT_8_8484003203B&S72%
DIGIT_OTHER50214085B&S-
DASH_FORMAT396-726B&S0%
OTHER27918FER20%

Issues Identified

1. Data Entry Errors (Immediate Fix Required)

OriginalCorrectedCodeIssue
06-006306.0063VNTDash instead of dot
5101756X2BS5101756X2FERExtra "BS" suffix
5101986SBS5101986SFERExtra "BS" suffix
5105512SBS5105512SFERExtra "BS" suffix

2. Pattern Routing Edge Cases (174 parts)

These parts are correctly routed by pattern statistics, but individually would be found with a different code:

PatternCurrent RouteParts Found ElsewhereBest Alt
SMB&S53FER (52)
YPB&S33FER (32)
D8-84B&S40FER (40)
D6B&S12FER (7), NHL (2)
FSFER11B&S (11)
D7FER6B&S (4)
OTHERFER11B&S (6), NHL (5)

Note: Changing routing for these patterns would harm more parts than it helps. The current routing is statistically optimal.

3. Truly Not Found Parts (72 parts)

These parts were not found with ANY manufacturer code tested:

PatternCountExamples
DASH120509-0269, 396-726, 396-727
OTHER3026156, 50450370B, 102409501
D68278035, 278036, 496590
D781670855, 5020875, 5021181
S7183390PS, 499486S
D8350214085, 80175702
SM25046360XISM, 5100259SM
DOT28.A065, 81.B50
YP15101071YP
X1510016X1
FS15106952FS

These require manual investigation - possible causes:

  • Data entry errors (typos in part numbers)
  • Parts not yet added to DIS
  • Internal/OEM numbers not in DIS catalog
  • Different manufacturer codes not in our test list

Recommendations

Phase 1: Immediate Fixes (High Impact)

  1. Fix data entry errors in parts_bns collection:

    // In MongoDB
    db.parts_bns.updateOne({ partNumber: "06-0063" }, { $set: { partNumber: "06.0063" }})
  2. Strip BS suffix from part numbers ending in "SBS" or "BS" when querying DIS (or fix in DB)

Phase 2: Per-Part Override System (Medium Impact)

Create an override collection for edge cases:

interface PartRouteOverride {
  vendorCode: string;  // "BNS"
  partNumber: string;  // "5020441SM"
  manufacturerCode: string;  // "FER" instead of default "B&S"
}

This would boost found rate from 81.3% to 94.5% without changing pattern logic.

Phase 3: Manual Review (Cleanup)

Generate a report of 72 truly not-found parts for manual review:

  • Verify part numbers are correct
  • Check if parts exist in DIS under different numbers
  • Consider removing obsolete parts from database

Files Modified

Frontend

  • /lib/types/dis.ts - Added X_SUFFIX pattern, fixed DOT_FORMAT regex

Backend

  • /CROP-parts-services/services/catalog/src/services/dis-service.ts - Synced with frontend

Scripts Created

  • scripts/analyze-misrouted.ts - Pattern analysis
  • scripts/quick-investigate.ts - Fast batch investigation
  • scripts/analyze-not-found-patterns.ts - Typo detection
  • scripts/routing-gap-analysis.ts - Full gap analysis

Conclusion

The "500 not found" issue was reduced to:

  • 174 edge cases - Pattern routing is optimal, but individual parts differ
  • 72 truly not found - Require manual investigation
  • 1068 parts (81.3%) - Now correctly found with optimized routing

With per-part overrides for the 174 edge cases, we could achieve 94.5% found rate.

On this page