# Business Logic — FUW02301SFLogic.getMansionDiv() [27 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.FUW02301SF.FUW02301SFLogic` |
| Layer | Service Logic (webview layer) |
| Module | `FUW02301SF` (Package: `eo.web.webview.FUW02301SF`) |

## 1. Role

### FUW02301SFLogic.getMansionDiv()

This method determines whether the current customer subscription qualifies as an **"eo Hikari Net Mansion Type"** service — specifically the Private (プライベート), Global (グローバル), or Optical Wiring (光配線) variants of NTT East's fiber-to-the-building (FTTB) broadband offering for multi-dwelling units (apartment complexes / condominiums). It operates as a **conditional type-dispatch utility** used by the `FUW02301SF` screen logic to branch pricing and feature rendering based on whether the customer resides in a qualifying mansion-type building.

The method navigates through a nested hierarchy of data-bean access objects — from the top-level `commoninfoBean` down through web-change-info, existing-customer-info, and service-contract-info — to extract the **price-group code** and **subscription-payment-method code**. It then applies three simultaneous conditions: (1) the price-group code must be `"04"` (identifying the eo Hikari Net Mansion pricing tier), (2) the payment method must be `"003"` (identifying the building-wide unified payment arrangement — 全戸一括), and (3) the `chkPayInitialCost` method must confirm that initial fees are applicable. Only when all three hold does the method return `true`. This is a **routing/dispatch gate** that determines which mansion-specific UI and billing paths are exercised downstream.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["getMansionDiv commoninfoBean, outputMap"])
    START --> INIT["mansionDiv = false"]
    INIT --> WEB_CHG["webChgInfoBean = commoninfoBean.getDataBeanArray(WEB_CHG_INFO).getDataBean(0)"]
    WEB_CHG --> GEN_CUST["genCustKeiInfoBean = webChgInfoBean.getDataBeanArray(GEN_CUST_KEI_INFO).getDataBean(0)"]
    GEN_CUST --> SVC_INFO["svcKeiInfoBean = genCustKeiInfoBean.getDataBeanArray(SVC_KEI_INFO).getDataBean(0)"]
    SVC_INFO --> PRG_CD["prcGrpCd = svcKeiInfoBean.sendMessageString(PRC_GRP_CD_23, DATABEAN_GET_VALUE)"]
    PRG_CD --> KANYU_CD["kanyuKeiPayHoshikiCd = svcKeiInfoBean.sendMessageString(KANYU_KEI_PAY_HOSHIKI_CD_23, DATABEAN_GET_VALUE)"]
    KANYU_CD --> COND{prcGrpCd equals 04 AND kanyuKeiPayHoshikiCd equals 003 AND chkPayInitialCost}
    COND -->|true| SET_TRUE["mansionDiv = true"]
    COND -->|false| RET_FALSE["mansionDiv = false"]
    SET_TRUE --> END_NODE(["return mansionDiv"])
    RET_FALSE --> END_NODE
```

**Constant Resolution:**
- `JFUStrConst.CD00133_04` → `"04"` — Price-group code for **eo Hikari Net Mansion Type** (eo光ネットマンションタイプ: プライベート・グローバル・光配線)
- `JFUStrConst.CD01216_003` → `"003"` — Subscription payment method: **Building-wide unified payment** (加入契約支払方式コード: 全戸一括)

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `commoninfoBean` | `X31SDataBeanAccess` | Top-level data bean accessor containing the complete customer session state for the `FUW02301SF` screen. It holds nested data-bean arrays for web-change-info, existing customer info, and service-contract info. This is the central context object passed through the entire screen logic. |
| 2 | `outputMap` | `HashMap<String, Object>` | Output map shared across screen-logic methods. Used here as a parameter to `chkPayInitialCost()` to determine whether initial fees (registration fee, installation fee) apply. Likely contains accumulated screen state, pricing flags, and customer-specific charge information. |

**Instance fields / external state read:**
- None directly — all external state is accessed through the `commoninfoBean` parameter chain and the shared `outputMap`.

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `X31SDataBeanAccess.getDataBeanArray` | - | - | Navigates the nested data-bean hierarchy to access the WEB_CHG_INFO array. |
| R | `X31SDataBeanAccess.getDataBean` | - | - | Extracts the first element (index 0) from the WEB_CHG_INFO array to get web-change-info bean. |
| R | `X31SDataBeanAccess.getDataBeanArray` | - | - | Navigates to the GEN_CUST_KEI_INFO (existing customer info) array. |
| R | `X31SDataBeanAccess.getDataBean` | - | - | Extracts the first element (index 0) from GEN_CUST_KEI_INFO array. |
| R | `X31SDataBeanAccess.getDataBeanArray` | - | - | Navigates to the SVC_KEI_INFO (service contract info) array. |
| R | `X31SDataBeanAccess.getDataBean` | - | - | Extracts the first element (index 0) from SVC_KEI_INFO array to get the service contract data bean. |
| R | `X31SDataBeanAccess.sendMessageString` | - | - | Reads the price-group code (PRC_GRP_CD_23) from the service-contract bean. Returns a String code identifying the service pricing tier. |
| R | `X31SDataBeanAccess.sendMessageString` | - | - | Reads the subscription payment method code (KANYU_KEI_PAY_HOSHIKI_CD_23) from the service-contract bean. |
| CALL | `FUW02301SFLogic.chkPayInitialCost` | - | - | Delegates to a companion method to check whether initial fees (registration/installation charges) apply for this customer. Returns `true` if initial costs exist. |

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. This method is called internally by the `init()` method of `FUW02301SFLogic`, which serves as the screen's primary initialization routine for the mansion-type classification flow.

Terminal operations from this method: `chkPayInitialCost` [-], `sendMessageString` [-], `sendMessageString` [-], `getDataBean` [R], `getDataBean` [R], `getDataBean` [R], `getDataBean` [R], `getDataBeanArray` [R], `getDataBean` [R], `getDataBeanArray` [R], `getDataBean` [R]

## 6. Per-Branch Detail Blocks

**Block 1** — [VARIABLE INITIALIZATION] (L1087)

> Initializes the return flag. Default to `false` — the method assumes non-mansion classification until proven otherwise.

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

**Block 2** — [VARIABLE ASSIGNMENT] Web-change-info extraction (L1090)

> Extracts the web-change-info data bean from the top-level common-info bean. This bean holds data modified during the current web session.
> [-> `WEB_CHG_INFO` = CommonInfoCFConst.WEB_CHG_INFO constant key]

| # | Type | Code |
|---|------|------|
| 1 | SET | `webChgInfoBean = commoninfoBean.getDataBeanArray(CommonInfoCFConst.WEB_CHG_INFO).getDataBean(0)` // WEB change info |

**Block 3** — [VARIABLE ASSIGNMENT] Existing customer info extraction (L1092)

> Extracts the existing-customer-info bean from the web-change-info bean.
> [-> `GEN_CUST_KEI_INFO` = CommonInfoCFConst.GEN_CUST_KEI_INFO constant key]

| # | Type | Code |
|---|------|------|
| 1 | SET | `genCustKeiInfoBean = webChgInfoBean.getDataBeanArray(CommonInfoCFConst.GEN_CUST_KEI_INFO).getDataBean(0)` // Existing customer info |

**Block 4** — [VARIABLE ASSIGNMENT] Service contract info extraction (L1094)

> Extracts the service-contract-info bean from the existing-customer-info bean.
> [-> `SVC_KEI_INFO` = CommonInfoCFConst.SVC_KEI_INFO constant key]

| # | Type | Code |
|---|------|------|
| 1 | SET | `svcKeiInfoBean = genCustKeiInfoBean.getDataBeanArray(CommonInfoCFConst.SVC_KEI_INFO).getDataBean(0)` // Service contract info |

**Block 5** — [VARIABLE ASSIGNMENT] Price-group code retrieval (L1097)

> Reads the price-group code from the service-contract-info bean. Code `"04"` identifies the eo Hikari Net Mansion Type pricing tier.
> [-> `PRC_GRP_CD_23` = CommonInfoCFConst.PRC_GRP_CD_23 constant key]

| # | Type | Code |
|---|------|------|
| 1 | SET | `prcGrpCd = svcKeiInfoBean.sendMessageString(CommonInfoCFConst.PRC_GRP_CD_23, X31CWebConst.DATABEAN_GET_VALUE)` // Price-group code |

**Block 6** — [VARIABLE ASSIGNMENT] Payment-method code retrieval (L1099–1100)

> Reads the subscription payment method code from the service-contract-info bean. Code `"003"` identifies building-wide unified payment (全戸一括).
> [-> `KANYU_KEI_PAY_HOSHIKI_CD_23` = CommonInfoCFConst.KANYU_KEI_PAY_HOSHIKI_CD_23 constant key]

| # | Type | Code |
|---|------|------|
| 1 | SET | `kanyuKeiPayHoshikiCd = svcKeiInfoBean.sendMessageString(CommonInfoCFConst.KANYU_KEI_PAY_HOSHIKI_CD_23, X31CWebConst.DATABEAN_GET_VALUE)` // Payment method code |

**Block 7** — [IF CONDITION] Mansion-type qualification check (L1103–1104)

> All three conditions must be true simultaneously:
> - Price-group code is `"04"` (eo Hikari Net Mansion Type — プライベート・グローバル・光配線)
> - Payment method is `"003"` (Building-wide unified payment — 全戸一括)
> - `chkPayInitialCost(outputMap)` returns `true` (initial fees exist)
>
> [CD00133_04 = "04"] [CD01216_003 = "003"]

| # | Type | Code |
|---|------|------|
| 1 | COND | `JFUStrConst.CD00133_04.equals(prcGrpCd)` // Price-group code is "04" (eo Hikari Net Mansion) |
| 2 | COND | `JFUStrConst.CD01216_003.equals(kanyuKeiPayHoshikiCd)` // Payment method is "003" (Building-wide unified) |
| 3 | COND | `chkPayInitialCost(outputMap)` // Initial fees are applicable |

**Block 7.1** — [IF TRUE BRANCH] Set mansionDiv to true (L1105–1106)

> All conditions satisfied — the customer is in a qualifying mansion-type building.
> [CD00133_04 = "04"] [CD01216_003 = "003"]

| # | Type | Code |
|---|------|------|
| 1 | SET | `mansionDiv = true` // Qualifies as eo Hikari Net Mansion Type |

**Block 8** — [RETURN] (L1108)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return mansionDiv` // true = mansion type, false = otherwise |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `mansionDiv` | Field | Mansion division flag — boolean indicator of whether the customer's service is classified as an "eo Hikari Net Mansion Type" (multi-dwelling unit fiber broadband) |
| `prcGrpCd` | Field | Price-group code — identifies the service pricing tier; `"04"` specifically denotes the eo Hikari Net Mansion pricing category |
| `kanyuKeiPayHoshikiCd` | Field | Subscription contract payment method code — `"003"` indicates building-wide unified payment (全戸一括), where one bill covers all units in a multi-dwelling building |
| WEB_CHG_INFO | Constant | Web-change information — session-scoped data for changes made during the current web interaction |
| GEN_CUST_KEI_INFO | Constant | Existing-customer information — data about the customer's current service profile and subscription history |
| SVC_KEI_INFO | Constant | Service-contract information — detailed data about the active service contract, including pricing and payment method |
| PRC_GRP_CD_23 | Constant | Price-group code field key — used to read the pricing-tier code from a data bean |
| KANYU_KEI_PAY_HOSHIKI_CD_23 | Constant | Subscription payment method code field key — used to read the payment-method code from a data bean |
| CD00133_04 | Constant | Price-group code value `"04"` — identifies eo Hikari Net Mansion Type (eo光ネットマンションタイプ) services |
| CD01216_003 | Constant | Payment method code value `"003"` — building-wide unified payment (全戸一括), meaning all units in the building share a single billing arrangement |
| `chkPayInitialCost` | Method | Companion method that determines whether initial registration/installation fees apply for the current customer/session |
| X31SDataBeanAccess | Class | Generic data-bean access wrapper — provides methods (`getDataBeanArray`, `getDataBean`, `sendMessageString`) for navigating nested data structures and extracting field values |
| eo光ネットマンションタイプ | Business term | eo Hikari Net Mansion Type — NTT East's fiber-to-the-building broadband service for apartment complexes and condominiums, offered in Private (プライベート), Global (グローバル), and Optical Wiring (光配線) variants |
| プライベート | Business term | Private — one of the three eo Hikari Net Mansion service tiers |
| グローバル | Business term | Global — one of the three eo Hikari Net Mansion service tiers |
| 光配線 | Business term | Optical Wiring — one of the three eo Hikari Net Mansion service tiers (fiber-optic wiring infrastructure) |
| 全戸一括 | Business term | Building-wide unified payment — a single billing arrangement covering all units in a multi-dwelling building, corresponding to payment method code `"003"` |
| FUW02301SF | Module | Screen/feature module ID — the webview service responsible for this mansion-type classification flow |
