---

# Business Logic — FUW03901SFLogic.getMansionDiv() [23 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.FUW03901SF.FUW03901SFLogic` |
| Layer | Service (Webview Logic — front-end business logic within the WEB tier) |
| Module | `FUW03901SF` (Package: `eo.web.webview.FUW03901SF`) |

## 1. Role

### FUW03901SFLogic.getMansionDiv()

This method determines whether the current customer session represents a **mansion (full-house bulk) contract with payable fees** — a specific classification used for paid-fee text control (有料文言制御) on the service screen. It performs a hierarchical traversal of the shared form bean (`commonInfoBean`) to extract the service contract context, then checks three independent conditions: (1) the price group code matches the eo Hikari Net Mansion type (`CD00133_04` = `"04"`), (2) the subscription payment method code matches the full-house bulk pattern (`CD01216_003` = `"003"`), and (3) a paid-flag flag is set to true. If and only if all three conditions hold, it returns `true`; otherwise it returns `false`. This is a **pure predicate** (no side effects, no data mutation) that acts as a conditional gate controlling whether paid-fee messaging and UI elements are displayed on the mansion-type contract screen. The method is called from `FUW03901SFLogic.init()` and its result is stored back into the service form bean under the key `MANSION_DIV` (マンション区分), where downstream screen rendering logic consumes it.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["getMansionDiv bean, commonInfoBean"])
    START --> RET1["Retrieve webChgInfoBean from commonInfoBean"]
    RET1 --> RET2["Retrieve genCustKeiInfoBean from webChgInfoBean"]
    RET2 --> RET3["Retrieve svcKeiInfoBean from genCustKeiInfoBean"]
    RET3 --> RET4["Get prcGrpCd from svcKeiInfoBean"]
    RET4 --> RET5["Get kanyuKeiPayHoshikiCd from svcKeiInfoBean"]
    RET5 --> RET6["Get payFlg from bean"]
    RET6 --> COND{prcGrpCd equals 04 AND kanyuKeiPayHoshikiCd equals 003 AND payFlg true}
    COND -->|All true| RESULT["result = true"]
    COND -->|Any false| RESULT2["result = false"]
    RESULT --> ENDN(["Return result"])
    RESULT2 --> ENDN
```

**Condition Constant Resolution:**
- `CD00133_04 = "04"` — コード種別 料金グループコード eo光ネットマンションタイプ (Code Type: Price Group Code — eo Hikari Net Mansion Type)
- `CD01216_003 = "003"` — コード種別 加入契約支払方式コード 全戸一括 (Code Type: Subscription Payment Method Code — Full-House Bulk / All Units Unified)
- `PAY_FLG` resolves to `"有料フラグ"` (Paid Fee Flag) — a boolean field on the service form bean indicating whether the contract line incurs fees.

**Requirements:**
- The method follows a **flatten-and-check** pattern: it first traverses the nested bean hierarchy to reach the service contract data, then extracts three scalar values, and finally evaluates a single conjunctive predicate.
- There are no branches other than the final `&&` evaluation; no loops, no try-catch, no conditional method calls.
- The method is **pure** (no I/O, no mutation, no exceptions thrown by this method itself).

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `bean` | `X31SDataBeanAccess` | The **service form bean** for the FUW03901SF screen. It carries the current screen state including the `PAY_FLG` (有料フラグ — paid fee flag) field, which indicates whether the current contract line item involves payable fees. The `getMansionDiv` result is also written back into this bean (by the caller `init()`) under the key `MANSION_DIV` (マンション区分). |
| 2 | `commonInfoBean` | `X31SDataBeanAccess` | The **shared form bean** containing common customer and service data shared across the screen. It has a hierarchical nested structure: `WEB_CHG_INFO` (WEB変更情報 — Web Change Information) → `GEN_CUST_KEI_INFO` (現顧客情報 — Current Customer Profile) → `SVC_KEI_INFO` (サービス契約情報 — Service Contract Information). The method drills down through three levels of this hierarchy to reach the pricing group code and payment method code. |

**External state / instance fields read:** None. This method reads no instance fields and performs no side effects.

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `OneStopDataBeanAccess.getDataBean` | — | — | Gets indexed data bean from the nested `WEB_CHG_INFO` array |
| R | `OneStopDataBeanAccess.getDataBeanArray` | — | — | Retrieves nested data bean arrays during hierarchy traversal (WEB_CHG_INFO, GEN_CUST_KEI_INFO, SVC_KEI_INFO) |
| R | `OneStopDataBeanAccess.sendMessageString` | — | — | Reads string values from data beans: `PRC_GRP_CD_23` (prcGrpCd), `KANYU_KEI_PAY_HOSHIKI_CD_23` (kanyuKeiPayHoshikiCd) |
| R | `OneStopDataBeanAccess.sendMessageBoolean` | — | — | Reads boolean value `PAY_FLG` from the service form bean |

**Note:** This method performs **zero database operations**. All calls are read operations against in-memory data bean structures. The method is a pure predicate evaluator that consumes already-loaded screen state.

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 1 methods.
Terminal operations from this method: `sendMessageString` [-], `sendMessageString` [-], `sendMessageBoolean` [-], `getDataBean` [R], `getDataBean` [R], `getDataBeanArray` [R], `getDataBeanArray` [R], `getDataBeanArray` [R]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `FUW03901SFLogic.init()` | `FUW03901SFLogic.init()` → `FUW03901SFLogic.getMansionDiv(bean, commonInfoBean)` → `sendMessageBoolean(MANSION_DIV, DATABEAN_SET_VALUE, result)` | `sendMessageBoolean [-] (in-memory bean write)` |

**Caller details:** The sole caller is `FUW03901SFLogic.init()`, which invokes `getMansionDiv` during screen initialization and writes the boolean result back into `bean` under the key `FUW03901SFConst.MANSION_DIV` ("マンション区分"). The result controls downstream paid-fee text display logic on the screen.

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] Nested bean traversal — build service contract context (L514–L516)

> Extracts the service contract info bean by drilling down through three levels of the shared form bean hierarchy: WEB changes → current customer profile → service contract info.

| # | Type | Code |
|---|------|------|
| 1 | SET | `webChgInfoBean = commonInfoBean.getDataBeanArray(WEB_CHG_INFO).getDataBean(0)` // WEB変更情報 (Web Change Information) |
| 2 | SET | `genCustKeiInfoBean = webChgInfoBean.getDataBeanArray(GEN_CUST_KEI_INFO).getDataBean(0)` // 現顧客情報 (Current Customer Profile) |
| 3 | SET | `svcKeiInfoBean = genCustKeiInfoBean.getDataBeanArray(SVC_KEI_INFO).getDataBean(0)` // サービス契約情報 (Service Contract Information) |

**Block 2** — [SET] Extract pricing group code and payment method code (L519–L522)

> Reads two string codes from the service contract info bean that define the customer's pricing tier and payment method.

| # | Type | Code |
|---|------|------|
| 1 | SET | `prcGrpCd = svcKeiInfoBean.sendMessageString(PRC_GRP_CD_23, DATABEAN_GET_VALUE)` // 料金グループコード (Price Group Code) — e.g., "04" = eo Hikari Net Mansion |
| 2 | SET | `kanyuKeiPayHoshikiCd = svcKeiInfoBean.sendMessageString(KANYU_KEI_PAY_HOSHIKI_CD_23, DATABEAN_GET_VALUE)` // 加入契約支払方式コード (Subscription Payment Method Code) — e.g., "003" = 全戸一括 (Full-House Bulk) |

**Block 3** — [SET] Extract paid fee flag (L525)

> Reads the boolean paid-flag from the service form bean to determine if the contract line incurs fees.

| # | Type | Code |
|---|------|------|
| 1 | SET | `payFlg = bean.sendMessageBoolean(PAY_FLG, DATABEAN_GET_VALUE)` // 有料フラグ (Paid Fee Flag) — true if fees apply |

**Block 4** — [RETURN] Conjunctive evaluation (L528–L530)

> Evaluates the final predicate: the price group must be the mansion type (`CD00133_04 = "04"`), the payment method must be full-house bulk (`CD01216_003 = "003"`), AND the paid flag must be true.

| # | Type | Code |
|---|------|------|
| 1 | SET | `result = JFUStrConst.CD00133_04.equals(prcGrpCd) && JFUStrConst.CD01216_003.equals(kanyuKeiPayHoshikiCd) && payFlg` // マンション(全戸一括)かつ支払金あり (Mansion full-house bulk AND has payable fees) [-> CD00133_04="04", CD01216_003="003"] |
| 2 | RETURN | `return result;` // true = mansion full-house bulk with fees; false = otherwise |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `prcGrpCd` | Field | Price Group Code — classifies the customer's pricing tier. `"04"` (CD00133_04) = eo Hikari Net Mansion type, distinguishing it from regular eo Hikari Net (`"01"`), eo ADSL (`"05"`/`"06"`), etc. |
| `kanyuKeiPayHoshikiCd` | Field | Subscription Contract Payment Method Code — how the monthly contract fees are collected. `"003"` (CD01216_003) = 全戸一括 (Full-House Bulk / All Units Unified), meaning one unified billing for all units in a multi-dwelling building. `"004"` = 居住者一括 (Resident Unified), `"005"` = 個別 (Individual). |
| `payFlg` | Field | Paid Fee Flag (有料フラグ) — boolean indicating whether the current contract line incurs payable fees. Used to gate paid-fee text and UI elements. |
| `MANSION_DIV` | Field | Mansion Division Flag (マンション区分) — the output key stored back into the service form bean by the caller `init()`. Its true/false value controls whether mansion-type paid-fee messaging is displayed. |
| `WEB_CHG_INFO` | Constant | WEB変更情報 (Web Change Information) — top-level nested section of the shared form bean containing web-editable change data. |
| `GEN_CUST_KEI_INFO` | Constant | 現顧客情報 (Current Customer Profile) — nested section containing the customer's current service profile data. |
| `SVC_KEI_INFO` | Constant | サービス契約情報 (Service Contract Information) — nested section containing the active service contract details including pricing and payment method. |
| `PRC_GRP_CD_23` | Constant | 料金グループコード (Price Group Code) — key used to extract the price group code from the service contract info bean. |
| `KANYU_KEI_PAY_HOSHIKI_CD_23` | Constant | 加入契約支払方式コード (Subscription Contract Payment Method Code) — key used to extract the payment method code from the service contract info bean. |
| `PAY_FLG` | Constant | 有料フラグ (Paid Fee Flag) — key used to extract the paid fee boolean from the service form bean. |
| `CD00133_04` | Constant | Code Type: Price Group Code = `"04"` — eo Hikari Net Mansion Type (eo光ネットマンションタイプ). This identifies customers in multi-dwelling buildings with fiber optic service. |
| `CD01216_003` | Constant | Code Type: Subscription Payment Method Code = `"003"` — Full-House Bulk / All Units Unified (全戸一括). This indicates a single billing arrangement covering all units in a building. |
| `X31SDataBeanAccess` | Technical | Shared data bean access object — the standard data transfer structure used in the K-Opticom WEB framework for carrying screen state between layers. |
| `OneStopDataBeanAccess` | Technical | Parent class of `X31SDataBeanAccess` — provides `getDataBean`, `getDataBeanArray`, `sendMessageString`, `sendMessageBoolean` methods for navigating and reading from nested bean structures. |
| DATABEAN_GET_VALUE | Technical | Constant for retrieving a value from a data bean (equivalent to a getter call). |
| DATABEAN_SET_VALUE | Technical | Constant for setting a value on a data bean (equivalent to a setter call). |
| FUW03901SF | Module | K-Opticom web screen module for mansion (multi-dwelling) contract change/registration operations. The "SF" suffix typically denotes a screen/forward module. |
| 有料文言制御 | Business | Paid-fee text control — the business rule that determines whether fee-related messaging (e.g., "monthly fee: X yen") is displayed on the screen based on the contract type and fee status. |
| マンション(全戸一括) | Business | Mansion (Full-House Bulk) — a contract type for multi-dwelling buildings where all units share a unified billing arrangement, as opposed to individual unit billing. |

---
