from application.service import BenefitService
from application.model.transactions import AddBenefitToApplyUnitOfWork


class AddBenefitToApplyInteractor:
    def __init__(self, benefit_service):
        # type: (BenefitService) -> None

        self.benefit_service = benefit_service

    def apply(self, uow):
        # type: (AddBenefitToApplyUnitOfWork) -> None

        self.benefit_service.fix_and_apply_benefit(
            uow=uow,
            is_manual=True,
        )
        self.benefit_service.send_order_update_event(static_uow=uow.static_uow)
