# Business Logic — FUW02701SFLogic.getMansionDiv() [65 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.FUW02701SF.FUW02701SFLogic` |
| Layer | Service / Business Logic (Web view layer, under `eo.web.webview` package) |
| Module | `FUW02701SF` (Package: `eo.web.webview.FUW02701SF`) |

## 1. Role

### FUW02701SFLogic.getMansionDiv()

This method determines whether the subscriber's service qualifies as an **eo光ネットマンションタイプ (eo Light Net Mansion Type)** — a special bundled internet service tier offered to multi-unit residential buildings (apartments/condominiums). It serves as a classification gate that the calling screen (`FUW02701SFLogic.init()`) uses to decide which UI flow, pricing options, or fee disclosures to present to the user.

The method evaluates two primary business conditions: first, it checks whether the service's pricing group code is `"04"` (eo光ネットマンションタイプ) and the subscription payment method is `"003"` (全戸一括 — building-wide unified billing). Second, within that qualified tier, it determines whether initial fees will be incurred by examining whether the additional capacity increase limit exceeds the free capacity (with a positive unit price) or whether there are entries in the temporary payment list (`EKK0721A010CBSMsg1List`), which represents fees like NTT West Japan work suspension charges.

The method implements a **gate classification pattern**: it navigates a nested data bean hierarchy to extract service contract metadata, then applies a series of conditional checks against domain-specific constants. If the building-type service qualifies with additional charges, it returns `true`; otherwise, it returns `false`. This boolean result controls downstream screen rendering logic — whether to display mansion-type-specific fee breakdowns, capacity upgrade options, or contract terms unique to multi-unit dwellings.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["getMansionDiv called"])
    START --> NAV["Navigate bean hierarchy:
WEB_CHG_INFO -> GEN_CUST_KEI_INFO -> SVC_KEI_INFO"]
    NAV --> EXTRACT["Extract values:
freeValue, endValue, tanka, prcGrpCd, kanyuKeiPayHoshikiCd"]
    EXTRACT --> COND_PRICING["prcGrpCd = '04'?
JFUStrConst.CD00133_04"]
    COND_PRICING -->|Yes| CHECK_PARENT["Check outputMap for
CC_TITLE_FUSV007601"]
    COND_PRICING -->|No| RETURN_FALSE["Set mansionDiv = false"]
    CHECK_PARENT --> HAS_PARENT["parentMap != null
and EKK0721A010CBSMSG1LIST exists?"]
    HAS_PARENT -->|No| CHECK_CAPA["endValue != 0
and freeValue != 0?"]
    HAS_PARENT -->|Yes| USE_CHILD["childList =
parentMap.get(EKK0721A010CBSMSG1LIST)"]
    USE_CHILD --> CHECK_CAPA
    CHECK_CAPA -->|Yes| CAPA_CHECK["endValue > freeValue
and tanka > 0?"]
    CHECK_CAPA -->|No| ELSE_CAPA["Set mansionDiv = false"]
    CAPA_CHECK -->|Yes| SET_TRUE_1["Set mansionDiv = true
(Add. capa increase with unit cost)"]
    CAPA_CHECK -->|No| CHECK_CHILD["childList != null
and childList.size() > 0?"]
    CHECK_CHILD -->|Yes| SET_TRUE_2["Set mansionDiv = true
(Initial fees incurred)"]
    CHECK_CHILD -->|No| ELSE_CAPA
    SET_TRUE_1 --> RETURN_TRUE["Set mansionDiv = true"]
    SET_TRUE_2 --> RETURN_TRUE
    ELSE_CAPA --> RETURN_FALSE
    RETURN_FALSE --> END(["Return mansionDiv"])
    RETURN_TRUE --> END
```

**CRITICAL — Constant Resolution:**

| Constant | Resolved Value | Business Meaning |
|----------|---------------|------------------|
| `JFUStrConst.CD00133_04` | `"04"` | Pricing group code for eo Light Net Mansion Type |
| `JFUStrConst.CD01216_003` | `"003"` | Subscription payment method — Building-wide unified billing (全戸一括) |
| `FUW02701SFConst.MRYO_CAPA` | `"無料容量"` | Free capacity — baseline data allowance included in the plan |
| `FUW02701SFConst.ADD_CAPA_ZOUBUN_UPPL_VALUE` | `"追加容量増分上限値"` | Additional capacity increase fraction upper limit value — max capacity upgrade tier |
| `FUW02701SFConst.PPLAN_KOTEI_AMNT` | `"料金プラン固定金額"` | Price plan fixed amount — unit price per capacity increase tier |
| `CommonInfoCFConst.WEB_CHG_INFO` | `"WEB変更情報"` | WEB change information — container for web screen modification data |
| `CommonInfoCFConst.GEN_CUST_KEI_INFO` | `"現顧客契約情報"` | Current customer contract information — container for existing subscriber data |
| `CommonInfoCFConst.SVC_KEI_INFO` | `"サービス契約情報"` | Service contract information — container for service detail contract records |
| `CommonInfoCFConst.PRC_GRP_CD_23` | `"料金グループコード"` | Pricing group code — classifies the service tier |
| `CommonInfoCFConst.KANYU_KEI_PAY_HOSHIKI_CD_23` | `"加入契約支払方式コード"` | Subscription contract payment method code — billing arrangement type |
| `CC_TITLE_FUSV007601` | `"FUSV007601CC"` | Title key for FUSV007601 component — maps parent map in output |
| `EKK0721A010CBSMSG1LIST` | `"EKK0721A010CBSMsg1List"` | Temporary payment items list — contains NTT West Japan work suspension charges and other one-time fees |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `commoninfoBean` | `X31SDataBeanAccess` | Master access container holding the WEB change information hierarchy. It is navigated through three nested levels (WEB_CHG_INFO → GEN_CUST_KEI_INFO → SVC_KEI_INFO) to reach the service contract data containing the pricing group code and payment method code. |
| 2 | `bean` | `X31SDataBeanAccess` | Primary data bean carrying mansion-type subscription parameters: free capacity, additional capacity increase limit value, and price plan fixed amount (unit cost). These numeric values determine whether capacity upgrade costs apply. |
| 3 | `outputMap` | `HashMap<String, Object>` | Output data map that may contain component title data. Specifically checked for the `CC_TITLE_FUSV007601` key to retrieve the `EKK0721A010CBSMsg1List` — a list of temporary payment items (e.g., NTT West Japan work suspension charges) that indicate initial fees are incurred. |

**Instance fields / external state read:** None. This method is fully self-contained and stateless, operating solely on its parameters and locally defined variables.

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `commoninfoBean.getDataBeanArray(CommonInfoCFConst.WEB_CHG_INFO)` | — | — | Reads WEB change information data bean array from the common info container |
| R | `webChgInfoBean.getDataBeanArray(CommonInfoCFConst.GEN_CUST_KEI_INFO)` | — | — | Reads current customer contract information array from WEB change info |
| R | `genCustKeiInfoBean.getDataBeanArray(CommonInfoCFConst.SVC_KEI_INFO)` | — | — | Reads service contract information array from customer info |
| R | `bean.sendMessageLong(FUW02701SFConst.MRYO_CAPA, X31CWebConst.DATABEAN_GET_VALUE)` | — | — | Retrieves free capacity value (in MB/GB) from the primary data bean |
| R | `bean.sendMessageLong(FUW02701SFConst.ADD_CAPA_ZOUBUN_UPPL_VALUE, X31CWebConst.DATABEAN_GET_VALUE)` | — | — | Retrieves additional capacity increase fraction upper limit value from the primary data bean |
| R | `bean.sendMessageLong(FUW02701SFConst.PPLAN_KOTEI_AMNT, X31CWebConst.DATABEAN_GET_VALUE)` | — | — | Retrieves price plan fixed amount (unit cost per capacity tier) from the primary data bean |
| R | `svcKeiInfoBean.sendMessageString(CommonInfoCFConst.PRC_GRP_CD_23, X31CWebConst.DATABEAN_GET_VALUE)` | — | — | Retrieves pricing group code (e.g., "04" for mansion type) from service contract info |
| R | `svcKeiInfoBean.sendMessageString(CommonInfoCFConst.KANYU_KEI_PAY_HOSHIKI_CD_23, X31CWebConst.DATABEAN_GET_VALUE)` | — | — | Retrieves subscription payment method code (e.g., "003" for building-wide billing) from service contract info |
| R | `outputMap.containsKey(CC_TITLE_FUSV007601)` | — | — | Checks if the FUSV007601 component data exists in the output map |
| R | `outputMap.get(CC_TITLE_FUSV007601)` | — | — | Retrieves the parent map associated with FUSV007601 component |
| R | `parentMap.containsKey(EKK0721A010CBSMSG1LIST)` | — | — | Checks if temporary payment items list exists in the parent map |
| R | `parentMap.get(EKK0721A010CBSMSG1LIST)` | — | — | Retrieves the list of temporary payment items (one-time fees) from the parent map |

**Classification rationale:** All operations are **Read (R)** — this method does not create, update, or delete any data. It exclusively reads from in-memory data bean structures (`X31SDataBeanAccess`) and map objects to classify the service tier. No direct database table access occurs at this method level; underlying data was populated by earlier screen processing steps.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | FUW02701SFLogic.init() | `init()` → `getMansionDiv(commoninfoBean, bean, outputMap)` | `sendMessageString` [-], `sendMessageString` [-], `sendMessageString` [-], `sendMessageString` [-], `getDataBean` [R], `getDataBean` [R] |

**Call chain detail:**
- `FUW02701SFLogic.init()` is the sole direct caller, invoked as part of the web screen initialization flow for module `FUW02701SF` (Mansion Type service detail screen).
- No upstream screen/batch entry points (KKSV*) were found within 8 hops of the call graph — `init()` likely acts as the screen's entry point handler.
- Terminal operations from this method: purely in-memory reads — `sendMessageString`, `sendMessageLong`, `getDataBean`, `getDataBeanArray`, `containsKey`, and `get` on map/data bean objects. No database CRUD operations are performed at this level.

## 6. Per-Branch Detail Blocks

**Block 1** — [VARIABLE INITIALIZATION] `(initialization)` (L845)

> Initializes the return variable `mansionDiv` to `false` (default: not a mansion type).

| # | Type | Code |
|---|------|------|
| 1 | SET | `boolean mansionDiv = false;` // Default: not eo Light Net Mansion Type |

**Block 2** — [DATA NAVIGATION] `(bean hierarchy navigation)` (L848–L851)

> Navigates through the nested data bean structure to reach the service contract information. This chain walks: WEB change info → Current customer contract info → Service contract info.

| # | Type | Code |
|---|------|------|
| 1 | SET | `webChgInfoBean = commoninfoBean.getDataBeanArray(CommonInfoCFConst.WEB_CHG_INFO).getDataBean(0);` // WEB change information [→ "WEB変更情報"] |
| 2 | SET | `genCustKeiInfoBean = webChgInfoBean.getDataBeanArray(CommonInfoCFConst.GEN_CUST_KEI_INFO).getDataBean(0);` // Current customer contract information [→ "現顧客契約情報"] |
| 3 | SET | `svcKeiInfoBean = genCustKeiInfoBean.getDataBeanArray(CommonInfoCFConst.SVC_KEI_INFO).getDataBean(0);` // Service contract information [→ "サービス契約情報"] |

**Block 3** — [VALUE EXTRACTION] `(extract numeric and string parameters)` (L854–L861)

> Extracts five business parameters: free capacity, additional capacity increase limit value, price plan fixed amount (unit cost), pricing group code, and subscription payment method code.

| # | Type | Code |
|---|------|------|
| 1 | SET | `freeValue = bean.sendMessageLong(FUW02701SFConst.MRYO_CAPA, X31CWebConst.DATABEAN_GET_VALUE).intValue();` // Free capacity [→ "無料容量"] |
| 2 | SET | `endValue = bean.sendMessageLong(FUW02701SFConst.ADD_CAPA_ZOUBUN_UPPL_VALUE, X31CWebConst.DATABEAN_GET_VALUE).intValue();` // Additional capacity increase fraction upper limit value [→ "追加容量増分上限値"] |
| 3 | SET | `tanka = bean.sendMessageLong(FUW02701SFConst.PPLAN_KOTEI_AMNT, X31CWebConst.DATABEAN_GET_VALUE).intValue();` // Price plan fixed amount (unit cost) [→ "料金プラン固定金額"] |
| 4 | SET | `prcGrpCd = svcKeiInfoBean.sendMessageString(CommonInfoCFConst.PRC_GRP_CD_23, X31CWebConst.DATABEAN_GET_VALUE);` // Pricing group code [→ "料金グループコード"] |
| 5 | SET | `kanyuKeiPayHoshikiCd = svcKeiInfoBean.sendMessageString(CommonInfoCFConst.KANYU_KEI_PAY_HOSHIKI_CD_23, X31CWebConst.DATABEAN_GET_VALUE);` // Subscription payment method code [→ "加入契約支払方式コード"] |

**Block 4** — [IF] `(pricing group = "04" AND payment method = "003")` (L865–L899)

> Primary gate: checks if the service is an eo Light Net Mansion Type (pricing group "04") with building-wide unified billing (payment method "003"). If both conditions match, the method proceeds to evaluate whether initial fees apply. If either condition fails, `mansionDiv` remains `false` (not a mansion type).

| # | Type | Code |
|---|------|------|
| 1 | IF | `JFUStrConst.CD00133_04.equals(prcGrpCd) && JFUStrConst.CD01216_003.equals(kanyuKeiPayHoshikiCd)` // [CD00133_04="04"] [CD01216_003="003"] |
| 2 | SET | `parentMap = null;` // Initialize null; will hold FUSV007601 component data if present |
| 3 | SET | `childList = null;` // Initialize null; will hold temporary payment items list if present |

**Block 4.1** — [IF] `(outputMap contains CC_TITLE_FUSV007601)` (L874–L876)

> Attempts to retrieve the parent map from the output map keyed by `CC_TITLE_FUSV007601`. If this key does not exist, `parentMap` remains `null`, causing Block 4.2 to fail its null check and proceed to Block 4.3's capacity check.

| # | Type | Code |
|---|------|------|
| 1 | IF | `outputMap.containsKey(CC_TITLE_FUSV007601)` // [CC_TITLE_FUSV007601="FUSV007601CC"] |
| 2 | SET | `parentMap = (HashMap)outputMap.get(CC_TITLE_FUSV007601);` // Cast to HashMap: FUSV007601 component data |

**Block 4.2** — [IF] `(parentMap != null AND contains EKK0721A010CBSMSG1LIST)` (L879–L881)

> Attempts to extract the temporary payment items list from the parent map. This list (`EKK0721A010CBSMsg1List`) contains one-time fees such as NTT West Japan work suspension charges. If found, `childList` holds this list for evaluation in Block 4.3.

| # | Type | Code |
|---|------|------|
| 1 | IF | `null != parentMap && parentMap.containsKey(EKK0721A010CBSMSG1LIST)` // [EKK0721A010CBSMSG1LIST="EKK0721A010CBSMsg1List"] |
| 2 | SET | `childList = (ArrayList)parentMap.get(EKK0721A010CBSMSG1LIST);` // Temporary payment items list (NTT West Japan work suspension charges etc.) |

**Block 4.3** — [IF] `(endValue != 0 AND freeValue != 0)` (L883–L897)

> Capacity check gate: both the additional capacity increase limit value and the free capacity must be non-zero. This ensures valid capacity data exists before evaluating fee applicability. If either is zero (no capacity defined), the service is not treated as a mansion type with fees.

| # | Type | Code |
|---|------|------|
| 1 | IF | `0 != endValue && 0 != freeValue` // Both capacity values must be non-zero |

**Block 4.3.1** — [IF] `(endValue > freeValue AND tanka > 0)` (L886–L888)

> First fee determination: the additional capacity increase limit value exceeds the free capacity AND the unit price (fixed amount) is positive. This indicates the customer is upgrading to a higher capacity tier that incurs a per-tier charge. This qualifies as mansion type with fees.

| # | Type | Code |
|---|------|------|
| 1 | IF | `endValue > freeValue && tanka > 0` // Capacity upgrade with positive unit cost |
| 2 | SET | `mansionDiv = true;` // Qualifies as mansion type — additional capacity increase has unit cost |

**Block 4.3.2** — [ELSE IF] `(childList != null AND childList.size() > 0)` (L889–L892)

> Second fee determination: the temporary payment items list exists and contains entries. Even if capacity values don't indicate an upgrade, the presence of one-time fees (such as NTT West Japan work suspension charges) means the service incurs initial costs, qualifying it as a mansion type with fees.

| # | Type | Code |
|---|------|------|
| 1 | ELSE IF | `childList != null && childList.size() > 0` // Temporary payment items list has entries |
| 2 | SET | `mansionDiv = true;` // Qualifies as mansion type — initial fees are incurred (手数料が発生する場合) |

**Block 4.3.3** — [ELSE] `(endValue == 0 OR freeValue == 0)` (L893–L895)

> Default fallback: when capacity data is zero/incomplete, the service does not qualify as a mansion type with fees. `mansionDiv` is explicitly set to `false`.

| # | Type | Code |
|---|------|------|
| 1 | ELSE | // Capacity check failed — no valid capacity data |
| 2 | SET | `mansionDiv = false;` // Not a mansion type with fees |

**Block 5** — [RETURN] (L902)

> Returns the final classification result.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return mansionDiv;` // true: eo Light Net Mansion Type (private/global/wired), false: not mansion type |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `mansionDiv` | Field | Mansion type division flag — boolean indicator for whether the service is an eo Light Net Mansion Type |
| `prcGrpCd` | Field | Pricing group code — classifies the service tier; "04" = eo Light Net Mansion Type |
| `kanyuKeiPayHoshikiCd` | Field | Subscription contract payment method code — billing arrangement; "003" = building-wide unified billing (全戸一括) |
| `freeValue` | Field | Free capacity — baseline data allowance included in the subscription plan (无偿 capacity) |
| `endValue` | Field | Additional capacity increase fraction upper limit value — maximum capacity upgrade tier the customer has selected |
| `tanka` | Field | Unit price / price plan fixed amount — cost per capacity increase tier (fixed unit cost) |
| `parentMap` | Field | Parent data map for component FUSV007601 — intermediate container holding temporary payment items |
| `childList` | Field | Temporary payment items list — ArrayList of one-time fees including NTT West Japan work suspension charges |
| CD00133_04 | Constant | Pricing group code value "04" — eo Light Net Mansion Type |
| CD01216_003 | Constant | Payment method code value "003" — building-wide unified billing (all units billed together) |
| WEB_CHG_INFO | Constant | "WEB変更情報" — WEB change information data container key |
| GEN_CUST_KEI_INFO | Constant | "現顧客契約情報" — current customer contract information data container key |
| SVC_KEI_INFO | Constant | "サービス契約情報" — service contract information data container key |
| PRC_GRP_CD_23 | Constant | "料金グループコード" — pricing group code field key in service contract info bean |
| KANYU_KEI_PAY_HOSHIKI_CD_23 | Constant | "加入契約支払方式コード" — subscription contract payment method code field key |
| CC_TITLE_FUSV007601 | Constant | "FUSV007601CC" — component title key for FUSV007601 mapping |
| EKK0721A010CBSMSG1LIST | Constant | "EKK0721A010CBSMsg1List" — temporary payment items list key (NTT West Japan work suspension charges) |
| eo光ネットマンションタイプ | Business term | eo Light Net Mansion Type — bundled internet service for multi-unit residential buildings (apartments/condominiums), covering private, global, and wired wiring variants |
| 全戸一括 | Business term | Building-wide unified billing — single billing arrangement covering all units in a multi-unit building |
| 手数料 | Business term | Work suspension charges — one-time fees (e.g., NTT West Japan work suspension charges) incurred during service installation |
| 無料容量 | Business term | Free capacity — data allowance included at no additional cost in the base subscription |
| 追加容量増分上限値 | Business term | Additional capacity increase fraction upper limit value — maximum capacity upgrade tier |
| 料金プラン固定金額 | Business term | Price plan fixed amount — unit cost per capacity increase tier |
| FUSV007601 | Component | Component handling additional service fee detail screen logic |
| X31SDataBeanAccess | Technical | Data bean access class — interface for reading/writing structured form data in the web layer |
| OneStopDataBeanAccessArray | Technical | Array container for data bean access — provides `getDataBeanArray` method for nested data retrieval |
