import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/ListUserAgreement.dart';

import '../base_service.dart';

class TermsConditionService extends BaseService{
  bool isFinished = true;
  bool hasError = false;
  String errorMsg = '';
  String successMsg = '';

  ListUserAgreement listUserAgreement;

  Future getUserTermsAndConditionsForEPharmcy() async {
    hasError = false;
    super.error = "";

    Map<String, dynamic> body = Map();

    try {
      await baseAppClient.post(LAKUM_GET_USER_TERMS_AND_CONDITIONS,
          onSuccess: (response, statusCode) async {
            listUserAgreement = ListUserAgreement.fromJson(response['ListUserAgreement'][0]);
          }, onFailure: (String error, int statusCode) {
            hasError = true;
            super.error = error;
          }, body: body);
    } catch (error) {
      throw error;
    }
  }

}