<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

/**
 * Class SeasonalSegment
 * @package App\Models
 *
 * @property int $company_id
 * @property int $transferable_bank_id
 * @property string $marking
 * @property string $reference
 * @property float $fix_amount
 * @property int $convertible_currency_id
 * @property int $conversion_currency_id
 */
class SeasonalSegment extends Model
{
    use HasFactory;

    use SoftDeletes;

    protected $table = 'seasonal_segment';

    /**
     * Get the attributes that should be cast.
     *
     * @return array<string, string>
     */
    protected function casts(): array
    {
        return [
            'starting_on' => 'datetime',
            'ending_on' => 'datetime',
            'deleted_at' => 'datetime',
        ];
    }

    /**
     * @return BelongsTo
     */
    public function company(): BelongsTo
    {
        return $this->BelongsTo(Company::class, 'company_id', 'id');
    }

    public function segment()
    {
        return $this->belongsTo(Segment::class);
    }
}
