From 1b14ce5ffbc44cae7bc3a84fd9b4a880964c7755 Mon Sep 17 00:00:00 2001 From: Yoga Pangestu Date: Mon, 8 Dec 2025 11:07:05 +0700 Subject: [PATCH] refactor(voucher): menyesuaikan factory dengan penambahan kolom baru --- database/factories/VoucherFactory.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/database/factories/VoucherFactory.php b/database/factories/VoucherFactory.php index 16657f1..f1e79bb 100644 --- a/database/factories/VoucherFactory.php +++ b/database/factories/VoucherFactory.php @@ -19,6 +19,7 @@ public function definition(): array return [ 'name' => $this->faker->words(2, true), 'code' => Str::upper(Str::random(8)), + 'tags' => $this->faker->words(1, true), 'type' => $type, 'discount_amount' => $type === VoucherType::PERCENTAGE->value ? $this->faker->numberBetween(5, 50) @@ -27,7 +28,8 @@ public function definition(): array 'max_discount' => $type === VoucherType::PERCENTAGE->value ? $this->faker->numberBetween(10000, 50000) : null, 'quota' => $this->faker->optional()->numberBetween(50, 500), 'limit_per_user' => $this->faker->optional()->numberBetween(1, 5), - 'start_date' => $this->faker->dateTimeBetween('-1 week', '+1 week')->format('Y-m-d'), + 'summary' => $this->faker->sentence(), + 'start_date' => $this->faker->dateTimeBetween('tomorrow', '+1 week')->format('Y-m-d'), 'end_date' => $this->faker->optional()->dateTimeBetween('+1 day', '+2 months')?->format('Y-m-d'), ]; }