# -*- coding: utf-8 -*-

from sysactions import (
    action,
    show_messagebox,
)

from actions.rupture.rupture_common import get_rupture_user_id_with_validation
from msgbusboundary import Rupture


@action
def do_sync_delivery_menu(
    pos_id,     # type: str
):
    # type: (...) -> None

    user_id = get_rupture_user_id_with_validation(pos_id=pos_id)

    current_disabled = Rupture.get_disabled_products()
    Rupture.update_items(
        user_id=user_id,
        parts_to_enable=[],
        parts_to_disable=current_disabled,
    )
    show_messagebox(pos_id, "$DELIVERY_SYNC_STARTED")
