<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>syu-m-5151</author_name>
  <author_url>https://blog.hatena.ne.jp/syu-m-5151/</author_url>
  <blog_title>じゃあ、おうちで学べる </blog_title>
  <blog_url>https://syu-m-5151.hatenablog.com/</blog_url>
  <categories>
    <anon>Rust</anon>
    <anon>rowan</anon>
  </categories>
  <description>はじめに 長年、動いた DB を覗くと、たいていこういうレコードが眠っています。 { &quot;order_id&quot;: 12345, &quot;is_paid&quot;: true, &quot;payment_id&quot;: null } is_paid = true なのに payment_id は null。 ドメイン上、 同時に成立してはいけない組み合わせ が静かに残り、数ヶ月後の返金処理で例外を出します。 今後 「型で illegal state を表現不能にする」みたいな発表をします 。 そしてその前の記事で書いた 「rowan で自家製 lint を書く」 は、 cargo check に乗らない規約をコードで強制する話…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fsyu-m-5151.hatenablog.com%2Fentry%2F2026%2F05%2F12%2F161200&quot; title=&quot;ドメイン規約を lint で表現する — `Order` に `is_paid + payment_id` を共存させない - じゃあ、おうちで学べる &quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://cdn-ak.f.st-hatena.com/images/fotolife/s/syu-m-5151/20260512/20260512155532.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2026-05-12 16:12:00</published>
  <title>ドメイン規約を lint で表現する — `Order` に `is_paid + payment_id` を共存させない</title>
  <type>rich</type>
  <url>https://syu-m-5151.hatenablog.com/entry/2026/05/12/161200</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
