先に明かしておく。 2026年6月にこの雑誌はある会計事務所の締切ボードの話を載せた。この記事に出てくる人と事業者は実在しない。多くの現場で実際に仕事が回っている形を集めて作った人物で構成しており、人物の言葉も作り物だ。以下はその形どおりに自分で作ったものであり、取引先と締切項目は作り物だ。
このドメインの難しさは算数ではない。規則と日付は別物なのに、事務所はいつも規則の側を失うということだ。
表計算のセルに 2026-04-27 と書かれているとしよう。それを読む人は、それが法定期限なのか、週末でずれた日なのか、去年のものをコピーして生まれた誤字なのか、知る術がない。
だからこのボードは締切日をひとつも保存しない。
保存するのは規則だ
/// A filing obligation, as a rule rather than a date.
class Duty {
const Duty(this.client, this.name, this.dayOfMonth, this.monthOf, this.note);
/// Statutory day of the month.
final int dayOfMonth;
/// Which month it lands in, relative to the period being filed.
final int monthOf;
}
日付がない。何月何日という規則だけがある。画面に出る日付は毎回その規則から計算される。
そして検証がそれを確認する。画面に出た締切日がソースに文字列として存在すれば失敗させる。
board = s.call("board.today")
assert all(r["rule"] for r in board["rows"]), "every row must say which rule produced it"
この検査が実際に何かを捕まえた。 最初に回したとき失敗し、原因は私がドキュメントコメントに例として書いておいた 2026-04-27 だった。誤検知だ — コメントであって保存された日付ではないからだ。
ところが直しながら本物がひとつ一緒に出てきた。状態応答に 'today': '2026-04-20' と文字列が埋め込まれていて、その値はコード上方の _today と一致しなければならない二か所だった。
// Derived, not typed twice. Two places that must agree eventually
// disagree.
'today': _fmt(_today),
検査が捕まえたのはコメントだったが、それを見に行ったついでに本物を直した。検査が誤検知を出すことと役に立たないことは違う。
週末でずれたならずれたと言う
このドメインの代表的な罠だ。誰もが知っている規則なのに、表計算はいつも忘れる。
/// Shift a statutory date off a weekend, and say that you did.
///
/// This is the rule everyone knows and every spreadsheet forgets. Returning
/// the shift as text rather than silently moving the date is the whole point:
/// "25th, moved to Monday" is checkable, "27th" is not.
実行ログだ。
2026-03-31 D-20 Fairfield Corporate tax [day 31 of month 3]
2026-04-10 D-10 Brightwater Withholding — March [day 10 of month 4]
2026-04-10 D-10 Northgate Withholding — March [day 10 of month 4]
2026-04-27 D7 Brightwater VAT — Q1 [day 25 of month 4 · statutory 25th fell on Saturday]
2026-04-27 D7 Fairfield VAT — Q1 [day 25 of month 4 · statutory 25th fell on Saturday]
2026-04-30 D10 Northgate Local income tax [day 30 of month 4]
04-25が実際に土曜日だったので04-27にずれ、その事由が角括弧の中に付いている。 ずれていない行にも規則が付いていることも見てほしい — ずれたものだけ説明して残りを日付だけにすれば、規則のある行とない行が画面で区別できなくなる。
検証が両方を見る。
assert any("fell on" in r["rule"] for r in board["rows"]), "a weekend shift must be marked in the rule"

取引先ひとつに絞っても規則はそのまま付いてくる。
