fix(voucher): menghapus kolom terms_condition dan menyesuaikan terhadap perubahannya
This commit is contained in:
parent
c8af14c505
commit
6e83278564
@ -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,
|
||||
];
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -67,14 +67,6 @@
|
||||
<flux:date-picker with-today label="Tanggal Selesai"
|
||||
wire:model.live.debounce.500ms="form.end_date" placeholder="Pilih Tanggal"
|
||||
autocomplete="off" locale="id-ID" />
|
||||
|
||||
<div class="md:col-span-2">
|
||||
<flux:editor label="Syarat dan Ketentuan"
|
||||
wire:model.live.debounce.500ms="form.terms_conditions"
|
||||
placeholder="1.Harus berlaku hanya untuk ....." auotocomplete="off"
|
||||
class="**:data-[slot=content]:min-h-[100px]!" />
|
||||
<flux:error name="form.terms_conditions" />
|
||||
</div>
|
||||
</div>
|
||||
</flux:card>
|
||||
</div>
|
||||
|
||||
@ -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'])
|
||||
|
||||
@ -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'])
|
||||
|
||||
Loading…
Reference in New Issue
Block a user