Sha256: a7fbe563fc037df94711bcc68d0aeb8515ab23c74c7fb62a3ad1a94d51c9d38a

Contents?: true

Size: 680 Bytes

Versions: 8

Compression:

Stored size: 680 Bytes

Contents

# frozen_string_literal: true

module Renalware
  module Letters
    class UnreadElectronicCCsComponent < ApplicationComponent
      include Pundit::Helper
      attr_reader :current_user

      def initialize(current_user:)
        @current_user = current_user
      end

      def unread_electronic_ccs
        @unread_electronic_ccs ||= begin
          receipts = Letters::ElectronicReceipt
            .includes(letter: [:patient, :author, :letterhead])
            .unread
            .for_recipient(current_user.id)
            .order(created_at: :asc)
          CollectionPresenter.new(receipts, Letters::ElectronicReceiptPresenter)
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
renalware-core-2.0.159 app/components/renalware/letters/unread_electronic_ccs_component.rb
renalware-core-2.0.158 app/components/renalware/letters/unread_electronic_ccs_component.rb
renalware-core-2.0.157 app/components/renalware/letters/unread_electronic_ccs_component.rb
renalware-core-2.0.156 app/components/renalware/letters/unread_electronic_ccs_component.rb
renalware-core-2.0.155 app/components/renalware/letters/unread_electronic_ccs_component.rb
renalware-core-2.0.153 app/components/renalware/letters/unread_electronic_ccs_component.rb
renalware-core-2.0.152 app/components/renalware/letters/unread_electronic_ccs_component.rb
renalware-core-2.0.151 app/components/renalware/letters/unread_electronic_ccs_component.rb