chore(write-slice): align cross-module conventions post-#122 review - #185
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Cross-module parity sweep applying the conventions the post-#122 review surfaced as Nice-to-haves. Companion to #184 (database-only followups).
account+mailaccountlist views: dropUSED_MBheader →USED; cells gain" MB"suffix (matches singular detail + database slice).ddns.DDNSUser.in_progress: dropomitempty; align with majority of read modules.cronjob/ddns/ftpuser/sambauser/mailinglist/mailforwardClient.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.