from typing import Any, Tuple

from messageprocessorutil import UuidMessageProcessor

from dailygoals_services.interactor.update_total_sold import UpdateTotalSoldOrderInteractor


class UpdateTotalSoldOrderProcessor(UuidMessageProcessor):
    def __init__(self, interactor):
        # type: (UpdateTotalSoldOrderInteractor) -> None

        super(UpdateTotalSoldOrderProcessor, self).__init__()
        self.interactor = interactor

    def parse_data(self, data, event_type):
        # type: (Any, str) -> (Any, str)

        return data, event_type

    def call_business(self, params):
        # type: (Tuple) -> None

        data, event_type = params
        self.interactor.update(data, event_type)

    def format_response(self, message_bus, message, event, request, response):
        return

    def format_exception(self, message_bus, message, event, request, exception):
        return

    def format_parse_exception(self, message_bus, message, event, data, exception):
        return
