import os
os.makedirs('.codewiki/dd/FUW00927SFBean', exist_ok=True)

J = {
  'FUNC': '機能コード',
  'SCREEN': '画面モード',
  'KOUMOKU': '項目コード',
  'VALUE': '値',
  'GETSU_KMK': '月額料金項目',
  'GETSU': '月額料金',
  'SHOKI_KMK': '初期費用項目',
  'SHOKI': '初期費用',
  'GETSU_KEI': '月額料金計',
  'GETSU_KEI_ZEI': '月額料金計（税抜）',
  'MOBILE_MONTH': 'モバイル月額料金計',
  'MOBILE_INIT': 'モバイル初期費用計',
  'GETSU_MONGON': '月額料金文言',
  'SHOKI_MONGON': '初期費用文言',
  'MOBILE_MONTH_MONGON': 'モバイル月額料金文言',
  'MOBILE_INIT_MONGON': 'モバイル初期費用文言',
  'GTGK_PR_GOKEI': '月額料金合計',
  'GTGK_PR_GOKEI_ZEI': '月額料金合計（税抜）',
  'SHKH_GOKEI': '初期費用合計',
  'SHKH_GOKEI_ZEI': '初期費用合計（税抜）',
  'GTGK_PR_GOKEI_MONGON': '月額料金合計文言',
  'SHKH_GOKEI_MONGON': '初期費用合計文言',
  'KEI_SBT': '契約種別',
  'SEX': 'ご契約者情報（個人）・性別',
  'HNIN_CFM': 'ご本人様確認書類',
  'SETPLACE_FORM': 'ご利用場所設置位置・ご利用場所の形態',
  'SETPLACE_FLR': 'ご利用場所設置位置・お住まいの階数',
  'SETPLACE_BNCHI': 'ご利用場所設置位置・住所番地',
  'USE_NET_KSN': 'ご利用場所設置位置・利用中のネット回線',
  'KIKI_PLACE_CHG': 'ご利用場所設置位置・利用中の機器の設置場所変更予定',
  'TKC_KOJI_SAME': 'ご利用場所設置位置・宅内調査と工事の同日実施',
  'RRKS_CHOICE': '連絡先選択',
  'FAX_KIBO': 'ＦＡＸ連絡ご希望',
  'DSP_SAME_PLACE': '同一利用場所警告表示制御フラグ',
  'DSP_PCD': '郵便番号表示制御フラグ',
  'DSP_CLOSE_BTN': '閉じるボタン表示制御フラグ',
  'DSP_ADD_BTN': '登録して次へボタン表示フラグ',
  'DSP_NEXT_BTN': '次へボタン表示フラグ',
  'TWRYO_STIAM': '通話料指定額到達通知指定金額',
  'KEI_SVC_AREA': '契約中サービスエリア表示フラグ',
  'CX_START_FLG': 'ＣＸ案件開始フラグ',
  'TAKCHO_APO_DISP': '宅内調査のアポ架電希望表示フラグ',
  'TAKCHO_APO_SCR': '宅内調査のアポ架電希望',
  'SML': '（スマートリンク）',
  'NH': '（ＮＨ）',
}

L = []
a = L.append

# Header
a('# Business Logic - FUW00927SFBean.storeModelData() [1127 LOC]')
a('')
a('| Field | Value |')
a('|-------|-------|')
a('| Fully Qualified Name | eo.web.webview.FUW00927SF.FUW00927SFBean |')
a('| Layer | Webview / Front-End Bean (Web Presentation Layer) |')
a('| Module | FUW00927SF (Package: eo.web.webview.FUW00927SF) |')
a('')
a('## 1. Role')
a('')
a('### FUW00927SFBean.storeModelData()')
a('')
a('This method is the central **data binding router** for the K-Opticom FTTH (Fiber-to-the-Home) new subscription order screen (FUW00927SF - "Input Content Confirmation (Sales/Delivery)"). It receives a key/subkey/value triplet and dispatches the incoming data to the correct field setter, list item, or common-info handler based on the semantic meaning of the key.')
a('')
a('The method handles **four categories** of data types: (1) **Common information** fields (key starts with "//"), which are delegated to the superclass `storeCommonInfoData` - these represent shared screen-level metadata; (2) **Single-value String fields** (e.g., Function Code, Screen Mode, Monthly Fees, Initial Fees, Contract Type, Customer Info, Fax Request, Display Flags), where data is routed to a `setXxx_value` or `setXxx_state` setter; (3) **Single-value Boolean fields** (e.g., Contract Service Area Display Flag), where `in_value` is cast to `Boolean` for the value setter and to `String` for the state setter; (4) **Repeating list fields** (e.g., Item Code, Value, Monthly Fee Items, Smart Link items, NH items), where an index is parsed from the key path, bounds-checked against the backing list, and the data is delegated to the individual list item\'s own `storeModelData` method - implementing recursive hierarchical data binding.')
a('')
a('The design pattern implemented is a **routing/dispatch pattern** combined with a **delegation pattern**: the method acts as a central dispatcher that examines the key prefix, extracts nested indices from slash-delimited paths, and delegates to either instance setters or child bean objects. This is a shared utility called by the screen controller to populate model data into this bean\'s fields.')
a('')
a('The method also supports **slash-delimited hierarchical key paths** (e.g., "getsu_ryokin_kmk/0") to support repeatable/variable-count fields - a common pattern in the K-Opticom web framework for representing line-item data.')

with open('.codewiki/dd/FUW00927SFBean/storeModelData.md', 'w', encoding='utf-8') as f:
    f.write('
'.join(L) + '
')
print("Part 1 ok")
