ministryofjustice/Claim-for-Crown-Court-Defence

View on GitHub
app/presenters/fee/misc_fee_presenter.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
module Fee
  class MiscFeePresenter < Fee::BaseFeePresenter
    def quantity
      return not_applicable_html unless agfs?
      return not_applicable_html if fee_type&.unique_code == 'MISTE'

      super
    end

    def rate
      return not_applicable_html unless agfs?
      return not_applicable_html if fee_type&.unique_code == 'MISTE'

      super
    end

    private

    def agfs?
      fee&.claim&.agfs? ? true : false
    end
  end
end