from typing import List

from mw_helper import ensure_iterable

from production.model import ProductionOrder
from ._OrderCondition import OrderCondition


class PodTypeCondition(OrderCondition):
    def __init__(self, pod_types):
        # type: (List[str]) -> None

        self.valid_pod_types = ensure_iterable(pod_types)

    def evaluate(self, order):
        # type: (ProductionOrder) -> bool

        return order.pod_type in self.valid_pod_types
