Skip to content

API documentation

Денис Лочмелис edited this page Nov 6, 2021 · 2 revisions

Data classes

The classes used to store logical entities are located in the models/ folder. The most important are:

  • Item - a single entry in a check (i.e. name, price, quantity)
  • Check - info about a check (i.e. items, time, store)
  • Store - store properties (i.e. address, name of chain)

Others are supplementary and mostly speak for themselves. However, some of them need a brief extra description:

  • Rating - abstraction for calculating average rating
  • Review - abstraction for a single rating of a user
  • ItemInStore - a convenience class for return type of some methods
  • Filter - a wrapper for multiple predicates to filter the items

Interfaces

The main UCheck class provides an interface for interacting with the prices' database:

  • void addCheck(Check, Review) updates the database according to the Check information (i.e. lower the price for an Item in a Store, increase the price after a discount has expired and so on), and also adds a Review to the corresponding Store

  • void removeOldChecks(DateTime) removes all information added by checks that are as old or older than the specified date and time

  • Rating getStoreRating(Store) simply retrieves the Rating of the specified Store

  • List<ItemInStore> getFilteredItemInStores(int, Filter, SortRule) returns the list of ItemInStore objects corresponding to the Item specified by its int code, filtered using a Filter and sorted using a SortRule

  • List<ItemInStore> getFilteredItemInStores(int, Filter, SortRule, Coordinates) does the same thing, but enables sorting and filtering by customer Coordinates

Clone this wiki locally