"""Stable workflow vocabulary.

These constants are intentionally company-neutral. Company profiles can rename
labels, but the engine uses these keys to keep rules testable.
"""

PAYMENT_BEFORE_SHIPPING = "before_shipping"
PAYMENT_AFTER_DELIVERY = "after_delivery"
PAYMENT_AGREEMENT = "agreement"
PAYMENT_UNDEFINED = "undefined"

DELIVERY_CARRIER = "carrier"
DELIVERY_PICKUP = "pickup"
DELIVERY_INSTALL_PARTNER = "install_partner"
DELIVERY_UNDEFINED = "undefined"

DOCUMENT_QUOTE = "quote"
DOCUMENT_INVOICE = "invoice"

ACTION_NO_ACTION = "NO_ACTION"
ACTION_OPEN_TASK = "OPEN_TASK"
ACTION_VALIDATE_FISCAL_CUSTOMER = "VALIDATE_FISCAL_CUSTOMER"
ACTION_RECONCILE_DOCUMENTS = "RECONCILE_DOCUMENTS"
ACTION_CREATE_QUOTE = "CREATE_JASMIN_QUOTE"
ACTION_CONFIRM_PAYMENT = "CONFIRM_PAYMENT"
ACTION_SEND_INVOICE = "SEND_INVOICE"
ACTION_CONFIRM_ORDER = "CONFIRM_ORDER"
ACTION_PREPARE_ORDER = "PREPARE_ORDER"
ACTION_WAIT_PRODUCTION = "WAIT_PRODUCTION"
ACTION_VALIDATE_PHYSICAL_ORDER = "VALIDATE_PHYSICAL_ORDER"
ACTION_SHIP_ORDER = "SHIP_ORDER"
ACTION_FOLLOW_UP_PAYMENT = "FOLLOW_UP_PAYMENT"
ACTION_FOLLOW_UP = "FOLLOW_UP"
ACTION_CLOSE_OPPORTUNITY = "CLOSE_OPPORTUNITY"
ACTION_REVIEW = "REVIEW"

COMMERCIAL_STAGE_NEW = "NEW_LEAD"
COMMERCIAL_STAGE_INFO_SENT = "INFO_SENT"
COMMERCIAL_STAGE_QUOTE_SENT = "QUOTE_SENT"
COMMERCIAL_STAGE_WAITING_PAYMENT = "WAITING_PAYMENT"
COMMERCIAL_STAGE_PAYMENT_CONFIRMED = "PAYMENT_CONFIRMED"
COMMERCIAL_STAGE_IN_EXECUTION = "ODOO_ORDER_CREATED"
COMMERCIAL_STAGE_WON = "WON"
COMMERCIAL_STAGE_LOST = "LOST"
COMMERCIAL_STAGE_REVIEW = "REVIEW"

TERMINAL_STAGES = {"WON", "LOST", "NO_INTEREST", "DELIVERED", "ARCHIVED"}

# Legacy action names still present in old data. They are normalized at the
# boundary so the rest of the engine can avoid showing "pró-forma" to operators.
LEGACY_PROFORMA_ACTIONS = {"SEND_PROFORMA", "PROFORMA_REQUESTED", "PROFORMA_SENT"}
