# Business Logic — JFUTelOptSvcMskmCmpCC.setOpSvcKeiDeleData() [140 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `com.fujitsu.futurity.bp.custom.common.JFUTelOptSvcMskmCmpCC` |
| Layer | CC/Common Component |
| Module | `common` (Package: `com.fujitsu.futurity.bp.custom.common`) |

## 1. Role

### JFUTelOptSvcMskmCmpCC.setOpSvcKeiDeleData()

This method implements the **option service contract cancellation processing** (オプションサービス契約データ解約処理) within the telephone option pack registration and cancellation system (eo telephone option pack submission/cancellation CMP component). It iterates over a list of option service masking data (`opSvcMskmList`) and performs the appropriate cancellation workflow for each eligible entry based on its status code.

The method handles **two cancellation branches** depending on the option service contract status:

1. **Pre-audit cancellation** (status `"020"` — `CD00037_020`): Executes only the cancellation callback (EKK0351C220) without charge evaluation, since the service has not yet begun charging.
2. **Post-audit cancellation** (all other statuses): Performs a full cancellation sequence — charge evaluation (`jdgHiChrg`), contract cancellation (EKK0351C241), and cancellation confirmation (EKK0351C250) — which handles cancellations after billing has started.

Additionally, for **050-number services** (B029 — `CD00136_B029`), the method triggers an email service termination (EZM0111C010) to end the usage of the 050-number endpoint assigned to the cancelled service.

The method uses a **dispatch/delegation pattern**: it initializes and populates input maps via helper methods (`setInMapEKK0351C220`, `setInMapEKK0351C241`, `setInMapEKK0351C250`, `setInMapEZM0111C010`), then delegates the actual service component execution to `JFUBPCommon.executeSC`. It acts as a **shared utility component** called by the main registration/cancellation orchestration method (`JFUSetOptPackMskmCC.setTelSelOptPackMapping`) during bulk option pack processing.

At the end of each iteration, it builds a Service Order Data (SOD) mapping fragment (`updateSODMap`) that records the option service contract number and the post-generation timestamp, enabling downstream SOD synchronization.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["setOpSvcKeiDeleData Start"])
    LOG_START["outDebugLog Start"]
    GET_INMAP["inMap = param.getData(fixedText)"]
    INIT_EKK0371B001["JFUBPCommon.initData EKK0371B001"]
    MAP_EKK0371B001["setInMapEKK0371B001 param fixedText inMap"]
    EXEC_EKK0371B001["JFUBPCommon.executeSC EKK0371B001"]
    GET_LIST["opList = JFUBPCommon.getTemplateList"]
    LOOP["for each dataMap in dataList"]
    FILTER_MSKM_DIV{"mskm_div == 2
AND svc_div == 1?"}
    SKIP["continue skip"]
    LOOP_OP["for each dtlMap in opList"]
    MATCH_OP_SVC{"op_svc_kei_no match?"}
    SET_STAT["dataMap.op_svc_kei_stat
dataMap.svc_staymd"]
    GET_OP_STAT["String opSvcKeiStat"]
    CHECK_STAT{"opSvcKeiStat == 020?"}
    EKK0351C220_INIT["JFUBPCommon.initData EKK0351C220"]
    EKK0351C220_MAP["setInMapEKK0351C220 cancellation"]
    EKK0351C220_EXEC["JFUBPCommon.executeSC EKK0351C220 Cancel"]
    EKK0351C220_GET_DTM["lastUpdDtm geneAddDtm update"]
    HI_CHRG["jdgHiChrg handle param fixedText dataMap"]
    EKK0351C241_INIT["JFUBPCommon.initData EKK0351C241"]
    EKK0351C241_MAP["setInMapEKK0351C241 contract cancellation"]
    EKK0351C241_EXEC["JFUBPCommon.executeSC EKK0351C241 Cancel"]
    EKK0351C241_UPD["lastUpdDtm update"]
    EKK0351C250_INIT["JFUBPCommon.initData EKK0351C250"]
    EKK0351C250_MAP["setInMapEKK0351C250 cancellation confirm"]
    EKK0351C250_EXEC["JFUBPCommon.executeSC EKK0351C250 Confirm"]
    EKK0351C250_GET_DTM["lastUpdDtm geneAddDtm update"]
    CHECK_050{"op_sbop_svc_cd == B029?"}
    EZM0111_INIT["JFUBPCommon.initData EZM0111C010"]
    EZM0111_MAP["setInMapEZM0111C010 050 number ending"]
    EZM0111_EXEC["JFUBPCommon.executeSC EZM0111C010 Email termination"]
    SOD_MAP["updateSODMap build and set"]
    END_LOOP["end of dataList loop"]
    LOG_END["outDebugLog End"]
    RETURN["return lastUpdDtm"]

    START --> LOG_START
    LOG_START --> GET_INMAP
    GET_INMAP --> INIT_EKK0371B001
    INIT_EKK0371B001 --> MAP_EKK0371B001
    MAP_EKK0371B001 --> EXEC_EKK0371B001
    EXEC_EKK0371B001 --> GET_LIST
    GET_LIST --> LOOP
    LOOP --> FILTER_MSKM_DIV
    FILTER_MSKM_DIV -->|No| SKIP
    FILTER_MSKM_DIV -->|Yes| LOOP_OP
    LOOP_OP --> MATCH_OP_SVC
    MATCH_OP_SVC -->|No| LOOP_OP
    MATCH_OP_SVC -->|Yes| SET_STAT
    SET_STAT --> GET_OP_STAT
    GET_OP_STAT --> CHECK_STAT
    CHECK_STAT -->|Yes 020| EKK0351C220_INIT
    CHECK_STAT -->|No| HI_CHRG
    EKK0351C220_INIT --> EKK0351C220_MAP
    EKK0351C220_MAP --> EKK0351C220_EXEC
    EKK0351C220_EXEC --> EKK0351C220_GET_DTM
    HI_CHRG --> EKK0351C241_INIT
    EKK0351C241_INIT --> EKK0351C241_MAP
    EKK0351C241_MAP --> EKK0351C241_EXEC
    EKK0351C241_EXEC --> EKK0351C241_UPD
    EKK0351C241_UPD --> EKK0351C250_INIT
    EKK0351C250_INIT --> EKK0351C250_MAP
    EKK0351C250_MAP --> EKK0351C250_EXEC
    EKK0351C250_EXEC --> EKK0351C250_GET_DTM
    EKK0351C220_GET_DTM --> CHECK_050
    EKK0351C250_GET_DTM --> CHECK_050
    CHECK_050 -->|Yes B029| EZM0111_INIT
    CHECK_050 -->|No| SOD_MAP
    EZM0111_INIT --> EZM0111_MAP
    EZM0111_MAP --> EZM0111_EXEC
    EZM0111_EXEC --> SOD_MAP
    SOD_MAP --> END_LOOP
    END_LOOP --> LOOP
    LOOP --> LOG_END
    LOG_END --> RETURN
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Database session handle used for SC (Service Component) invocations. Provides the transactional context for all CBS (Business Support System) calls made within this method. |
| 2 | `param` | `IRequestParameterReadWrite` | Request parameter object carrying inter-component data via `getData()`, `initData()`, and `executeSC()`. Holds the input map, template data, and error information exchanged between CC components and CBS layers. |
| 3 | `fixedText` | `String` | Fixed text key used as the map identifier within `param`. It acts as a namespace/namespace key to scope data retrieval (`param.getData(fixedText)`) and template operations. Typically maps to a screen or process identifier. |
| 4 | `dataList` | `ArrayList` | List of option service masking data maps to process for cancellation. Each `HashMap` entry represents one option service contract line item containing fields like `mskm_div`, `svc_div`, `op_svc_kei_no`, `op_svc_kei_stat`, `op_svc_cd`, and `op_sbop_svc_cd`. Only entries where `mskm_div == "2"` and `svc_div == "1"` are processed. |
| 5 | `lastUpdDtm` | `String` | Last update date-time (YYYYMMDDHHmmss format). Carried forward through the cancellation sequence to set the "previous update time" (`UPD_DTM_BF`) for audit trail consistency. Updated after each CBS call to reflect the new generation timestamp. |

**Instance fields / external state read:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `TEMP_ID_EKK0371B001` | String | Template ID for option service contract telephone list retrieval (pre-audit master data). |
| `TEMP_ID_DTL_EKK0371B001` | String | Detail template ID for the above. |
| `IN_COL_LIST_EKK0371B001` | List<String> | Input column list defining which fields to fetch from the EKK0371B001 service component (contract details). |
| `ERR_COL_EKK0371B001` | List<String> | Error column list for the above. |
| `TEMP_TEMPLATE_PRIFIX` | String | Template prefix key: `"TEMP_TEMPLATE_"`. |
| `TEMP_TEMPLATE_PRIFIX_SEP` | String | Template prefix separator: `"_"`. |
| `TEMP_TEMP_KEY_EKK0371B001` | String | Temporary template key for EKK0371B001 data lookup. |
| `EKK0161_SVC_KEI_UCWK_STAT` | String | Service contract detail status field key: `"kk0161_svcKeiUcwkStat"`. |
| `JFUStrConst.CD00037_020` | String | Pre-audit status constant: `"020"`. |
| `JFUStrConst.CD00136_B029` | String | 050-number service code constant: `"B029"`. |
| `OP_SBOP_SVC_CD` | String | Field name constant: `"op_sbop_svc_cd"` (option/sub-option service code). |
| `OP_SVC_CD` | String | Field name constant: `"op_svc_cd"` (option service code). |
| `IN_OP_SVC_MSKM_LIST` | String | Input key: `"option_service_list"`. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JFUBPCommon.executeSC` (EKK0371B001) | EKK0371B001SC | KK_T_OPSVKEI_ISP (option service contract master) | Retrieves the option service contract telephone list (マスター一覧照会). Fetches contract details including `op_svc_kei_stat`, `op_svc_kei_no`, and `svc_staymd` (service start date) used for status matching. |
| C | `JFUBPCommon.executeSC` (EKK0351C220) | EKK0351C220SC | KK_T_OPSVKEI_ISP, KK_T_OPSVKEI_DTL (option service contract details) | Option service contract cancellation (オプションサービス契約キャンセル). Executes pre-audit cancellation for non-charging services. Sets cancellation reason to "06" (解約によるキャンセル — cancellation by termination), and movement division to "00031" (オプション設定 — option setting). |
| C | `JFUBPCommon.executeSC` (EKK0351C241) | EKK0351C241SC | KK_T_OPSVKEI_ISP (option service contract master) | Option service contract termination (オプションサービス契約解約). First-phase cancellation processing after charge evaluation. Cancels the active option service contract based on the result of `jdgHiChrg` charge determination. |
| C | `JFUBPCommon.executeSC` (EKK0351C250) | EKK0351C250SC | KK_T_OPSVKEI_ISP, KK_T_OPSVKEI_DTL (option service contract details) | Option service contract termination confirmation (オプションサービス契約解約確定). Finalizes the cancellation after EKK0351C241 succeeds. Confirms the contract cancellation and updates all related records to the terminated state. |
| C | `JFUBPCommon.executeSC` (EZM0111C010) | EZM0111C010SC | KK_T_050_NUM_MAST (050-number terminal assignment) | 050-number service usage termination (050番号使用終了). For 050-number services, terminates the assigned 050-number endpoint and cleans up the usage assignment. |
| R | `JFUeoTelOpTransferCC.getData` | EKK0351CBS | KK_T_OPSVKEI_ISP | Called by `jdgHiChrg` — retrieves option service contract data for charge evaluation. |
| R | `JFUTransferCC.getData` | EKK0351CBS | KK_T_OPSVKEI_ISP | Called by `jdgHiChrg` — transfers/reads contract data for the charge determination process. |
| R | `JFUTransferListToListCC.getData` | EKK0351CBS | - | Called by `jdgHiChrg` — list-to-list transfer for charge evaluation context. |
| R | `JFUTelOptSvcMskmCmpCC.getUpdateSODMap` | - | In-memory SOD mapping | Retrieves and builds the SOD (Service Order Data) update map structure that tracks post-cancellation state changes for downstream SOD synchronization. |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKSV0004 (via JFUSetOptPackMskmCC.setTelSelOptPackMapping) | `JFUSetOptPackMskmCC.setTelSelOptPackMapping` → `JFUTelOptSvcMskmCmpCC.setOpSvcKeiDeleData` | `executeSC EKK0351C220 [C] KK_T_OPSVKEI_ISP`, `executeSC EKK0351C241 [C] KK_T_OPSVKEI_ISP`, `executeSC EKK0351C250 [C] KK_T_OPSVKEI_ISP`, `executeSC EZM0111C010 [C] KK_T_050_NUM_MAST`, `executeSC EKK0371B001 [R] KK_T_OPSVKEI_ISP` |
| 2 | Class: JFUTelOptSvcMskmCmpCC.setTelSelOptPackMapping | `JFUTelOptSvcMskmCmpCC.setTelSelOptPackMapping` → `JFUTelOptSvcMskmCmpCC.setOpSvcKeiDeleData` | `executeSC EKK0351C220 [C]`, `executeSC EKK0351C241 [C]`, `executeSC EKK0351C250 [C]`, `executeSC EZM0111C010 [C]`, `executeSC EKK0371B001 [R]`, `jdgHiChrg [-]`, `getUpdateSODMap [R]` |

**Call Chain Detail:**
- `JFUSetOptPackMskmCC.setTelSelOptPackMapping` (L567) calls `setOpSvcKeiDeleData(handle, param, fixedText, opSvcMskmList, lastUpdDtm)` as part of the bulk option pack processing pipeline, executed after contract registration (`setOpSvcKeiMskmData`) and before sub-option processing (`setSbopSvcKeiMskmData`).
- `JFUTelOptSvcMskmCmpCC.setTelSelOptPackMapping` (L1034) within the same class also calls `setOpSvcKeiDeleData` directly.

## 6. Per-Branch Detail Blocks

### Block 1 — Initialization (L1669–L1693)

> Log start, retrieve the input map, fetch the option service contract master list for status lookup, and prepare for iteration.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `outDebugLog("----- setOpSvcKeiDeleData Start -----")` // Start debug log |
| 2 | CALL | `inMap = param.getData(fixedText)` // Retrieve the input data map by fixedText key [-> `fixedText` is the namespace identifier] |
| 3 | SET | `String geneAddDtm = null` // Generation registration date-time, initialized to null [-> will be set after CBS execution] |
| 4 | EXEC | `JFUBPCommon.initData(param, fixedText, IN_COL_LIST_EKK0371B001)` // Initialize user data for EKK0371B001 (option service contract telephone list) |
| 5 | CALL | `setInMapEKK0371B001(param, fixedText, inMap)` // Populate input map with EKK0371B001 mapping items [-> sets `op_svc_kei_no`, `kk0161_svcKeiUcwkStat`, etc.] |
| 6 | CALL | `JFUBPCommon.executeSC(handle, param, fixedText, TEMP_ID_EKK0371B001, TEMP_ID_DTL_EKK0371B001, IN_COL_LIST_EKK0371B001, ERR_COL_EKK0371B001)` // Execute SC to retrieve the option service contract master list [-> EKK0371B001: Option service contract <Telephone> list (service contract details number)] |
| 7 | CALL | `opList = JFUBPCommon.getTemplateList(inMap, JFUBPCommon.getMaxTempTempleteKey(inMap, TEMP_TEMP_KEY_EKK0371B001), TEMP_ID_DTL_EKK0371B001)` // Get the option service contract detail list for status/number matching [-> Each entry has `op_svc_kei_no`, `op_svc_kei_stat`, `svc_staymd`] |

### Block 2 — Outer Loop: Iterate Over Data List (L1695–L1797)

> For each data map in the input dataList, filter, match status, and execute the appropriate cancellation path.

| # | Type | Code |
|---|------|------|
| 1 | SET | `dataMap = (HashMap)dataList.get(i)` // Extract each option service masking data entry |

#### Block 2.1 — IF: Filter Condition (mskm_div AND svc_div) (L1702–L1707)

> Skip entries that are not option service cancellation targets. Only `mskm_div == "2"` (option masking division = option) AND `svc_div == "1"` (service division = option service) are processed.

| # | Type | Code |
|---|------|------|
| 1 | IF | `!\"2\".equals(dataMap.get(\"mskm_div\")) || !\"1\".equals(dataMap.get(\"svc_div\"))` [-> `mskm_div` is the masking division flag; `svc_div` is the service division flag] |
| 1.1 | EXEC | `continue;` // Skip this entry — not an option service cancellation target |

#### Block 2.2 — Inner Loop: Match Option Service Contract Status (L1709–L1722)

> Match each data map's option service contract number against the pre-fetched master list to resolve its current status and service start date.

| # | Type | Code |
|---|------|------|
| 1 | SET | `dtlMap = opList entry` // Iterate over the option service contract master list |
| 2 | IF | `dtlMap.get(\"op_svc_kei_no\").equals(dataMap.get(\"op_svc_kei_no\"))` [-> Match by option service contract number] |
| 2.1 | SET | `dataMap.put(\"op_svc_kei_stat\", dtlMap.get(\"op_svc_kei_stat\"))` // Copy status from master [-> `op_svc_kei_stat` = option service contract status] |
| 2.2 | SET | `dataMap.put(\"svc_staymd\", dtlMap.get(\"svc_staymd\"))` // Copy service start date from master |
| 2.3 | RETURN | (implicit — inner loop continues to next dtlMap) |

| # | Type | Code |
|---|------|------|
| 3 | SET | `String opSvcKeiStat = (String)dataMap.get(\"op_svc_kei_stat\")` // Read the resolved status code for branching |

### Block 3 — IF: Pre-Audit Cancellation (status == "020") (L1725–L1741)

> **Condition**: `opSvcKeiStat` equals `CD00037_020` which resolves to `"020"` (pre-audit / before charging).
> **Business Meaning**: The service has not yet started charging. Execute cancellation callback only, without full termination workflow.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `JFUBPCommon.initData(param, fixedText, IN_COL_LIST_EKK0351C220)` // Initialize user data for EKK0351C220 (Option service contract cancellation) |
| 2 | CALL | `setInMapEKK0351C220(param, fixedText, dataMap, lastUpdDtm)` // Populate input map: `op_svc_kei_no`, `mskm_dtl_no`, `svc_cancel_rsn_cd = "06"` (解約によるキャンセル), `ido_div = "00031"` (オプション設定), `upd_dtm_bf = lastUpdDtm` |
| 3 | CALL | `JFUBPCommon.executeSC(handle, param, fixedText, TEMP_ID_EKK0351C220, TEMP_ID_DTL_EKK0351C220, IN_COL_LIST_EKK0351C220, ERR_COL_EKK0351C220)` // Execute cancellation callback SC [-> EKK0351C220: Option service contract cancellation (キャンセル)] |
| 4 | SET | `lastUpdDtm = JFUBPCommon.getTemplateValue(inMap, JFUBPCommon.getMaxTempTempleteKey(inMap, TEMP_TEMP_KEY_EKK0351C220), EKK0351C220CBSMsg.UPD_DTM)` // Update last update datetime from SC response |
| 5 | SET | `geneAddDtm = JFUBPCommon.getTemplateValue(inMap, JFUBPCommon.getMaxTempTempleteKey(inMap, TEMP_TEMP_KEY_EKK0351C220), EKK0351C220CBSMsg.GENE_ADD_DTM)` // Set generation registration datetime |

### Block 4 — ELSE: Post-Audit Cancellation (status != "020") (L1743–L1774)

> **Condition**: `opSvcKeiStat` does NOT equal `"020"` — meaning the service is active or has started charging. Execute the full cancellation workflow: charge evaluation, contract cancellation, and cancellation confirmation.

#### Block 4.1 — Charge Evaluation (L1746)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `hiChrgMap = jdgHiChrg(handle, param, fixedText, dataMap)` // Charge evaluation processing [-> Determines if charges apply and returns a map with `svcChrgEndYmd` (service charge end date) and `chrgFlg` (charge flag)] |

#### Block 4.2 — Contract Cancellation (EKK0351C241) (L1749–L1762)

> First phase: cancel the active option service contract based on the charge evaluation result.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `JFUBPCommon.initData(param, fixedText, IN_COL_LIST_EKK0351C241)` // Initialize user data for EKK0351C241 (Option service contract termination) |
| 2 | CALL | `setInMapEKK0351C241(param, fixedText, dataMap, hiChrgMap, lastUpdDtm)` // Populate input map with cancellation data and charge evaluation result |
| 3 | CALL | `JFUBPCommon.executeSC(handle, param, fixedText, TEMP_ID_EKK0351C241, TEMP_ID_DTL_EKK0351C241, IN_COL_LIST_EKK0351C241, ERR_COL_EKK0351C241)` // Execute contract cancellation SC [-> EKK0351C241: Option service contract termination (解約)] |
| 4 | SET | `lastUpdDtm = JFUBPCommon.getTemplateValue(inMap, JFUBPCommon.getMaxTempTempleteKey(inMap, TEMP_TEMP_KEY_EKK0351C241), EKK0351C241CBSMsg.UPD_DTM)` // Update last update datetime |

#### Block 4.3 — Cancellation Confirmation (EKK0351C250) (L1765–L1774)

> Second phase: confirm and finalize the cancellation.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `JFUBPCommon.initData(param, fixedText, IN_COL_LIST_EKK0351C250)` // Initialize user data for EKK0351C250 (Option service contract termination confirmation) |
| 2 | CALL | `setInMapEKK0351C250(param, fixedText, dataMap, hiChrgMap, lastUpdDtm)` // Populate input map with cancellation confirmation data |
| 3 | CALL | `JFUBPCommon.executeSC(handle, param, fixedText, TEMP_ID_EKK0351C250, TEMP_ID_DTL_EKK0351C250, IN_COL_LIST_EKK0351C250, ERR_COL_EKK0351C250)` // Execute cancellation confirmation SC [-> EKK0351C250: Option service contract termination confirmation (解約確定)] |
| 4 | SET | `lastUpdDtm = JFUBPCommon.getTemplateValue(inMap, JFUBPCommon.getMaxTempTempleteKey(inMap, TEMP_TEMP_KEY_EKK0351C250), EKK0351C250CBSMsg.UPD_DTM)` // Update last update datetime |
| 5 | SET | `geneAddDtm = JFUBPCommon.getTemplateValue(inMap, JFUBPCommon.getMaxTempTempleteKey(inMap, TEMP_TEMP_KEY_EKK0351C250), EKK0351C250CBSMsg.GENE_ADD_DTM)` // Set generation registration datetime from confirmation result |

### Block 5 — IF: 050-Number Service Termination (L1776–L1789)

> **Condition**: `dataMap.get(OP_SBOP_SVC_CD)` equals `CD00136_B029` which resolves to `"B029"` (050-number service).
> **Business Meaning**: For services using 050-number endpoints (a Japanese virtual number service for businesses), the 050-number usage must be terminated upon contract cancellation.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `JFUBPCommon.initData(param, fixedText, IN_COLUMN_LIST_EZM0111C010)` // Initialize user data for EZM0111C010 (050-number usage termination) |
| 2 | CALL | `setInMapEZM0111C010(param, fixedText, (String)dataMap.get(\"n_050_op_telno\"), (String)dataMap.get(\"zm0111_upd_dtm_bf\"))` // Populate: `n_050_op_telno` (050-number assigned to option service) and `zm0111_upd_dtm_bf` (previous update datetime) |
| 3 | CALL | `JFUBPCommon.executeSC(handle, param, fixedText, TEMPLATE_ID_EZM0111C010, TEMPLATE_ID_EZM0111C010_DETAIL, IN_COLUMN_LIST_EZM0111C010, ERROR_COLUMN_EZM0111C010)` // Execute 050-number termination SC [-> EZM0111C010: 050-number usage termination (エジング対象使用終了)] |

### Block 6 — SOD Mapping Update (L1791–L1797)

> Build the Service Order Data (SOD) update map fragment that records the option service contract number and its post-generation timestamp. This is used by downstream processing (`setSODMapping`) to synchronize the SOD system with the cancellation state.

| # | Type | Code |
|---|------|------|
| 1 | SET | `updateSODopMap = new HashMap()` // New SOD option map for this iteration |
| 2 | SET | `updateSODopMap.put(\"chaf_opsvkei_no\", (String)dataMap.get(\"op_svc_kei_no\"))` // Option service contract number |
| 3 | SET | `updateSODopMap.put(\"chaf_opsvkei_gene_add_dtm\", geneAddDtm)` // Post-generation option service contract generation datetime (sub-option service) |
| 4 | CALL | `updateSODMap = getUpdateSODMap(inMap)` // Retrieve/create the SOD update map structure |
| 5 | SET | `updateSODMap.put(dataMap.get(OP_SVC_CD), updateSODopMap)` // Set the SOD map keyed by option service code [-> `op_svc_cd`] |

### Block 7 — Termination (L1799–L1805)

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `outDebugLog("----- setOpSvcKeiDeleData End -----")` // End debug log |
| 2 | RETURN | `return lastUpdDtm` // Return the final last update datetime from the last executed CBS call |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `mskm_div` | Field | Masking division — classifies the type of masking data. Value `"2"` indicates option service masking data (オプションマスキング区分). |
| `svc_div` | Field | Service division — classifies the service type. Value `"1"` indicates option service (サービス区分). |
| `op_svc_kei_no` | Field | Option service contract number — unique identifier for an option service contract line item (オプションサービス契約番号). |
| `op_svc_kei_stat` | Field | Option service contract status — current state of the option service contract. `"020"` indicates pre-audit (before charging begins). |
| `svc_staymd` | Field | Service start date — the date the service began (サービス開始日). |
| `op_sbop_svc_cd` | Field | Option/sub-option service code — identifies the specific service type. `"B029"` indicates 050-number service (オプション・サブオプションサービスコード). |
| `op_svc_cd` | Field | Option service code — general service code identifier (オプションサービスコード). |
| `n_050_op_telno` | Field | 050-number assigned to option service — the virtual phone number assigned (050番号). |
| `zm0111_upd_dtm_bf` | Field | Previous update datetime for EZM0111 — audit trail timestamp before this operation (更新前日時). |
| `lastUpdDtm` | Field | Last update date-time — current timestamp carried across CBS calls for audit consistency (更新年月日時分秒). |
| `geneAddDtm` | Field | Generation registration date-time — the timestamp assigned by the CBS for record generation (世代登録年月日時分秒). |
| `UPD_DTM_BF` | Field | Update datetime before — previous update timestamp sent to CBS for optimistic concurrency control (更新前日時). |
| CD00037_020 | Constant | Pre-audit status code `"020"` — service has not yet started charging (照済). |
| CD00136_B029 | Constant | 050-number service code `"B029"` — identifies services using NTT's 050 virtual phone number. |
| CD01390_06 | Constant | Cancellation reason `"06"` — cancellation by termination (解約によるキャンセル). |
| CD00576_00031 | Constant | Movement division `"00031"` — option setting (オプション設定). |
| EKK0371B001 | SC Code | Option service contract telephone list retrieval — master data query for option service contracts (オプションサービス契約〈電話〉照会). |
| EKK0351C220 | SC Code | Option service contract cancellation — cancellation callback for pre-audit (オプションサービス契約キャンセル). |
| EKK0351C241 | SC Code | Option service contract termination — contract cancellation after charge evaluation (オプションサービス契約解約). |
| EKK0351C250 | SC Code | Option service contract termination confirmation — finalizes the cancellation (オプションサービス契約解約確定). |
| EZM0111C010 | SC Code | 050-number usage termination — terminates the 050-number endpoint assignment (050番号使用終了). |
| jdgHiChrg | Method | Charge determination/judgment processing — evaluates whether charges apply for the cancellation (課金判定処理). |
| getUpdateSODMap | Method | Builds the Service Order Data update map — prepares SOD sync data for downstream processing (更新後SODマップの設定). |
| SOD | Acronym | Service Order Data — Fujitsu's telecom order fulfillment system entity for tracking service orders. |
| SC | Acronym | Service Component — the service layer module that handles business logic and database operations. |
| CBS | Acronym | Business Support System — the backend system handling telecom billing, order, and customer management. |
| CMP | Acronym | Component — the common component layer (CMP component) shared across screens/processes. |
| 050-number | Business term | NTT's virtual phone number service for businesses, used for call centers and customer support lines. |
| KK_T_OPSVKEI_ISP | DB Table | Option service contract master table — stores option service contract headers (オプションサービス契約マスター). |
| KK_T_OPSVKEI_DTL | DB Table | Option service contract detail table — stores option service contract line items. |
| KK_T_050_NUM_MAST | DB Table | 050-number terminal assignment table — stores 050-number usage assignments. |
