-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
44 changed files
with
136 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
app/Application/Infrastructure/Database/Factories/Traits/SupportProjections.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
namespace App\Application\Infrastructure\Database\Factories\Traits; | ||
|
||
use Illuminate\Database\Eloquent\Factories\Factory; | ||
use Illuminate\Database\Eloquent\Model; | ||
|
||
trait SupportProjections | ||
{ | ||
public function newModel(array $attributes = []): Model | ||
{ | ||
return Factory::newModel([ | ||
'uuid' => fake()->uuid(), | ||
...$attributes, | ||
])->writeable(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
namespace Database\Factories\Domain\Account; | ||
|
||
use App\Application\Infrastructure\Database\Factories\Traits\SupportProjections; | ||
use App\Domain\Account\Account; | ||
|
||
class AccountFactory extends \Illuminate\Database\Eloquent\Factories\Factory | ||
{ | ||
use SupportProjections; | ||
|
||
protected $model = Account::class; | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function definition(): array | ||
{ | ||
return [ | ||
'uuid' => $this->faker->uuid(), | ||
'name' => $this->faker->name(), | ||
'balance' => $this->faker->randomFloat(2, 0, 1000000), | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
namespace Database\Seeders; | ||
|
||
use App\Domain\Account\Account; | ||
use App\Domain\User\User; | ||
use Database\Seeders\Domain\User\UserSeeder; | ||
use Illuminate\Database\Seeder; | ||
|
||
class DatabaseSeeder extends Seeder | ||
{ | ||
/** | ||
* Seed the application's database. | ||
*/ | ||
public function run(): void | ||
{ | ||
$this->call([ | ||
UserSeeder::class, | ||
]); | ||
|
||
Account::factory()->count(50)->make()->each(function ($account) { | ||
$account->user_uuid = User::factory()->create()->uuid; | ||
$account->save(); | ||
}); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?php | ||
|
||
namespace App\Domain\User\Database\Seeders; | ||
namespace Database\Seeders\Domain\User; | ||
|
||
use App\Domain\User\User; | ||
use Illuminate\Database\Seeder; | ||
|
@@ -14,5 +14,7 @@ public function run(): void | |
'email' => '[email protected]', | ||
'password' => bcrypt('password'), | ||
])->create(); | ||
|
||
User::factory()->count(10)->create(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.