this repo has no description
1<?php
2
3namespace Database\Factories;
4
5use App\Models\Institution;
6use Illuminate\Database\Eloquent\Factories\Factory;
7use Illuminate\Support\Str;
8
9/**
10 * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Account>
11 */
12class AccountFactory extends Factory
13{
14 /**
15 * Define the model's default state.
16 *
17 * @return array<string, mixed>
18 */
19 public function definition(): array
20 {
21 return [
22 "external_ref" => Str::random(10),
23 "institution_id" => fake()->randomElement(Institution::all())->id,
24 "name" => fake()->randomElement([
25 "Private account",
26 "Savings account",
27 "Checking account",
28 ]),
29 "account_type" => fake()->randomElement([
30 "checking",
31 "savings",
32 "credit_card",
33 "loan",
34 "mortgage",
35 "brokerage",
36 "retirement",
37 "crypto_wallet",
38 "custody",
39 "other",
40 ]),
41 "currency" => fake()->currencyCode(),
42 "balance_minor" => fake()->randomNumber(7),
43 "direction" => fake()->randomElement(["positive", "negative"]),
44 "status" => fake()->randomElement(["open", "closed"]),
45 "raw_json" => null,
46 "opened_at" => fake()->date(),
47 "closed_at" => null,
48 ];
49 }
50}