Skip to content

Commit

Permalink
Only transmit people with active roles to abacus (#1427)
Browse files Browse the repository at this point in the history
  • Loading branch information
codez authored Dec 19, 2024
1 parent fafd7bf commit f26c9ac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/jobs/invoices/abacus/transmit_all_members_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def failure(job)
end

def member_ids
Person.joins(:roles_unscoped)
Person.joins(:roles)
.where(roles: {type: ROLES_TO_TRANSMIT.map(&:sti_name)})
.where.not(data_quality: :error)
.distinct
Expand Down
5 changes: 4 additions & 1 deletion spec/jobs/invoices/abacus/transmit_all_members_job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@
end

let(:unexpected_people) do
Fabricate.times(2, :person)
Fabricate(:person) # no role
Group::SektionsFunktionaere::Administration.create!(person: Fabricate(:person), group: groups(:bluemlisalp_funktionaere)) # other role
Group::SektionsMitglieder::Mitglied.create!(person: Fabricate(:person), group: groups(:bluemlisalp_mitglieder), start_on: 60.years.ago, end_on: 5.years.ago) # old member
Group::AboMagazin::Abonnent.create!(person: Fabricate(:person), group: groups(:abo_die_alpen), start_on: 5.years.ago, end_on: 2.years.ago) # old abonnent
Group::AboMagazin::Neuanmeldung.create!(person: Fabricate(:person), group: groups(:abo_die_alpen))
end

Expand Down

0 comments on commit f26c9ac

Please sign in to comment.