"""Original mapping contract, no real importer or supplier records."""
def route(row,catalogue):
    if not row.get('supplier_code'):return 'hold: missing code'
    matches=catalogue.get(row['supplier_code'],[])
    if len(matches)==0:return 'hold: unmapped code'
    if len(matches)>1:return 'hold: ambiguous mapping'
    return 'eligible for remaining validation: '+matches[0]
catalogue={'S17':['C11','C12'],'S18':['C18']}
cases=[('R17',{'supplier_code':'S17'},'hold: ambiguous mapping'),('R18',{'supplier_code':'S18'},'eligible for remaining validation: C18'),('R19',{},'hold: missing code'),('R20',{'supplier_code':'S20'},'hold: unmapped code')]
for name,row,want in cases:
    actual=route(row,catalogue);assert actual==want
    print(name,actual)
print('4/4 branch assertions passed. Eligible does not mean the import has executed.')
