from application.model import Configurations
from application.repository import NDiscountRepository
from typing import List


class GetBenefitsInteractor(object):
    def __init__(self, configs, repository):
        # type: (Configurations, NDiscountRepository) -> None
        self.configs = configs
        self.logger = configs.logger
        self.repository = repository

    def apply(self, only_visible):
        # type: (bool) -> List[dict]

        return self.repository.get_benefits_by_visibility_from_database(only_visible)
