Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 30 additions & 2 deletions pyjiit/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ def __hit(self, *args, **kwargs):
if resp["status"]["responseStatus"] != "Success":
raise exception("status:\n"+pformat(resp["status"]))



return resp


Expand Down Expand Up @@ -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"]