diff --git a/database/factories/Payment/PaymentFactory.php b/database/factories/Payment/PaymentFactory.php index ab13b8e7..f9f63a0b 100644 --- a/database/factories/Payment/PaymentFactory.php +++ b/database/factories/Payment/PaymentFactory.php @@ -16,7 +16,10 @@ class PaymentFactory extends Factory public function definition(): array { return [ - // + 'nr' => $this->faker->year, + 'subscription_id' => Subscription::factory()->create()->id, + 'status_id' => Status::factory()->create()->id, + 'last_remembered_at' => $this->faker->dateTime, ]; } diff --git a/database/factories/Payment/StatusFactory.php b/database/factories/Payment/StatusFactory.php new file mode 100644 index 00000000..ca8b6f95 --- /dev/null +++ b/database/factories/Payment/StatusFactory.php @@ -0,0 +1,26 @@ +<?php + +namespace Database\Factories\Payment; + +use App\Payment\Status; +use Illuminate\Database\Eloquent\Factories\Factory; + +class StatusFactory extends Factory +{ + + public $model = Status::class; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition() + { + return [ + 'name' => $this->faker->sentence, + 'is_bill' => $this->faker->boolean, + 'is_remember' => $this->faker->boolean, + ]; + } +} diff --git a/database/factories/Payment/SubscriptionFactory.php b/database/factories/Payment/SubscriptionFactory.php index 1297fc5a..e69aeb68 100644 --- a/database/factories/Payment/SubscriptionFactory.php +++ b/database/factories/Payment/SubscriptionFactory.php @@ -2,6 +2,7 @@ namespace Database\Factories\Payment; +use App\Fee; use App\Payment\Subscription; use Illuminate\Database\Eloquent\Factories\Factory; @@ -13,8 +14,9 @@ class SubscriptionFactory extends Factory public function definition(): array { return [ - 'name' => $this->faker->name, + 'name' => $this->faker->word, 'amount' => $this->faker->numberBetween(1000, 50000), + 'fee_id' => Fee::factory()->create()->id, ]; }