<?php

namespace App\Console\Commands;

use App\Packages\Phone\Service\ContactSyncService;
use App\Packages\User\Models\User;
use Illuminate\Console\Command;

/**
 * Class PhoneCommand
 * @package App\Console\Commands
 */
class PhoneCommand extends Command
{
	protected $signature = 'command:phone';

	public function handle()
	{
		$contacts = [
//		    ['phone_full' => '20399776', 'full_name' => 'Exists No CODE'],
//		    ['phone_full' => '+37120399776', 'full_name' => 'Exists With Code'],
//
//            ['phone_full' => '20391776', 'full_name' => 'Not With Code'],
//		    ['phone_full' => '+3712316', 'full_name' => 'Not With Code'],

		    ['phone_full' => '+37129896412', 'full_name' => 'Qwer'],
//		    ['phone_full' => '+3712989641', 'full_name' => 'Not With Code'],
//		    ['phone_full' => '2989641', 'full_name' => 'Not With Code'],
		];

		/** @var ContactSyncService $contactSyncService */
        $contactSyncService = app(ContactSyncService::class);

        /** @var User $user */
        $user = User::repository()->first();

        $list = [];
        if (is_array($contacts)) {
            $list = $contactSyncService->getSyncedContactUsers($contacts, $user);
        }

        dd($list);


	}
}













