chore: init commit

in worker.../repo/GITFOLDER.zip is the .git folder.
This commit is contained in:
2026-08-11 14:44:09 -04:00
parent 0012380fd3
commit 392781f7aa
781 changed files with 65944 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
# frozen_string_literal: true
class EarningsSummary
attr_reader :portfolio
def initialize(portfolio)
@portfolio = portfolio
end
def attendance_earnings_cents
sum_by_reason(:attendance_earnings)
end
def reading_earnings_cents
sum_by_reason(:reading_earnings)
end
def math_earnings_cents
sum_by_reason(:math_earnings)
end
def awards_cents
sum_by_reason(:awards)
end
def total_earnings_cents
attendance_earnings_cents + reading_earnings_cents + math_earnings_cents + awards_cents
end
def transaction_fees_cents
sum_by_reason(:transaction_fees)
end
private
def sum_by_reason(reason)
portfolio.portfolio_transactions
.deposits
.where(reason: reason)
.sum(:amount_cents)
end
end