open-index/open-npm huggingface dataset:
npm package: @mshoaibraja/directus-extension-hook-formula
Description: 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.
Latest version: 1.1.2

# 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(\<revenue\>,2)+266.79*\<revenue\>-20323 
2. collection => manhour_distribution AND fields => shop_cd, date, kitchen_manhours, bar_manhours,cleaning_manhours,foh_manhours
> e.g. kitchen_manhours =  kitchen_ratio * \<revenue\>

# Formula Format
> 0.0006*Math.pow(\<revenue\>,2)+266.79*\<revenue\>-20323
where \<revenue\> field in **system_projection** collection 

# Requirement for manhour_distribution computation
collection **benchmark_ratio** must have ratios for **shop_cd**