ministryofjustice/Claim-for-Crown-Court-Defence

View on GitHub
app/services/ccr/advocate_category_adapter.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
module CCR
  class AdvocateCategoryAdapter
    TRANSLATION_TABLE = {
      KC: 'KC',
      QC: 'QC',
      'Led junior': 'LEDJR',
      'Leading junior': 'LEADJR',
      'Junior alone': 'JRALONE',
      Junior: 'JUNIOR'
    }.stringify_keys.freeze

    class << self
      def code_for(category)
        TRANSLATION_TABLE.fetch(category)
      end
    end
  end
end