Skip to content

fix: usage module cosmetic follow-ups - #67

Merged
chmmou merged 1 commit into
mainfrom
fix/usage-cosmetic-followups-45
May 9, 2026
Merged

fix: usage module cosmetic follow-ups#67
chmmou merged 1 commit into
mainfrom
fix/usage-cosmetic-followups-45

Conversation

@chmmou

@chmmou chmmou commented May 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • internal/usage — add a (t Traffic) IsSummary() bool helper so callers no longer rely on the Day == 0 magic number; the table renderer is switched over and the decoder test asserts the helper for both the summary row and a per-day entry.
  • internal/usage — doc-note on Space that UsedWebspace is the sum of UsedHTDocsSpace, UsedChrootSpace, UsedDatabaseSpace, and UsedMailaccountSpace, so future readers do not double-count.
  • kasapi-cli usage traffic — pre-validate --year ([2000, currentYear+1]) and --month (1..12) in PreRunE. Obvious typos now surface locally instead of after a KAS roundtrip.

Closes #45.

- internal/usage: add Traffic.IsSummary() helper so callers no longer
  encode the "summary row vs. day-zero" decision via the Day == 0
  magic number; the TrafficList table renderer uses it too.
- internal/usage: doc-note on Space that UsedWebspace is the sum of
  UsedHTDocsSpace, UsedChrootSpace, UsedDatabaseSpace, and
  UsedMailaccountSpace, so future readers do not double-count.
- internal/cli: pre-validate "kasapi-cli usage traffic --year"
  ([2000, currentYear+1]) and "--month" (1..12) in PreRunE so obvious
  typos surface locally instead of after a KAS roundtrip.

Closes #45.
@chmmou
chmmou merged commit 99743f4 into main May 9, 2026
1 check passed
@chmmou
chmmou deleted the fix/usage-cosmetic-followups-45 branch May 9, 2026 01:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

usage module: cosmetic follow-ups from review of #43

1 participant