<?php

namespace App\Jobs;

use App\Models\JobsHistory;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldBeUnique;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;

class ScheduleSmsJob implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

    protected $data;
    public $tries = 1;
    public $day_end_date;
    public $branch_id;
    public $job;
    protected $history;

    public function __construct($data, JobsHistory $history)
    {
        $this->data = $data;
        $this->history = $history;

        $this->history->date = date('Y-m-d');
        $this->history->date = $data['date'];
        $this->history->job_type = $data['job_type'];
        $this->history->status = 0;

        $this->history->save();
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {
        dd('asas');
    }
}
