feat(display): limit /adults and /juniors to last N months by default
All checks were successful
Deploy to K8s / deploy (push) Successful in 17s
All checks were successful
Deploy to K8s / deploy (push) Successful in 17s
Show only the last MONTHS_TO_SHOW months (default 5) in the fee table columns so the page fits on screen without horizontal scrolling. Reconciliation still runs over the full month history so balances, credits, and debts are unaffected. Set MONTHS_TO_SHOW=0 to show all months. Implemented in both Python and Go. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -64,6 +64,7 @@ type Config struct {
|
||||
DriveTimeout time.Duration
|
||||
LogLevel string
|
||||
ServerAddr string
|
||||
MonthsToShow int // show last N month columns; 0 means show all
|
||||
}
|
||||
|
||||
// Load reads configuration from the environment, applying defaults that
|
||||
@@ -87,6 +88,7 @@ func Load() Config {
|
||||
DriveTimeout: envDuration("DRIVE_TIMEOUT_SECONDS", 10),
|
||||
LogLevel: env("LOG_LEVEL", "INFO"),
|
||||
ServerAddr: env("SERVER_ADDR", ":8080"),
|
||||
MonthsToShow: envInt("MONTHS_TO_SHOW", 5),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,3 +123,12 @@ func envDuration(key string, defaultSeconds int) time.Duration {
|
||||
}
|
||||
return time.Duration(defaultSeconds) * time.Second
|
||||
}
|
||||
|
||||
func envInt(key string, fallback int) int {
|
||||
if v := os.Getenv(key); v != "" {
|
||||
if n, err := strconv.Atoi(v); err == nil {
|
||||
return n
|
||||
}
|
||||
}
|
||||
return fallback
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user