diff --git a/pyjiit/wrapper.py b/pyjiit/wrapper.py index 6896b1b..e97208f 100644 --- a/pyjiit/wrapper.py +++ b/pyjiit/wrapper.py @@ -105,8 +105,6 @@ def __hit(self, *args, **kwargs): if resp["status"]["responseStatus"] != "Success": raise exception("status:\n"+pformat(resp["status"])) - - return resp @@ -457,3 +455,33 @@ def get_fines_msc_charges(self): resp = self.__hit("POST", API + ENDPOINT, json=enc_payload, authenticated=True) return resp["response"] + @authenticated + def get_fee_summary(self): + """ + fetches the fee summary for the logged-in student. + :returns: The raw 'response' dict from the API. + :raises APIError: on any non-Success responseStatus. + """ + ENDPOINT = "/studentfeeledger/loadfeesummary" + payload_dict = { + "instituteid": self.session.instituteid, + } + resp = self.__hit("POST", API + ENDPOINT, json=payload_dict, authenticated=True) + return resp["response"] + + @authenticated + def get_subject_choices(self, semester: Semester): + """ + :param semester: A Semester object + :returns: A dictionary with subject choices data + :raises APIError: Raised for generic API error + """ + # get the subject choice print - if the subject is allocated then resp["response"]["subjectpreferencegrid"] is an array of dict which would have an attribute subjectrunning == "Y" + ENDPOINT = "/studentchoiceprint/getsubjectpreference" + payload_dict = { + "instituteid": self.session.instituteid, + "studentid": self.session.memberid, + "registrationid": semester.registration_id, + } + resp = self.__hit("POST", API + ENDPOINT, json=payload_dict, authenticated=True) + return resp["response"]