Skip to content

Commit

Permalink
Merge pull request #2018 from sul-dlss/poppy-fulfillment
Browse files Browse the repository at this point in the history
Send fulfillmentPreference (typo fix) if FOLIO version is poppy
  • Loading branch information
cbeer authored Feb 16, 2024
2 parents fba063d + 0d6718d commit de6045b
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions app/services/folio_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,25 @@ def as_json
CirculationRequest = Data.define(:request_level, :request_type, :instance_id, :item_id, :holdings_record_id,
:requester_id, :fulfillment_preference, :pickup_service_point_id,
:patron_comments, :request_expiration_date) do
# rubocop:disable Metrics/AbcSize, Metrics/MethodLength
def as_json
# TODO: after Poppy launch delete this logic and add `fulfillmentPreference: fulfillment_preference` directly to the hash.
# In versions prior to Poppy there is a typo in FOLIO ('fulfilment') that we are accounting for here
fix_fulfillment_preference = Settings.ils&.folio_version == 'poppy' ? { fulfillmentPreference: fulfillment_preference } : { fulfilmentPreference: fulfillment_preference } # rubocop:disable Layout/LineLength
{
requestLevel: request_level, requestType: request_type,
instanceId: instance_id, itemId: item_id, holdingsRecordId: holdings_record_id,
requesterId: requester_id, requestDate: Time.zone.now.utc.iso8601, fulfilmentPreference: fulfillment_preference,
requestLevel: request_level,
requestType: request_type,
instanceId: instance_id,
itemId: item_id,
holdingsRecordId: holdings_record_id,
requesterId: requester_id,
requestDate: Time.zone.now.utc.iso8601,
pickupServicePointId: pickup_service_point_id,
patronComments: patron_comments, requestExpirationDate: request_expiration_date
}
patronComments: patron_comments,
requestExpirationDate: request_expiration_date
}.merge(fix_fulfillment_preference)
end
# rubocop:enable Metrics/AbcSize, Metrics/MethodLength
end

def circulation_request_policy(item_type_id:, loan_type_id:, patron_type_id:, location_id:)
Expand Down

0 comments on commit de6045b

Please sign in to comment.