Skip to content

chore(write-slice): align cross-module conventions post-#122 review - #185

Merged
chmmou merged 1 commit into
mainfrom
chore/write-slice-conventions-align
May 20, 2026
Merged

chore(write-slice): align cross-module conventions post-#122 review#185
chmmou merged 1 commit into
mainfrom
chore/write-slice-conventions-align

Conversation

@chmmou

@chmmou chmmou commented May 20, 2026

Copy link
Copy Markdown
Owner

Summary

Cross-module parity sweep applying the conventions the post-#122 review surfaced as Nice-to-haves. Companion to #184 (database-only followups).

  • account + mailaccount list views: drop USED_MB header → USED; cells gain " MB" suffix (matches singular detail + database slice).
  • ddns.DDNSUser.in_progress: drop omitempty; align with majority of read modules.
  • cronjob/ddns/ftpuser/sambauser/mailinglist/mailforward Client.Add: combined validation messages → per-field errors. Caller can now identify which specific field broke.
  • docs/usage/destructive-writes.md: refactored into a baseline section + per-slice deviations table. Replaces eight near-identical paragraphs.

Pure refactor + doc work, no behaviour change for previously-valid invocations.

Apply the cross-module parity changes the post-merge review of #122
(PR #183) surfaced as Nice-to-haves. The database-only followups
landed in #184; this commit propagates the same conventions to the
bestand modules so the next slice inherits a consistent baseline.

- internal/account/table.go: AccountList drops the unit-bearing
  USED_MB header in favour of USED, and used_account_space carries
  the " MB" suffix as part of the value (matching the singular detail
  row and the database slice convention).
- internal/mailaccount/mailaccount.go: same alignment for
  MailAccountList + singular MailAccount.
- internal/ddns/ddns.go: DDNSUser.in_progress drops omitempty,
  aligning with the majority of read modules (account, mailaccount,
  mailinglist, sambauser, ftpuser, database). Comment updated to
  cite the parity reason.
- internal/cronjob/write.go: Client.Add replaces two combined
  validation messages ("requires non-empty protocol, http url AND
  comment" + the schedule one) with eight per-field error returns —
  the caller can tell which specific field broke without guessing.
- internal/ddns/write.go, internal/ftpuser/write.go,
  internal/sambauser/write.go, internal/mailinglist/write.go,
  internal/mailforward/write.go: same per-field validation refactor
  for each slice's Add method. Same convention introduced by the
  database slice in #122 followups.
- docs/usage/destructive-writes.md: refactored. Single "per-slice
  baseline" section captures the contract every wired slice carries
  (gating policy, dry-run/audit/redaction, generated-login printing);
  a "per-slice deviations" table calls out only what each slice
  changes (mailforward's target-list phrasing, database's louder
  delete verb + optional --allowed-hosts wildcard, ddns's
  no-_new_password split). Replaces eight near-identical paragraphs.

Pure refactor + doc work: behaviour for any previously-valid CLI
invocation is unchanged; the validation messages got narrower
(per-field instead of combined) but the validation surface itself
did not move.
@chmmou
chmmou merged commit 51e31db into main May 20, 2026
6 checks passed
@chmmou
chmmou deleted the chore/write-slice-conventions-align branch May 20, 2026 19:44
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.

1 participant