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

class VaccinationTableService extends BaseService {
  List<CreateVaccinationTable> createVaccinationTableModelList = List();
  Map<String, dynamic> body = Map();



  Future getCreateVaccinationTableOrders() async {
    hasError = false;
    await   getUser();
    body['BabyName']="fffffffffff eeeeeeeeeeeeee";
    body['DOB'] = "/Date(1585774800000+0300)/";
    body['EmailAddress'] = user.emailAddress;
    body['isDentalAllowedBackend'] = false;
    body['SendEmail'] = false;
    body['IsLogin'] =true;




    await baseAppClient.post(GET_TABLE_REQUEST,
        onSuccess: (dynamic response, int statusCode) {
          createVaccinationTableModelList.clear();
          response['List_CreateVaccinationTableModel'].forEach((vital) {
            createVaccinationTableModelList.add(
                CreateVaccinationTable.fromJson(vital));
          });
        }, onFailure: (String error, int statusCode) {
          hasError = true;
          super.error = error;
        }, body: body);
  }

}