diff --git a/app/Livewire/Forms/Studio/Loyalty/VoucherForm.php b/app/Livewire/Forms/Studio/Loyalty/VoucherForm.php index 8a8a67f..a176ce7 100644 --- a/app/Livewire/Forms/Studio/Loyalty/VoucherForm.php +++ b/app/Livewire/Forms/Studio/Loyalty/VoucherForm.php @@ -33,8 +33,6 @@ class VoucherForm extends Form public ?string $end_date = null; - public ?string $terms_conditions = null; - public array $outlet_ids = []; public function rules(): array @@ -69,7 +67,6 @@ public function rules(): array 'limit_per_user' => ['nullable', new UnsignedInteger], 'start_date' => ['required', 'date', 'after:yesterday'], 'end_date' => ['nullable', 'date', 'after_or_equal:start_date'], - 'terms_conditions' => ['nullable', 'string'], 'outlet_ids' => ['required', 'array', 'min:1'], 'outlet_ids.*' => Rule::exists('outlets', 'id'), ]; @@ -84,7 +81,6 @@ public function validationAttributes(): array 'max_discount' => 'maks. diskon', 'quota' => 'kuota', 'limit_per_user' => 'limit per user', - 'terms_conditions' => 'syarat dan ketentuan', 'type' => 'Tipe', 'discount_amount' => 'Jumlah Diskon', 'start_date' => 'tanggal mulai', @@ -106,7 +102,6 @@ public function setVoucher(Voucher $voucher) $this->max_discount = replaceCurrency($this->voucher->max_discount); $this->quota = $this->voucher->quota; $this->limit_per_user = $this->voucher->limit_per_user; - $this->terms_conditions = $this->voucher->terms_conditions; $this->start_date = $this->voucher->start_date; $this->end_date = $this->voucher->end_date; @@ -151,7 +146,6 @@ private function prepareSavedData() 'quota' => $this->quota, 'available_count' => $this->quota, 'limit_per_user' => $this->limit_per_user, - 'terms_conditions' => $this->terms_conditions, 'start_date' => $this->start_date, 'end_date' => $this->end_date, ]; diff --git a/database/factories/VoucherFactory.php b/database/factories/VoucherFactory.php index e7d4445..16657f1 100644 --- a/database/factories/VoucherFactory.php +++ b/database/factories/VoucherFactory.php @@ -19,7 +19,6 @@ public function definition(): array return [ 'name' => $this->faker->words(2, true), 'code' => Str::upper(Str::random(8)), - 'terms_conditions' => $this->faker->optional()->sentence(), 'type' => $type, 'discount_amount' => $type === VoucherType::PERCENTAGE->value ? $this->faker->numberBetween(5, 50) diff --git a/database/migrations/2025_09_25_125559_create_vouchers_table.php b/database/migrations/2025_09_25_125559_create_vouchers_table.php index 714eeee..d459ef5 100644 --- a/database/migrations/2025_09_25_125559_create_vouchers_table.php +++ b/database/migrations/2025_09_25_125559_create_vouchers_table.php @@ -16,7 +16,6 @@ public function up(): void $table->id(); $table->string('name', 50); $table->string('code', 20)->unique(); - $table->text('terms_conditions')->nullable(); $table->enum('type', [VoucherType::values()])->default(VoucherType::PERCENTAGE)->comment(VoucherType::comment()); $table->unsignedInteger('discount_amount'); $table->unsignedInteger('min_purchase')->nullable(); diff --git a/resources/views/livewire/studio/loyalty/voucher/form.blade.php b/resources/views/livewire/studio/loyalty/voucher/form.blade.php index af99881..08d6307 100644 --- a/resources/views/livewire/studio/loyalty/voucher/form.blade.php +++ b/resources/views/livewire/studio/loyalty/voucher/form.blade.php @@ -67,14 +67,6 @@ - -
- - -
diff --git a/tests/Feature/Livewire/Studio/Loyalty/Voucher/CreateTest.php b/tests/Feature/Livewire/Studio/Loyalty/Voucher/CreateTest.php index ec0a11f..4fda89a 100644 --- a/tests/Feature/Livewire/Studio/Loyalty/Voucher/CreateTest.php +++ b/tests/Feature/Livewire/Studio/Loyalty/Voucher/CreateTest.php @@ -36,7 +36,6 @@ ->set('form.limit_per_user', $data['limit_per_user']) ->set('form.start_date', $data['start_date']) ->set('form.end_date', $data['end_date']) - ->set('form.terms_conditions', $data['terms_conditions']) ->set('form.type', $data['type']) ->set('form.discount_amount', $data['discount_amount']) ->set('form.max_discount', $data['max_discount']) diff --git a/tests/Feature/Livewire/Studio/Loyalty/Voucher/EditTest.php b/tests/Feature/Livewire/Studio/Loyalty/Voucher/EditTest.php index 4aa1d76..f0a4922 100644 --- a/tests/Feature/Livewire/Studio/Loyalty/Voucher/EditTest.php +++ b/tests/Feature/Livewire/Studio/Loyalty/Voucher/EditTest.php @@ -43,7 +43,6 @@ ->set('form.limit_per_user', $data['limit_per_user']) ->set('form.start_date', $data['start_date']) ->set('form.end_date', $data['end_date']) - ->set('form.terms_conditions', $data['terms_conditions']) ->set('form.type', $data['type']) ->set('form.discount_amount', $data['discount_amount']) ->set('form.max_discount', $data['max_discount'])