@@ -2,6 +2,7 @@ defmodule Algora.Admin do
22  @ moduledoc  false 
33  import  Ecto.Query 
44
5+   alias  Algora.Accounts 
56  alias  Algora.Accounts.User 
67  alias  Algora.Bounties.Claim 
78  alias  Algora.Parser 
@@ -12,6 +13,57 @@ defmodule Algora.Admin do
1213
1314  require  Logger 
1415
16+   def  seed  do 
17+     import  Algora.Factory 
18+ 
19+     title  =  "Monthly PR Review & Triage Bounty" 
20+ 
21+     description  =  """ 
22+     ## What needs doing 
23+ 
24+     Review open pull requests across our repos and: 
25+ 
26+     1. Test them locally 
27+     2. Leave helpful comments 
28+     3. Merge or close stale PRs 
29+     4. Tag relevant people when needed 
30+ 
31+     ## Success looks like 
32+ 
33+     - [ ] All PRs older than 2 weeks have been reviewed 
34+     - [ ] Clear comments left on PRs needing changes 
35+     - [ ] Stale PRs (>30 days old) closed with explanation 
36+     - [ ] Weekly summary posted in #dev channel 
37+     """ 
38+ 
39+     org  =  Repo . get_by! ( User ,  handle:  "piedpiper0" ) 
40+     user  =  Repo . get_by! ( User ,  handle:  "zcesur" ) 
41+ 
42+     repository  =  insert! ( :repository ,  user:  org ) 
43+     ticket  =  insert! ( :ticket ,  title:  title ,  repository:  repository ,  description:  description ) 
44+     bounty  =  insert! ( :bounty ,  ticket:  ticket ,  owner:  org ,  creator:  user ,  amount:  Money . new ( 1000 ,  :USD ) ) 
45+ 
46+     for  contributor  <-  Accounts . list_featured_developers ( )  do 
47+       insert! ( :transaction , 
48+         type:  :debit , 
49+         net_amount:  Money . new ( 1000 ,  :USD ) , 
50+         user_id:  org . id , 
51+         bounty_id:  bounty . id , 
52+         status:  :succeeded 
53+       ) 
54+ 
55+       insert! ( :transaction , 
56+         type:  :credit , 
57+         net_amount:  Money . new ( 1000 ,  :USD ) , 
58+         user_id:  contributor . id , 
59+         bounty_id:  bounty . id , 
60+         status:  :succeeded 
61+       ) 
62+     end 
63+ 
64+     IO . puts ( "#{ AlgoraWeb.Endpoint . url ( ) }  /org/#{ org . handle }  /bounties/#{ bounty . id }  " ) 
65+   end 
66+ 
1567  def  token! ,  do:  System . fetch_env! ( "ADMIN_GITHUB_TOKEN" ) 
1668
1769  def  run ( worker )  do 
0 commit comments