Sha256: 5d1842401744c36788a9fc58bd348632c6ae15d415db5a704529211ac59c74ac

Contents?: true

Size: 755 Bytes

Versions: 5

Compression:

Stored size: 755 Bytes

Contents

# frozen_string_literal: true
module Hyrax
  class FixityCheckFailureService < AbstractMessageService
    attr_reader :log_date, :checksum_audit_log, :file_set

    def initialize(file_set, checksum_audit_log:)
      @file_set = file_set
      @checksum_audit_log = checksum_audit_log
      @log_date = checksum_audit_log.created_at

      user = ::User.find_by_user_key(file_set.depositor)

      super(file_set, user)
    end

    def message
      uri = checksum_audit_log.checked_uri
      file_title = file_set.title.first
      I18n.t('hyrax.notifications.fixity_check_failure.message', log_date: log_date, file_title: file_title, uri: uri)
    end

    def subject
      I18n.t('hyrax.notifications.fixity_check_failure.subject')
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
hyrax-5.0.2 app/services/hyrax/fixity_check_failure_service.rb
hyrax-5.0.1 app/services/hyrax/fixity_check_failure_service.rb
hyrax-5.0.0 app/services/hyrax/fixity_check_failure_service.rb
hyrax-5.0.0.rc3 app/services/hyrax/fixity_check_failure_service.rb
hyrax-5.0.0.rc2 app/services/hyrax/fixity_check_failure_service.rb