<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: member_0fbab672</title>
    <description>The latest articles on DEV Community by member_0fbab672 (@member_0fbab672).</description>
    <link>https://dev.to/member_0fbab672</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4262633%2F3b771d18-7d89-4a5d-bb1c-0547e00ca9a6.png</url>
      <title>DEV Community: member_0fbab672</title>
      <link>https://dev.to/member_0fbab672</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/member_0fbab672"/>
    <language>en</language>
    <item>
      <title>Japan's minimum wage isn't one number on a given day: resolving staggered effective dates in code</title>
      <dc:creator>member_0fbab672</dc:creator>
      <pubDate>Tue, 24 Nov 2026 12:12:07 +0000</pubDate>
      <link>https://dev.to/member_0fbab672/japans-minimum-wage-isnt-one-number-on-a-given-day-resolving-staggered-effective-dates-in-code-2e0o</link>
      <guid>https://dev.to/member_0fbab672/japans-minimum-wage-isnt-one-number-on-a-given-day-resolving-staggered-effective-dates-in-code-2e0o</guid>
      <description>&lt;p&gt;Japan sets its minimum wage per prefecture (47 of them), and each prefecture's new rate starts on its &lt;strong&gt;own&lt;/strong&gt; effective date. For FY2026 most prefectures switched in October/November, but as of 24 Nov 2026 three had not switched yet: &lt;strong&gt;Iwate and Kumamoto (1 Dec)&lt;/strong&gt; and &lt;strong&gt;Okinawa (2 Dec)&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;So "what is the minimum wage in Okinawa?" has two right answers depending on the date. Payroll checks, job boards, and AI agents that answer "is this job offer legal?" get it wrong when they cache one "current" value.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Store both rates with their dates, not "current"
&lt;/h2&gt;

&lt;p&gt;The official source is MHLW. The yearly list is a PDF; the history (H14 to R8) is an XLSX that also carries the &lt;strong&gt;previous&lt;/strong&gt; rate and its effective date. I parse both and abort the build on any mismatch (all 47 matched).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"pref"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Okinawa"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"fy2026"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"yen"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"..."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"effective"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"2026-12-02"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"previous"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"yen"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"..."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"effective"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"2025-..."&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  2. Resolve the rate for a date at query time
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;rateOn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;            &lt;span class="c1"&gt;// d = 'YYYY-MM-DD' (JST)&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;fy2026&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;effective&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;fy2026&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;previous&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;effective&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;previous&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;                     &lt;span class="c1"&gt;// older than our data: say so, don't guess&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;ISO dates compare correctly as strings. With this, the staggered 1 Dec / 2 Dec switch is right on every date with &lt;strong&gt;no rebuild&lt;/strong&gt;. After the end of the fiscal year, add a note that a newer rate may apply instead of silently serving a stale one.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Prefecture names come in many spellings
&lt;/h2&gt;

&lt;p&gt;Users and LLMs send &lt;code&gt;Tokyo&lt;/code&gt;, &lt;code&gt;Toukyou&lt;/code&gt;, &lt;code&gt;Hokkaidō&lt;/code&gt;, &lt;code&gt;Kochi&lt;/code&gt;/&lt;code&gt;Kouchi&lt;/code&gt;, &lt;code&gt;JP-13&lt;/code&gt;, &lt;code&gt;13&lt;/code&gt;, &lt;code&gt;東京都&lt;/code&gt;, &lt;code&gt;東京&lt;/code&gt;. What worked:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Strip macrons, then fold &lt;code&gt;ou&lt;/code&gt;/&lt;code&gt;oo&lt;/code&gt;/&lt;code&gt;uu&lt;/code&gt; → &lt;code&gt;o&lt;/code&gt;/&lt;code&gt;u&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Strip &lt;code&gt;-ken&lt;/code&gt;/&lt;code&gt;-fu&lt;/code&gt;/&lt;code&gt;-to&lt;/code&gt; &lt;strong&gt;only if 4+ characters remain&lt;/strong&gt; — otherwise "Kyoto" loses its "to".&lt;/li&gt;
&lt;li&gt;In Japanese, allow an optional 県/府/都/道 suffix, but never strip 都 from the name itself, or 京都 becomes 京.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  4. Validate before you charge
&lt;/h2&gt;

&lt;p&gt;My endpoint is pay-per-call (x402, 0.01 USDC on Base). Unknown prefecture, a bad date or a bad section returns &lt;strong&gt;400 before the 402&lt;/strong&gt;, so nobody pays for a typo.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Laws: the premium rates are not in the Labor Standards Act
&lt;/h2&gt;

&lt;p&gt;If you also return overtime rules: the 25% overtime / 35% holiday premiums are set by a &lt;strong&gt;cabinet order&lt;/strong&gt; (政令), not the Act itself; the Act only holds the 60h/50% and 25% night rules. The e-Gov API v1 returns full law text as XML, so you can cite article numbers instead of paraphrasing blogs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;HTTP: &lt;code&gt;https://hodoyoku.pages.dev/api/v1/minimum-wage?pref=Okinawa&amp;amp;date=2026-12-02&lt;/code&gt; (x402; no &lt;code&gt;pref&lt;/code&gt; returns all 47)&lt;/li&gt;
&lt;li&gt;Worker-rights summary with official help desks: &lt;code&gt;/api/v1/worker-rights?section=minimum_wage|rights|help_desks|job_change&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;MCP server for agents: &lt;code&gt;https://hodoyoku.pages.dev/mcp&lt;/code&gt; — tools &lt;code&gt;get_japan_minimum_wage&lt;/code&gt;, &lt;code&gt;get_japan_worker_rights&lt;/code&gt; (plus business-calendar, weather-warning and ticket-drop tools). Listed in the official MCP Registry.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Everything is sourced from MHLW and e-Gov; unverified items are flagged in the response rather than filled in.&lt;/p&gt;

&lt;p&gt;Setup guide, tool list and curl examples: &lt;a href="https://hodoyoku.pages.dev/agents" rel="noopener noreferrer"&gt;https://hodoyoku.pages.dev/agents&lt;/a&gt;&lt;/p&gt;

</description>
      <category>api</category>
      <category>japan</category>
      <category>ai</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
