Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Currently all the calculations live in the LineItemFieldsCalculator class, that contains static methods - one for each field. The extension mechanism in OpenLMIS requires that every extendible piece is a Spring bean, therefore a refactor of the class, as well as its usage would be required. Each calculation would live in its own class and be an independent Spring bean. A single class that delegates the calls to get the calculations could exist and would be used by the consumers of the calculations.

 - figure out the way to use spring beans in the domain class (passing it from controller or retrieving from a static spring helper)

 - we need a way to pass the necessary data to UI (previous requisitions in DTO)

 - Malawi may not even need an extension point to change the calculations, perhaps just the retrieval of the previous requisitions can be changed (Sebastian Brudziński needs to confirm)

Another issue that needs to be resolved is allowing the user to specify which calculation is to be used for the column and store that choice. This can be achieved by adding the extraData field to the RequisitionTemplateColumn and have the implementation of the extension point check that field to determine which calculation should be used.

...