from application.service import BenefitService
from application.model import Configurations
from typing import List


class RemoveBenefitInteractor(object):

    def __init__(self, configs, benefit_service):
        # type: (Configurations, BenefitService) -> None

        self.configs = configs
        self.benefit_service = benefit_service

    def remove(self, pos_id, benefit_keys):
        # type: (int, List) -> None

        self.benefit_service.remove_benefits(pos_id, benefit_keys)
        self.benefit_service.unset_applied_benefit(pos_id, ["IN_PROGRESS", "TOTALED"])
        self.benefit_service.apply_pending_benefits(pos_id)
