"""Versioned smartphone checks; this is a service policy, not a master taxonomy."""
CHECKLIST_VERSION = 1
# code, label, permits NOT_APPLICABLE. Every entry requires a recorded result.
CHECKLIST = (
    ("BOOT", "Power on / boot", False),
    ("DISPLAY", "Display", True),
    ("TOUCH", "Touch response", True),
    ("BUTTONS", "Physical buttons", True),
    ("CHARGING", "Charging", False),
    ("BATTERY", "Battery / basic power behavior", False),
    ("CELLULAR", "Cellular / network", True),
    ("WIFI", "Wi-Fi", True),
    ("BLUETOOTH", "Bluetooth", True),
    ("MICROPHONE", "Microphone", True),
    ("EARPIECE", "Earpiece", True),
    ("LOUDSPEAKER", "Loudspeaker", True),
    ("FRONT_CAMERA", "Front camera", True),
    ("REAR_CAMERA", "Rear camera", True),
    ("SENSORS", "Proximity / major sensors", True),
    ("VIBRATION", "Vibration", True),
    ("SIM", "SIM detection", True),
    ("IDENTIFIERS", "Visible device identifiers / consistency", True),
    ("COSMETIC", "Post-repair cosmetic / physical condition", False),
    ("REPAIRED_COMPLAINT", "Repaired complaint verification", False),
    ("FINAL_FUNCTION", "Final functional verification", False),
)


def definition(version):
    if version != CHECKLIST_VERSION:
        from django.core.exceptions import ValidationError
        raise ValidationError("Unsupported QC checklist version.")
    return CHECKLIST
