<?php

namespace App\Http\Resources\Discounts;

use Illuminate\Http\Resources\Json\JsonResource;

class DiscountVoucherResource extends JsonResource
{
    public function toArray($request): array
    {
        return [
            'id' => $this->id,
            'code' => $this->code,
            'discount_type' => $this->discount_type,
            'discount_value' => $this->discount_value,
            'max_uses' => $this->max_uses,
            'times_used' => $this->times_used,
            'valid_from' => $this->valid_from,
            'valid_until' => $this->valid_until,
            'is_active' => (bool) $this->is_active,
            'description' => $this->description,
            'school_year' => $this->school_year,
            'semester' => $this->semester,
        ];
    }
}
