# Business Logic — KKW02516SFBean.listKoumokuIds() [63 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKA16801SF.KKW02516SFBean` |
| Layer | Service (Webview Bean — presentation-tier service form controller) |
| Module | `KKA16801SF` (Package: `eo.web.webview.KKA16801SF`) |

## 1. Role

### KKW02516SFBean.listKoumokuIds()

This method serves as the **central item (column) metadata router** for the KKA16801SF screen. Its job is to return the list of displayable column labels for a service-contract data grid, with the returned list varying depending on what the caller requests. When `key` is `null`, the method returns the full set of item names for the **entire service form**, representing all columns visible on the master screen. When `key` targets a **data-type-specific sub-item** (such as "Customer Contract Inheritance List" or "Movement Reason List"), the method delegates to a dedicated detail bean (`KKW02516SF01DBean` or `KKW02516SF02DBean`) to obtain the column labels for that sub-grid. When `key` starts with a slash (indicating a **common-info view** item), the method delegates to its superclass implementation for shared handling. This pattern — branching on the type of requested item and delegating to the appropriate bean — implements a **routing/dispatch design**, allowing each sub-component to own its own column metadata. The method is a shared utility called by the screen controller to dynamically build the grid headers, and is itself overloaded by `listKoumokuIds()` with no parameters, which forwards to this variant with `null`.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["listKoumokuIds(String key)"])
    COND_NULL{"key == null?"}
    PROCESS_FULL["Build full service form item list: add 29 item labels"]
    COMMON_CHECK{key starts with slash and length gt 2}
    CALL_SUPER["super.listKoumokuIds"]
    CUSTOMER_CHECK{"key equals customer_contract_inheritance_list"}
    CALL_01D["KKW02516SF01DBean.listKoumokuIds"]
    IDO_CHECK{"key equals movement_reason_list"}
    CALL_02D["KKW02516SF02DBean.listKoumokuIds"]
    RETURN_EMPTY["return new ArrayList"]
    END_RETURN(["Return / Next"])

    START --> COND_NULL
    COND_NULL -->|true| PROCESS_FULL
    COND_NULL -->|false| COMMON_CHECK
    PROCESS_FULL --> END_RETURN
    COMMON_CHECK -->|true| CALL_SUPER
    COMMON_CHECK -->|false| CUSTOMER_CHECK
    CALL_SUPER --> END_RETURN
    CUSTOMER_CHECK -->|true| CALL_01D
    CUSTOMER_CHECK -->|false| IDO_CHECK
    CALL_01D --> END_RETURN
    IDO_CHECK -->|true| CALL_02D
    IDO_CHECK -->|false| RETURN_EMPTY
    RETURN_EMPTY --> END_RETURN
```

**Processing branches:**

1. **Null-key path (Full service form):** When `key` is `null`, the caller is requesting the complete list of column labels for the master service form. The method constructs a new `ArrayList` and populates it with 29 item labels (including a post-addition entry for "返却データ" added under ANK-2694-00-00). This is a pure read operation — no database or service calls.

2. **Common-info view path:** When `key` starts with `/` and has more than 2 characters, the caller is requesting a column list for a **common-info view** item. The method delegates to the superclass `listKoumokuIds(key)` to handle shared logic.

3. **Customer Contract Inheritance List path:** When `key` equals "顧客契約引継リスト" (Customer Contract Inheritance List), the method delegates to `KKW02516SF01DBean.listKoumokuIds()` which returns the column labels for the customer contract detail sub-grid.

4. **Movement Reason List path:** When `key` equals "異動理由リスト" (Movement Reason List), the method delegates to `KKW02516SF02DBean.listKoumokuIds()` which returns the column labels for the movement reason detail sub-grid.

5. **Default path (Unknown key):** When none of the above conditions match, the method returns an empty `ArrayList<String>`, signaling no known items for the requested key.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | An item identifier that determines which set of column labels to return. When `null`, it signals the caller wants the full service form column list. When it equals specific item display names (e.g., "顧客契約引継リスト"), it requests the detail bean's column list for that sub-grid. When it starts with "/" and has length > 2, it identifies a common-info view item. |

**External state read:**
- `super.listKoumokuIds(key)` — the superclass implementation is invoked for common-info view keys, delegating to inherited behavior.

## 4. CRUD Operations / Called Services

### Pre-computed evidence from code analysis graph:

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `super.listKoumokuIds` | KKW02516SFBean (superclass) | - | Delegates to superclass for common-info view item column retrieval |
| R | `KKW02516SF01DBean.listKoumokuIds` | KKW02516SF01DBean | - | Returns detail bean column labels for Customer Contract Inheritance sub-grid |
| R | `KKW02516SF02DBean.listKoumokuIds` | KKW02516SF02DBean | - | Returns detail bean column labels for Movement Reason sub-grid |

**Classification rationale:**
- All three called methods are **Read (R)** operations — they return column metadata (display labels) without performing any database access, service invocation, or data mutation. They are pure metadata providers for UI grid column configuration.
- No SC (Service Component) or CBS (CBS Component) codes are referenced. This method operates entirely at the bean layer, providing presentation metadata without reaching into the service or persistence layers.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Method: listKoumokuIds() | `KKW02516SFBean.listKoumokuIds()` (no-arg overload) -> `KKW02516SFBean.listKoumokuIds(key)` with `key=null` | `listKoumokuIds [R] -` (full form items) |

**Notes:** The pre-computed code graph identifies only one direct caller: the overloaded `KKW02516SFBean.listKoumokuIds()` (with no parameters) which delegates to this method by passing `key=null`. This overload acts as a convenience entry point. The method is a bean-level utility — callers are within the same class and are not directly invoked from screens or batches by name.

## 6. Per-Branch Detail Blocks

**Block 1** — [IF] `(key == null)` "key is null — return full service form item list" (L1841)

> When the key parameter is null, the method builds and returns the complete list of column labels for the entire service form grid. This is the default path when no specific sub-item is requested.

| # | Type | Code |
|---|------|------|
| 1 | SET | `koumokuList = new ArrayList<String>()` // Create new list [-> L1842] |
| 2 | CALL | `koumokuList.add("顧客契約引継リスト")` // Add "Customer Contract Inheritance List" [-> L1843] |
| 3 | CALL | `koumokuList.add("利用開始日")` // Add "Service Start Date" [-> L1844] |
| 4 | CALL | `koumokuList.add("利用終了日（年）")` // Add "Service End Date (Year)" [-> L1845] |
| 5 | CALL | `koumokuList.add("利用終了日（月）")` // Add "Service End Date (Month)" [-> L1846] |
| 6 | CALL | `koumokuList.add("利用終了日（日）")` // Add "Service End Date (Day)" [-> L1847] |
| 7 | CALL | `koumokuList.add("利用終了日")` // Add "Service End Date" [-> L1848] |
| 8 | CALL | `koumokuList.add("SRSID")` // Add "SRSID" [-> L1849] |
| 9 | CALL | `koumokuList.add("サービス契約番号")` // Add "Service Contract Number" [-> L1850] |
| 10 | CALL | `koumokuList.add("異動区分")` // Add "Movement Classification" [-> L1851] |
| 11 | CALL | `koumokuList.add("異動理由リスト")` // Add "Movement Reason List" [-> L1852] |
| 12 | CALL | `koumokuList.add("オプションサービス契約番号")` // Add "Option Service Contract Number" [-> L1853] |
| 13 | CALL | `koumokuList.add("処理区分")` // Add "Processing Classification" [-> L1854] |
| 14 | CALL | `koumokuList.add("申請番号")` // Add "Application Number" [-> L1855] |
| 15 | CALL | `koumokuList.add("申請詳細番号")` // Add "Application Detail Number" [-> L1856] |
| 16 | CALL | `koumokuList.add("運用年月日")` // Add "Operation Date" [-> L1857] |
| 17 | CALL | `koumokuList.add("運用年月日時分秒")` // Add "Operation Date-Time (Year/Month/Day Hour:Minute:Second)" [-> L1858] |
| 18 | CALL | `koumokuList.add("予約適用年月日")` // Add "Reservation Apply Date" [-> L1859] |
| 19 | CALL | `koumokuList.add("世代登録年月日時分秒")` // Add "Generation Registration Date-Time" [-> L1860] |
| 20 | CALL | `koumokuList.add("オプションサービス契約ステータス")` // Add "Option Service Contract Status" [-> L1861] |
| 21 | CALL | `koumokuList.add("オプションサービスコード")` // Add "Option Service Code" [-> L1862] |
| 22 | CALL | `koumokuList.add("料金コースコード")` // Add "Fee Course Code" [-> L1863] |
| 23 | CALL | `koumokuList.add("料金プランコード")` // Add "Fee Plan Code" [-> L1864] |
| 24 | CALL | `koumokuList.add("サービス開始年月日")` // Add "Service Start Date" [-> L1865] |
| 25 | CALL | `koumokuList.add("サービス終了年月日")` // Add "Service End Date" [-> L1866] |
| 26 | CALL | `koumokuList.add("サービス課金終了年月日")` // Add "Service Billing End Date" [-> L1867] |
| 27 | CALL | `koumokuList.add("回復年月日")` // Add "Recovery Date" [-> L1868] |
| 28 | CALL | `koumokuList.add("最終更新年月日時分秒")` // Add "Last Update Date-Time" [-> L1869] |
| 29 | CALL | `koumokuList.add("返却メッセージID")` // Add "Return Message ID" [-> L1870] |
| 30 | CALL | `koumokuList.add("更新状態可否フラグ")` // Add "Update Status Flag" [-> L1871] |
| 31 | CALL | `koumokuList.add("進展特記事項1")` // Add "Progress Special Notes 1" [-> L1872] |
| 32 | CALL | `koumokuList.add("返却データ")` // Add "Return Data" [ANK-2694-00-00 ADD: Wansupp addition] [-> L1874] |
| 33 | RETURN | `return koumokuList` // Return the populated list [-> L1876] |

**Block 2** — [ELSE-IF] `(key starts with "/" && length > 2)` "common-info view item" (L1879)

> When the key starts with "/" and has more than 2 characters, it identifies a common-info view item. The method delegates to the superclass for shared handling logic.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `return super.listKoumokuIds(key)` // Delegate to superclass for common-info view [-> L1880] |

**Block 3** — [ELSE-IF] `(key equals "顧客契約引継リスト")` "Customer Contract Inheritance List" [-> "顧客契約引継リスト" = "Customer Contract Inheritance List"] (L1884)

> When the key matches the customer contract inheritance list item name, delegates to the detail bean KKW02516SF01DBean to provide the column labels for the customer contract sub-grid. This supports a data-type view where each row's customer contract details are displayed in a child table.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `return KKW02516SF01DBean.listKoumokuIds()` // Get column labels from Customer Contract detail bean [-> L1885] |

**Block 4** — [ELSE-IF] `(key equals "異動理由リスト")` "Movement Reason List" [-> "異動理由リスト" = "Movement Reason List"] (L1889)

> When the key matches the movement reason list item name, delegates to the detail bean KKW02516SF02DBean to provide the column labels for the movement reason sub-grid. This supports a data-type view where each row's movement reasons are displayed in a child table.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `return KKW02516SF02DBean.listKoumokuIds()` // Get column labels from Movement Reason detail bean [-> L1890] |

**Block 5** — [ELSE] `(no condition matched)` "default — return empty list" (L1892)

> When none of the known key values match, the method returns an empty ArrayList, signaling that no column metadata is available for the requested item.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return new ArrayList<String>()` // Return empty list for unknown key [-> L1892] |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `koumoku` | Field | Item/column — Japanese term for a display column or field in a data grid |
| 顧客契約引継リスト | Japanese label | Customer Contract Inheritance List — the list of items shown in the customer contract detail sub-grid |
| 利用開始日 | Japanese label | Service Start Date — when the service begins |
| 利用終了日（年） | Japanese label | Service End Date (Year) — year component of the service end date |
| 利用終了日（月） | Japanese label | Service End Date (Month) — month component of the service end date |
| 利用終了日（日） | Japanese label | Service End Date (Day) — day component of the service end date |
| 利用終了日 | Japanese label | Service End Date — full service end date |
| SRSID | Acronym | System/Service Reference ID — internal identifier for the service record |
| サービス契約番号 | Japanese label | Service Contract Number — unique identifier for a service contract |
| 異動区分 | Japanese label | Movement Classification — categorizes the type of contract change/movement |
| 異動理由リスト | Japanese label | Movement Reason List — the list of items shown in the movement reason detail sub-grid |
| オプションサービス契約番号 | Japanese label | Option Service Contract Number — identifier for an option service contract |
| 処理区分 | Japanese label | Processing Classification — categorizes the type of processing |
| 申請番号 | Japanese label | Application Number — unique identifier for a service application |
| 申請詳細番号 | Japanese label | Application Detail Number — sub-identifier for an application detail line |
| 運用年月日 | Japanese label | Operation Date — the date the record was created/operated |
| 運用年月日時分秒 | Japanese label | Operation Date-Time — the full timestamp of the operation |
| 予約適用年月日 | Japanese label | Reservation Apply Date — date when a scheduled reservation takes effect |
| 世代登録年月日時分秒 | Japanese label | Generation Registration Date-Time — timestamp of record generation/registration |
| オプションサービス契約ステータス | Japanese label | Option Service Contract Status — current status of the option service contract |
| オプションサービスコード | Japanese label | Option Service Code — code identifying the option service |
| 料金コースコード | Japanese label | Fee Course Code — code for the fee course/tier |
| 料金プランコード | Japanese label | Fee Plan Code — code for the fee plan |
| サービス開始年月日 | Japanese label | Service Start Date — full date when service begins |
| サービス終了年月日 | Japanese label | Service End Date — full date when service ends |
| サービス課金終了年月日 | Japanese label | Service Billing End Date — date when billing for the service ends |
| 回復年月日 | Japanese label | Recovery Date — date the service was recovered/restored |
| 最終更新年月日時分秒 | Japanese label | Last Update Date-Time — timestamp of the most recent record update |
| 返却メッセージID | Japanese label | Return Message ID — identifier for a return/response message |
| 更新状態可否フラグ | Japanese label | Update Status Flag — flag indicating whether the record can be updated |
| 進展特記事項1 | Japanese label | Progress Special Notes 1 — first free-text field for progress notes |
| 返却データ | Japanese label | Return Data — data returned in response (added in ANK-2694-00-00 as a Wansupp addition) |
| common-info view | Technical term | Shared/common information display — a view type that shows shared data fields across the application, identified by a key starting with "/" |
| ANK-2694-00-00 | Issue ID | Change ticket/issue that added the "返却データ" (Return Data) column |
