from rest_framework.reverse import reverse
from wbcore.metadata.configs.endpoints import EndpointViewConfig


class CommissionEndpointConfig(EndpointViewConfig):
    def get_endpoint(self, **kwargs):
        return reverse(
            "wbcommission:type-account-commission-list",
            args=[self.view.kwargs["commission_type_id"], self.view.kwargs["account_id"]],
            request=self.request,
        )


class CommissionRuleCommissionEndpointConfig(EndpointViewConfig):
    def get_endpoint(self, **kwargs):
        return reverse("wbcommission:commission-rule-list", args=[self.view.commission.id], request=self.request)
