Skip to content

Commit

Permalink
Create activity log record when a user approves a claim from the samp…
Browse files Browse the repository at this point in the history
…ling flow
  • Loading branch information
Kizr committed Jan 16, 2025
1 parent 0f9cc97 commit ac7da82
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions app/controllers/claims/support/claims/samplings_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ def confirm_approval; end
def update
@claim.status = :paid
@claim.save!

Claims::ClaimActivity.create!(action: :sampling_approved_manually, user: current_user, record: @claim)

redirect_to claims_support_claims_samplings_path, flash: {
heading: t(".success_heading"),
}
Expand Down
2 changes: 1 addition & 1 deletion app/services/claims/sampling/create_and_deliver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def call
end
end

Claims::ClaimActivity.create!(action: :sampling_approved_manually, user: current_user, record: sampling)
Claims::ClaimActivity.create!(action: :sampling_uploaded, user: current_user, record: sampling)
end

private
Expand Down
2 changes: 1 addition & 1 deletion spec/services/claims/sampling/generate_csv_file_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
subject(:generate_csv_file) { described_class.call(claims:, provider_name:) }

let(:claims) { create_list(:claim, 3, mentor_trainings: [create(:mentor_training, hours_completed: 10)]) }
let(:provider_name) { "NIOT"}
let(:provider_name) { "NIOT" }

describe "#call" do
it "generates a CSV file of claims" do
Expand Down

0 comments on commit ac7da82

Please sign in to comment.