Introduction
When new record is inserted into
system_projection collection. It will trigger this hook to compute values based on custom formula and insert record into
benchmark_manhour and
manhour_distribution collections.
Procedure
Input (Trigger)
1. collection => system_projection AND field => revenue
Variables
1. (FOR benchmark_manhour) collection => formulas AND field => formula_expression,
type = 'benchmark-manhour'
2. (FOR manhour_distribution) collection => benchmark_ratio AND field => kitchen_ratio, bar_ratio, foh_ratio, cleaning_ratio
Result
1. collection => benchmark_manhour AND fields => shop_cd,date,manhours
> e.g. manhours = 0.0006
Math.pow(\,2)+266.79\
-20323
2. collection => manhour_distribution AND fields => shop_cd, date, kitchen_manhours, bar_manhours,cleaning_manhours,foh_manhours
> e.g. kitchen_manhours = kitchen_ratio * \
Formula Format
> 0.0006Math.pow(\,2)+266.79\-20323
where \ field in system_projection collection
Requirement for manhour_distribution computation
collection benchmark_ratio must have ratios for shop_cd