import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/privilege/PrivilegeModel.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';

class PrivilegeService extends BaseService {

  List<PrivilegeModel> privilegeModelList = List();

  Future getPrivilege() async {
    Map<String, dynamic> body = Map();
    body['PatientType'] = 4;
    await baseAppClient.post(GET_PRIVILEGE,
        onSuccess: (dynamic response, int statusCode) {
      response['ServicePrivilegeList'].forEach((item) {
        privilegeModelList.add(PrivilegeModel.fromJson(item));
      });
    }, onFailure: (String error, int statusCode) {
      hasError = true;
      super.error = error;
    }, body: body);
  }
}
