# -*- coding: utf-8 -*-
from xml.etree import cElementTree as eTree
from typing import List

from sysactions import get_podtype, OrderTaker
from pos_model import POSTypeMapper


def set_pos_type(pos_ot, model, sale_type=None, pod_type=None):
    # type: (OrderTaker, eTree.XML, str, str) -> None

    if not pod_type:
        pod_type = get_podtype(model)

    pos_type = POSTypeMapper.get(sale_type, pod_type)
    pos_ot.setOrderCustomProperty("POS_TYPE", pos_type)


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

    return POSTypeMapper.get_types()
