# Business Logic — FUW03501SFLogic.chkPayInitialCost() [29 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.FUW03501SF.FUW03501SFLogic` |
| Layer | Controller / Web Logic (package `eo.web.webview.FUW03501SF`) |
| Module | `FUW03501SF` (House Information Input Screen) |

## 1. Role

### FUW03501SFLogic.chkPayInitialCost()

This method performs **initial fee availability determination** for a service contract. It inspects the output data map to determine whether the current order involves any initial fees (初期費用 — shiki-hiyō) such as installation charges, setup fees, or one-time payment items. The method acts as a **shared utility predicate** used by multiple processing branches within `FUW03501SFLogic` (specifically `init()` and `setMansionDiv()`) to conditionally display or handle fee-related UI elements and processing paths. It implements a **guard-clause / early-exit pattern**, returning `false` by default and only setting `true` when it finds evidence of chargeable items in the nested output structure. Its role in the larger system is to centralize the initial-fee check logic, ensuring all callers derive the same consistent determination from the same data structure produced by upstream CBS (Component-Based Service) calls.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["chkPayInitialCost(outputMap)"])
    COND1{Does outputMap
contain FUSV007301CC?}
    EXTRACT["Extract parentMap
= outputMap.get(FUSV007301CC)"]
    COND2{Is parentMap
not null AND does it contain
EKK0721A010CBSMSG1LIST?}
    EXTRACT_CHILD["Extract childList
= parentMap.get(EKK0721A010CBSMSG1LIST)"]
    COND3{Is childList
not null AND size > 0?}
    SET_TRUE["res = true
(Initial fees exist)"]
    SET_FALSE["res = false
(No initial fees)"]
    RETURN_TRUE(["Return true"])
    RETURN_FALSE(["Return false"])
    START --> COND1
    COND1 -->|Yes| EXTRACT
    COND1 -->|No| RETURN_FALSE
    EXTRACT --> COND2
    COND2 -->|Yes| EXTRACT_CHILD
    COND2 -->|No| RETURN_FALSE
    EXTRACT_CHILD --> COND3
    COND3 -->|Yes| SET_TRUE
    COND3 -->|No| SET_FALSE
    SET_TRUE --> RETURN_TRUE
    SET_FALSE --> RETURN_FALSE
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `outputMap` | `HashMap` | The aggregated output data map containing service information extracted from CBS calls. It holds nested sub-maps keyed by constant strings (e.g., `FUSV007301CC` for parent service data, `EKK0721A010CBSMsg1List` for fee item lists). Used to inspect the presence and content of initial fee records. |

**Read instance fields / external state:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `FUSV007301CC` | `static final String` | Constant key `"FUSV007301CC"` identifying the parent service map within `outputMap`. This key is produced by the `setFUSV007301CC` mapping method which populates service-level data extracted from the `FUSV0073` service components. |
| `EKK0721A010CBSMSG1LIST` | `static final String` | Constant key `"EKK0721A010CBSMsg1List"` identifying the child fee item list within `parentMap`. This map holds records of temporary payment items (一時支払金額), specifically NTT West Japan holiday work fees (NTT西日本休止工事費) and their consent details. |

## 4. CRUD Operations / Called Services

This method performs **no CRUD operations** and calls **no service components or CBS methods**. It is a pure data-inspection method that navigates the in-memory `outputMap` structure to check for the presence of fee records.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| — | — | — | — | No database or service calls. Pure in-memory data inspection. |

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 2 methods.

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Internal Logic: `FUW03501SFLogic.init()` | `init()` -> `chkPayInitialCost(outputMap)` | — (no CRUD; pure inspection) |
| 2 | Internal Logic: `FUW03501SFLogic.setMansionDiv()` | `setMansionDiv()` -> `chkPayInitialCost(outputMap)` | — (no CRUD; pure inspection) |

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] Initialization (L798)

> Initializes local variables with default values before entering conditional logic.

| # | Type | Code |
|---|------|------|
| 1 | SET | `res = false` // Default result: no initial fees |
| 2 | SET | `parentMap = null` // Will hold the parent service map if present |

**Block 2** — [IF] `(outputMap.containsKey(FUSV007301CC))` (L800)

> Checks whether the output map contains the parent service data structure under the `FUSV007301CC` key. This key is set by the `setFUSV007301CC` mapper method from the FUSV0073 service components, which extracts service-level data.

| # | Type | Code |
|---|------|------|
| 1 | SET | `parentMap = (HashMap)outputMap.get(FUSV007301CC)` // Cast and extract parent map [-> FUSV007301CC="FUSV007301CC"] |

**Block 3** — [IF] `(null != parentMap && parentMap.containsKey(EKK0721A010CBSMSG1LIST))` (L804)

> Guards both null-check and key-presence check for the fee item list. Only proceeds if `parentMap` was successfully extracted and contains the `EKK0721A010CBSMsg1List` key, which holds temporary payment fee records from the `EKK0721A010CBS` service.

| # | Type | Code |
|---|------|------|
| 1 | SET | `childList = (ArrayList)parentMap.get(EKK0721A010CBSMSG1LIST)` // Extract fee item list [-> EKK0721A010CBSMSG1LIST="EKK0721A010CBSMsg1List"] |
| 2 | IF | `(childList != null && childList.size() > 0)` // Fee records exist? (L807) |

**Block 3.1** — [IF-TRUE] `(childList != null && childList.size() > 0)` (L807)

> When the fee item list contains one or more records, the method determines that initial fees are present.

| # | Type | Code |
|---|------|------|
| 1 | SET | `res = true` // 初期費用がある場合 (Initial fees exist) |

**Block 3.2** — [ELSE] (L812)

> When the fee item list is empty (size == 0), the method determines that no initial fees apply.

| # | Type | Code |
|---|------|------|
| 1 | SET | `res = false` // 初期費用がない場合 (No initial fees) |

**Block 4** — [RETURN] (L819)

> Returns the determination result.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return res` |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `初期費用` (shiki-hiyō) | Japanese Field | Initial Fee — one-time charges incurred at contract inception, such as installation or setup fees. The method name `chkPayInitialCost` encodes this concept (pay = 有料 = charged). |
| `FUSV007301CC` | Constant | Parent service data key — identifies the service-level information map extracted from FUSV0073 service components. Produced by `setFUSV007301CC` mapper. |
| `EKK0721A010CBSMsg1List` | Constant | Temporary payment item list key — holds records of one-time payment items including NTT West Japan holiday work fees (一時支払金額／NTT西日本休止工事費). Extracted from `EKK0721A010CBS` service response. |
| `parentMap` | Field | Nested HashMap under `FUSV007301CC` containing service-level data including the child fee item list. |
| `childList` | Field | ArrayList of fee item records; each record represents a billable initial fee line item. Presence and non-empty size indicate initial fees apply. |
| `outputMap` | Parameter | Aggregated output data map used across the FUW03501SF screen for passing structured data between CBS calls and view-layer logic. |
| `FUW03501SF` | Module | House Information Input Screen — a web screen for entering/managing property (mansion/condominium) details in the telecom service ordering workflow. |
| CBS | Acronym | Component-Based Service — the service component tier that handles business logic and data access. |
| `init()` | Method | Initialization method in `FUW03501SFLogic` that sets up initial screen state; calls `chkPayInitialCost` to determine fee display logic. |
| `setMansionDiv()` | Method | Mansion division setting method in `FUW03501SFLogic` that categorizes property types; calls `chkPayInitialCost` to adjust division logic based on fee presence. |
| NTT西日本休止工事費 | Japanese Term | NTT West Japan Holiday Work Fee — a temporary payment item covering construction work scheduled during NTT West Japan's business suspension period. Stored in `EKK0721A010CBSMsg1List`. |
