# -*- coding: utf-8 -*-
from typing import List

from order_api import OrderService
from order_api.dto import CustomProperty
from pos_model import POSTypeMapper


def set_pos_type(
    order_service,  # type: OrderService
    sale_type,      # type: str
    pod_type,       # type: str
):
    # type: (...) -> None

    custom_property = CustomProperty(
        key="POS_TYPE",
        value=POSTypeMapper.get(sale_type, pod_type),
    )
    order_service.set_order_custom_property(custom_property=custom_property)


def get_pos_types():
    # type: () -> List[str]

    return POSTypeMapper.get_types()
