from model.loyalty import (
    AdditionalInfo,
    Customer,
)


class CustomerInfo(object):
    def __init__(
        self,
        loyalty,    # type: Dict
    ):
        # type: (...) -> None

        customer_info = loyalty.get("customerInfo", {})

        customer = customer_info.get("customer", {})
        if customer:
            self.customer = Customer(
                customer=customer,
            )

        additional_info = customer_info.get("additionalInfo", {})
        if additional_info:
            self.additional_info = AdditionalInfo(
                additional_info=additional_info,
            )
