# Business Logic — KKW22301SF02DBean.listKoumokuIds() [19 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW22301SF.KKW22301SF02DBean` |
| Layer | Utility / Data Type Bean (View-layer metadata provider) |
| Module | `KKW22301SF` (Package: `eo.web.webview.KKW22301SF`) |

## 1. Role

### KKW22301SF02DBean.listKoumokuIds()

This method serves as the metadata provider for the "Campaign List" (キャンペーン一覧) data type within the web application's dynamic view rendering system. It returns a fixed `ArrayList<String>` containing 11 Japanese strings, each representing a column header (item name) displayed on a campaign data grid screen.

The method implements a **data type bean dispatch** design pattern — a shared infrastructure where each `*DBean` class in the `KKW22301SF` module provides its own list of field names. A dispatcher bean (`KKW22301SFBean.listKoumokuIds(String key)`) routes calls to the correct `*DBean` based on a key string. This particular bean handles the "キャンペーン一覧" (Campaign List) key, returning the field names for the campaign data table.

Its role in the larger system is that of a **view-layer configuration source**. The returned list is consumed by UI rendering logic (typically a data-type grid component) to determine which columns appear in the campaign display screen, and in what order. The method is static and stateless — it returns the same list on every invocation and performs no I/O, branching, or conditional logic.

The 11 items cover campaign identification (display campaign code), discount service metadata (discount service name, status name), date ranges (service start/end date, application date, discount start/end date), and discount configuration (discount application path name, discount target segment).

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["listKoumokuIds()"])
    STEP1["Create ArrayList<String> koumokuList"]
    STEP2["Add: Display Campaign Code"]
    STEP3["Add: Discount Service Name"]
    STEP4["Add: Service Start Date"]
    STEP5["Add: Service End Date"]
    STEP6["Add: Application Date"]
    STEP7["Add: Related Customer ID [ANK-3521 ADD]"]
    STEP8["Add: Status Name [ANK-4195 ADD]"]
    STEP9["Add: Discount Start Date [ANK-4195 ADD]"]
    STEP10["Add: Discount End Date [ANK-4195 ADD]"]
    STEP11["Add: Discount Application Path [ANK-4195 ADD]"]
    STEP12["Add: Discount Target Segment [ANK-4195 ADD]"]
    ENDN["Return koumokuList"]

    START --> STEP1
    STEP1 --> STEP2
    STEP2 --> STEP3
    STEP3 --> STEP4
    STEP4 --> STEP5
    STEP5 --> STEP6
    STEP6 --> STEP7
    STEP7 --> STEP8
    STEP8 --> STEP9
    STEP9 --> STEP10
    STEP10 --> STEP11
    STEP11 --> STEP12
    STEP12 --> ENDN
```

The processing is a linear sequence with no conditional branches or loops. Each step appends one Japanese column header string to the list. Two items were added via change requests (ANK-3521 and ANK-4195) and are marked in the flowchart.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| - | (none) | - | This method takes no parameters. It is a static factory method that returns a fixed list of column header names. |

| No | Source | Type | Business Description |
|----|--------|------|---------------------|
| 1 | (instance fields / external state) | - | None — this method is entirely stateless and reads no instance fields or external dependencies. |

## 4. CRUD Operations / Called Services

This method performs no CRUD operations, no database access, and no service component calls. It exclusively uses standard Java collection operations (`ArrayList` constructor and `add()`).

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| — | `ArrayList.<init>()` | — | — | In-memory list construction |
| — | `ArrayList.add(String)` × 11 | — | — | In-memory list population |

No terminal SC codes, CBS codes, or database tables are involved.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKW22301SF | `KKW22301SFBean.listKoumokuIds(String key)` → `KKW22301SF02DBean.listKoumokuIds()` (when key == "キャンペーン一覧") | — |

**Notes:**
- The sole caller is `KKW22301SFBean.listKoumokuIds(String key)`, a dispatcher method that routes based on the `key` parameter.
- When `key.equals("キャンペーン一覧")` (Campaign List), the dispatcher delegates to this method.
- No downstream SC/CBS/DB endpoints are reached from this method as it is purely a data factory.

## 6. Per-Branch Detail Blocks

Since this method contains no conditional branches, loops, or nested structures, the entire method is analyzed as a single sequential block.

**Block 1** — [SEQUENCE] (L835)

> Creates an empty ArrayList and populates it with 11 Japanese column header strings in display order for the campaign data grid.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ArrayList<String> koumokuList = new ArrayList<String>();` // Initialize the item name list |
| 2 | SET | `koumokuList.add("表示用キャンペーンコード");` // Add: Display Campaign Code [-> "表示用キャンペーンコード"] |
| 3 | SET | `koumokuList.add("割引サービス名");` // Add: Discount Service Name [-> "割引サービス名"] |
| 4 | SET | `koumokuList.add("サービス開始年月日");` // Add: Service Start Date [-> "サービス開始年月日"] |
| 5 | SET | `koumokuList.add("サービス終了年月日");` // Add: Service End Date [-> "サービス終了年月日"] |
| 6 | SET | `koumokuList.add("申請年月日");` // Add: Application Date [-> "申請年月日"] |
| 7 | SET | `koumokuList.add("関連お客さまID");` // Add: Related Customer ID [ANK-3521-00-00 feature addition, 2018/12/21] [-> "関連お客さまID"] |
| 8 | SET | `koumokuList.add("ステータス名");` // Add: Status Name [ANK-4195-00-00 feature addition] [-> "ステータス名"] |
| 9 | SET | `koumokuList.add("割引開始日");` // Add: Discount Start Date [ANK-4195-00-00 feature addition] [-> "割引開始日"] |
| 10 | SET | `koumokuList.add("割引終了日");` // Add: Discount End Date [ANK-4195-00-00 feature addition] [-> "割引終了日"] |
| 11 | SET | `koumokuList.add("セット割申請経路名");` // Add: Discount Application Path Name [ANK-4195-00-00 feature addition] [-> "セット割申請経路名"] |
| 12 | SET | `koumokuList.add("セット割対象区分");` // Add: Discount Target Segment [ANK-4195-00-00 feature addition] [-> "セット割対象区分"] |
| 13 | RETURN | `return koumokuList;` // Return the 11-element list |

**Change Request Notes:**
- **ANK-3521-00-00** (2018/12/21): Added item #7 "関連お客さまID" (Related Customer ID) to link campaign entries to customer accounts.
- **ANK-4195-00-00**: Added items #8–#11 for discount lifecycle management: status name, discount start/end dates, discount application path, and discount target segment.

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `koumokuList` | Field | Item name list — the ArrayList containing Japanese column header strings for the campaign display grid |
| `*DBean` | Pattern | Data Type Bean — a view-layer class that provides metadata (field names, types) for a specific data type in the dynamic grid rendering system |
| `KKW22301SF` | Module | Campaign management module — handles campaign data display, creation, and modification screens |
| "表示用キャンペーンコード" | Field | Display Campaign Code — the campaign identifier shown on UI screens |
| "割引サービス名" | Field | Discount Service Name — the name of the service to which the campaign discount applies |
| "サービス開始年月日" | Field | Service Start Date — the date when the service becomes active (YYYY-MM-DD format) |
| "サービス終了年月日" | Field | Service End Date — the date when the service expires (YYYY-MM-DD format) |
| "申請年月日" | Field | Application Date — the date the service contract was applied for |
| "関連お客さまID" | Field | Related Customer ID — external customer account identifier linked to the campaign (added by ANK-3521) |
| "ステータス名" | Field | Status Name — current lifecycle status of the discount/campaign (e.g., active, expired, cancelled) |
| "割引開始日" | Field | Discount Start Date — the date the discount promotion begins |
| "割引終了日" | Field | Discount End Date — the date the discount promotion ends |
| "セット割申請経路名" | Field | Discount Application Path Name — the channel/route through which the bundle discount was applied (e.g., web, phone, store) |
| "セット割対象区分" | Field | Discount Target Segment — classification of the target customer segment for the bundle discount |
| "キャンペーン一覧" | Field | Campaign List — the data type key that routes to this bean; represents the campaign data grid screen |
| ANK-3521 | Change Request | JIRA ticket adding related customer ID linkage to campaign data |
| ANK-4195 | Change Request | JIRA ticket adding discount lifecycle management fields (status, dates, application path, segment) |
