# Business Logic — JKKKeiNewCmnLogicUtil.getEohtlSbopPrcKnrnCd() [19 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.commonOneStop.JKKKeiNewCmnLogicUtil` |
| Layer | Utility (Common Logic Utility) |
| Module | `commonOneStop` (Package: `eo.web.webview.commonOneStop`) |

## 1. Role

### JKKKeiNewCmnLogicUtil.getEohtlSbopPrcKnrnCd()

This method serves as a **subscription service code-to-pricing-code lookup bridge** for the NTT Hikari Fiber (eo光) Telephone product line. It translates a high-level **sub-option service code (サブオプションサービスコード)** — representing a telecommunication add-on service the customer has selected — into a pair of downstream pricing/plan code mappings used across multiple screens and batch mappers. Specifically, it resolves the sub-option service code into a **contract code (pcrs_cd)** and a **plan code (pplan_cd)**, which are then consumed by order processing, screen display, and billing logic in the eo web view layer. The method implements a **routing/dispatch design pattern**: it branches on the input service code to produce the correct pricing code pair for the selected service, or returns `null` for unrecognized codes. It is a shared utility called by numerous screen mappers and batch processing operations (KKSV0080, KKSV0082, KKSV0085, KKSV00895, KKSV0102, KKSV0675) across the eo light one-stop service flow. Two branches are currently supported: (1) TNS Selection (転送電話選択) — mapping to the forwarded telephone choice service codes, and (2) Anonymous Call Rejection (非通知着信拒否) — mapping to the anonymous caller ID rejection service codes.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["getEohtlSbopPrcKnrnCd sbopSvcCd"])
    STEP1["Create new HashMap dataMap"]

    COND1{sbopSvcCd equals<br/>CD00137_TNS_TEL_CHOICE<br/>D07}
    COND2{sbopSvcCd equals<br/>CD00137_HITCHI_KYOHI<br/>D08}

    BRANCH_TNS["PUT pcrs_cd CD00134_TNS_TEL_CHOICE<br/>PUT pplan_cd CD00565_TNS_TEL_CHOICE<br/>TNS Selection service mapping"]
    BRANCH_HITCHI["PUT pcrs_cd CD00134_HITCHI_KYOHI<br/>PUT pplan_cd CD00565_HTCHI_KYOHI<br/>Anonymous Call Rejection mapping"]
    ELSE_BRANCH["return null<br/>Unrecognized service code"]

    RETURN["return dataMap"]

    START --> STEP1 --> COND1
    COND1 -- D07 --> BRANCH_TNS --> RETURN
    COND1 -- otherwise --> COND2
    COND2 -- D08 --> BRANCH_HITCHI --> RETURN
    COND2 -- otherwise --> ELSE_BRANCH
```

**Constant Resolution:**

| Constant | Resolved Value | Business Meaning |
|----------|---------------|-----------------|
| `JKKStrConst.CD00137_TNS_TEL_CHOICE` | `"D07"` | Sub-option service code for Forwarded Telephone Selection (転送電話選択) |
| `JKKStrConst.CD00137_HITCHI_KYOHI` | `"D08"` | Sub-option service code for Anonymous Call Rejection (非通知着信拒否) |
| `JKKStrConst.CD00134_TNS_TEL_CHOICE` | `"D07"` | Contract code (pcrs_cd) for forwarded telephone selection |
| `JKKStrConst.CD00134_HITCHI_KYOHI` | `"D08"` | Contract code (pcrs_cd) for anonymous call rejection |
| `JKKStrConst.CD00565_TNS_TEL_CHOICE` | *see unresolved note* | Plan code (pplan_cd) for forwarded telephone selection |
| `JKKStrConst.CD00565_HTCHI_KYOHI` | *see unresolved note* | Plan code (pplan_cd) for anonymous call rejection |

> **Note:** The CD00565 constants (`CD00565_TNS_TEL_CHOICE` and `CD00565_HTCHI_KYOHI`) were not found in the JKKStrConst file within the searched scope. They are referenced in the source code and should exist in the production codebase. Their actual resolved string values should be filled in during a full constant scan of the production environment.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `sbopSvcCd` | `String` | Sub-option service code (サブオプションサービスコード) — identifies the eo光 Telephone add-on telecommunication service selected by the customer. Drives the entire branching logic: `"D07"` triggers the TNS Selection (転送電話選択) pricing mapping, `"D08"` triggers the Anonymous Call Rejection (非通知着信拒否) mapping, and any other value results in `null` being returned. |

No instance fields or external state are read by this method — it is a fully stateless utility function.

## 4. CRUD Operations / Called Services

This method performs **no direct CRUD operations**. It contains no database calls, SC (Service Component) invocations, CBS (Common Business Service) calls, or entity-level operations. It is a pure in-memory code mapping utility.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| *None* | — | — | — | No database or service component calls — pure HashMap population from constant-based lookup. |

**Method Calls (Internal):**

| # | Call | Type | Description |
|---|------|------|-------------|
| 1 | `new HashMap<String, String>()` | Instantiation | Creates a new HashMap to hold the pricing code mapping |
| 2 | `dataMap.put("pcrs_cd", value)` | SET (local) | Stores the contract code (pcrs_cd) key-value pair into dataMap |
| 3 | `dataMap.put("pplan_cd", value)` | SET (local) | Stores the plan code (pplan_cd) key-value pair into dataMap |

## 5. Dependency Trace

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

**Direct callers of `getEohtlSbopPrcKnrnCd`:**

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKSV0895 | `KKSV0895_KKSV0895OPDBMapper.setSvcKeiTelCmn` → `JKKKeiNewCmnLogicUtil.getEohtlSbopPrcKnrnCd` | No downstream CRUD (pure mapping) |
| 2 | Screen:KKSV0080 | `KKSV0080_KKSV0080OPDBMapper.getEohTelAddSbopSvcKeiList` → `JKKKeiNewCmnLogicUtil.getEohtlSbopPrcKnrnCd` | No downstream CRUD (pure mapping) |
| 3 | Screen:KKSV0082 | `KKSV0082_KKSV0082OPDBMapper.getEohTelAddSbopSvcKeiList` → `JKKKeiNewCmnLogicUtil.getEohtlSbopPrcKnrnCd` | No downstream CRUD (pure mapping) |
| 4 | Screen:KKSV0085 | `KKSV0085_KKSV0085OPDBMapper.setKKSV008501CC` → `JKKKeiNewCmnLogicUtil.getEohtlSbopPrcKnrnCd` | No downstream CRUD (pure mapping) |
| 5 | Screen:KKSV0085 | `KKSV0085_KKSV0085OPDBMapper.setKKSV008502CC` → `JKKKeiNewCmnLogicUtil.getEohtlSbopPrcKnrnCd` | No downstream CRUD (pure mapping) |
| 6 | Screen:KKSV0102 | `KKSV0102_KKSV0102OPDBMapper.setForAddSvcKeiTelCC` → `JKKKeiNewCmnLogicUtil.getEohtlSbopPrcKnrnCd` | No downstream CRUD (pure mapping) |
| 7 | Screen:KKSV0102 | `KKSV0102_KKSV0102OPDBMapper.setKKSV010205CC` → `JKKKeiNewCmnLogicUtil.getEohtlSbopPrcKnrnCd` | No downstream CRUD (pure mapping) |
| 8 | Screen:KKSV0675 | `KKSV0675_KKSV0675OPDBMapper.createTelOpList` → `JKKKeiNewCmnLogicUtil.getEohtlSbopPrcKnrnCd` | No downstream CRUD (pure mapping) |

**Call Chain Description:**
All callers are **screen mappers (OPDBMapper classes)** within the KKSVxxxx naming convention, which handle data mapping between screen forms and business entities. They invoke `getEohtlSbopPrcKnrnCd` to resolve sub-option telecommunication service codes into pricing/plan codes for display, order creation, or service listing purposes.

**Terminal operations from this method:** None — this method returns only a HashMap and does not reach any SC, CBS, or database endpoints.

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] `(variable initialization)` (L17532)

Create a new empty HashMap to hold the pricing code mapping. This is the local working data structure used throughout all branches.

| # | Type | Code |
|---|------|------|
| 1 | SET | `dataMap = new HashMap<String, String>()` // New empty HashMap for contract code and plan code mapping |

**Block 2** — [IF] `(JKKStrConst.CD00137_TNS_TEL_CHOICE.equals(sbopSvcCd))` [`CD00137_TNS_TEL_CHOICE = "D07" (Forwarded Telephone Selection / 転送電話選択)`] (L17533)

Branch for TNS Selection (転送電話選択) sub-option service. Populates the dataMap with the contract code and plan code pair specific to the forwarded telephone selection service.

| # | Type | Code |
|---|------|------|
| 1 | SET | `dataMap.put("pcrs_cd", JKKStrConst.CD00134_TNS_TEL_CHOICE)` // [-> CD00134_TNS_TEL_CHOICE = "D07"] Set contract code for TNS selection |
| 2 | SET | `dataMap.put("pplan_cd", JKKStrConst.CD00565_TNS_TEL_CHOICE)` // [-> CD00565_TNS_TEL_CHOICE = <unresolved>] Set plan code for TNS selection |

**Block 3** — [ELSE-IF] `(JKKStrConst.CD00137_HITCHI_KYOHI.equals(sbopSvcCd))` [`CD00137_HITCHI_KYOHI = "D08" (Anonymous Call Rejection / 非通知着信拒否)`] (L17538)

Branch for Anonymous Call Rejection (非通知着信拒否) sub-option service. Populates the dataMap with the contract code and plan code pair specific to the anonymous caller ID rejection service.

| # | Type | Code |
|---|------|------|
| 1 | SET | `dataMap.put("pcrs_cd", JKKStrConst.CD00134_HITCHI_KYOHI)` // [-> CD00134_HITCHI_KYOHI = "D08"] Set contract code for anonymous call rejection |
| 2 | SET | `dataMap.put("pplan_cd", JKKStrConst.CD00565_HTCHI_KYOHI)` // [-> CD00565_HTCHI_KYOHI = <unresolved>] Set plan code for anonymous call rejection |

**Block 4** — [ELSE] `(default / unrecognized code)` (L17543)

Falls through when the input `sbopSvcCd` does not match any known sub-option service code. Returns `null` to signal that no pricing code mapping is available for the given service code. This is a **guard clause** preventing invalid or unsupported service codes from producing incorrect pricing data.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return null` // Unrecognized sbopSvcCd — no pricing code mapping available |

**Block 5** — [RETURN] `(end of method)` (L17546)

The happy-path return after successfully populating the dataMap in either Block 2 or Block 3. Returns the HashMap containing both `pcrs_cd` and `pplan_cd` entries.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return dataMap` // Return populated pricing code mapping |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|-----------------|
| `sbopSvcCd` | Parameter | Sub-option Service Code (サブオプションサービスコード) — identifies the specific add-on telecommunication service (e.g., forwarded telephone selection, anonymous call rejection) selected for an eo光 Telephone contract |
| `pcrs_cd` | Field | Contract Code (契約コード) — the downstream pricing/service contract code used to identify the service in pricing and billing systems |
| `pplan_cd` | Field | Plan Code (プランコード) — the downstream plan/pricing tier code associated with the service contract |
| `dataMap` | Local Variable | HashMap holding the mapping from `pcrs_cd` and `pplan_cd` keys to their resolved string values |
| `JKKStrConst.CD00137_TNS_TEL_CHOICE` | Constant | Sub-option service code `"D07"` — represents Forwarded Telephone Selection (転送電話選択), a service that allows the subscriber to forward incoming calls to another number |
| `JKKStrConst.CD00137_HITCHI_KYOHI` | Constant | Sub-option service code `"D08"` — represents Anonymous Call Rejection (非通知着信拒否), a service that blocks calls from callers who have hidden their caller ID |
| `JKKStrConst.CD00134_TNS_TEL_CHOICE` | Constant | Contract code `"D07"` — the pricing contract code corresponding to Forwarded Telephone Selection |
| `JKKStrConst.CD00134_HITCHI_KYOHI` | Constant | Contract code `"D08"` — the pricing contract code corresponding to Anonymous Call Rejection |
| `JKKStrConst.CD00565_TNS_TEL_CHOICE` | Constant | Plan code — the pricing plan code corresponding to Forwarded Telephone Selection (exact value not resolved in current scan) |
| `JKKStrConst.CD00565_HTCHI_KYOHI` | Constant | Plan code — the pricing plan code corresponding to Anonymous Call Rejection (exact value not resolved in current scan) |
| eo光 (Hikari) | Business term | NTT's fiber-optic broadband internet service brand in Japan. The "eo" prefix refers to the "eo光電話" (eo Light Telephone) VoIP telephone service bundled with the fiber connection. |
| サブオプション (Sub-option) | Business term | Add-on telecommunication services available as optional extras to the base eo光 Telephone plan (e.g., call forwarding, anonymous caller rejection) |
| TNS | Abbreviation | Telephone Number System — in this context refers to the forwarded telephone selection service (転送電話選択) which routes calls to an alternate number |
| KKSVxxxx | Convention | Screen/mapper class naming convention for eo web screen operations (e.g., KKSV0080, KKSV0085). These OPDBMapper classes handle data mapping between screen forms and business layer entities. |
| commonOneStop | Module | The "one-stop" common utility package for eo web services, providing shared logic used across multiple screens and processes |
