# Business Logic — FUW00943SFLogic.removeInvalidDataFromHanyoCdList() [67 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.FUW00943SF.FUW00943SFLogic` |
| Layer | Service Component (WebLogic tier — part of the eo-kōnet (eo Light) web application logic layer) |
| Module | `FUW00943SF` (Package: `eo.web.webview.FUW00943SF`) |

## 1. Role

### FUW00943SFLogic.removeInvalidDataFromHanyoCdList()

This method is responsible for **filtering out invalid (unapplicable) service application codes** from the application code list (`hanyoCdList`) that was previously populated during a customer's order flow for eo Light (eo kōnet — fiber-optic internet). It is called just before final order submission, as the last data-cleansing step to ensure only applicable service codes remain in the list. The method first checks the sales type: it only processes data for **Hōtantai (訪販以外 — non-door-to-door / general sales channel)** orders. If the sales type matches, it retrieves campaign component codes for **Smart Link** (smart-home linked services) and **GH (Google Home)** from a shared property map (populated from screen FUW00926). Then it iterates through each application code entry: if the customer has **not** selected a smart tablet plan, it removes any application code whose campaign code matches a Smart Link campaign; if the customer has **not** selected a GH (Google Home) plan, it removes any application code whose campaign code matches a GH campaign. The method implements a **filter-and-evict pattern**, modifying the list in-place and adjusting the loop index to account for removed elements.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["removeInvalidDataFromHanyoCdList starts"])
    START --> GET_EONET["getEonet call"]
    GET_EONET --> GET_HANBAI["Get hanbaiType from bnWebNewInfo"]
    GET_HANBAI --> CHECK_HOHAN{hanbaiType equals<br/>HNBAI_TYPE_HOHAN = 2?}
    CHECK_HOHAN -- No --> EARLY_RETURN1([return - non-hohantei])
    CHECK_HOHAN -- Yes --> GET_SMLN["Get smlnCmpCd from JFUWebCommon.getDispText"]
    GET_SMLN --> SPLIT_SMLN["Split smlnCmpCd by COMMA"]
    SPLIT_SMLN --> GET_GH["Get ghCmpCd from JFUWebCommon.getDispText"]
    GET_GH --> SPLIT_GH["Split ghCmpCd by COMMA"]
    SPLIT_GH --> CHECK_SMLN{isNull smlnCmpCd?}
    CHECK_SMLN -- Yes --> EARLY_RETURN2([return - no smartlink candidates])
    CHECK_SMLN -- No --> CREATE_LISTS["Create smlnCmpList and ghCmpList"]
    CREATE_LISTS --> GET_HANYO["Get hanyoCdList from getDataBeanArray"]
    GET_HANYO --> CHECK_HANYO{isNull hanyoCdList?}
    CHECK_HANYO -- Yes --> EARLY_RETURN3([return - no application codes])
    CHECK_HANYO -- No --> FOR_START{idx = 0 to getCount}
    FOR_START --> GET_DATA["data = getDataBean(idx)"]
    GET_DATA --> CHECK_SMALIN{tabletTanmtMskm is NOT 1?}
    CHECK_SMALIN -- No --> CHECK_GH{ghTanmt is NOT 1?}
    CHECK_SMALIN -- Yes --> CHECK_SMLN_MATCH{smlnCmpList contains hanyoCd46?}
    CHECK_SMLN_MATCH -- Yes --> REMOVE_SMLN["removeDataBean(idx)<br/>idx--; continue"]
    CHECK_SMLN_MATCH -- No --> CHECK_GH
    REMOVE_SMLN --> CHECK_GH
    CHECK_GH -- No --> FOR_INC{idx < getCount?}
    CHECK_GH -- Yes --> CHECK_GH_MATCH{ghCmpList contains hanyoCd46?}
    CHECK_GH_MATCH -- Yes --> REMOVE_GH["removeDataBean(idx)<br/>idx--; continue"]
    CHECK_GH_MATCH -- No --> FOR_INC
    REMOVE_GH --> FOR_INC
    FOR_INC -- Yes --> GET_DATA
    FOR_INC -- No --> END_LOOP([End loop])
    END_LOOP --> END_NODE([Return])
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `bnWebNewInfo` | `X31SDataBeanAccess` | The Web new-info data bean that carries all form data for the current eo kōnet (fiber-optic) order session. It contains the sales type (`HANBAI_TYPE_06`), the eonet service plan bean (`TABLET_TANMT_MSKM_11`, `GH_TANMT_11`), and the application code list (`HANYO_CD_LIST`) which holds candidate service codes that need to be validated for applicability. |

**Instance fields / external state read:**

| Source | Description |
|--------|-------------|
| `KEY_OTHER_CMP_CD_SMART_LINK` | Static key `"OTHER_CMP_CD_SMART_LINK"` — retrieves Smart Link campaign component codes from a shared property map |
| `KEY_OTHER_CMP_CD_GH` | Static key `"OTHER_CMP_CD_GH"` — retrieves Google Home campaign component codes from a shared property map |
| `getEonet()` | Helper method that extracts the eoNet (service plan) sub-bean from `bnWebNewInfo` |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `getEonet` | - | - | Retrieves the eoNet (service plan) data bean from `bnWebNewInfo` |
| - | `JFUStrConst.COMMA` | - | - | Static constant `","` used as split delimiter |
| - | `JFUWebCommon.getDispText(screenId, key)` | - | - | Retrieves campaign component code strings from shared property (display definition) |
| - | `JFUWebCommon.isNull(obj[])` | - | - | Null-check on String array returned from split |
| - | `bnWebNewInfo.sendMessageString(key, DATABEAN_GET_VALUE)` | - | - | Reads sales type, tablet plan, and GH plan values from the data bean |
| R | `bnWebNewInfo.getDataBeanArray(HANYO_CD_LIST)` | - | - | Reads the application code list (hanyoCdList) containing candidate service codes |
| R | `hanyoCdList.getCount()` | - | - | Counts total application code entries to iterate |
| R | `hanyoCdList.getDataBean(idx)` | - | - | Gets the individual application code entry at index |
| R | `data.sendMessageString(HANYO_CD_46, DATABEAN_GET_VALUE)` | - | - | Reads the campaign code (hanyoCd_46) from the application code entry |
| U | `hanyoCdList.removeDataBean(idx)` | - | - | Removes an invalid application code entry from the list (modifies in place) |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Class: `FUW00943SFLogic` | `FUW00943SFLogic` (caller within order submission flow, ~L1241) | `sendMessageString` [Read data bean], `removeDataBean` [Update list], `getDataBean` [Read] |

**Caller Context:** This method is called from within `FUW00943SFLogic` itself, during the order submission processing flow (around line 1241). The calling context performs final order agreement confirmation (申送一意会), payment method information processing, and file generation. `removeInvalidDataFromHanyoCdList` acts as a data-cleansing step executed after mapper SC calls for agreement processing but before the final output map is generated.

**Terminal operations reached from this method:**
- `sendMessageString` — Reads sales type, tablet plan, GH plan, and campaign code values from data beans
- `removeDataBean` — Removes non-applicable application codes from the in-memory list
- `getDataBean` — Retrieves individual application code entries for validation

## 6. Per-Branch Detail Blocks

**Block 1** — [CALL] `(extract eoNet data bean)` (L3805)

> Extracts the eoNet (service plan) sub-bean from the input parameter.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `bnNetinfo = getEonet(bnWebNewInfo)` // Extract eoNet data bean from input |

**Block 2** — [CALL] `(get sales type)` (L3808)

> Reads the sales type value from the web new info bean using a shared constant key.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `hanbaiType = bnWebNewInfo.sendMessageString(HANBAI_TYPE_06, DATABEAN_GET_VALUE)` // Read sales type — key: "販売タイプ" |

**Block 3** — [IF] `(HNBAI_TYPE_HOHAN = "2" equals hanbaiType)` (L3810)

> Determines whether this is a Hōtantai (訪販以外 — non-door-to-door / general sales) order. If NOT, the method returns immediately without processing — application codes are left untouched for non-hohantei channels.

| # | Type | Code |
|---|------|------|
| 1 | CONDITION | `!HNBAI_TYPE_HOHAN.equals(hanbaiType)` |
| 2 | SET | `[-> HNBAI_TYPE_HOHAN = "2" (訪販以外 / Non-door-to-door sales type)]` |
| 3 | RETURN | `return;` // Exit early for non-hohantei sales channels |

**Block 4** — [ELSE implicit, fall-through] `(hanbaiType IS hohantei)` (L3810)

> The sales type is confirmed as Hōtantai. Proceed to retrieve campaign component codes.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `smlnCmpCd[] = JFUWebCommon.getDispText(SCREEN_ID_FUW00926, KEY_OTHER_CMP_CD_SMART_LINK)` // Get Smart Link campaign codes from shared property |
| 2 | SET | `[-> KEY_OTHER_CMP_CD_SMART_LINK = "OTHER_CMP_CD_SMART_LINK"]` |
| 3 | EXEC | `smlnCmpCd.split(COMMA)` // Split by comma |
| 4 | SET | `[-> COMMA = ","]` |
| 5 | CALL | `ghCmpCd[] = JFUWebCommon.getDispText(SCREEN_ID_FUW00926, KEY_OTHER_CMP_CD_GH)` // Get Google Home campaign codes |
| 6 | SET | `[-> KEY_OTHER_CMP_CD_GH = "OTHER_CMP_CD_GH"]` |
| 7 | EXEC | `ghCmpCd.split(COMMA)` |

**Block 5** — [IF] `(isNull(smlnCmpCd))` (L3822)

> If the Smart Link component code array is null (no Smart Link campaign data available), return immediately. There is nothing to filter.

| # | Type | Code |
|---|------|------|
| 1 | CONDITION | `JFUWebCommon.isNull(smlnCmpCd)` |
| 2 | RETURN | `return;` // No smartlink campaign data — nothing to filter |

**Block 6** — [ELSE implicit, fall-through] `(smlnCmpCd is NOT null)` (L3822)

> Smart Link campaign codes are available. Convert arrays to lists for efficient contains-checking.

| # | Type | Code |
|---|------|------|
| 1 | SET | `smlnCmpList = Arrays.asList(smlnCmpCd)` // Smart Link campaign list |
| 2 | SET | `ghCmpList = Arrays.asList(ghCmpCd)` // Google Home campaign list |

**Block 7** — [CALL] `(get application code list)` (L3832)

> Retrieves the full list of application codes (hanyo codes) from the web new info bean.

| # | Type | Code |
|---|------|------|
| 1 | SET | `hanyoCdList = bnWebNewInfo.getDataBeanArray(HANYO_CD_LIST)` // Get application code list |

**Block 8** — [IF] `(isNull(hanyoCdList))` (L3834)

> If there are no application codes in the list, return immediately — nothing to filter.

| # | Type | Code |
|---|------|------|
| 1 | CONDITION | `JFUWebCommon.isNull(hanyoCdList)` |
| 2 | RETURN | `return;` // No application code entries — nothing to filter |

**Block 9** — [FOR] `(idx = 0; idx < hanyoCdList.getCount(); idx++)` (L3837)

> Iterates through each application code entry to check if it should be removed based on the customer's service selections.

| # | Type | Code |
|---|------|------|
| 1 | SET | `idx = 0` // Initialize loop counter |
| 2 | CONDITION | `idx < hanyoCdList.getCount()` // Loop bound check |
| 3 | EXEC | `data = hanyoCdList.getDataBean(idx)` // Get current application code entry |

**Block 9.1** — [IF] `(!SMALIN_TABLET_MSKM == tabletTanmtMskm)` (L3842)

> Checks if the customer has NOT selected a smart tablet plan. If so, removes any application code that matches a Smart Link campaign code — these services require a smart tablet to be applicable.

| # | Type | Code |
|---|------|------|
| 1 | CONDITION | `!SMALIN_TABLET_MSKM.equals(tabletTanmtMskm)` |
| 2 | SET | `[-> SMALIN_TABLET_MSKM = "1" (スマートタブレット / Smart tablet)]` |
| 3 | EXEC | `tabletTanmtMskm = bnNetinfo.sendMessageString(TABLET_TANMT_MSKM_11, DATABEAN_GET_VALUE)` // Read tablet application status |
| 4 | CONDITION | `smlnCmpList.contains(data.sendMessageString(HANYO_CD_46, DATABEAN_GET_VALUE))` |
| 5 | SET | `[-> HANYO_CD_46: Application code campaign field]` |
| 6 | EXEC | `hanyoCdList.removeDataBean(idx)` // Remove the non-applicable entry |
| 7 | SET | `idx--` // Adjust index to re-check next element |
| 8 | EXEC | `continue` // Skip to next iteration |

**Block 9.1.1** — [IF-NESTED] `(smlnCmpList contains hanyoCd46)` (L3848)

> The application code's campaign code matches a Smart Link campaign. Since the customer has no smart tablet, this code is invalid and must be removed.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `hanyoCdList.removeDataBean(idx)` // Remove non-applicable application code |
| 2 | SET | `idx--` // Decrement to compensate for removal |
| 3 | EXEC | `continue` // Jump to loop condition re-evaluation |

**Block 9.2** — [IF] `(!GH_TANMT_BUY == ghTanmt)` (L3854)

> Checks if the customer has NOT selected a GH (Google Home) plan. If so, removes any application code that matches a GH campaign code — these services require a GH plan to be applicable.

| # | Type | Code |
|---|------|------|
| 1 | CONDITION | `!GH_TANMT_BUY.equals(ghTanmt)` |
| 2 | SET | `[-> GH_TANMT_BUY = "1" (GH申込 / GH application)]` |
| 3 | EXEC | `ghTanmt = bnNetinfo.sendMessageString(GH_TANMT_11, DATABEAN_GET_VALUE)` // Read GH application status |
| 4 | CONDITION | `ghCmpList.contains(data.sendMessageString(HANYO_CD_46, DATABEAN_GET_VALUE))` |
| 5 | EXEC | `hanyoCdList.removeDataBean(idx)` // Remove the non-applicable entry |
| 6 | SET | `idx--` // Adjust index to re-check next element |
| 7 | EXEC | `continue` // Skip to next iteration |

**Block 9.2.1** — [IF-NESTED] `(ghCmpList contains hanyoCd46)` (L3860)

> The application code's campaign code matches a GH campaign. Since the customer has no GH plan, this code is invalid and must be removed.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `hanyoCdList.removeDataBean(idx)` // Remove non-applicable application code |
| 2 | SET | `idx--` // Decrement to compensate for removal |
| 3 | EXEC | `continue` // Jump to loop condition re-evaluation |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `hanyoCd` ( hanyo code) | Field | Application code — a code representing a service that a customer has applied for or is being offered during the order flow |
| `hanyoCdList` | Field | Application code list — a data bean array holding all candidate service application codes for the current order |
| `hanyoCd_46` | Field | Application code campaign field — the campaign code stored within each application code entry, used for matching against Smart Link / GH campaigns |
| `hanbaiType` | Field | Sales type — indicates the sales channel category for the order |
| `HNBAI_TYPE_HOHAN` | Constant | Sales type code `"2"` — Hōtantai (訪販以外 / Non-door-to-door). Orders placed through general channels (web, store) rather than direct sales visits |
| `SMALIN_TABLET_MSKM` | Constant | Smart tablet indicator `"1"` — indicates the customer has selected a smart tablet plan |
| `TABLET_TANMT_MSKM_11` | Constant | Tablet application type field key — the data bean key for the tablet service plan status |
| `GH_TANMT_BUY` | Constant | GH application indicator `"1"` — indicates the customer has applied for a GH (Google Home) plan |
| `GH_TANMT_11` | Constant | GH (Google Home) application type field key |
| `smlnCmpCd` | Variable | Smart Link campaign codes — array of campaign component codes related to smart-home linked services (smartlink) |
| `ghCmpCd` | Variable | Google Home campaign codes — array of campaign component codes related to Google Home services |
| `COMMA` | Constant | `","` — comma character used as delimiter for splitting campaign code strings |
| `KEY_OTHER_CMP_CD_SMART_LINK` | Constant | `"OTHER_CMP_CD_SMART_LINK"` — property map key for Smart Link campaign codes from shared configuration (screen FUW00926) |
| `KEY_OTHER_CMP_CD_GH` | Constant | `"OTHER_CMP_CD_GH"` — property map key for Google Home campaign codes from shared configuration (screen FUW00926) |
| `bnWebNewInfo` | Parameter | Web new-info data bean — carries all form/session data for the current eo kōnet order |
| `bnNetinfo` (eoNet) | Variable | eoNet data bean — the service plan sub-bean containing tablet/GH plan selections and other service-related data |
| `JFUWebCommon.getDispText` | Method | Retrieves display/definition text from a shared property map keyed by screen ID and key name |
| `HANYO_CD_LIST` | Constant | Key for the application code list within the web new info data bean |
| `HANBAI_TYPE_06` | Constant | `"販売タイプ"` (Sales type) — field key for retrieving the sales type from the data bean |
| eo kōnet (eo光) | Business term | eo Light — K-Opticom's fiber-optic broadband internet service in Japan |
| Hōtantai (訪販以外) | Business term | Non-door-to-door sales — orders placed through web, store, or other non-direct-visit channels. Code `"2"` |
| Smart Link | Business term | Smart-home linked services — IoT-connected home automation services offered as add-on to eo kōnet |
| GH (Google Home) | Business term | Google Home smart speaker service — offered as an add-on service for eo kōnet customers |
| `X31SDataBeanAccess` | Type | Web data bean access class — provides methods for reading/writing form/session data via `sendMessageString` and `getDataBeanArray` |
| `X31SDataBeanAccessArray` | Type | Array-type data bean access — supports indexed access (`getDataBean`, `getCount`, `removeDataBean`) to a list of service entries |
