Fee class

class almapiwrapper.users.Fee(fee_id: Optional[str] = None, primary_id: Optional[str] = None, zone: Optional[str] = None, env: Optional[Literal['P', 'S']] = 'P', user: Optional[User] = None, data: Optional[JsonData] = None, create_fee: Optional[bool] = False)

Bases: Record

Class representing a Users fee

Variables
  • api_base_url_users – url of the user api

  • fee_id – id of the fee

  • zone – initial value: zone of the fee

  • env – initial value: environment of the entity: ‘P’ for production and ‘S’ for sandbox

  • useralmapiwrapper.users.User either primary_id of the user or the user itself must be provided

  • dataalmapiwrapper.record.JsonData with fee data

static build_headers(data_format: Literal['json', 'xml'], zone: str, area: str, rights: Literal['R', 'RW'] = 'RW', env: Optional[Literal['P', 'S']] = 'P') Dict

Build the headers for the API calls.

Parameters
  • data_format – “json” or “xml”

  • zone – optional, if indicated allow to make the query in an other IZ

  • area – area of the record, bibs, users for example

  • rights – “R” for read only or “RW” for write and read rights

  • env – environment of the api call: ‘P’ for production, ‘S’ for sandbox

Returns

dict with the headers

property data: Optional[Union[Dict, Element, DataFrame]]

Property that get xml data with API call. If not available, make an api call

Returns

xml data, dictionary or pandas dataframe

property fee_id: str

Property returning the fee ID

It fetches it in a private attribute if not available in the data property.

operate(**kwargs)

Operate on a fee

Parameters
  • op – can be ‘pay’, ‘waive’, ‘dispute’, ‘restore’

  • amount – optional amount. For pay and waive, it will be the balance as default value

  • comment – free text associated to the operation

  • method – for pay or waive operations, can be: ‘CREDIT_CARD’, ‘ONLINE’, ‘CASH’

  • reason – a value of FineFeeTransactionReason table. Required only for waiving fee

  • external_transaction_id – external id of the bursar system

Returns

object almapiwrapper.users.Fee

save(**kwargs)

Save a user fee record in the ‘records’ folder

When saved, a suffix is added to the file path with the version. Example: records/<primary_id>/fee_<IZ>_<fee_id>_<version>.xml

Returns

object almapiwrapper.users.Fee