Skip to content

Commit 64da7a6

Browse files
committed
delete obsolete seeds
1 parent a70591c commit 64da7a6

File tree

1 file changed

+0
-138
lines changed

1 file changed

+0
-138
lines changed

priv/repo/seeds.exs

Lines changed: 0 additions & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -198,106 +198,6 @@ if account_id = Algora.config([:stripe, :test_account_id]) do
198198
)
199199
end
200200

201-
num_cycles = 20
202-
203-
# Create the contract template
204-
_contract_template =
205-
insert!(
206-
:contract,
207-
%{
208-
client_id: pied_piper.id,
209-
start_date: days_from_now(-num_cycles * 7),
210-
end_date: days_from_now(-(num_cycles - 1) * 7)
211-
}
212-
)
213-
214-
# Create the initial contract
215-
initial_contract =
216-
insert!(
217-
:contract,
218-
%{
219-
contractor_id: carver.id,
220-
client_id: pied_piper.id,
221-
start_date: days_from_now(-(num_cycles + 1) * 7),
222-
end_date: days_from_now(-num_cycles * 7)
223-
}
224-
)
225-
226-
{:ok, initial_contract} = Algora.Contracts.fetch_contract(initial_contract.id)
227-
228-
# Prepay the initial contract
229-
{:ok, _txs} = Algora.Contracts.prepay_contract(initial_contract)
230-
231-
# Iterate over the cycles to create timesheets and release & renew contracts
232-
last_contract =
233-
Enum.reduce_while(1..num_cycles, initial_contract, fn _i, contract ->
234-
insert!(:timesheet, %{
235-
contract_id: contract.id,
236-
hours_worked: Enum.random(35..45),
237-
inserted_at: contract.end_date
238-
})
239-
240-
{:ok, contract} = Algora.Contracts.fetch_contract(contract.id)
241-
242-
{:ok, {_txs, new_contract}} = Algora.Contracts.release_and_renew_contract(contract)
243-
244-
{:cont, new_contract}
245-
end)
246-
247-
insert!(:timesheet, %{
248-
contract_id: last_contract.id,
249-
hours_worked: Enum.random(35..45),
250-
inserted_at: last_contract.end_date
251-
})
252-
253-
thread = insert!(:thread, %{title: "#{pied_piper.name} x #{carver.name}"})
254-
255-
for user <- [pied_piper, carver, erich, richard, dinesh, gilfoyle] do
256-
insert!(
257-
:participant,
258-
%{
259-
thread_id: thread.id,
260-
user_id: user.id
261-
}
262-
)
263-
end
264-
265-
messages = [
266-
{erich,
267-
"hey kevin, i heard you're the best cloud architect in the valley. we need someone to help scale pied piper's infrastructure",
268-
days_from_now(-4, ~T[09:15:00.000000])},
269-
{carver,
270-
"thanks for reaching out! i've been following pied piper's middle-out compression algorithm - really excited about its potential",
271-
days_from_now(-4, ~T[09:45:00.000000])},
272-
{richard, "yeah our infrastructure needs help. we're getting crushed by the user growth",
273-
days_from_now(-4, ~T[14:20:00.000000])},
274-
{gilfoyle, "the current setup is adequate. but i suppose a second opinion wouldn't hurt",
275-
days_from_now(-3, ~T[15:05:00.000000])},
276-
{dinesh, "adequate? the servers catch fire every time we deploy", days_from_now(-3, ~T[15:12:00.000000])},
277-
{jared, "our uptime metrics have been concerning. i've prepared a spreadsheet tracking all incidents",
278-
days_from_now(-2, ~T[10:30:00.000000])},
279-
{carver,
280-
"i specialize in unconventional but effective solutions. fair warning - my methods might seem chaotic at first",
281-
days_from_now(-1, ~T[11:45:00.000000])},
282-
{gilfoyle, "chaos is good. keeps everyone on their toes", days_from_now(-1, ~T[16:20:00.000000])},
283-
{carver, "give me root access and a week. i'll make your infrastructure bulletproof 🚀",
284-
days_from_now(0, ~T[09:00:00.000000])}
285-
]
286-
287-
for {sender, content, inserted_at} <- messages do
288-
insert!(
289-
:message,
290-
%{
291-
thread_id: thread.id,
292-
sender_id: sender.id,
293-
content: content,
294-
inserted_at: inserted_at
295-
}
296-
)
297-
end
298-
299-
Logger.info("Contract: #{AlgoraWeb.Endpoint.url()}/#{pied_piper.handle}/contracts/#{initial_contract.id}")
300-
301201
big_head =
302202
upsert!(
303203
:user,
@@ -591,45 +491,7 @@ for {repo_name, issues} <- repos do
591491
end)
592492
end
593493
end
594-
595-
Logger.info("Claim [#{claim.status}]: #{AlgoraWeb.Endpoint.url()}/claims/#{claim.group_id}")
596494
end
597495
end
598496
end
599497
end
600-
601-
reviews = [
602-
{richard, carver, -1,
603-
"His cloud architecture is... unconventional, but it works. Like, really works. Our servers haven't crashed in weeks. Just wish he'd document things better."},
604-
{gilfoyle, carver, 0,
605-
"Finally, someone who understands that true system architecture requires embracing chaos. His security implementations are adequately paranoid. Satan would approve."},
606-
{dinesh, carver, -2,
607-
"The infrastructure is faster, I'll give him that. But his code comments are borderline offensive and he keeps calling my frontend 'cute'. Still better than our previous setup."},
608-
{jared, carver, -1,
609-
"Very efficient contractor! While his methods are somewhat anxiety-inducing, our uptime metrics have improved by 287%. Would recommend (with appropriate warnings)."},
610-
{richard, aly, -1,
611-
"Aly's expertise in distributed systems helped us optimize our entire backend. Their Java implementations were surprisingly elegant."},
612-
{gilfoyle, big_head, -2,
613-
"Big Head somehow managed to solve our most complex scaling issues by complete accident. I'm still not sure if he knows what he did."},
614-
{dinesh, jian_yang, -1,
615-
"Jian Yang's machine learning optimizations were impressive, even though half his comments were in Chinese. The SeeFood integration works flawlessly."},
616-
{jared, john, 0,
617-
"John's datacenter expertise saved us thousands in operational costs. His documentation is immaculate and his Perl scripts, while archaic, are incredibly efficient."}
618-
]
619-
620-
for {reviewer, reviewee, rating_delta, content} <- reviews do
621-
insert!(
622-
:review,
623-
%{
624-
rating: Algora.Reviews.Review.max_rating() + rating_delta,
625-
content: content,
626-
visibility: :public,
627-
contract_id: initial_contract.id,
628-
organization_id: pied_piper.id,
629-
reviewer_id: reviewer.id,
630-
reviewee_id: reviewee.id
631-
}
632-
)
633-
end
634-
635-
IO.puts("Contract: #{AlgoraWeb.Endpoint.url()}/#{pied_piper.handle}/contracts/#{initial_contract.id}")

0 commit comments

Comments
 (0)