Created
November 28, 2024 14:08
-
-
Save RStankov/85afcee3b23a1acde27ccd51233f9c4b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
batch = AngryBatch.new label: 'BulkWithdraw' | |
# check inherits from ActiveJob::Base | |
batch.on_complete Finance::WithdrawBulkCompleteJob, bulk_withdraw | |
zerod_fees do |fee| | |
# check inherits from ActiveJob::Base | |
# check job includes AngryJob::Batchable | |
batch.enqueue Taxation::MaintenanceTaxAutoAdjustmentJob, bulk_withdraw, fee: fee, amount: 0 | |
end | |
bulk_withdraw.withdraws.each do | |
batch.enqueue Taxation::GeneratePaymentDocumentJob, _1 | |
batch.enqueue Taxation::MaintenanceTaxAutoAdjustmentJob, _1 | |
end | |
# can do `perform_now` | |
batch.perform_later |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment