def get_barcode(barcode: str) -> int:
    if str(barcode).isalpha():
        raise ValueError(f"Barcode '{barcode}' has alphabetic characters.")
    elif int(barcode) < 0:
        raise ValueError("The entered barcode has a negative value. Try again.")
    else:
        return int(barcode)