import 'package:hmg_patient_app/config/config.dart';
import 'package:hmg_patient_app/config/shared_pref_kay.dart';
import 'package:hmg_patient_app/core/model/childvaccines/add_newchild_model.dart';
import 'package:hmg_patient_app/core/model/childvaccines/create_new_user_model.dart';
import 'package:hmg_patient_app/core/model/childvaccines/delete_baby_model.dart';
import 'package:hmg_patient_app/core/model/childvaccines/user_information_model.dart';

import '../base_service.dart';



class DeleteBabyService extends BaseService{

  List<CreateNewBaby> createNewBabyModelList =[];
  List<List_UserInformationModel> userModelList =[];
  List<CreateNewUser_New> newUserModelList =[];

  List<DeleteBaby> deleteBabyModelList=[];


  Future getDeleteBabyOrder({DeleteBaby? deleteChild,int? babyID}) async {
    hasError = false;
    await getUser();
    Map<String, dynamic> body = Map.from(deleteChild!.toJson());
   // body['CreatedBy'] = 102;
    body['EditedBy'] = 102;
    //body['BabyID'] = babyID;
    //body['BabyID'] = createNewBabyModelList ;
   // body['AlertBy'] = 2;
  //  body['EmailAddress'] = user.emailAddress;
    body['IsLogin'] = true;
    body['LogInTokenID'] = await sharedPref.getString(TOKEN);
    body['MobileNumber'] = user.mobileNumber;
    body['NationalID'] = user.nationalityID;
    body['ZipCode'] = user.zipCode;

    body['isDentalAllowedBackend'] = false;

    await baseAppClient.post(DELETE_CHILD_REQUEST,
        onSuccess: (dynamic response, int statusCode) {
          var asd ="";
        },
        onFailure: (String error, int statusCode) {
          hasError = true;
          super.error = error;
        }, body: body);
  }

  // Future getCreateNewBabyOrders({CreateNewBaby newChild,int userID}) async {
  //   hasError = false;
  //   await getUser();
  //   Map<String, dynamic> body = Map.from(newChild.toJson());
  //   body['CreatedBy'] = 102;
  //   body['EditedBy'] = 102;
  //   body['UserID'] = userID;
  //   body['AlertBy'] = 2;
  //   body['EmailAddress'] = user.emailAddress;
  //   body['IsLogin'] = true;
  //   body['LogInTokenID'] = await sharedPref.getString(TOKEN);
  //   body['MobileNumber'] = user.mobileNumber;
  //   body['NationalID'] = user.nationalityID;
  //   body['ZipCode'] = user.zipCode;
  //
  //   body['isDentalAllowedBackend'] = false;
  //
  //   await baseAppClient.post(GET_NEWCHILD_REQUEST,
  //       onSuccess: (dynamic response, int statusCode) {
  //         var asd ="";
  //       },
  //       onFailure: (String error, int statusCode) {
  //         hasError = true;
  //         super.error = error;
  //       }, body: body);
  // }

}