@@ -637,16 +637,16 @@ defmodule Algora.Payments do
637637 |> Repo . all ( )
638638 |> Map . new ( & { & 1 . id , & 1 } )
639639
640- { issue_bounty_ids , contract_bounty_ids } =
640+ { auto_bounty_ids , manual_bounty_ids } =
641641 Enum . split_with ( bounty_ids , fn id ->
642642 bounty = bounties [ id ]
643- bounty && bounty . ticket . repository_id
643+ bounty && bounty . contract_type != :marketplace
644644 end )
645645
646646 tip_ids = txs |> Enum . map ( & & 1 . tip_id ) |> Enum . reject ( & is_nil / 1 ) |> Enum . uniq ( )
647647 claim_ids = txs |> Enum . map ( & & 1 . claim_id ) |> Enum . reject ( & is_nil / 1 ) |> Enum . uniq ( )
648648
649- Repo . update_all ( from ( b in Bounty , where: b . id in ^ issue_bounty_ids ) , set: [ status: :paid ] )
649+ Repo . update_all ( from ( b in Bounty , where: b . id in ^ auto_bounty_ids ) , set: [ status: :paid ] )
650650 Repo . update_all ( from ( t in Tip , where: t . id in ^ tip_ids ) , set: [ status: :paid ] )
651651 # TODO: add and use a new "paid" status for claims
652652 Repo . update_all ( from ( c in Claim , where: c . id in ^ claim_ids ) , set: [ status: :approved ] )
@@ -655,16 +655,16 @@ defmodule Algora.Payments do
655655 Enum . filter ( txs , fn tx ->
656656 bounty = bounties [ tx . bounty_id ]
657657
658- contract ? = tx . bounty_id in contract_bounty_ids
658+ manual ? = tx . bounty_id in manual_bounty_ids
659659
660- if contract ? do
660+ if tx . type == :credit and manual ? do
661661 Admin . alert (
662662 "Contract payment received. URL: #{ AlgoraWeb.Endpoint . url ( ) } /#{ bounty . owner . handle } /contracts/#{ bounty . id } " ,
663663 :info
664664 )
665665 end
666666
667- tx . type != :credit or not contract ?
667+ tx . type != :credit or not manual ?
668668 end )
669669
670670 Repo . update_all (
0 commit comments