from .common_lock import get_lock_reason
from actions.models import UserLockType


def get_lock_message(
    user_id,    # type: str
):
    # type: (...) -> str

    reasons = {
        UserLockType.CLOSING_OPERATOR: "$OPERATOR_IS_PERFORMING_AN_OPEN_OR_CLOSE_ACTION",
        UserLockType.PERFORMING_TENDER: "$OPERATOR_IS_PERFORMING_TENDER_ACTION"
    }
    reason = get_lock_reason(user_id=user_id)
    if reason in reasons:
        return reasons[reason]

    return reasons[UserLockType.CLOSING_OPERATOR]
