Please enable JavaScript.
Coggle requires JavaScript to display documents.
Moderation tool (Moderator Salary
Mongodb: ModerationStat =>…
Moderation tool
Moderator Salary
- Mongodb: ModerationStat => SalaryReport, AdvertErrors, KeywordErrors
SalaryReport db
date_start
date_end
is_finished
processed_at
data {user_id: {pace:speed,keywords:int,avgPace:avgSpeed,standDeviation}}
AdvertErrors, KeywordErrors db
- moderator_id
- time
- errors
- total
Calculate Grade and Ke Logic
- Dependences: AdvertErrorRate, KeywordErrorRate
- Grade AA = AER < 1 && KER < 0.1 ||| Ke = 1.25
- Grade A = AER < 2 && KER < 0.3 ||| Ke = 1.15
- Grade B = AER < 4 && KER < 0.6 ||| Ke = 1
- Grade C = (6 > AER >= 4) || (1 > KER >= 0.6) ||| Ke = 0.85
- Grade D = AER >= 6 || KER >=1 ||| Ke = 0.7
Calculate Pace Score Logic
- Dependences: pace, avgPace, standDeviation
- score = (pace - avgPace) / standDeviation
Calculate Salary Logic
- Dependences: keywords, keywordPrice, Ke
- salary = keywords * keywordPrice * ke
-
-
Cron Salary Report
command: report:salary {date?}
get period of current month
get total ads mod in period by modId on moderatorStat db
Calculate Pace
- Dependences: totalAdsMod, totalKwMod, timeWorked
pace = totalAdsMod / timeWorked * 3600
Calculate avgPace
- sum(paceOfUsers) / count(paceOfUsers)
Calculate standDeviation
- Dependences: paceOfUsers, avgPace
result += pow(paceOfUser - avgPace, 2)standDeviation = sqrt($result / count(paceOfUsers))
Save Salary Report
- only user has pace > 0
- if to date = last day of month >>> set isFinish = true
Auto Process command
-
auto-process:moderation-queue {process_id}
get Advert by msg in RabbitMQ
with key: moderation_auto_process_queue
Blacklist queue
Save advert to blacklist queue
- moderate with url param: flowtype=follow
- advert satisfy rule in blacklist
- normal moderator accept advert
-
Logic add advert to queue QA recheck
- add advert 10th save to QA queue
- #541427:
-- check 10th advert
-- get 10 last ads, random 1 advert save to queue