File tree Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ defmodule Algora.Bounties.Jobs.NotifyTransfer do
8
8
alias Algora.Github
9
9
alias Algora.Payments.Transaction
10
10
alias Algora.Repo
11
+ alias Algora.Workspace.Installation
11
12
alias Algora.Workspace.Ticket
12
13
13
14
require Logger
@@ -41,7 +42,7 @@ defmodule Algora.Bounties.Jobs.NotifyTransfer do
41
42
where: tx . type == :transfer ,
42
43
select_merge: % { user: user }
43
44
) do
44
- installation = Repo . get ( Installation , connected_user_id : ticket . repository . user . id )
45
+ installation = Repo . get_by ( Installation , provider_user_id : ticket . repository . user . id )
45
46
body = "🎉🎈 @#{ transaction . user . provider_login } has been awarded **#{ transaction . net_amount } **! 🎈🎊"
46
47
47
48
do_perform ( ticket_ref , body , installation )
Original file line number Diff line number Diff line change @@ -49,8 +49,9 @@ defmodule Algora.Github do
49
49
if pat_enabled ( ) do
50
50
apply ( function , [ pat ( ) | args ] )
51
51
else
52
- { module , name } = Function . info ( function , :name )
53
- function_name = "#{ module } .#{ name } "
52
+ { _ , module } = Function . info ( function , :module )
53
+ { _ , name } = Function . info ( function , :name )
54
+ function_name = String . trim_leading ( "#{ module } .#{ name } " , "Elixir." )
54
55
55
56
formatted_args =
56
57
Enum . map_join ( args , ", " , fn
Original file line number Diff line number Diff line change @@ -418,6 +418,10 @@ defmodule Algora.Payments do
418
418
provider: "stripe" ,
419
419
type: :transfer ,
420
420
status: :initialized ,
421
+ tip_id: credit . tip_id ,
422
+ bounty_id: credit . bounty_id ,
423
+ contract_id: credit . contract_id ,
424
+ claim_id: credit . claim_id ,
421
425
user_id: credit . user_id ,
422
426
gross_amount: credit . net_amount ,
423
427
net_amount: credit . net_amount ,
@@ -427,6 +431,10 @@ defmodule Algora.Payments do
427
431
|> Algora.Validations . validate_positive ( :gross_amount )
428
432
|> Algora.Validations . validate_positive ( :net_amount )
429
433
|> foreign_key_constraint ( :user_id )
434
+ |> foreign_key_constraint ( :tip_id )
435
+ |> foreign_key_constraint ( :bounty_id )
436
+ |> foreign_key_constraint ( :contract_id )
437
+ |> foreign_key_constraint ( :claim_id )
430
438
|> Repo . insert ( )
431
439
end
432
440
You can’t perform that action at this time.
0 commit comments