Skip to content

Commit

Permalink
Fix the manual report json (#2236)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cory McDonald authored Sep 18, 2019
1 parent a76a5b4 commit a95106b
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions app/models/json_builders/manual_payout_report_json_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,22 @@ def initialize(payout_report:)
def build
contents = []
@payout_report.potential_payments.to_be_paid.where(kind: PotentialPayment::MANUAL).find_each do |potential_payment|
publisher = Publisher.find(potential_payment.publisher_id).owner_identifier

contents.push(
{
"name" => potential_payment.name.to_s,
"altcurrency" => "BAT",
"probi" => potential_payment.amount.to_s,
"fees" => potential_payment.fees.to_s,
"authority" => Publisher.find(potential_payment.finalized_by_id).email,
"transactionId" => potential_payment.payout_report_id.to_s,
"owner" => Publisher.find(potential_payment.publisher_id).owner_identifier.to_s,
"type" => PotentialPayment::MANUAL,
"address" => potential_payment.address.to_s,
"upholdId" => potential_payment.uphold_id.to_s,
"documentId" => potential_payment.invoice_id.to_s,
name: potential_payment.name,
altcurrency: "BAT",
probi: potential_payment.amount.to_s,
fees: potential_payment.fees.to_s,
authority: Publisher.find(potential_payment.finalized_by_id).email,
transactionId: potential_payment.payout_report_id,
owner: publisher,
publisher: publisher,
type: PotentialPayment::MANUAL,
address: potential_payment.address,
upholdId: potential_payment.uphold_id,
documentId: potential_payment.invoice_id,
}
)
end
Expand Down

0 comments on commit a95106b

Please sign in to comment.