<?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 \App\Models\Company company_id
 * @property \App\Models\Bank 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';

    protected $dates = [
        'starting_on',
        'ending_on',
        'deleted_at',
    ];

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

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