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

class CreteNewBabyService extends BaseService {
  List<CreateNewBaby> createNewBabyModelList = List();
  List<List_UserInformationModel> userModelList = List();
  List<CreateNewUser_New> newUserModelList = List();



  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);
  }
}
