from enum import IntEnum

from messagebus import TokenCreator, TokenPriority


MSGGRP_SLCTRL_PRODMGR = "9"


def _create_product_token(number):
    return TokenCreator.create_token(
        priority=TokenPriority.low,
        message_group=MSGGRP_SLCTRL_PRODMGR,
        number=number,
    )


MSGGRP_SLCTRL_RUPTURE = "42"


def _create_rupture_token(number):
    return TokenCreator.create_token(
        priority=TokenPriority.low,
        message_group=MSGGRP_SLCTRL_RUPTURE,
        number=number,
    )

# noinspection SpellCheckingInspection


class ProductApiTokens(IntEnum):

    TK_SLCTRL_PMGR_GET_TENDERS = _create_product_token("68")
    TK_SLCTRL_PMGR_GET_PRODUCTS_NAME = _create_product_token("69")
    TK_SLCTRL_PMGR_RUPTURE_UPDATE_DAILY_DISHES = _create_rupture_token("13")
    TK_SLCTRL_PMGR_RUPTURE_UPDATE_ITEMS = _create_rupture_token("8")
