# Business Logic — FUW01403SFLogic.checkInitError() [265 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.FUW01403SF.FUW01403SFLogic` |
| Layer | Controller / Screen Logic (webview package) |
| Module | `FUW01403SF` (Package: `eo.web.webview.FUW01403SF`) |

## 1. Role

### FUW01403SFLogic.checkInitError()

This method serves as the **initial display error validation gate** for the "Second Service Application" screen (2番サービスお申込み), which allows customers to apply for a secondary NTT-Fujitsu internet/phone service bundled with their existing primary service. Executed at the top of the `init()` method during screen initialization, it performs comprehensive preconditions checking on pre-fetched service contract data before the screen content is rendered to the user.

The method validates **six distinct business checkpoints** across four functional areas: (1) **service contract existence** — confirming the primary service (eo Hikari phone) has valid, retrievable contract records from the `FUSV004101SC` search; (2) **equipment reuse case existence** — confirming construction case records from `FUSV004108SC` (added in ANK-3136 for OPMS hardware retention compliance); (3) **device-provided service contract existence** — confirming the device-provided service contract list from `FUSV004102SC`; (4) **multi-router number availability** — when only zero or two-plus primary service contracts exist, validating that a valid multi-router (G03) subscription with cost code A31 is active on the device; (5) **service contract state validation** — ensuring the primary service status is one of the valid states (in-service, reserved, or settled); and (6) **duplicate application prevention** — detecting conflicting internal work numbers, pending portability reservations, or overlapping construction equipment usage that would make the application ineligible.

The method implements a **fail-fast validation pattern**, throwing `JCCBusinessException` with error code "0102" (contract state error) or "0203" (change-in-progress error) at the first detected violation. It reads pre-populated data from `outputMap` (populated by prior service component calls in `init()`) and performs no data mutations — making it a pure read-based validation method. Its role in the larger system is a **shared pre-render gate** that ensures the customer is eligible to proceed with the second service application flow, preventing the UI from presenting an application form under invalid contract states.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START["checkInitError outputMap"]
    START --> L1["L1893: Log Start"]
    L1 --> C1["L1897: Contains FUSV004101SC"]
    C1 -- No --> E1["L1901: throw ERROR_CODE_0102"]
    C1 -- Yes --> G1["L1903: Get FUSV004101SC map"]
    G1 --> C2["L1907: Contains CBSMsg1List"]
    C2 -- No --> E2["L1912: throw ERROR_CODE_0102"]
    C2 -- Yes --> G2["L1915: Get EKK0081B508CBSMsg1List"]
    G2 --> C3["L1919: List null or size zero"]
    C3 -- Yes --> E3["L1924: throw ERROR_CODE_0102"]
    C3 -- No --> C4["L1930: Contains FUSV004108SC"]
    C4 -- No --> E4["L1934: throw ERROR_CODE_0102"]
    C4 -- Yes --> G4["L1936: Get FUSV004108SC map"]
    G4 --> C5["L1940: Contains EKU0011B010CBSMsg1List"]
    C5 -- No --> E5["L1946: throw ERROR_CODE_0102"]
    C5 -- Yes --> G5["L1948: Get EKU0011B010CBSMsg1List"]
    G5 --> C6["L1954: Contains FUSV004102SC"]
    C6 -- No --> E6["L1958: throw ERROR_CODE_0102"]
    C6 -- Yes --> G6["L1960: Get FUSV004102SC map"]
    G6 --> C7["L1965: Contains EKK0341B002CBSMsg1List"]
    C7 -- No --> E7["L1970: throw ERROR_CODE_0102"]
    C7 -- Yes --> G7["L1973: Get EKK0341B002CBSMsg1List"]
    G7 --> G8["L1978: Get FUSV004106SC map"]
    G8 --> C8["L1982: List null or empty or size >= 2"]
    C8 -- Yes --> C9["L1986: Contains EKK2811B503CBSMsg1List"]
    C9 -- No --> E8["L1990: throw ERROR_CODE_0102"]
    C9 -- Yes --> G9["L1993: Get EKK2811B503CBSMsg1List"]
    G9 --> I1["L1998: check = false"]
    I1 --> F1["L2000: for i=0..size"]
    F1 --> GP["L2003: Get pcrsCd from cbsMsg"]
    GP --> CP["L2007: pcrsCd equals G03"]
    CP -- Yes --> ST["L2009: check = true"]
    CP -- No --> N1["L2013: i++"]
    ST --> N1
    N1 --> CS1["i < size"]
    CS1 -- Yes --> F1
    CS1 -- No --> CB["L2015: check equals false"]
    CB -- Yes --> E9["L2019: throw ERROR_CODE_0203"]
    CB -- No --> S1["End multi-router block"]
    C8 -- No --> S1
    S1 --> GF["L2029: Get first record from EKK0081B508CBSMsg1List"]
    GF --> CS2["L2033: svc_kei_stat != 100 and != 030 and != 020"]
    CS2 -- Yes --> E10["L2039: throw ERROR_CODE_0102"]
    CS2 -- No --> CS3["L2055: equip_ryuyo == 1 AND kojiak_stat in 130-190"]
    CS3 -- Yes --> E11["L2064: throw ERROR_CODE_0102"]
    CS3 -- No --> N2["L2067: i++"]
    N2 --> CS2a["i < size"]
    CS2a -- Yes --> CS3
    CS2a -- No --> S2["End equipment reuse block"]
    CS2 -- Yes --> S2
    S2 --> CC["L2076: pcrs_cd != A31"]
    CC -- Yes --> E12["L2081: throw ERROR_CODE_0203"]
    CC -- No --> CP2["L2085: pplan_cd NOT in PA3101..PA3104"]
    CP2 -- Yes --> E13["L2090: throw ERROR_CODE_0203"]
    CP2 -- No --> GD["L2094: Get opeDate from JFUWebCommon"]
    GD --> IS["L2098: New HashSet ucwkSet"]
    IS --> F2["L2100: for i=0..size"]
    F2 --> GR["L2103: Get cbsMsg from list"]
    GR --> CR["L2107: kk0161_rsv_aply_cd == 2"]
    CR -- Yes --> GU["L2111: Get svc_kei_ucwk_stat"]
    GU --> CU["L2118: stat == 910 OR 920 AND isPastDate"]
    CU -- Yes --> CT["L2123: continue"]
    CU -- No --> GN["L2126: Get svc_kei_ucwk_no"]
    GN --> CM["L2130: ucwkSet contains svc_kei_ucwk_no"]
    CM -- No --> AS["L2133: ucwkSet add svc_kei_ucwk_no"]
    CM -- Yes --> N3["L2134: i++"]
    AS --> N3
    CT --> N3
    N3 --> CS3a["i < size"]
    CS3a -- Yes --> F2
    CS3a -- No --> CHS["L2139: ucwkSet.size > 1"]
    CR -- No --> GN
    CHS -- Yes --> E14["L2143: throw ERROR_CODE_0203"]
    CHS -- No --> F3["L2150: for i=0..size"]
    F3 --> GI["L2154: Get kk0081_ido_rsv_dtl_cd"]
    GI --> CIDO["L2158: ido_dtl_cd NOT null or empty"]
    CIDO -- Yes --> E15["L2162: throw ERROR_CODE_0203"]
    CIDO -- No --> N4["L2165: i++"]
    N4 --> CS4a["i < size"]
    CS4a -- Yes --> F3
    CS4a -- No --> LE["L2167: Log End"]
    E15 --> LE
    E14 --> LE
    E13 --> LE
    E12 --> LE
    E11 --> LE
    E10 --> LE
    E9 --> LE
    E8 --> LE
    E7 --> LE
    E6 --> LE
    E5 --> LE
    E4 --> LE
    E3 --> LE
    E2 --> LE
    E1 --> LE
    LE["Return void"]
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `outputMap` | `final HashMap<String, HashMap<String, Object>>` | The pre-populated service search results map containing all SC (Service Component) query results needed for the initial display. Each key maps to an inner HashMap holding CBS (Customer Business System) message lists — service contract data, equipment reuse case data, device-provided service contract data, and multi-router data. The method performs only reads on this map and throws if any expected keys or nested lists are missing/empty. |

**Instance fields / external state read by this method:**

| Field | Description |
|-------|-------------|
| `DEBUG_LOG` | Debug logger used for tracing each error checkpoint entry and exit |
| `SC_TITLE_FUSV004101SC` | Constant `"FUSV004101SC"` — SC title key for eo Hikari Phone service contract information list |
| `SC_TITLE_FUSV004102SC` | Constant `"FUSV004102SC"` — SC title key for device-provided service contract list |
| `SC_TITLE_FUSV004106SC` | Constant `"FUSV004106SC"` — SC title key for device option service contract list (front) |
| `SC_TITLE_FUSV004108SC` | Constant `"FUSV004108SC"` — SC title key for construction case list (added for OPMS hardware retention) |
| `MAP_KEY_EKK0081B508_CBSMSGLIST` | Constant `"EKK0081B508CBSMsg1List"` — nested map key for service contract detail list |
| `MAP_KEY_EKK0341B002_CBSMSGLIST` | Constant `"EKK0341B002CBSMsg1List"` — nested map key for device-provided service contract detail |
| `MAP_KEY_EKK2811B503_CBSMSGLIST` | Constant `"EKK2811B503CBSMsg1List"` — nested map key for multi-router (device option) contract list |
| `MAP_KEY_EKU011B010_CBSMSGLIST` | Constant `"EKU0011B010CBSMsg1List"` — nested map key for construction case list |
| `PPLAN_CD_1NO_LIST` | Constant list `["PA3101", "PA3102", "PA3103", "PA3104"]` — valid 1st-course flat-rate pricing plan codes |
| `DOJITSU_HUKUMU` | Constant `"1"` — `isPastDate` parameter meaning "include same day" in date comparison |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JFUWebCommon.getOpeDate` | JFUWebCommon | - | Retrieves the current operation date (business date) from the application context. Used for date comparison when validating cancellation timing. |
| R | `FUW01403SFLogic.getValue` | FUW01403SFLogic | - | Utility method that safely extracts a String value from a `HashMap<String, String>` by key, returning empty string or null if not found. Called throughout for all field reads from CBS message maps. |
| - | `FUW01403SFLogic.isNull` | FUW01403SFLogic | - | Utility method that checks if a String value is null or empty. Used to verify the portability reservation detail code field is absent. |
| - | `JPCUtilCommon.isPastDate` | JPCUtilCommon | - | Date utility method that determines if one date string is strictly in the past relative to another, with the `DOJITSU_HUKUMU` flag controlling same-day inclusion. |

**Note:** This method does not perform direct database operations. All data is read from the `outputMap` which was pre-populated by SC (Service Component) calls in the parent `init()` method. The method acts as a pure validation layer — it does not invoke any SC/CBS methods itself.

## 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: `getOpeDate` [R], `getValue` [R], `getValue` [R], `getValue` [R], `getValue` [R], `getValue` [R], `isNull` [-], `getValue` [R], `getValue` [R], `isPastDate` [-], `isPastDate` [-], `isPastDate` [-], `isPastDate` [-], `isPastDate` [-], `getValue` [R], `getValue` [R], `getValue` [R], `getOpeDate` [R], `getOpeDate` [R], `getOpeDate` [R]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Logic: `FUW01403SFLogic.init()` | `init()` -> `checkInitError(outputMap)` | `getOpeDate [R]`, `getValue [R]`, `isNull [-]`, `isPastDate [-]` |

**Instructions:**
- The only direct caller is `FUW01403SFLogic.init()`, which is the screen initialization method.
- `init()` first populates `outputMap` by calling multiple SC (Service Component) search operations, then invokes `checkInitError()` to validate the results before rendering.
- This method is **not called by any screen entry point** directly — it is strictly an internal validation method within the `FUW01403SFLogic` class.

## 6. Per-Branch Detail Blocks

### 6.1 Checkpoint 1 — Service Contract Existence

**Block 1** — IF `[containsKey: SC_TITLE_FUSV004101SC]` (L1897)

> Verifies that the eo Hikari Phone service contract information list search (`FUSV004101SC`) returned a result in the output map. If absent, the service contract record state is invalid or the data could not be retrieved.

| # | Type | Code |
|---|------|------|
| 1 | COND | `outputMap.containsKey(SC_TITLE_FUSV004101SC)` → `"FUSV004101SC"` |
| 2 | IF-NO | throw `JCCBusinessException(JFUStrConst.ERROR_CODE_0102)` — `"0102": Contract state error` |
| 3 | IF-YES | `HashMap<String, Object> fusv004101SCMap = outputMap.get(SC_TITLE_FUSV004101SC)` |

**Block 1.1** — IF `[containsKey: MAP_KEY_EKK0081B508_CBSMSGLIST]` (L1907)

> Verifies that the nested map contains the CBS message list (`EKK0081B508CBSMsg1List`) which holds the service contract detail records.

| # | Type | Code |
|---|------|------|
| 1 | COND | `fusv004101SCMap.containsKey(MAP_KEY_EKK0081B508_CBSMSGLIST)` → `"EKK0081B508CBSMsg1List"` |
| 2 | IF-NO | throw `JCCBusinessException(JFUStrConst.ERROR_CODE_0102)` |
| 3 | IF-YES | `ArrayList<HashMap<String, String>> ekk0081b508cbsMsgList = (ArrayList<HashMap<String, String>>)fusv0081b508cbsMsgList = (ArrayList<HashMap<String, String>>)fusv004101SCMap.get(MAP_KEY_EKK0081B508_CBSMSGLIST)` |

**Block 1.2** — IF `[size check: ekk0081b508cbsMsgList]` (L1919)

> Verifies the service contract detail list is not null and contains at least one record.

| # | Type | Code |
|---|------|------|
| 1 | COND | `ekk0081b508cbsMsgList == null || ekk0081b508cbsMsgList.size() <= 0` |
| 2 | IF-YES | throw `JCCBusinessException(JFUStrConst.ERROR_CODE_0102)` |

---

### 6.2 Checkpoint 2 — Equipment Reuse Case Existence (ANK-3136)

**Block 2** — IF `[containsKey: SC_TITLE_FUSV004108SC]` (L1930)

> Verifies that the construction case list search (`FUSV004108SC`) returned a result. This check was added in ANK-3136-00-00 for OPMS (Optical Power Management System) hardware retention compliance. If absent, the equipment reuse case data could not be retrieved.

| # | Type | Code |
|---|------|------|
| 1 | COND | `outputMap.containsKey(SC_TITLE_FUSV004108SC)` → `"FUSV004108SC"` |
| 2 | IF-NO | throw `JCCBusinessException(JFUStrConst.ERROR_CODE_0102)` — `"0102": Contract state error` |
| 3 | IF-YES | `HashMap<String, Object> fusv004108SCMap = outputMap.get(SC_TITLE_FUSV004108SC)` |

**Block 2.1** — IF `[containsKey: MAP_KEY_EKU011B010_CBSMSGLIST]` (L1940)

> Verifies that the construction case map contains the CBS message list (`EKU0011B010CBSMsg1List`).

| # | Type | Code |
|---|------|------|
| 1 | COND | `fusv004108SCMap.containsKey(MAP_KEY_EKU011B010_CBSMSGLIST)` → `"EKU0011B010CBSMsg1List"` |
| 2 | IF-NO | throw `JCCBusinessException(JFUStrConst.ERROR_CODE_0102)` |
| 3 | IF-YES | `ArrayList<HashMap<String, String>> eku0011b010cbsMsgList = (ArrayList<HashMap<String, String>>)fusv004108SCMap.get(MAP_KEY_EKU011B010_CBSMSGLIST)` |

---

### 6.3 Checkpoint 3 — Device-Provided Service Contract Existence

**Block 3** — IF `[containsKey: SC_TITLE_FUSV004102SC]` (L1954)

> Verifies that the device-provided service contract list search (`FUSV004102SC`) returned a result. Device-provided services include hardware like routers and set-top boxes. If absent, the VA (Value Added) contract state is invalid or data could not be retrieved.

| # | Type | Code |
|---|------|------|
| 1 | COND | `outputMap.containsKey(SC_TITLE_FUSV004102SC)` → `"FUSV004102SC"` |
| 2 | IF-NO | throw `JCCBusinessException(JFUStrConst.ERROR_CODE_0102)` |
| 3 | IF-YES | `HashMap<String, Object> fusv004102SCMap = outputMap.get(SC_TITLE_FUSV004102SC)` |

**Block 3.1** — IF `[containsKey: MAP_KEY_EKK0341B002_CBSMSGLIST]` (L1965)

> Verifies the device-provided service contract map contains the CBS message list.

| # | Type | Code |
|---|------|------|
| 1 | COND | `fusv004102SCMap.containsKey(MAP_KEY_EKK0341B002_CBSMSGLIST)` → `"EKK0341B002CBSMsg1List"` |
| 2 | IF-NO | throw `JCCBusinessException(JFUStrConst.ERROR_CODE_0102)` |
| 3 | IF-YES | `ArrayList<HashMap<String, String>> ekk0341b002cbsmsglist = (ArrayList<HashMap<String, String>>)fusv004102SCMap.get(MAP_KEY_EKK0341B002_CBSMSGLIST)` |

---

### 6.4 Checkpoint 4 — Multi-Router Availability Validation

**Block 4** — IF `[size: ekk0341b002cbsmsglist == null or empty or size >= 2]` (L1982)

> Validates multi-router (multiple phone line) conditions. If the device-provided service contract list has zero records or two or more records, an additional check is performed: the multi-router option service contract (`FUSV004106SC`) must exist, and at least one record must have `pcrsCd == "G03"` (multi-router subscription with cost code G03). If neither condition is met, a contract change is in progress and application is prohibited.

| # | Type | Code |
|---|------|------|
| 1 | SET | `HashMap<String, Object> fusv004106SCMap = outputMap.get(SC_TITLE_FUSV004106SC)` → `FUSV004106SC` |
| 2 | COND | `ekk0341b002cbsmsglist == null || size <= 0 || size >= 2` |
| 3 | IF-YES | → Block 4.1 |
| 4 | IF-NO | Skip to Block 5 (proceed to service state validation) |

**Block 4.1** — IF `[containsKey: MAP_KEY_EKK2811B503_CBSMSGLIST]` (L1986)

> When the multi-router condition triggers (0 or 2+ primary contracts), checks if the multi-router option contract detail list (`EKK2811B503CBSMsg1List`) exists.

| # | Type | Code |
|---|------|------|
| 1 | COND | `!fusv004106SCMap.containsKey(MAP_KEY_EKK2811B503_CBSMSGLIST)` → `"EKK2811B503CBSMsg1List"` |
| 2 | IF-YES | throw `JCCBusinessException(JFUStrConst.ERROR_CODE_0102)` — contract state error |
| 3 | IF-NO | → Block 4.2 |

**Block 4.2** — FOR `[i=0..ekk2811b503cbsmsglist.size()]` with nested IF (L1998)

> Iterates through multi-router option records to verify at least one has the multi-router subscription code (`pcrsCd == "G03"`).

| # | Type | Code |
|---|------|------|
| 1 | SET | `boolean check = false` |
| 2 | SET | `ArrayList<HashMap<String, String>> ekk2811b503cbsmsglist = (ArrayList<HashMap<String, String>>)fusv004106SCMap.get(MAP_KEY_EKK2811B503_CBSMSGLIST)` |
| 3 | LOOP | `for (int i = 0; i < ekk2811b503cbsmsglist.size(); i++)` |
| 4 | SET | `HashMap<String, String> cbsMsg = ekk2811b503cbsmsglist.get(i)` |
| 5 | SET | `String pcrsCd = this.getValue(cbsMsg, MAP_KEY_PCRS_CD)` → `"pcrs_cd"` |
| 6 | IF-NESTED | `[pcrsCd != null AND NOT EMPTY AND CD00134_G03="G03"]` |
| 7 | SET-NESTED | `check = true` |
| 8 | IF-END | → Block 4.3 |

**Block 4.3** — IF `[check == false]` (L2015)

> After the loop, if no multi-router subscription was found, a contract change involving a second service is already in progress.

| # | Type | Code |
|---|------|------|
| 1 | COND | `!check` |
| 2 | IF-YES | throw `JCCBusinessException(JFUStrConst.ERROR_CODE_0203)` — `"0203": Contract change in progress error` (already has 2nd service application reservation) |

---

### 6.5 Checkpoint 5 — Service Contract State Validation

**Block 5** — `[GET FIRST RECORD]` (L2029)

> Retrieves the first record from the eo Hikari Phone service contract detail list as the reference record for state validation.

| # | Type | Code |
|---|------|------|
| 1 | SET | `HashMap<String, String> ekk0081b508cbsMsg = ekk0081b508cbsMsgList.get(0)` |

**Block 5.1** — IF `[svc_kei_stat NOT IN valid states]` (L2033)

> Validates the primary service contract status. Only three valid states are permitted: `"100"` (Service in Progress — サービス提供中), `"020"` (Reservation Completed — 予約済), `"030"` (Settled — 締結済). Any other state means the contract record is in an ineligible state.

| # | Type | Code |
|---|------|------|
| 1 | COND | `!CD00037_100="100" AND !CD00037_030="030" AND !CD00037_020="020"` |
| 2 | IF-YES | throw `JCCBusinessException(JFUStrConst.ERROR_CODE_0102)` |
| 3 | IF-NO | → Block 6 (Equipment reuse state check) |

---

### 6.6 Checkpoint 6 — Equipment Reuse Status Check (ANK-3136)

**Block 6** — FOR `[i=0..eku0011b010cbsMsgList.size()]` with nested IF (L2053)

> Iterates through construction case records to check if any active construction case has equipment reuse enabled (`CD00002_1="1"`) AND the construction case status is in an in-progress state. This prevents customers from applying for a new service when they have an active ongoing construction that reuses equipment.

| # | Type | Code |
|---|------|------|
| 1 | LOOP | `for (int i = 0; i < eku0011b010cbsMsgList.size(); i++)` |
| 2 | SET | `HashMap<String, String> eku0011b010cbsMsg = eku0011b010cbsMsgList.get(i)` |
| 3 | COND | `[CD00002_1="1" (equipment reuse: YES)]` |
| 4 | AND | AND `[CD00474_130="130" OR 140 OR 150 OR 160 OR 170 OR 180 OR 190]` (kojiak_stat = in-progress states: 工事計画 through 工事完了通知済) |
| 5 | IF-YES | throw `JCCBusinessException(JFUStrConst.ERROR_CODE_0102)` — equipment reuse conflict error with construction case number |

---

### 6.7 Checkpoint 7 — Service Contract Price Course Validation

**Block 7** — IF `[pcrs_cd != A31]` (L2076)

> Validates that the first service contract record has price course code `CD00134_A31 = "A31"` (1st Course). If the price course is anything other than "A31", it means a second course is already contracted or in the process of being contracted.

| # | Type | Code |
|---|------|------|
| 1 | COND | `!JFUStrConst.CD00134_A31="A31"` |
| 2 | IF-YES | throw `JCCBusinessException(JFUStrConst.ERROR_CODE_0203)` — `"0203": Contract change in progress error` (already has 2nd course contracted) |

**Block 7.1** — IF `[pplan_cd NOT in valid 1st-course plans]` (L2085)

> Validates that the pricing plan code is one of the four valid 1st-course flat-rate plans: `PA3101` (Home/Mesontype), `PA3102` (Mansion Mesontype), `PA3103` (Flat), `PA3104` (Mansion Flat). Any other plan indicates a second course is in place.

| # | Type | Code |
|---|------|------|
| 1 | SET | `PPLAN_CD_1NO_LIST = [PA3101, PA3102, PA3103, PA3104]` |
| 2 | COND | `!PPLAN_CD_1NO_LIST.contains(pplanCd)` |
| 3 | IF-YES | throw `JCCBusinessException(JFUStrConst.ERROR_CODE_0203)` |

---

### 6.8 Checkpoint 8 — Duplicate Internal Work Number Check

**Block 8** — GET `[opeDate]` (L2094)

> Retrieves the current operation date (business date) from `JFUWebCommon`. This date is used in date comparison to exclude resolved/cancelled internal work records from the duplicate check.

| # | Type | Code |
|---|------|------|
| 1 | SET | `String opeDate = JFUWebCommon.getOpeDate(this, null)` |

**Block 8.1** — `[SETUP]` (L2098)

> Initializes a `HashSet` to track unique internal work numbers across all service contract records.

| # | Type | Code |
|---|------|------|
| 1 | SET | `HashSet<String> ucwkSet = new HashSet<String>(1)` |

**Block 8.2** — FOR `[i=0..ekk0081b508cbsMsgList.size()]` with nested IF (L2100)

> Iterates through all service contract records, extracting unique internal work numbers (`svc_kei_ucwk_no`). Records that have been cancelled (`kk0161_rsv_aply_cd == "2"`) with status 910 (resolved) or 920 (cancelled) AND whose cancellation date is in the past are excluded from the deduplication count.

| # | Type | Code |
|---|------|------|
| 1 | LOOP | `for (int i = 0; i < ekk0081b508cbsMsgList.size(); i++)` |
| 2 | SET | `HashMap<String, String> cbsMsg = ekk0081b508cbsMsgList.get(i)` |
| 3 | IF-NESTED | `[CD00343_2="2" (reservation confirmed)]` for `kk0161_rsv_aply_cd` |
| 4 | SET-NESTED | `String svcKeiUcwkStat = this.getValue(cbsMsg, MAP_KEY_SVC_KEI_UCWK_STAT)` → `"svc_kei_ucwk_stat"` |
| 5 | SET-NESTED | `String kk0161RsvAplyYmd = this.getValue(cbsMsg, MAP_KEY_KK0161_RSV_APLY_YMD)` → `"kk0161_rsv_aply_ymd"` |
| 6 | IF-NESTED-2 | `[stat == CD00037_910="910" (resolved) OR CD00037_920="920" (cancelled)]` AND `JPCUtilCommon.isPastDate(kk0161RsvAplyYmd, opeDate, DOJITSU_HUKUMU="1")` |
| 7 | EXEC-NESTED-2 | `continue` — skip cancelled/resolved internal work records |
| 8 | SET | `String svc_kei_ucwk_no = this.getValue(cbsMsg, MAP_KEY_SVC_KEI_UCWK_NO)` → `"svc_kei_ucwk_no"` |
| 9 | IF-NESTED-2 | `!ucwkSet.contains(svc_kei_ucwk_no)` |
| 10 | EXEC-NESTED-2 | `ucwkSet.add(svc_kei_ucwk_no)` |

**Block 8.3** — IF `[ucwkSet.size() > 1]` (L2139)

> After collecting all unique internal work numbers, if more than one distinct number is found, it means the customer already has multiple phone numbers in use — making the second service application ineligible.

| # | Type | Code |
|---|------|------|
| 1 | COND | `ucwkSet.size() > 1` |
| 2 | IF-YES | throw `JCCBusinessException(JFUStrConst.ERROR_CODE_0203)` — `"0203": Contract change in progress error` (already has multiple phone numbers) |

---

### 6.9 Checkpoint 9 — Pending Portability Reservation Check

**Block 9** — FOR `[i=0..ekk0081b508cbsMsgList.size()]` with nested IF (L2150)

> Iterates through all service contract records to check if any record has a portability reservation detail code (`kk0081_ido_rsv_dtl_cd`) set. A non-null/empty value indicates the customer has an active portability reservation for a second service, which makes the application ineligible.

| # | Type | Code |
|---|------|------|
| 1 | LOOP | `for (int i = 0; i < ekk0081b508cbsMsgList.size(); i++)` |
| 2 | SET | `ekk0081b508cbsMsg = ekk0081b508cbsMsgList.get(i)` |
| 3 | SET | `String kk0081IdoRsvDtlCd = this.getValue(ekk0081b508cbsMsg, MAP_KEY_KK0081_IDO_RSV_DTL_CD)` → `"kk0081_ido_rsv_dtl_cd"` |
| 4 | IF-NESTED | `!this.isNull(kk0081IdoRsvDtlCd)` — portability reservation detail code IS set |
| 5 | IF-NESTED-YES | throw `JCCBusinessException(JFUStrConst.ERROR_CODE_0203)` — `"0203": Contract change in progress error` (already has 2nd service portability application reservation) |

---

### 6.10 Completion

**Block 10** — Return (L2167)

> If all checkpoints pass without throwing an exception, the method returns normally. The screen initialization proceeds to render the application form.

| # | Type | Code |
|---|------|------|
| 1 | LOG | `DEBUG_LOG.info("----- FUW01403 End checkInitError -----")` |
| 2 | RETURN | `return;` — no error |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `svc_kei_stat` | Field | Service contract status — indicates the current lifecycle state of a service contract (e.g., "100" = in service, "910" = resolved/cancelled) |
| `svc_kei_ucwk_no` | Field | Service detail work number — internal tracking ID for service contract work items; used to detect duplicate/overlapping contracts |
| `svc_kei_ucwk_stat` | Field | Service detail work status — status of a service work item (e.g., "910" = resolved, "920" = cancelled) |
| `kk0081_pcrs_cd` | Field | Price course code (Service Contract) — classifies the pricing tier of a service contract (e.g., "A31" = 1st Course) |
| `kk0081_pplan_cd` | Field | Price plan code (Service Contract) — specific pricing plan identifier within a course |
| `kk0081_ido_rsv_dtl_cd` | Field | Portability reservation detail code (Service Contract) — indicates an active portability (number portability) reservation; non-empty means a second service change is already pending |
| `kk0161_rsv_aply_cd` | Field | Reservation application code (Service Contract detail) — indicates reservation state (e.g., "2" = reservation confirmed) |
| `kk0161_rsv_aply_ymd` | Field | Reservation application year/month/day (Service Contract detail) — the date the reservation was applied; used for cancellation timing validation |
| `pcrs_cd` | Field | Price course code — from device option service contract; "G03" indicates multi-router subscription |
| `kojiak_stat` | Field | Construction case status — lifecycle state of a construction job (e.g., "130" = planning, "170" = started, "180" = completed) |
| `kojiak_no` | Field | Construction case number — unique identifier for a construction case record |
| `equip_ryuyo_um` | Field | Equipment reuse availability — "1" means the equipment (hardware) is to be reused in the new service; "0" means new equipment |
| CD00037_100 | Constant | Service contract status: "100" — Service in Progress (サービス提供中) |
| CD00037_020 | Constant | Service contract status: "020" — Reservation Completed (予約済) |
| CD00037_030 | Constant | Service contract status: "030" — Settled (締結済) |
| CD00037_910 | Constant | Service contract status: "910" — Resolved/Closed (解約済) |
| CD00037_920 | Constant | Service contract status: "920" — Cancelled (キャンセル済) |
| CD00002_1 | Constant | Equipment reuse flag: "1" — Equipment reuse YES (設備流用有) |
| CD00474_130 through CD00474_190 | Constants | Construction case status codes: "130"–"190" representing in-progress states (工事計画 through 工事完了通知済) |
| CD00134_A31 | Constant | Price course code: "A31" — 1st Course (1番コース) |
| CD00134_G03 | Constant | Price course code: "G03" — Multi-router subscription (マルチルーター契約) |
| CD00343_2 | Constant | Reservation application code: "2" — Reservation confirmed (予約確定) |
| CD00565_PA3101 | Constant | Pricing plan: "PA3101" — 1st Course Flat-rate Plan (Home/Mesontype) |
| CD00565_PA3102 | Constant | Pricing plan: "PA3102" — 1st Course Flat-rate Plan (Mansion Mesontype) |
| CD00565_PA3103 | Constant | Pricing plan: "PA3103" — 1st Course Flat-rate Plan (Flat) |
| CD00565_PA3104 | Constant | Pricing plan: "PA3104" — 1st Course Flat-rate Plan (Mansion Flat) |
| ERROR_CODE_0102 | Constant | Error code "0102" — Contract State Error (契約状態エラー): service contract data is invalid, missing, or in an ineligible state |
| ERROR_CODE_0203 | Constant | Error code "0203" — Contract Change In Progress (契約変更手続き中エラー): a second service is already contracted, in the process of being contracted, or has a pending reservation |
| DOJITSU_HUKUMU | Constant | Date comparison mode: "1" — Include same day (当日を含む) in `isPastDate()` comparison |
| FUSV004101SC | Constant | SC Title: eo Hikari Phone Service Contract Information List — primary service contract data query |
| FUSV004102SC | Constant | SC Title: Device-Provided Service Contract List (Service Contract Number) — device contract data query |
| FUSV004106SC | Constant | SC Title: Device Option Service Contract List (Front) — multi-router option data query |
| FUSV004108SC | Constant | SC Title: Construction Case List — construction/equipment reuse case data query (ANK-3136) |
| EKK0081B508CBSMsg1List | Constant | Map key for service contract detail record list (from FUSV004101SC) |
| EKK0341B002CBSMsg1List | Constant | Map key for device-provided service contract detail list |
| EKK2811B503CBSMsg1List | Constant | Map key for multi-router option contract detail list |
| EKU0011B010CBSMsg1List | Constant | Map key for construction case detail list |
| SC | Abbreviation | Service Component — server-side component that performs data retrieval and business processing |
| CBS | Abbreviation | Customer Business System — backend business system that processes customer transactions |
| OPMS | Abbreviation | Optical Power Management System — network management system for fiber optic infrastructure |
| VA | Abbreviation | Value Added — refers to value-added device services (routers, set-top boxes) provided to customers |
| 2番サービス | Business term | Second Service — a secondary NTT-Fujitsu internet/phone service bundled with a primary service; the core domain of this screen |
| サービス提供中 | Japanese field value | Service in Progress — the active state where a service is currently being provided to the customer |
| 解約済 | Japanese field value | Resolved/Closed — the service contract has been terminated and the account is closed |
| キャンセル済 | Japanese field value | Cancelled — the service contract reservation was cancelled |
| 工事計画 | Japanese field value | Construction Planning — initial stage of a construction case where plans are being made |
| 工事完了 | Japanese field value | Construction Complete — the construction work has been completed |
| 設備流用 | Japanese field value | Equipment Reuse — the existing equipment (hardware) will be reused for the new service instead of provisioning new equipment |
| 異動予約 | Japanese field value | Portability Reservation — a reservation to port a phone number to/from another provider or service |