Skip to content

Commit

Permalink
Add expense invite description method and update invoice description
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew committed Jan 10, 2025
1 parent f1e5056 commit 96e5544
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions app/models/project_allocation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,16 @@ def payout
end
end

def expense_invite_description
if invitation.present? && invitation.accepted?
"You are receiving this message because you confirmed you are happy to accept a donation for your work within the #{fund.name} open source ecosystem."
else
"You are receiving this message because we have not received a response regarding a donation for your work within the #{fund.name} open source ecosystem.
If you wish to accept this donation please follow the instructions in this message."
end
end

def send_expense_invite
return if funding_rejected?
return if approved_funding_source?
Expand Down Expand Up @@ -128,11 +138,11 @@ def send_expense_invite
type: "INVOICE",
payee: {
name: "#{project.to_s} maintainer", # TODO try to get the maintainer name
email: "#{project.contact_email.gsub('@', '+test')}@test.com" # Use a test email for now
email: project.contact_email
},
items: [
{
description: "Allocation for #{project.to_s}",
description: expense_invite_description,
amount: amount_cents,
currency: "USD"
}
Expand Down

0 comments on commit 96e5544

Please sign in to comment.