from typing import List


class ListenedEvents(object):
    DEVICE_STATUS_CHANGED = "DEVICE_STATUS_CHANGED"
    ORDER_MODIFIED = "ORDER_MODIFIED"
    ORDER_MODIFIED_DO_TENDER = "ORDER_MODIFIED_DO_TENDER"
    ORDER_MODIFIED_DISCOUNT_APPLIED = "ORDER_MODIFIED_DISCOUNT_APPLIED"
    ORDER_MODIFIED_DISCOUNT_REMOVED = "ORDER_MODIFIED_DISCOUNT_REMOVED"
    ORDER_MODIFIED_CLEAR_TENDERS = "ORDER_MODIFIED_CLEAR_TENDERS"
    ORDER_MODIFIED_RESET_CURRENT_ORDER = "ORDER_MODIFIED_RESET_CURRENT_ORDER"


def all_events(
    order_modified_by_message,    # type: bool
):
    # type: (...) -> List[str]

    listened_events = [
        ListenedEvents.DEVICE_STATUS_CHANGED,
    ]

    if not order_modified_by_message:
        listened_events.extend([
            ListenedEvents.ORDER_MODIFIED,
            ListenedEvents.ORDER_MODIFIED_DO_TENDER,
            ListenedEvents.ORDER_MODIFIED_DISCOUNT_APPLIED,
            ListenedEvents.ORDER_MODIFIED_DISCOUNT_REMOVED,
            ListenedEvents.ORDER_MODIFIED_CLEAR_TENDERS,
            ListenedEvents.ORDER_MODIFIED_RESET_CURRENT_ORDER,
        ])

    return listened_events
