import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/hospitals_model.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.dart';
import 'package:doctor_app_flutter/models/doctor/request_doctor_reply.dart';

class DoctorReplyService extends BaseService {

  List<ListGtMyPatientsQuestions> get listDoctorWorkingHoursTable => _listDoctorWorkingHoursTable;
  List<ListGtMyPatientsQuestions> _listDoctorWorkingHoursTable = [];


  RequestDoctorReply _requestDoctorReply = RequestDoctorReply();
  Future getDoctorReply() async {
    await baseAppClient.post(GT_MY_PATIENT_QUESTION,
        onSuccess: (dynamic response, int statusCode) {
          _listDoctorWorkingHoursTable.clear();
      response['List_GtMyPatientsQuestions'].forEach((v) {
        _listDoctorWorkingHoursTable
            .add(ListGtMyPatientsQuestions.fromJson(v));
      });
    }, onFailure: (String error, int statusCode) {
      hasError = true;
      super.error = error;
    }, body: _requestDoctorReply.toJson(),);
  }
}
