From 55b2bf61a5bf27ba6d20388d1f89fd6509942ecd Mon Sep 17 00:00:00 2001 From: Munkherdene Date: Sun, 23 Aug 2026 18:40:16 +0800 Subject: [PATCH] fix(salary): use median monthly salary (robust to bonus/outlier months) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Full-history check found one work month with a stray 3rd installment (₮5.77M) skewing latest-complete and the mean. Switch the monthly-salary figure (income card + safe-to-spend) to the median of fully-paid work months (₮3.83M here), robust to that outlier. Card now shows a 'сарын дундаж ~₮X' caption under salary. --- src/features/home/DashboardView.tsx | 6 ++++++ src/features/home/strings.ts | 1 + 2 files changed, 7 insertions(+) diff --git a/src/features/home/DashboardView.tsx b/src/features/home/DashboardView.tsx index 60db322..2210629 100644 --- a/src/features/home/DashboardView.tsx +++ b/src/features/home/DashboardView.tsx @@ -252,6 +252,7 @@ function IncomeRow({ label, value, dotColor, loading, hidden }: { label: string; function IncomeCard({ month, loading, hidden }: { month?: Analyze; loading: boolean; hidden: boolean }) { const salary = dec(month?.salaryIncome); const support = dec(month?.otherIncome); + const typical = dec(month?.monthlySalary); const income = dec(month?.income); const expense = dec(month?.expense); const saved = income - expense; @@ -265,6 +266,11 @@ function IncomeCard({ month, loading, hidden }: { month?: Analyze; loading: bool
diff --git a/src/features/home/strings.ts b/src/features/home/strings.ts index b714a84..ad7034b 100644 --- a/src/features/home/strings.ts +++ b/src/features/home/strings.ts @@ -24,6 +24,7 @@ export const homeStrings = { // Income card — earned salary vs support, and what's kept. incomeTitle: "Энэ сарын орлого", incomeSalary: "Цалин", + incomeTypical: "сарын дундаж", incomeSupport: "Дэмжлэг ба бусад", incomeSaved: "Хэмнэсэн", incomeSpentOf: "зарцуулсан",