# Business Logic — FUW03901SFLogic.tankanrenCheck() [69 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.FUW03901SF.FUW03901SFLogic` |
| Layer | Service / Front-end Logic |
| Module | `FUW03901SF` (Package: `eo.web.webview.FUW03901SF`) |

## 1. Role

### FUW03901SFLogic.tankanrenCheck()

This method performs single-relationship verification (単関連チェック) for password and authentication ID consistency during an online contract change process. Specifically, it validates three distinct security checks in sequence: first, it confirms that the user-provided current password matches the registered ISP authentication password stored in the customer's service contract detail records; second, it verifies that the new password and its re-typed confirmation are identical; third, it ensures the new password is not identical to the current password, preventing meaningless password changes. The method operates as a pre-flight guard inside the `mskm()` (maintenance screen) flow of the FUW03901SF (online contract change) screen, ensuring that authentication credentials are valid before the system proceeds to update the customer record. It follows a fail-fast design pattern — each validation block short-circuits and returns `false` with an associated error message on the first sign of failure, only returning `true` when all checks pass.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["tankanrenCheck"])

    START --> RETRIEVE["Retrieve password values from bean"]

    RETRIEVE --> EXTRACT["Extract nested data beans from commonInfoBean"]

    EXTRACT --> WEB_CHG["Get WEB_CHG_INFO from commonInfoBean"]
    WEB_CHG --> SSO_INFO["Get SSO_INFO from webChgInfoBean"]
    SSO_INFO --> GEN_CUST["Get GEN_CUST_KEI_INFO from webChgInfoBean"]
    GEN_CUST --> SVC_KEI["Get SVC_KEI_INFO from genCustKeiInfoBean"]
    SVC_KEI --> SVC_KEI_UCWK["Get SVC_KEI_UCWK_INFO array from svcKeiInfoBean"]

    SVC_KEI_UCWK --> LOOP_START["Set loop counter k = 0"]

    LOOP_START --> LOOP_CHECK{"k < svcKeiUcwkInfoArray.getCount()"}

    LOOP_CHECK -->|No| PWD_RETYPE_CHECK["Check new password matches re-typed password"]
    LOOP_CHECK -->|Yes| GET_BEAN["Set svcKeiUcwkInfoBean = svcKeiUcwkInfoArray.getDataBean(k)"]

    GET_BEAN --> GET_ISP_ID["Get ISP authentication ID from service contract detail"]

    GET_ISP_ID --> ISP_MATCH{"ssoInfoNinshoId.equals(svcKeiUcwkInfoISPNinshoId)"}

    ISP_MATCH -->|No| INC_K["Increment k by 1"]
    INC_K --> LOOP_CHECK

    ISP_MATCH -->|Yes| VERIFY_PWD["Get ISP authentication password from service contract detail"]

    VERIFY_PWD --> PWD_CHECK{"!svcKeiUcwkInfoISPNinshoIdPwd.equals(nowPass)"}

    PWD_CHECK -->|Yes| ERROR_NOW_PWD["setMessageInfo: current password invalid"]
    PWD_CHECK -->|No| BREAK_LOOP["Break from loop"]

    ERROR_NOW_PWD --> FAIL_RETURN(["Return false"])
    BREAK_LOOP --> PWD_RETYPE_CHECK

    PWD_RETYPE_CHECK --> RECHG_CHECK{"!chgPass.equals(reChgPass)"}

    RECHG_CHECK -->|Yes| ERROR_RETYPE["setMessageInfo: re-typed new password mismatch"]
    RECHG_CHECK -->|No| SAME_CHECK{"nowPass.equals(chgPass)"}

    ERROR_RETYPE --> FAIL_RETURN
    SAME_CHECK -->|Yes| ERROR_SAME["setMessageInfo: new password must differ"]
    SAME_CHECK -->|No| SUCCESS_RETURN(["Return true"])

    ERROR_SAME --> FAIL_RETURN
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `bean` | `X31SDataBeanAccess` | Service form bean carrying the user-entered password values: the current authentication ID password, the new password, and the re-typed new password confirmation. These are the primary inputs for the three validation checks. |
| 2 | `commonInfoBean` | `X31SDataBeanAccess` | Shared form bean containing hierarchical nested data beans: WEB change information (WEB変更情報), SSO authentication information (SSO情報) with the registered authentication ID, and general customer contract information with service contract details (including ISP authentication ID and password). Used for cross-referencing stored credentials against user input. |

**Fields/State accessed from `commonInfoBean`:**

| Source | Constant | Business Meaning |
|--------|----------|------------------|
| `CommonInfoCFConst.WEB_CHG_INFO` = "WEB変更情報" | WEB change information container |
| `CommonInfoCFConst.SSO_INFO` = "SSO情報" | Single Sign-On information containing registered authentication ID |
| `CommonInfoCFConst.GEN_CUST_KEI_INFO` = "現顧客契約情報" | Existing customer contract information |
| `CommonInfoCFConst.SVC_KEI_INFO` = "サービス契約情報" | Service contract information |
| `CommonInfoCFConst.SVC_KEI_UCWK_INFO` = "サービス契約内況情報" | Service contract detail information (iterable array of contract line items) |
| `CommonInfoCFConst.NINSHO_ID_21` = "認証ID" | SSO authentication ID (for SSO info record) |
| `CommonInfoCFConst.ISP_NINSHO_ID_24` = "ISP認証ID" | ISP authentication ID (for service contract detail records) |
| `CommonInfoCFConst.ISP_NINSHO_ID_PWD_24` = "ISP認証IDパスワード" | ISP authentication ID password (for service contract detail records) |
| `FUW03901SFConst.NOW_NINSHO_ID_PWD` = "現在の認証IDパスワード" | Current authentication ID password (user input) |
| `FUW03901SFConst.CHG_NINSHO_ID_PWD` = "変更認証IDパスワード" | New authentication ID password (user input) |
| `FUW03901SFConst.RE_INPUT_CHG_NINSHO_ID_PWD` = "変更認証IDパスワード（再入力）" | Re-typed new authentication ID password (user input) |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `OneStopDataBeanAccess.sendMessageString` | - | - | Retrieves current password value from service form bean using key `FUW03901SFConst.NOW_NINSHO_ID_PWD` |
| - | `OneStopDataBeanAccess.sendMessageString` | - | - | Retrieves new password value from service form bean using key `FUW03901SFConst.CHG_NINSHO_ID_PWD` |
| - | `OneStopDataBeanAccess.sendMessageString` | - | - | Retrieves re-typed new password value from service form bean using key `FUW03901SFConst.RE_INPUT_CHG_NINSHO_ID_PWD` |
| R | `OneStopDataBeanAccess.getDataBeanArray` | - | - | Retrieves WEB change info bean array from `commonInfoBean` |
| R | `OneStopDataBeanAccess.getDataBean` | - | - | Retrieves first element (index 0) of WEB change info bean array |
| R | `OneStopDataBeanAccess.getDataBeanArray` | - | - | Retrieves SSO info bean array from web change info bean |
| R | `OneStopDataBeanAccess.getDataBean` | - | - | Retrieves first element (index 0) of SSO info bean array |
| R | `OneStopDataBeanAccess.sendMessageString` | - | - | Retrieves SSO authentication ID (NINSHO_ID_21) from SSO info bean |
| R | `OneStopDataBeanAccess.getDataBeanArray` | - | - | Retrieves general customer contract info bean array from web change info bean |
| R | `OneStopDataBeanAccess.getDataBean` | - | - | Retrieves first element (index 0) of general customer contract info bean array |
| R | `OneStopDataBeanAccess.getDataBeanArray` | - | - | Retrieves service contract info bean array from general customer contract info |
| R | `OneStopDataBeanAccess.getDataBean` | - | - | Retrieves first element (index 0) of service contract info bean array |
| R | `OneStopDataBeanAccess.getDataBeanArray` | - | - | Retrieves service contract detail (UcwK) info bean array from service contract info |
| R | `OneStopDataBeanAccessArray.getCount` | - | - | Gets count of service contract detail records for iteration |
| R | `OneStopDataBeanAccessArray.getDataBean` | - | - | Gets service contract detail bean at loop index k |
| R | `OneStopDataBeanAccess.sendMessageString` | - | - | Retrieves ISP authentication ID from service contract detail bean |
| R | `OneStopDataBeanAccess.sendMessageString` | - | - | Retrieves ISP authentication password from service contract detail bean |
| C | `JFUWebCommon.setMessageInfo` | - | - | Sets error message for current password mismatch (EKF0400-TW) |
| C | `JFUWebCommon.setMessageInfo` | - | - | Sets error message for re-typed password mismatch (EKF0400-TW) |
| C | `JFUWebCommon.setMessageInfo` | - | - | Sets error message for same current/new password (EKF0270-NW) |

**How to classify:**
- This method is purely a validation/verification routine — it performs no Create, Read (from database), Update, or Delete operations on persistent storage.
- All operations are read-based data extraction from in-memory DataBean objects (passive R for bean access).
- The `setMessageInfo` calls set error message objects in the presentation context — classified as Create (C) since they create error message instances.

## 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: `setMessageInfo` [-], `setMessageInfo` [-], `setMessageInfo` [-], `sendMessageString` [-], `sendMessageString` [-], `sendMessageString` [-]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen: FUW03901SF (mskm) | `FUW03901SFLogic.mskm()` -> `tankanrenCheck(bean, commonInfoBean)` | `setMessageInfo [C] -` (3 invocations for error display) |

**Caller Details:**

| Caller Class | Method | Description |
|-------------|--------|-------------|
| `FUW03901SFLogic` | `mskm()` | Main maintenance screen logic. This private helper is invoked during the online contract change (maintenance) screen flow, after general pre-checks and data extraction have been completed. |

## 6. Per-Branch Detail Blocks

**Block 1** — [ASSIGNMENT] (L433-435)

> Retrieves the three password values from the service form bean. The method reads the current authentication ID password, the new password, and the re-typed new password confirmation entered by the user on the screen.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `nowPass = bean.sendMessageString(FUW03901SFConst.NOW_NINSHO_ID_PWD, DATABEAN_GET_VALUE)` // Gets current password [-> NOW_NINSHO_ID_PWD = "現在の認証IDパスワード"] |
| 2 | EXEC | `chgPass = bean.sendMessageString(FUW03901SFConst.CHG_NINSHO_ID_PWD, DATABEAN_GET_VALUE)` // Gets new password [-> CHG_NINSHO_ID_PWD = "変更認証IDパスワード"] |
| 3 | EXEC | `reChgPass = bean.sendMessageString(FUW03901SFConst.RE_INPUT_CHG_NINSHO_ID_PWD, DATABEAN_GET_VALUE)` // Gets re-typed new password [-> RE_INPUT_CHG_NINSHO_ID_PWD = "変更認証IDパスワード（再入力）"] |

**Block 2** — [ASSIGNMENT] (L437-439)

> Extracts nested data bean hierarchies from the shared form bean to access SSO information and service contract detail records.

| # | Type | Code |
|---|------|------|
| 1 | SET | `webChgInfoBean = commonInfoBean.getDataBeanArray(WEB_CHG_INFO).getDataBean(0)` // Gets WEB change info [-> WEB_CHG_INFO = "WEB変更情報"] |
| 2 | SET | `ssoInfoBean = webChgInfoBean.getDataBeanArray(SSO_INFO).getDataBean(0)` // Gets SSO info [-> SSO_INFO = "SSO情報"] |

**Block 3** — [ASSIGNMENT] (L442-450)

> Retrieves the SSO authentication ID and navigates deeper into the customer contract information hierarchy to reach service contract detail records.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `ssoInfoNinshoId = ssoInfoBean.sendMessageString(NINSHO_ID_21, DATABEAN_GET_VALUE)` // Gets SSO auth ID [-> NINSHO_ID_21 = "認証ID"] |
| 2 | SET | `genCustKeiInfoBean = webChgInfoBean.getDataBeanArray(GEN_CUST_KEI_INFO).getDataBean(0)` // Gets existing customer contract info [-> GEN_CUST_KEI_INFO = "現顧客契約情報"] |
| 3 | SET | `svcKeiInfoBean = genCustKeiInfoBean.getDataBeanArray(SVC_KEI_INFO).getDataBean(0)` // Gets service contract info [-> SVC_KEI_INFO = "サービス契約情報"] |
| 4 | SET | `svcKeiUcwkInfoBean = null` // Initializes service contract detail info bean variable |
| 5 | SET | `svcKeiUcwkInfoArray = svcKeiInfoBean.getDataBeanArray(SVC_KEI_UCWK_INFO)` // Gets service contract detail array [-> SVC_KEI_UCWK_INFO = "サービス契約内況情報"] |

**Block 4** — [FOR LOOP] (k = 0; k < svcKeiUcwkInfoArray.getCount()) (L452-477)

> Iterates through each service contract detail record to find a matching ISP authentication ID. When a match is found with the SSO authentication ID, the method then verifies the ISP authentication password against the current password entered by the user. This is the first of three validation checks.

| # | Type | Code |
|---|------|------|
| 1 | SET | `svcKeiUcwkInfoBean = svcKeiUcwkInfoArray.getDataBean(k)` // Gets contract detail at index k |
| 2 | EXEC | `svcKeiUcwkInfoISPNinshoId = svcKeiUcwkInfoBean.sendMessageString(ISP_NINSHO_ID_24, DATABEAN_GET_VALUE)` // Gets ISP auth ID [-> ISP_NINSHO_ID_24 = "ISP認証ID"] |

**Block 4.1** — [IF] `ssoInfoNinshoId.equals(svcKeiUcwkInfoISPNinshoId)` (L455-475)

> Business meaning: The SSO authentication ID matches the ISP authentication ID in the current service contract detail record. This indicates the user is trying to authenticate against this specific contract line item. Upon a match, the system retrieves the stored ISP authentication password and compares it against the user's current password input.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `svcKeiUcwkInfoISPNinshoIdPwd = svcKeiUcwkInfoBean.sendMessageString(ISP_NINSHO_ID_PWD_24, DATABEAN_GET_VALUE)` // Gets ISP auth password [-> ISP_NINSHO_ID_PWD_24 = "ISP認証IDパスワード"] |

**Block 4.1.1** — [IF] `!svcKeiUcwkInfoISPNinshoIdPwd.equals(nowPass)` (L457-459)

> Business meaning: The stored ISP authentication password does not match the current password entered by the user. This is a failed authentication attempt — the user has entered an incorrect current password.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `JFUWebCommon.setMessageInfo(this, JPCOnlineMessageConstant.EKF0400_TW, REPLACE_CHAR_PWD_ARRAY, ERR_NOW_PWD_ITEM_ID)` // Error: current password invalid [EKF0400-TW, item=now_pwd] |
| 2 | RETURN | `return false` // Aborts processing |

**Block 4.1.2** — [ELSE] (no explicit else — fallthrough) (L461)

> The ISP authentication password matched the current password. This record is the correct one; break out of the loop to continue to the next validation check.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `break` // Exits the for loop |

**Block 4.2** — [ELSE] `ssoInfoNinshoId` does NOT match `svcKeiUcwkInfoISPNinshoId` (implicit fallthrough)

> The SSO authentication ID does not match the ISP authentication ID in this service contract detail record. Continue iterating to the next record.

| # | Type | Code |
|---|------|------|
| 1 | SET | `k++` // Increment loop counter (implicit in for statement) |
| 2 | EXEC | Loop back to condition check |

**Block 5** — [IF] `!chgPass.equals(reChgPass)` (L479-484)

> Business meaning: The new password and its re-typed confirmation do not match. This is a standard data entry validation — the user may have made a typo when entering the new password. The system requires the re-typed password to be identical to prevent the user from being locked out due to a mistyped password.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `JFUWebCommon.setMessageInfo(this, JPCOnlineMessageConstant.EKF0400_TW, RE_INPUT_CHG_PWD_KANREN_MSG, ERR_RE_INPUT_CHG_PWD_ITEM_ID)` // Error: re-typed password mismatch [EKF0400-TW, item=re_input_chg_pwd, msg=["新しいパスワード（再入力）"]] |
| 2 | RETURN | `return false` // Aborts processing |

**Block 6** — [IF] `nowPass.equals(chgPass)` (L486-491)

> Business meaning: The current password and the new password are identical. This is a security policy check — the system prevents the user from "changing" their password to the same value, which would be meaningless and potentially indicate the user did not actually intend to change their credentials.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `JFUWebCommon.setMessageInfo(this, JPCOnlineMessageConstant.EKF0270_NW, CHG_PWD_KANREN_MSG, ERR_CHG_PWD_ITEM_ID)` // Error: new password must differ [EKF0270-NW, item=chg_pwd, msg=["新しいパスワードに", "、", "パスワード以外"]] |
| 2 | RETURN | `return false` // Aborts processing |

**Block 7** — [RETURN] (L493)

> All three validation checks passed. The current password is valid, the new password matches its re-typed confirmation, and the new password differs from the current one.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return true` // All checks passed |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `tankanrenCheck` | Method | Single-relationship verification — validates authentication credentials during contract change |
| `mskm()` | Method | Maintenance screen entry point for the online contract change process |
| `NOW_NINSHO_ID_PWD` | Constant (Field key) | Current authentication ID password — the user's existing password to verify against stored credentials |
| `CHG_NINSHO_ID_PWD` | Constant (Field key) | New authentication ID password — the user's desired replacement password |
| `RE_INPUT_CHG_NINSHO_ID_PWD` | Constant (Field key) | Re-typed new authentication ID password — confirmation entry for the new password to catch typos |
| `NINSHO_ID_21` | Constant (Field key) | Authentication ID — the SSO (Single Sign-On) user identifier stored in the SSO information bean |
| `ISP_NINSHO_ID_24` | Constant (Field key) | ISP authentication ID — the customer's Internet Service Provider authentication identifier stored in service contract detail records |
| `ISP_NINSHO_ID_PWD_24` | Constant (Field key) | ISP authentication ID password — the registered password for the ISP authentication ID in service contract details |
| `WEB_CHG_INFO` | Constant (Field key) | WEB change information — container for data modified through the online (WEB) channel |
| `SSO_INFO` | Constant (Field key) | SSO information — Single Sign-On profile data for the authenticated user |
| `GEN_CUST_KEI_INFO` | Constant (Field key) | Existing customer contract information — general contract profile of the current customer |
| `SVC_KEI_INFO` | Constant (Field key) | Service contract information — details of the customer's active service contract(s) |
| `SVC_KEI_UCWK_INFO` | Constant (Field key) | Service contract detail information — individual service contract line items (e.g., ISP, TV, phone) within the master contract |
| `ERR_NOW_PWD_ITEM_ID` | Constant | Error display item ID — `"now_pwd"`; identifies the HTML input field for the current password for error highlighting |
| `ERR_CHG_PWD_ITEM_ID` | Constant | Error display item ID — `"chg_pwd"`; identifies the HTML input field for the new password |
| `ERR_RE_INPUT_CHG_PWD_ITEM_ID` | Constant | Error display item ID — `"re_input_chg_pwd"`; identifies the HTML input field for the re-typed password |
| `EKF0400_TW` | Message constant | Error message code for password validation failure (two-way/error message type) |
| `EKF0270_NW` | Message constant | Error message code for new password being identical to current password |
| `JFUWebCommon.setMessageInfo` | Framework method | Sets an error message on the screen for user display via the common web framework |
| `X31SDataBeanAccess` | Type | Service form data bean access class — provides key-based get/set operations on form data |
| `X31SDataBeanAccessArray` | Type | Array wrapper for data bean collections — provides indexed access and count |
| SSO | Acronym | Single Sign-On — unified authentication system allowing one set of credentials across multiple services |
| ISP | Acronym | Internet Service Provider — the authentication ID/password used for accessing the online service platform |
| WEB変更情報 (WEB change info) | Business term | Data modified through the WEB (online) channel — includes SSO info, customer contract info, and service contract details |
| 現顧客契約情報 (Existing customer contract info) | Business term | Current customer's contract profile — includes contract type, customer name, address, etc. |
| サービス契約内況情報 (Service contract detail info) | Business term | Individual service items (line items) under a customer's master contract — each item may have its own ISP credentials |
| 単関連チェック (Single-relationship check) | Business term | Validation check that confirms the consistency of a single set of related data fields (here: authentication credentials) |
