Skip to content

Commit

Permalink
refactor get claims by date to use new auth manager
Browse files Browse the repository at this point in the history
  • Loading branch information
liztownd committed Oct 25, 2024
1 parent 5ae9b38 commit 140d0a9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/travel_pay/app/services/travel_pay/claims_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ def get_claims(params = {})
}
end

def get_claims_by_date_range(veis_token, btsss_token, params = {})
def get_claims_by_date_range(params = {})
if params['start_date'] && params['end_date']
DateTime.parse(params['start_date'].to_s) && DateTime.parse(params['end_date'].to_s)
else
raise ArgumentError,
message: "Both start and end dates are required, got #{params['start_date']}-#{params['end_date']}."
end

@auth_manager.authorize => { veis_token:, btsss_token: }
faraday_response = client.get_claims_by_date(veis_token, btsss_token, params)
raw_claims = faraday_response.body['data'].deep_dup

Expand Down

0 comments on commit 140d0a9

Please sign in to comment.