<?php
namespace App\Http\Response;

class Response{
    /**
     * 
     */
    private static function commonStructure($response,$code){
        return [
            "status"=>$code,
            "response"=>$response
        ];
    }
    /**
     * 
     */
    public static function getResponseToken($token,$code){
        $response =  [
            "token"=>$token
        ];
        return Response::getBaseStructure(Response::commonStructure($response,$code));
    }

    /**
     * 
     */
    private static function getBaseStructure($response){
        return response()->json($response);
    }
    /**
     * 
     */
    public static function getResponseCreateAppointment($state,$appointmentCode,$code){
        $response =  [
            "success"=>$state,
        ];
        if(isset($appointmentCode))
            $response["code"] = $appointmentCode;
        return Response::getBaseStructure(Response::commonStructure($response,$code));
    }
}