Application logic - UkrSoft/choose-operator GitHub Wiki
-
Get input:
1.1 get source operator preferences: mts, kyivstar, life; - percentage; sum of the criteria values should be 100%
1.2 get target operator preferences: mts, kyivstar, life; - percentage; sum of the criteria values should be 100%
1.3 get target usage preferences: data, sms, calls, international calls? - percentage; sum of the criteria values should be 100%
1.4 get money preferences: what is monthly limit for you (slider) - integer, "0" by default, this means "no limit"
-
make calculations:
2.1 this would be just one multi-table join SQL query
2.2 input parameters filtering list will be concatenated as dynamic SQL at runtime just BEFORE script execution.
2.3 get value of how valuable each criteria is (%)
2.4 select list of packages which are most valuable:
2.4.1 each package has features. Each feature should have "how good" value assigned 2.4.2 this assigned value will be multiplied on target %
2.5 all package criteria resulting values should be summarized
2.5.1 packages should be sorted by this resulting sum 2.5.2 results should be represented as list of rows - 1 row for the separate package to output
-
output data:
3.1 output packages on the results page
3.2 use the same template as for data input (only difference is - pass resulting table parameter to template)
3.3 packages to be grouped inside of the template (it is cheep operation, because little amount of packages to be shown on the page)
3.4 table headers will be transposed to row names (this will be the feature names) in the resulting page
3.5 each table row will be transposed to separate column with 1 package in it