from common import InfAdicBuilderCommon
from ibpttaxprocessor import IbptTaxProcessor
from pos_model import Order, XmlTenderTypeFromPOSMapper

from _SatXmlPartBuilder import SatXmlPartBuilder
from satbuilder import ContextKeys


class InfAdicBuilder(SatXmlPartBuilder):
    def __init__(self, customer_text_field, tax_builder):
        # type: (str, IbptTaxProcessor) -> None

        self.customer_text_field = customer_text_field
        self.tax_builder = tax_builder

    def build_xml(self, order, context):
        # type: (Order, ContextKeys) -> unicode

        return InfAdicBuilderCommon(order, self.customer_text_field, self.tax_builder).build_common()
