from production.box import NotShowOnKitchenAddTagBox
from production.treebuilder import BoxConfiguration

from ._BoxBuilder import BoxBuilder


class NotShowOnKitchenAddTagBoxBuilder(BoxBuilder):
    def __init__(self, product_repository, loggers):
        super(NotShowOnKitchenAddTagBoxBuilder, self).__init__(loggers)

        self.product_repository = product_repository

    def build(self, config):
        # type: (BoxConfiguration) -> NotShowOnKitchenAddTagBox

        tag_to_add = self.get_extra(config, "TagToAdd", None)

        return NotShowOnKitchenAddTagBox(
            name=config.name,
            sons=config.sons,
            tag_to_add=tag_to_add,
            product_repository=self.product_repository,
            logger=self.get_logger(config),
        )
