# Business Logic — JKKKeiNewCmnLogicUtil.getOyaOpSvcCd() [12 LOC]

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

## 1. Role

### JKKKeiNewCmnLogicUtil.getOyaOpSvcCd()

The `getOyaOpSvcCd` method resolves a **sub-option service code** (`sbopSvcCd`) into its corresponding **parent option service code** (`oyaOpSvcCd`). In the telecom service ordering domain, sub-options (such as "Telecom Choice" or "Contract Refusal") are grouped under a parent option service code that is used by downstream billing, provisioning, and display logic. This utility acts as a **discriminator/routing method** — it inspects the incoming sub-option code and returns the canonical parent option service code, or `null` if the code has no defined parent mapping. The method is called by multiple screen mappers (e.g., KKSV0080, KKSV0082, KKSV0085, KKSV0102, KKSV0895) when building sub-option child maps for display during service contract and addition workflows, ensuring the correct parent option service code is propagated to downstream DB mapping and screen-rendering layers.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["getOyaOpSvcCd(sbopSvcCd)"])
    COND1{"sbopSvcCd == 'D07'
Telecom Choice"}
    RETURN_TEL(["return 'B024'
OP Svc Cd TNS Tel"])
    COND2{"sbopSvcCd == 'D08'
Contract Refusal"}
    RETURN_HASINSHA(["return 'B025'
OP Svc Cd Hasinsha DSP"])
    RETURN_NULL(["return null"])
    END(["End"])

    START --> COND1
    COND1 -->|Yes| RETURN_TEL
    COND1 -->|No| COND2
    COND2 -->|Yes| RETURN_HASINSHA
    COND2 -->|No| RETURN_NULL
    RETURN_TEL --> END
    RETURN_HASINSHA --> END
    RETURN_NULL --> END
```

**Constant Resolution:**

| Constant | Value | Business Meaning |
|----------|-------|-----------------|
| `JKKStrConst.CD00137_TNS_TEL_CHOICE` | `"D07"` | Telecom Choice — a sub-option code representing a customer's telecom carrier selection |
| `JKKStrConst.CD00137_HITCHI_KYOHI` | `"D08"` | Contract Refusal — a sub-option code representing a customer declining the service contract |
| `JKKStrConst.OP_SVC_CD_TNS_TEL` | `"B024"` | Parent Option Service Code for Telecom — the parent option service code for telecom carrier services |
| `JKKStrConst.OP_SVC_CD_HASINSHA_DSP` | `"B025"` | Parent Option Service Code for Home Owner Display — the parent option service code for homeowner display settings |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `sbopSvcCd` | `String` | **Sub-Option Service Code** — an input code representing a customer-selected sub-option within the telecom service ordering flow. Possible values include `"D07"` (Telecom Choice) which maps to parent option service code `"B024"`, and `"D08"` (Contract Refusal) which maps to parent option service code `"B025"`. Any other value (including `null`) results in a `null` return, meaning no parent mapping exists for that sub-option. |

No instance fields or external state are read by this method. It is a pure, stateless transformation function.

## 4. CRUD Operations / Called Services

This method performs **no CRUD operations**. It is a pure in-memory code resolution utility that contains no database reads, writes, or calls to service components (SCs). It simply compares an input string against constant values and returns a mapped output string.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| — | — | — | — | No database or service component operations. Pure in-memory string comparison and return. |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKSV0895 | `KKSV0895_KKSV0895OPDBMapper.setSvcKeiTelCmn` → `JKKKeiNewCmnLogicUtil.getOyaOpSvcCd` | — (no SC/CRUD terminal) |
| 2 | Screen:KKSV0080 | `KKSV0080_KKSV0080OPDBMapper.getEohTelAddSbopSvcKeiList` → `JKKWebCommon.getOyaOpSvcCd` → `JKKKeiNewCmnLogicUtil.getOyaOpSvcCd` | — (no SC/CRUD terminal) |
| 3 | Screen:KKSV0082 | `KKSV0082_KKSV0082OPDBMapper.getEohTelAddSbopSvcKeiList` → `JKKWebCommon.getOyaOpSvcCd` → `JKKKeiNewCmnLogicUtil.getOyaOpSvcCd` | — (no SC/CRUD terminal) |
| 4 | Screen:KKSV0085 | `KKSV0085_KKSV0085OPDBMapper.setKKSV008501CC` → `JKKWebCommon.getOyaOpSvcCd` → `JKKKeiNewCmnLogicUtil.getOyaOpSvcCd` | — (no SC/CRUD terminal) |
| 5 | Screen:KKSV0102 | `KKSV0102_KKSV0102OPDBMapper.setForAddSvcKeiTelCC` → `JKKWebCommon.getOyaOpSvcCd` → `JKKKeiNewCmnLogicUtil.getOyaOpSvcCd` | — (no SC/CRUD terminal) |

**Caller chain notes:**
- KKSV0895 calls the method **directly** on `JKKKeiNewCmnLogicUtil`.
- KKSV0080, KKSV0082, KKSV0085, and KKSV0102 call it via a **wrapper** method `JKKWebCommon.getOyaOpSvcCd()`, which delegates to `JKKKeiNewCmnLogicUtil.getOyaOpSvcCd()`.
- All callers are **screen mappers** (DB mapping classes for web screens) that are constructing sub-option child maps for display during service contract addition workflows.

## 6. Per-Branch Detail Blocks

**Block 1** — `IF` `(sbopSvcCd equals CD00137_TNS_TEL_CHOICE "D07")` `CD00137_TNS_TEL_CHOICE="D07"` (L17514)

> Check whether the sub-option service code is the "Telecom Choice" sub-option. If true, return the parent telecom option service code.

| # | Type | Code |
|---|------|------|
| 1 | CONDITION | `JKKStrConst.CD00137_TNS_TEL_CHOICE.equals(sbopSvcCd)` // CD00137_TNS_TEL_CHOICE = "D07" (Telecom Choice) |
| 2 | RETURN | `return JKKStrConst.OP_SVC_CD_TNS_TEL;` // OP_SVC_CD_TNS_TEL = "B024" (Parent Option Service Code for Telecom) |

**Block 2** — `ELSE-IF` `(sbopSvcCd equals CD00137_HITCHI_KYOHI "D08")` `CD00137_HITCHI_KYOHI="D08"` (L17517)

> If the first condition fails, check whether the sub-option service code is the "Contract Refusal" sub-option. If true, return the parent homeowner display option service code.

| # | Type | Code |
|---|------|------|
| 1 | CONDITION | `JKKStrConst.CD00137_HITCHI_KYOHI.equals(sbopSvcCd)` // CD00137_HITCHI_KYOHI = "D08" (Contract Refusal) |
| 2 | RETURN | `return JKKStrConst.OP_SVC_CD_HASINSHA_DSP;` // OP_SVC_CD_HASINSHA_DSP = "B025" (Parent Option Service Code for Homeowner Display) |

**Block 3** — `ELSE` / implicit fall-through (L17520)

> If neither condition matches (including when `sbopSvcCd` is `null`), return `null` indicating no parent option service code is mapped for the given sub-option.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return null;` // No parent mapping for the given sub-option service code |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|-----------------|
| `sbopSvcCd` | Field | Sub-Option Service Code — an input code representing a customer-selected sub-option within the telecom service ordering flow (e.g., carrier choice, contract refusal) |
| `oyaOpSvcCd` | Field | Parent Option Service Code — the resolved parent-level option service code that groups related sub-options for downstream processing |
| `CD00137_TNS_TEL_CHOICE` | Constant | "D07" — the code representing a Telecom Choice sub-option, where the customer selects their preferred telecom carrier |
| `CD00137_HITCHI_KYOHI` | Constant | "D08" — the code representing a Contract Refusal sub-option, where the customer declines the service contract |
| `OP_SVC_CD_TNS_TEL` | Constant | "B024" — the parent Option Service Code for Telecom services, used for billing and provisioning of telecom carrier options |
| `OP_SVC_CD_HASINSHA_DSP` | Constant | "B025" — the parent Option Service Code for Homeowner Display, used for homeowner display-related option services |
| TNS TEL | Abbreviation | Telecom TELecommunication — general telecom telephone service |
| KKK | Acronym | K-Opticom service product code prefix (screen/mapping class naming) |
| OP | Acronym | Option — refers to optional add-on services in the telecom offering |
| SV | Abbreviation | Service |
| CD | Abbreviation | Code |
| DSP | Abbreviation | Display |
| JKKKeiNewCmnLogicUtil | Class | Shared common logic utility for K-Opticom billing service operations — provides reusable static utility methods across web screens |
| KKSV | Acronym | K-Opticom Screen Verification — web screen mapping class naming convention (e.g., KKSV0080) |
| OP DB Mapper | Class | Option Database Mapping class — responsible for mapping screen data to database entities and vice versa |
