• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pulibrary / orangelight / 00dbc10b-d747-4ad7-b211-7b26d753abbb

14 Aug 2025 01:25PM UTC coverage: 0.483% (-94.9%) from 95.343%
00dbc10b-d747-4ad7-b211-7b26d753abbb

push

circleci

web-flow
Merge pull request #5181 from pulibrary/dependabot/bundler/activestorage-7.2.2.2

Bump activestorage from 7.2.2.1 to 7.2.2.2

47 of 9721 relevant lines covered (0.48%)

0.01 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/app/models/requests/submissions/clancy_edd.rb
1
# frozen_string_literal: true
2
require 'faraday'
×
3

4
module Requests::Submissions
×
5
  class ClancyEdd < Service
×
6
    def initialize(submission)
×
7
      super(submission, service_type: 'clancy_edd')
×
8
    end
×
9

10
    def handle
×
11
      items = @submission.filter_items_by_service(service_type)
×
12
      items.each do |item|
×
13
        handle_item(item)
×
14
      end
×
15
    end
×
16

17
    private
×
18

19
      def handle_item(item)
×
20
        # place the item on hold
21
        digitize = Requests::Submissions::DigitizeItem.new(@submission, service_type:)
×
22
        digitize.handle
×
23
        if digitize.errors.empty?
×
24
          # request it from the clancy facility
25
          clancy_item = Requests::ClancyItem.new(barcode: item[:barcode])
×
26
          status = clancy_item.request?(patron: @submission.patron, hold_id: hold_id(item_barcode: item[:barcode], patron_barcode: @submission.patron.barcode))
×
27
          @errors << { type: 'clancy', error: clancy_item.errors.first, bibid: item[:bibid], barcode: item[:barcode] } unless status
×
28
        else
×
29
          @errors << digitize.errors.first.merge(type: 'clancy_edd')
×
30
        end
×
31
      end
×
32

33
      def hold_id(item_barcode:, patron_barcode:)
×
34
        id = "#{item_barcode}-#{patron_barcode}-#{Time.zone.now.to_i}"
×
35
        Rails.logger.debug { "Requesting clancy item with id: #{id}" }
×
36
        id
×
37
      end
×
38
  end
×
39
end
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc