<?php

namespace App\Jobs\GrowingIO;

use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;

class PairSuccessReportJob extends BaseReportJob implements ShouldQueue
{
    use Dispatchable;
    use InteractsWithQueue;
    use Queueable;
    use SerializesModels;


    protected $uid;
    protected $otherUid;
    protected $stageId;
    protected $pair_type;

    /**
     * Create a new job instance.
     *
     * @return void
     */
    public function __construct($uid, $otherUid, $stageId, $pair_type)
    {
        $this->uid = $uid;
        $this->otherUid = $otherUid;
        $this->stageId = $stageId;
        $this->pair_type = $pair_type;
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function doHandle()
    {
        $this->doReport(self::PAIR_SUCCESS, $this->uid, [
            'related_id' => $this->otherUid,
            'stage_id' => $this->stageId,
            'pair_type' => $this->pair_type
        ]);
    }
}
