<?php

namespace App\Services;

use GuzzleHttp\Client as HTTPClient;

class NewUserApi extends CoreServiceApi
{

 public static function createAccount($data)
    {
	    $res =[];
	    $mode = (int) $mode;
        log_message('critical', "createAccount=>Mode ====>===>" );
/*
CRITICAL - 2022-04-20 22:27:16 --> API-WAS CALLED user
CRITICAL - 2022-04-20 22:27:16 --> API-WAS CALLED user
CRITICAL - 2022-04-20 22:27:16 --> API-WAS CALLED user 009=>createuser
CRITICAL - 2022-04-20 22:27:16 --> username=>lviet3@float.sg
CRITICAL - 2022-04-20 22:27:16 --> password=>a1234567
CRITICAL - 2022-04-20 22:27:16 --> sessionid=>DUMMYSESSION
CRITICAL - 2022-04-20 22:27:16 --> email=>lviet3@float.sg
CRITICAL - 2022-04-20 22:27:16 --> phone=>097879787
CRITICAL - 2022-04-20 22:27:16 --> firstname=>Le
CRITICAL - 2022-04-20 22:27:16 --> lastname=>Viet
CRITICAL - 2022-04-20 22:27:16 --> signup_random=>
CRITICAL - 2022-04-20 22:27:16 --> verify_link=>
CRITICAL - 2022-04-20 22:27:16 --> start_mode=>200
CRITICAL - 2022-04-20 22:27:16 --> signUpSurveyData=>ssq0 => Array
ssq1 => Array
ssq2 => Array
*/


        $arr = array(
            'start_mode' => $data['start_mode'],
            'username' => $data['username'],
            'password' => $data['password'],
            'email' => $data['email'],
            'phone' => $data['phone'],
            'sessionid' => $data['sessionid'],
            'firstname' => $data['firstname'],
            'lastname' => $data['lastname'],
            'signup_random' => $data['signup_random'],
            'verify_link' => $data['verify_link']
            
        ); 
        $data_json = json_encode($arr);
        $res = self::NodeServiceApi('user/register', $data_json);

        return $res;
    }

}