package w.soulofpluto.posstock;

import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.util.Log;
import android.view.Gravity;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.Toast;
import com.squareup.okhttp.MediaType;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.io.IOException;
import java.security.MessageDigest;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;

/*
Create by Ramesh Babu
*/
public class Constants{
    //public static String BASE_URL           = "http://182.18.167.139/";
    //public static String BASE_URL           = "https://2bc746.emporter.eu/";
    //public static String BASE_URL           = "https://68c783.emporter.eu/";
    //public static String BASE_URL           = "https://e0ca19.emporter.eu/";
    public static String BASE_URL           = "https://6d70e4.emporter.eu/";
    //public static String BASE_URL           = "http://posapi.plutokm.com/";
    //public static String BASE_URL         = "https://7fad42.emporter.eu/";
    public static String MenuBar            = Constants.BASE_URL + "/Users/generateUserMenuBarLinksForAndroidApp";
    public static String Logout             = Constants.BASE_URL + "/login/doLogout/";
    public static String Login              = Constants.BASE_URL + "/login/doLogin";
    public static String StoreId            = Constants.BASE_URL + "login/getStoresMappedToUser/";
    public static String Dashboard          = Constants.BASE_URL + "/stockaudit/listOfStockAuditsOfLoginStore";
    public static String BarcodeUpload      = Constants.BASE_URL + "/stockaudit/validateStockAuditBarcode";
    public static String BarcodeDelete      = Constants.BASE_URL + "/stockaudit/deleteBarcodeAndQuantityFromStockAudit";
    public static String BarcodeComplete    = Constants.BASE_URL + "/stockaudit/batchScanningCompleted";
    public static String RackWiseQty        = Constants.BASE_URL + "/stockaudit/stockAuditPlanBarcodesScannedInformation";
    public static String BarcodeSearch      = Constants.BASE_URL + "/stockaudit/stockAuditBarcodeRackInformation";
    public static String GenerateSlip       = Constants.BASE_URL + "/Sales/generateDeliverySlip";
    public static String Type               = "Content-Type";
    public static String App_json           = "application/json";
    public static MediaType JSON            = MediaType.parse("application/json; charset=utf-8");
    public static String Sec                = "<font color=#3700B3><b>SECTION      : </b></font>";
    public static String div                = "<font color=#3700B3><b>DIVISION     : </b></font>";
    public static String Id                 = "<font color=#3700B3><b>RACK ID      : </b></font>";
    public static String Qty                = "<font color=#3700B3><b>QTY          : </b></font>";
    public static String User               = "<font color=#3700B3><b>UserId       : </b></font>";
    public static String From               = "<font color=#3700B3><b>Start time   : </b></font>";
    public static String To                 = "<font color=#3700B3><b>End time     : </b></font>";
    public static String Count              = "<font color=#3700B3><b>TOTAL SCANNED ITEMS     : </b></font>";
    public static String Barcode            = "<font color=#3700B3><b>Barcode      : </b></font>";
    public static String Ver_Text           = "<font color=#3700B3><b>Version      : </b></font>";
    public static String Plan_Id            = "<font color=#3700B3><b>PLAN ID      : </b></font>";
    public static String Name               = "<font color=#3700B3><b>NAME         : </b></font>";
    public static String VERSION            = "1.1";
    public static int    Value              = 7 ;
    public static final String dashed       = "------------------------------------------------"+"\n";
    public static ProgressDialog progressDialog;
    public static StringBuilder stringBuilder;

    public static void getToast(Context context, String data){
        Toast toast = Toast.makeText(context, data, Toast.LENGTH_SHORT);
        toast.setGravity(Gravity.CENTER, 0, 0);
        toast.show();
    }

    public static String getVal(int count){
        return "<font color=#3700B3><b>TOTAL SCANNED ITEMS     : </b></font>"+"<font color=#3700B3><b>"+count+"</b></font>";
    }

    public static String getTotalItems(String count){
        return "<font color=#F31505><b>Total Items     : </b></font>"+"<font color=#000000><b>"+count+"</b></font>";
    }

    public static String getTotalMRP(String count){
        return "<font color=#F31505><b>Total MRP     : </b></font>"+"<font color=#000000><b>"+count+"</b></font>";
    }

    public static String getBarcode(String count){
        return "<font color=#6A95A5A6><b>Barcode     : </b></font>"+"<font color=#000000><b>"+count+"</b></font>";
    }

    public static String getCode(String count){
        return "<font color=#6A95A5A6><b>Disc Amt    : </b></font>"+"<font color=#000000><b>"+count+"</b></font>";
    }

    public static String getMRP(String count){
        return "<font color=#6A95A5A6><b>MRP  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : </b></font>"+"<font color=#000000><b>"+count+"</b></font>";
    }

    public static String getEmpId(String count){
        return "<font color=#6A95A5A6><b>SM   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : </b></font>"+"<font color=#000000><b>"+count+"</b></font>";
    }

    public static String getNetPayable(String count){
        return "<font color=#6A95A5A6><b>NetPayable     : </b></font>"+"<font color=#FE3004><b>"+count+"</b></font>";
    }
    public static boolean isNetworkAvailable(Context context){
        ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
        NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();
        return activeNetworkInfo != null;
    }

    public static String IndianRupeesFormat(String amount){
        NumberFormat formatter = NumberFormat.getCurrencyInstance(new Locale("en", "in"));
        String moneyString = formatter.format(Double.valueOf(amount));
        return moneyString;
        //return formatter.format(amount);
    }

    public static void ProgressDialogShow(Context context){
        progressDialog = new ProgressDialog(context);
        progressDialog.setMessage("Loading Please wait ...");
        progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
        progressDialog.show();
    }

    public static void ProgressDialogDismiss(){
        if(progressDialog != null){
           progressDialog.dismiss();
        }
    }

    public static String PrintData(String Id){
        return  ",{" + '"' + "delivery_slip_id" + '"' + ":" + '"' + Id + '"' + "," + '"' + "manual_discount" + '"' + ":" + 0 + "}";
    }

    public static String PrintData1(String Id){
        return  "{" + '"' + "delivery_slip_id" + '"' + ":" + '"' + Id + '"' + "," + '"' + "manual_discount" + '"' + ":" + 0 + "}";
    }
    public static String getSHA256(String data){
        StringBuffer sb = new StringBuffer();
        try{
            MessageDigest md = MessageDigest.getInstance("SHA-256");
            md.update(data.getBytes());
            byte byteData[] = md.digest();
            for(int i = 0; i < byteData.length; i++){
              sb.append(Integer.toString((byteData[i] & 0xff) + 0x100, 16).substring(1));
            }
        }catch (Exception e) {
            e.printStackTrace();
        }
        return sb.toString();
    }

    public static String convertString(String data){
        StringBuilder stringBuilder = new StringBuilder();
        try{
            JSONArray jsonArray = new JSONArray(data);
            for(int i = 0; i < jsonArray.length(); i++){
              stringBuilder.append(jsonArray.get(i) + ",");
            }
        }catch(JSONException e){
          e.printStackTrace();
        }
        return stringBuilder.toString().substring(0, stringBuilder.toString().length() - 1);
    }

    public static Boolean Existing(ArrayList<Plans> plans, String barcode){
        for(Plans plan : plans){
           if(plan.getBarcode().contains(barcode)){
             return true;
           }
        }
        return false;
    }

    public static Date getDateWithOffset(int offset, Date date){
        Calendar calendar = calendar = Calendar.getInstance();;
        calendar.setTime(date);
        calendar.add(Calendar.DAY_OF_MONTH, offset);
        return calendar.getTime();
    }

    public static boolean isNetworkOnline(){
        boolean isOnline = false;
        try{
            Runtime runtime = Runtime.getRuntime();
            Process p = runtime.exec("ping -c 1 8.8.8.8");
            int waitFor = p.waitFor();
            isOnline = waitFor == 0;
            Log.e("Constants",String.valueOf(isOnline));
        } catch (IOException e) {
            e.printStackTrace();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return isOnline;
    }

    protected static void hideSoftKeyboard(EditText input,Context context){
        InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
        imm.hideSoftInputFromWindow(input.getWindowToken(), 0);
    }
    public static String SL(String len){
        if(len.length() == 3){
            return len;
        }else if(len.length() == 2){
            return len+" ";
        }else if(len.length() == 1){
            return len+"  ";
        }
        return null;
    }
    public static String Qty(String len){
        if(len.length() == 3){
            return len+" ";
        }else if(len.length() == 2){
            return len+"  ";
        }else if(len.length() == 1){
            return len+"   ";
        }
        return null;
    }
    public static String Barcode(String mrp){
        if(mrp.length() == 11){
            return mrp;
        }else if(mrp.length() == 10){
            return mrp+" ";
        }else if(mrp.length() == 9){
            return mrp+"  ";
        }else if(mrp.length() == 8){
            return mrp+"   ";
        }else if(mrp.length() == 7){
            return mrp+"    ";
        }else if(mrp.length() == 6){
            return mrp+"     ";
        }else if(mrp.length() == 5){
            return mrp+"      ";
        }else if(mrp.length() == 4){
            return mrp+"       ";
        }else if(mrp.length() == 3){
            return mrp+"        ";
        }else if(mrp.length() == 2){
            return mrp+"         ";
        }else if(mrp.length() == 1){
            return mrp+"          ";
        }
        return null;
    }
    public static String Mrp(String mrp){
        if(mrp.length() == 9){
            return mrp;
        }else if(mrp.length() == 9){
            return mrp+" ";
        }else if(mrp.length() == 8){
            return mrp+"  ";
        }else if(mrp.length() == 7){
            return mrp+"   ";
        }else if(mrp.length() == 6){
            return mrp+"    ";
        }else if(mrp.length() == 5){
            return mrp+"     ";
        }else if(mrp.length() == 4){
            return mrp+"      ";
        }else if(mrp.length() == 3){
            return mrp+"       ";
        }else if(mrp.length() == 2){
            return mrp+"        ";
        }else if(mrp.length() == 1){
            return mrp+"         ";
        }
        return null;
    }
    public static String Dis(String dis){
        if(dis.length() == 9){
            return dis;
        }else if(dis.length() == 8){
            return dis+" ";
        }else if(dis.length() == 7){
            return dis+"  ";
        }else if(dis.length() == 6){
            return dis+"   ";
        }else if(dis.length() == 5){
            return dis+"    ";
        }else if(dis.length() == 4){
            return dis+"     ";
        }else if(dis.length() == 3){
            return dis+"      ";
        }else if(dis.length() == 2){
            return dis+"       ";
        }else if(dis.length() == 1){
            return dis+"        ";
        }
        return null;
    }
    public static String Total(String mrp){
        if(mrp.length() == 11){
            return mrp;
        }else if(mrp.length() == 10){
            return mrp+" ";
        }else if(mrp.length() == 9){
            return mrp+"  ";
        }else if(mrp.length() == 8){
            return mrp+"   ";
        }else if(mrp.length() == 7){
            return mrp+"    ";
        }else if(mrp.length() == 6){
            return mrp+"     ";
        }else if(mrp.length() == 5){
            return mrp+"      ";
        }else if(mrp.length() == 4){
            return mrp+"       ";
        }else if(mrp.length() == 3){
            return mrp+"        ";
        }else if(mrp.length() == 2){
            return mrp+"         ";
        }else if(mrp.length() == 1){
            return mrp+"          ";
        }
        return null;
    }
    public static String Taxable(String tax){
        if(tax.length() == 13){
            return tax;
        }else if(tax.length() == 12){
            return tax+" ";
        }else if(tax.length() == 11){
            return tax+"  ";
        }else if(tax.length() == 10){
            return tax+"   ";
        }else if(tax.length() == 9){
            return tax+"    ";
        }else if(tax.length() == 8){
            return tax+"     ";
        }else if(tax.length() == 7){
            return tax+"      ";
        }else if(tax.length() == 6){
            return tax+"       ";
        }else if(tax.length() == 5){
            return tax+"        ";
        }else if(tax.length() == 4){
            return tax+"         ";
        }else if(tax.length() == 3){
            return tax+"          ";
        }else if(tax.length() == 2){
            return tax+"           ";
        }else if(tax.length() == 1){
            return tax+"            ";
        }
        return null;
    }
    public static String CGST(String dis){
        if(dis.length() == 9){
            return dis;
        }else if(dis.length() == 8){
            return dis+" ";
        }else if(dis.length() == 7){
            return dis+"  ";
        }else if(dis.length() == 6){
            return dis+"   ";
        }else if(dis.length() == 5){
            return dis+"    ";
        }else if(dis.length() == 4){
            return dis+"     ";
        }else if(dis.length() == 3){
            return dis+"      ";
        }else if(dis.length() == 2){
            return dis+"       ";
        }else if(dis.length() == 1){
            return dis+"        ";
        }
        return null;
    }
    public static String SGST(String dis){
        if(dis.length() == 7){
            return dis+" ";
        }else if(dis.length() == 6){
            return dis+" ";
        }else if(dis.length() == 5){
            return dis+"  ";
        }else if(dis.length() == 4){
            return dis+"   ";
        }else if(dis.length() == 3){
            return dis+"    ";
        }else if(dis.length() == 2){
            return dis+"     ";
        }else if(dis.length() == 1){
            return dis+"      ";
        }
        return null;
    }
    public static String IGST(String dis){
        if(dis.length()== 8){
            return dis;
        }else if(dis.length() == 7){
            return dis+" ";
        }else if(dis.length() == 6){
            return dis+" ";
        }else if(dis.length() == 5){
            return dis+"  ";
        }else if(dis.length() == 4){
            return dis+"   ";
        }else if(dis.length() == 3){
            return dis+"    ";
        }else if(dis.length() == 2){
            return dis+"     ";
        }else if(dis.length() == 1){
            return dis+"      ";
        }
        return null;
    }
    public static String GST(String dis){
        if(dis.length() == 7){
            return dis;
        }else if(dis.length() == 6){
            return dis+" ";
        }else if(dis.length() == 5){
            return dis+"  ";
        }else if(dis.length() == 4){
            return dis+"   ";
        }else if(dis.length() == 3){
            return dis+"    ";
        }else if(dis.length() == 2){
            return dis+"     ";
        }else if(dis.length() == 1){
            return dis+"      ";
        }
        return null;
    }
    public static String Gross(String dis){
        if(dis.length() == 10){
            return "                     "+dis;
        }else if(dis.length() == 9){
            return "                      "+dis;
        }else if(dis.length() == 8){
            return "                       "+dis;
        }else if(dis.length() == 7){
            return "                        "+dis;
        }else if(dis.length() == 6){
            return "                         "+dis;
        }else if(dis.length() == 5){
            return "                          "+dis;
        }else if(dis.length() == 4){
            return "                           "+dis;
        }else if(dis.length() == 3){
            return "                            "+dis;
        }else if(dis.length() == 2){
            return "                             "+dis;
        }else if(dis.length() == 1){
            return "                              "+dis;
        }
        return null;
    }
    public static String RecievedCashText(String dis){
        if(dis.length() == 13){
            return dis+"     ";
        }else if(dis.length() == 14){
            return dis+"    ";
        }else if(dis.length() == 15){
            return dis+"   ";
        }else if(dis.length() == 16){
            return dis+"  ";
        }else if(dis.length() == 17){
            return dis+" ";
        }else if(dis.length() == 18){
            return dis;
        }
        return null;
    }
    public static String Deliveryslipnumber(String dev){
        if(dev.length() == 16){
            return dev+"    ";
        }else if(dev.length() == 15){
            return dev+"     ";
        }else if(dev.length() == 14){
            return dev+"      ";
        }else if(dev.length() == 13){
            return dev+"       ";
        }else if(dev.length() == 12){
            return dev+"        ";
        }else if(dev.length() == 11){
            return dev+"         ";
        }
        return null;
    }
    public static String DeliveryslipQty(String dev){
        if(dev.length() == 7){
            return dev+"      ";
        }else if(dev.length() == 6){
            return dev+"       ";
        }else if(dev.length() == 5){
            return dev+"        ";
        }else if(dev.length() == 4){
            return dev+"         ";
        }else if(dev.length() == 3){
            return dev+"          ";
        }else if(dev.length() == 2){
            return dev+"           ";
        }else if(dev.length() == 1){
            return dev+"            ";
        }
        return null;
    }
    public static String DeliveryslipAmt(String dev){
        if(dev.length() == 11){
            return dev+"    ";
        }else if(dev.length() == 10){
            return dev+"    ";
        }else if(dev.length() == 9){
            return dev+"     ";
        }else if(dev.length() == 8){
            return dev+"      ";
        }else if(dev.length() == 7){
            return dev+"       ";
        }else if(dev.length() == 6){
            return dev+"        ";
        }else if(dev.length() == 5){
            return dev+"          ";
        }else if(dev.length() == 4){
            return dev+"          ";
        }else if(dev.length() == 3){
            return dev+"           ";
        }else if(dev.length() == 2){
            return dev+"            ";
        }else if(dev.length() == 1){
            return dev+"             ";
        }
        return null;
    }
    public static String RecievedCash(String dis){
        if(dis.length() == 10){
            return "                   "+dis;
        }else if(dis.length() == 9){
            return "                    "+dis;
        }else if(dis.length() == 8){
            return "                     "+dis;
        }else if(dis.length() == 7){
            return "                      "+dis;
        }else if(dis.length() == 6){
            return "                       "+dis;
        }else if(dis.length() == 5){
            return "                        "+dis;
        }else if(dis.length() == 4){
            return "                         "+dis;
        }else if(dis.length() == 3){
            return "                          "+dis;
        }else if(dis.length() == 2){
            return "                           "+dis;
        }else if(dis.length() == 1){
            return "                            "+dis;
        }
        return null;
    }
    public static String TotalSavings(String dis){
        if(dis.length() == 10){
            return "                     "+dis;
        }else if(dis.length() == 9){
            return "                      "+dis;
        }else if(dis.length() == 8){
            return "                       "+dis;
        }else if(dis.length() == 7){
            return "                        "+dis;
        }else if(dis.length() == 6){
            return "                         "+dis;
        }else if(dis.length() == 5){
            return "                          "+dis;
        }else if(dis.length() == 4){
            return "                           "+dis;
        }else if(dis.length() == 3){
            return "                            "+dis;
        }else if(dis.length() == 2){
            return "                             "+dis;
        }else if(dis.length() == 1){
            return "                              "+dis;
        }
        return null;
    }
    public static String IndianRupeesformat(String amount){
        NumberFormat formatter = NumberFormat.getCurrencyInstance(new Locale("en", "in"));
        String moneyString = formatter.format(Double.valueOf(amount));
        return moneyString;
        //return formatter.format(amount);
    }
    public static void hideKeyboard(Activity activity){
        InputMethodManager imm = (InputMethodManager) activity.getSystemService(Activity.INPUT_METHOD_SERVICE);
        //Find the currently focused view, so we can grab the correct window token from it.
        View view = activity.getCurrentFocus();
        //If no view currently has focus, create a new one, just so we can grab a window token from it
        if(view == null){
            view = new View(activity);
        }
        imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
    }

    public static void hideSoftKeyBoardOnTabClicked(View v,Context context) {
        if (v != null && context != null) {
            InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
            imm.hideSoftInputFromWindow(v.getApplicationWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
        }
    }
    public static String formdata(String builder, String name, String phone){
        stringBuilder = new StringBuilder();
        stringBuilder.append("{"+'"'+"approval_emp_id"+'"'+":"+'"'+"1"+'"'+",");
        stringBuilder.append('"'+"from_mobile"+'"'+":"+'"'+"yes"+'"'+",");
        stringBuilder.append('"'+"incharge_emp_id"+'"'+":"+'"'+"1"+'"'+",");
        stringBuilder.append('"'+"bill_level_manual_discount"+'"'+":"+'"'+"0"+'"'+",");
        stringBuilder.append('"'+"transaction_type"+'"'+":"+'"'+"presale_check"+'"'+",");
        stringBuilder.append('"'+"clear_promotion"+'"'+":"+'"'+"N"+'"'+",");
        stringBuilder.append('"'+"delivery_slips"+'"'+":"+"["+builder+"]"+",");
        stringBuilder.append('"'+"actual_received_cash"+'"'+":"+'"'+"0"+'"'+",");
        stringBuilder.append('"'+"return_cash_amount"+'"'+":"+'"'+"0"+'"'+",");
        stringBuilder.append('"'+"mop"+'"'+":"+"{");
        stringBuilder.append('"'+"cash"+'"'+":"+'"'+0+'"'+",");
        stringBuilder.append('"'+"credit_card"+'"'+":"+"[]"+",");
        stringBuilder.append('"'+"return_slips"+'"'+":"+"[]"+",");
        stringBuilder.append('"'+"pkt_pending"+'"'+":"+'"'+0+'"'+",");
        stringBuilder.append('"'+"pkt_advance_used"+'"'+":"+"[]"+",");
        stringBuilder.append('"'+"gv_ids"+'"'+":"+"[]"+",");
        stringBuilder.append('"'+"loyalty_points"+'"'+":"+"[]"+",");
        stringBuilder.append('"'+"km_gvs"+'"'+":"+"[]"+",");
        stringBuilder.append('"'+"online_gvs"+'"'+":"+"[]"+"}"+",");
        stringBuilder.append('"'+"customer_info"+'"'+":"+"{");
        stringBuilder.append('"'+"customer_phone"+'"'+":"+'"'+phone+'"'+",");
        stringBuilder.append('"'+"customer_name"+'"'+":"+'"'+name+'"'+"},");
        stringBuilder.append('"'+"otp"+'"'+":"+'"'+'"'+"}");
        return stringBuilder.toString();
    }
    public static String formdata1(String builder, String name, String phone, JSONObject obj){
        stringBuilder = new StringBuilder();
        stringBuilder.append("{"+'"'+"approval_emp_id"+'"'+":"+'"'+"1"+'"'+",");
        stringBuilder.append('"'+"from_mobile"+'"'+":"+'"'+"yes"+'"'+",");
        stringBuilder.append('"'+"incharge_emp_id"+'"'+":"+'"'+"1"+'"'+",");
        stringBuilder.append('"'+"bill_level_manual_discount"+'"'+":"+'"'+"0"+'"'+",");
        stringBuilder.append('"'+"transaction_type"+'"'+":"+'"'+"sale"+'"'+",");
        stringBuilder.append('"'+"clear_promotion"+'"'+":"+'"'+"N"+'"'+",");
        stringBuilder.append('"'+"delivery_slips"+'"'+":"+"["+builder+"]"+",");
        stringBuilder.append('"'+"actual_received_cash"+'"'+":"+'"'+"0"+'"'+",");
        stringBuilder.append('"'+"return_cash_amount"+'"'+":"+'"'+"0"+'"'+",");
        stringBuilder.append('"'+"mop"+'"'+":"+"{");
        stringBuilder.append('"'+"cash"+'"'+":"+'"'+0+'"'+",");
        stringBuilder.append('"'+"credit_card"+'"'+":"+"["+obj+"]"+",");
        stringBuilder.append('"'+"return_slips"+'"'+":"+"[]"+",");
        stringBuilder.append('"'+"pkt_pending"+'"'+":"+'"'+0+'"'+",");
        stringBuilder.append('"'+"pkt_advance_used"+'"'+":"+"[]"+",");
        stringBuilder.append('"'+"gv_ids"+'"'+":"+"[]"+",");
        stringBuilder.append('"'+"loyalty_points"+'"'+":"+"[]"+",");
        stringBuilder.append('"'+"km_gvs"+'"'+":"+"[]"+",");
        stringBuilder.append('"'+"online_gvs"+'"'+":"+"[]"+"}"+",");
        stringBuilder.append('"'+"customer_info"+'"'+":"+"{");
        stringBuilder.append('"'+"customer_phone"+'"'+":"+'"'+phone+'"'+",");
        stringBuilder.append('"'+"customer_name"+'"'+":"+'"'+name+'"'+"},");
        stringBuilder.append('"'+"otp"+'"'+":"+'"'+'"'+"}");
        return stringBuilder.toString();
    }
}
