# Business Logic — JBSbatKKAdChgSodUpd.isSecPackOpeMapCC() [176 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.business.service.JBSbatKKAdChgSodUpd` |
| Layer | Service (Batch processing service layer) |
| Module | `service` (Package: `eo.business.service`) |

## 1. Role

### JBSbatKKAdChgSodUpd.isSecPackOpeMapCC()

This method configures security pack operation mappings during an address change (住所変更) batch process. Its core business purpose is to prepare the data structures needed to inherit optional security-related services when a customer's service contract is transferred from an old address (転居元) to a new address.

The method handles two categories of services. First, it processes **option services** (opSvcKeiSecurityOpList) that are explicitly tied to the address change — specifically McAfee Multi Access (B130), Internet SGW (B131), and Notification Mail Premium (B132). These are security-add-on services that the customer had at their old address and may wish to continue at the new address. The method iterates through this list and, for each non-cancelled option service, records its contract number into the `cancelInfo` mapping along with activation flags and billing code settings.

Second, it processes **discount write services** (wribSvcKeiSecurityOpList) that reference bundled service contracts. It checks whether these are **Security Pack** (W00000010) or **SmartLink Premium** (W00000080) discount types, and if so, sets corresponding target flags on both the cancellation and registration maps. For discount services already in cancelled status (910), the method performs an additional validation query (SELECT_074) to confirm whether the cancellation was due to the address change or a different reason — if it was not, and the record count is zero, the item is skipped from inheritance.

The method implements a **routing/dispatch design pattern**, branching on service code constants to populate distinct fields for each security service type, then consolidates the results into a single `wrib_op_svc_hktgi_upd_map` (the instance-level write operation inheritance update map). If no inheritable option services (McAfee, Internet SGW, or Notification Mail Premium) are found, it logs a business error (EKB0010CW) and increments the error counter — yet still allows processing to continue (non-fatal error).

This method is a shared utility called by the `JBSbatKKAdChgSodUpd.execute()` batch method. It plays a critical role in the address change fulfillment workflow, ensuring that customers' security-related add-on services are properly mapped for either cancellation at the old address and re-registration at the new address, or continued without interruption during the transfer.

## 2. Processing Pattern (Detailed Business Logic)

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

    START --> R1["Retrieve address change details"]
    R1 --> R2["Extract DSL service key number"]
    R2 --> R3["Extract new service key number"]
    R3 --> R4["Retrieve service contract info"]
    R4 --> I1["Initialize wrib_op_svc_hktgi_upd_map if null"]
    I1 --> S1["Set func_code to 1"]
    S1 --> S2["Set base_ymd to opeDate"]
    S2 --> S3["Set hikitugi_um to 1"]
    S3 --> S4["Set ido_div to 00019"]
    S4 --> CINIT["Initialize cancelInfoList"]
    CINIT --> CINFO["Build cancelInfo map"]
    CINFO --> AINIT["Initialize addInfoList"]
    AINIT --> AINFO["Build addInfo map"]
    AINFO --> LOOP1["Loop over opSvcKeiSecurityOpList"]

    LOOP1 --> EX1["Call executeKK_T_OP_SVC_KEI_KK_SELECT_133"]
    EX1 --> CHK1{"Cancellable"}
    CHK1 -->|No| SKIP["Continue"]
    SKIP --> LOOP1
    CHK1 -->|Yes| GETOP["Get opSvcKeiNo and opSvcCd"]

    GETOP --> COND1{"Check opSvcCd"}
    COND1 -->|B130 McAfee| MC["Set mcafee cancel info"]
    COND1 -->|B131 Internet SGW| ISGW["Set Internet SGW cancel and add info"]
    COND1 -->|B132 Notification Mail Premium| NTF["Set Notification Mail Premium cancel and add info"]
    COND1 -->|Other| LOOP1

    MC --> LOOP1
    ISGW --> LOOP1
    NTF --> LOOP1

    LOOP1 --> LOOP2["Loop over wribSvcKeiSecurityOpList"]

    LOOP2 --> EXEC1["Call executeKK_T_WRIB_SVC_KEI_KK_SELECT_011"]
    EXEC1 --> SEL1["Select next from db_KK_T_WRIB_SVC_KEI"]
    SEL1 --> NULLCHK{"Record exists"}
    NULLCHK -->|No| LOOP2
    NULLCHK -->|Yes| GETSTAT["Get wribSvcKeiStat and mskmDtl"]

    GETSTAT --> STATCHK{"Status is 910 Cancelled"}
    STATCHK -->|No| GETWCRIB["Get wribSvcCd"]

    STATCHK -->|Yes| EXEC74["Call executeKK_T_WRIB_SVC_KEI_KK_SELECT_074"]
    EXEC74 --> SEL74["Select next from db_KK_T_WRIB_SVC_KEI_74"]
    SEL74 --> ADCHK{"Different record"}
    ADCHK -->|No| GETWCRIB
    ADCHK -->|Yes| CNTCHK{"cnt equals 0"}
    CNTCHK -->|Yes| LOOP2
    CNTCHK -->|No| GETWCRIB

    GETWCRIB --> SECPACK{"Is security pack W00000010"}

    SECPACK -->|Yes| SEC["Set security pack cancel and add flags"]

    SECPACK -->|No| PKCHK{"Is SmartLink Premium W00000080"}

    PKCHK -->|Yes| PREM["Set premium pack cancel and add flags"]
    PKCHK -->|No| LOOP2

    SEC --> LOOP2
    PREM --> LOOP2

    LOOP2 --> CONTCHK{"Has inheritable option keys"}

    CONTCHK -->|Yes| ADDLIST["Add cancelInfoList and addInfoList to map"]
    CONTCHK -->|No| ERRLOG["Log error and increment error count"]

    ADDLIST --> ENDN(["Return void"])
    ERRLOG --> ENDN
    ENDN --> STOP(["End"])
```

**Constant Resolution:**

| Constant | Resolved Value | Business Meaning |
|----------|---------------|-----------------|
| `JKKStrConst.CD00576_ADCHG_ADD` | `"00019"` | Move notification division - Address Change Registration |
| `JKKStrConst.OP_SVC_CD_MCAFEE_MULTI_ACCSS` | `"B130"` | Option service code - McAfee Multi Access (antivirus) |
| `JKKStrConst.OP_SVC_CD_INETSGWL` | `"B131"` | Option service code - Internet SGW (secure gateway) |
| `JKKStrConst.OP_SVC_CD_NTFMLPRM` | `"B132"` | Option service code - Notification Mail Premium |
| `JKKStrConst.WRIB_SVC_CD_SECURITY_PACK` | `"W00000010"` | Discount service code - Security Pack |
| `JKKStrConst.WRIB_SVC_SMARTLINK_PREMIUM` | `"W00000080"` | Discount service code - SmartLink Premium |
| `JBSbatKKConst.SVC_KEI_STAT_DLS_ZM` | `"910"` | Service contract status - Cancelled/Ended |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `inAdchgNo` | `String` | Address change number (住所変更番号) — the unique identifier for the address change record being processed. Identifies which customer relocation event this batch is handling. Used to look up the old (pre-move) and new (post-move) service contract details. |
| 2 | `opSvcKeiSecurityOpList` | `ArrayList<HashMap<String, Object>>` | List of option service contract records (オプションサービス契約) associated with the address change. Each map contains `op_svc_kei_no` (option service contract number) and `op_svc_cd` (option service code, e.g., B130/B131/B132). Iterated to determine which option services should be cancelled at the old address and registered at the new address. |
| 3 | `wribSvcKeiSecurityOpList` | `ArrayList<HashMap<String, Object>>` | List of discount write service contract records (割引サービス契約) — services with bundled pricing/discounts. Each map contains `wrib_svc_kei_no` (discount service contract number). Used to check if any discount services include security pack or premium pack types that need special inheritance handling. |
| 4 | `inMskmNo` | `String` | Application detail number (申請明細番号) — the top-level application/dossier number for the address change request. Used as a parameter in the SELECT_074 query to validate cancelled discount service records. |

**Instance fields read:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `wrib_op_svc_hktgi_upd_map` | `HashMap<String, Object>` | Instance-level map storing the write operation inheritance update data. Holds func_code, base_ymd, hikitugi_um, ido_div, cancel_info_list, and add_info_list. |
| `opeDate` | `String` | The operational date (処理年月日) — the processing date for this batch run. Used as base_ymd (基準年月日) and passed to SELECT queries. |
| `db_KK_T_WRIB_SVC_KEI` | DB interface | Database accessor for the T_WRIB_SVC_KEI table (discount service contract table). |
| `db_KK_T_WRIB_SVC_KEI_74` | DB interface | Database accessor for the T_WRIB_SVC_KEI_74 table (discount service contract history/secondary). |
| `commonItem` | Base class field | Error tracking container. `addErrorCount(1)` increments the overall error count for the batch. |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JBSbatKKAdChgSodUpd.getAdChgDtlInfo` | (self) | KK_T_ADCHG_DTL | Reads address change detail record to extract pre-move (CHBF_SKBT_NO) and post-move (CHAF_SKBT_NO) service key numbers. |
| R | `JBSbatKKAdChgSodUpd.getSvcKeiInfo` | (self) | KK_T_SVC_KEI | Reads service contract master record (SYSID, MSKM_DTL_NO) for the new service contract. |
| R | `JBSbatKKAdChgSodUpd.getSvkeiLastUpdDtm` | (self) | KK_T_SVC_KEI | Reads the last update timestamp of a service contract, used as the "before update" timestamp for cancellation/registration. |
| R | `JBSbatKKAdChgSodUpd.executeKK_T_OP_SVC_KEI_KK_SELECT_133` | (self) | KK_T_OP_SVC_KEI | Queries whether an option service contract has already been cancelled. Returns true if already cancelled (skip). |
| R | `JBSbatKKAdChgSodUpd.executeKK_T_WRIB_SVC_KEI_KK_SELECT_011` | (self) | KK_T_WRIB_SVC_KEI | Queries a discount service contract record by contract number and date to retrieve its status and associated details. |
| R | `JBSbatKKAdChgSodUpd.executeKK_T_WRIB_SVC_KEI_KK_SELECT_074` | (self) | KK_T_WRIB_SVC_KEI_74 | Queries the discount service contract history (SELECT_074) to verify whether the cancellation was caused by the address change or a different reason. |
| R | `JBSbatKK_T_ADCHG_DTL.getString` | (self) | KK_T_ADCHG_DTL | Reads CHBF_SKBT_NO (pre-move service key number) and CHAF_SKBT_NO (post-move service key number) from address change detail. |
| R | `JBSbatKK_T_SVC_KEI.getString` | (self) | KK_T_SVC_KEI | Reads SYSID and MSKM_DTL_NO from the service contract master. |
| R | `JBSbatKK_T_WRIB_SVC_KEI.getString` | (self) | KK_T_WRIB_SVC_KEI | Reads WRIB_SVC_KEI_STAT (discount service status), WRIB_SVC_CD (discount service code), and MSKM_DTL_NO from discount contract. |
| C | `JKKStrConst.CD00576_ADCHG_ADD` | (self) | - | Constant lookup — value "00019", sets the move notification division to "Address Change Registration" in the update map. |

**Note:** This method is primarily a **data preparation and routing** method — it reads from multiple tables (KK_T_ADCHG_DTL, KK_T_SVC_KEI, KK_T_OP_SVC_KEI, KK_T_WRIB_SVC_KEI, KK_T_WRIB_SVC_KEI_74) but does not write data itself. It populates in-memory maps (`cancelInfo`, `addInfo`, `cancelInfoList`, `addInfoList`) which are later consumed by upstream callers to perform the actual contract updates and registrations.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Batch: JBSbatKKAdChgSodUpd | `JBSbatKKAdChgSodUpd.execute()` → `isSecPackOpeMapCC(inAdchgNo, opSvcKeiSecurityOpList, wribSvcKeiSecurityOpList, inMskmNo)` | `getAdChgDtlInfo [R] KK_T_ADCHG_DTL`, `getSvcKeiInfo [R] KK_T_SVC_KEI`, `executeKK_T_OP_SVC_KEI_KK_SELECT_133 [R] KK_T_OP_SVC_KEI`, `executeKK_T_WRIB_SVC_KEI_KK_SELECT_011 [R] KK_T_WRIB_SVC_KEI`, `executeKK_T_WRIB_SVC_KEI_KK_SELECT_074 [R] KK_T_WRIB_SVC_KEI_74`, `printBusinessErrorLog [-]`, `add ErrorCount [-]` |

This method is called from the batch entry point `JBSbatKKAdChgSodUpd.execute()`, which orchestrates the full address change processing workflow. The terminal operations reach into five database tables (KK_T_ADCHG_DTL, KK_T_SVC_KEI, KK_T_OP_SVC_KEI, KK_T_WRIB_SVC_KEI, KK_T_WRIB_SVC_KEI_74) and log errors when no inheritable option services are found.

## 6. Per-Branch Detail Blocks

**Block 1** — INIT (setup) (L3505)

> Retrieve address change detail and service contract information, then initialize the update map and build cancellation/registration base info.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `getAdChgDtlInfo(inAdchgNo)` |
| 2 | SET | `dslSvcKeiNo = adchgDtlInfo.getString(CHBF_SKBT_NO)` // DSL (pre-move) service key number |
| 3 | SET | `newSvcKeiNo = adchgDtlInfo.getString(CHAF_SKBT_NO)` // new service key number |
| 4 | CALL | `getSvcKeiInfo(newSvcKeiNo)` |
| 5 | IF | `wrib_op_svc_hktgi_upd_map == null` |
| 5.1 | SET | `wrib_op_svc_hktgi_upd_map = new HashMap<String,Object>()` |
| 6 | SET | `wrib_op_svc_hktgi_upd_map.put("func_code", "1")` // Function code: 1 |
| 7 | SET | `wrib_op_svc_hktgi_upd_map.put("base_ymd", opeDate)` // Reference date |
| 8 | SET | `wrib_op_svc_hktgi_upd_map.put("hikitugi_um", "1")` // Inheritance Yes (継承有無: Yes) |
| 9 | SET | `wrib_op_svc_hktgi_upd_map.put("ido_div", "00019")` // [CD00576_ADCHG_ADD = "00019"] Move notification division - Address Change Registration |
| 10 | SET | `cancelInfoList = new ArrayList<Map<String, String>>()` // Cancellation list (解約用リスト) |
| 11 | SET | `cancelInfo = new HashMap<String, String>()` |
| 12 | SET | `cancelInfo.put("sysid", svcKeiInfo.getString(SYSID))` |
| 13 | SET | `cancelInfo.put("svc_kei_no", dslSvcKeiNo)` // Old service contract number |
| 14 | SET | `cancelInfo.put("mskm_dtl_no", svcKeiInfo.getString(MSKM_DTL_NO))` |
| 15 | SET | `cancelInfo.put("upd_dtm_bf", getSvkeiLastUpdDtm(dslSvcKeiNo))` // Pre-update timestamp |
| 16 | SET | `addInfoList = new ArrayList<Map<String, String>>()` // Registration list (登録用リスト) |
| 17 | SET | `addInfo = new HashMap<String, String>()` |
| 18 | SET | `addInfo.put("sysid", svcKeiInfo.getString(SYSID))` |
| 19 | SET | `addInfo.put("svc_kei_no", newSvcKeiNo)` // New service contract number |
| 20 | SET | `addInfo.put("mskm_dtl_no", svcKeiInfo.getString(MSKM_DTL_NO))` |
| 21 | SET | `addInfo.put("upd_dtm_bf", getSvkeiLastUpdDtm(newSvcKeiNo))` // Pre-update timestamp |

**Block 2** — FOR_LOOP (option service iteration) (L3556)

> Iterate through option service contract list. For each, check if already cancelled (skip if so), then branch by option service code to populate cancel/add info.

| # | Type | Code |
|---|------|------|
| 1 | FOR | `for(int opIdx = 0; opIdx < opSvcKeiSecurityOpList.size(); opIdx++)` |
| 2 | SET | `opSvcKei = opSvcKeiSecurityOpList.get(opIdx)` |
| 3 | SET | `opSvcKeiNo = (String) opSvcKei.get("op_svc_kei_no")` |
| 4 | SET | `opSvcCd = (String) opSvcKei.get("op_svc_cd")` |
| 5 | CALL | `executeKK_T_OP_SVC_KEI_KK_SELECT_133(opSvcKeiNo, opeDate)` // Check if already cancelled |
| 6 | IF | **result is true** (already cancelled) |
| 6.1 | EXEC | `continue` // Skip to next iteration — already cancelled, no option inheritance needed |

**Block 2.1** — IF/ELSE-IF/ELSE (option service code branching) (L3565)

> Branch based on option service code to populate type-specific cancel and add info.

| # | Type | Code |
|---|------|------|
| 1 | IF | `JKKStrConst.OP_SVC_CD_MCAFEE_MULTI_ACCSS ("B130")` **equals** `opSvcCd` |
| 1.1 | SET | `cancelInfo.put("mcafee_op_svc_kei_no", opSvcKeiNo)` // McAfee option service contract number for cancellation |
| 2 | ELSE-IF | `JKKStrConst.OP_SVC_CD_INETSGWL ("B131")` **equals** `opSvcCd` |
| 2.1 | SET | `cancelInfo.put("inetsgwl_op_svc_kei_no", opSvcKeiNo)` // Internet SGW option service contract number for cancellation |
| 2.2 | SET | `cancelInfo.put("inetsgwl_tg_flg", "1")` // Internet SGW target flag |
| 2.3 | SET | `cancelInfo.put("inetsgwl_chrg_hichrg_cd", "")` // Internet SGW non-billing code (empty) |
| 2.4 | SET | `addInfo.put("inetsgwl_tg_flg", "1")` // Internet SGW target flag for registration |
| 2.5 | SET | `addInfo.put("inetsgwl_start_ymd", opeDate)` // Internet SGW desired start date |
| 3 | ELSE-IF | `JKKStrConst.OP_SVC_CD_NTFMLPRM ("B132")` **equals** `opSvcCd` |
| 3.1 | SET | `cancelInfo.put("ntfmlprm_op_svc_kei_no", opSvcKeiNo)` // Notification Mail Premium option service contract number for cancellation |
| 3.2 | SET | `cancelInfo.put("ntfmlprm_tg_flg", "1")` // Notification Mail Premium target flag |
| 3.3 | SET | `cancelInfo.put("ntfmlprm_chrg_hichrg_cd", "")` // Notification Mail Premium non-billing code (empty) |
| 3.4 | SET | `addInfo.put("ntfmlprm_tg_flg", "1")` // Notification Mail Premium target flag for registration |
| 3.5 | SET | `addInfo.put("ntfmlprm_start_ymd", opeDate)` // Notification Mail Premium desired start date |
| 4 | ELSE | // Other service codes: no special handling |

**Block 3** — FOR_LOOP (discount service iteration) (L3590)

> Iterate through discount write service contract list. For each, query the contract record, check cancellation status, and branch by discount service code.

| # | Type | Code |
|---|------|------|
| 1 | FOR | `for(int wribIdx = 0; wribIdx < wribSvcKeiSecurityOpList.size(); wribIdx++)` |
| 2 | SET | `opSvcKei = wribSvcKeiSecurityOpList.get(wribIdx)` |
| 3 | SET | `wribSvcKeiNo = (String) opSvcKei.get("wrib_svc_kei_no")` |
| 4 | SET | `paramWribSvcKei = {wribSvcKeiNo, opeDate}` |
| 5 | CALL | `executeKK_T_WRIB_SVC_KEI_KK_SELECT_011(paramWribSvcKei)` |
| 6 | SET | `wribSvcKeiMap = db_KK_T_WRIB_SVC_KEI.selectNext()` |

**Block 3.1** — IF (null check on discount service record) (L3596)

> If the discount service contract record exists, process its status and service code.

| # | Type | Code |
|---|------|------|
| 1 | IF | `wribSvcKeiMap != null` |
| 2 | SET | `wribSvcKeiStat = nullToBlank(Rtrim(wribSvcKeiMap.getString(WRIB_SVC_KEI_STAT)))` // Trimmed discount service status |
| 3 | SET | `mskmDtl = nullToBlank(Rtrim(wribSvcKeiMap.getString(MSKM_DTL_NO)))` // Trimmed application detail number |

**Block 3.1.1** — IF (cancelled status validation) (L3598)

> If the discount service is already cancelled (status "910"), run an additional query to check if cancellation was caused by address change.

| # | Type | Code |
|---|------|------|
| 1 | IF | `JBSbatKKConst.SVC_KEI_STAT_DLS_ZM ("910")` **equals** `wribSvcKeiStat` [Cancelled/Ended] |
| 1.1 | SET | `wribSvcKeiNo = (String) opSvcKei.get("wrib_svc_kei_no")` // Re-read from map |
| 1.2 | SET | `paramWribSvcKei_74 = {inMskmNo, mskmDtl, wribSvcKeiNo, opeDate}` |
| 1.3 | CALL | `executeKK_T_WRIB_SVC_KEI_KK_SELECT_074(paramWribSvcKei_74)` // Additional history check |
| 1.4 | SET | `wribSvcKeiMap_74 = db_KK_T_WRIB_SVC_KEI_74.selectNext()` |
| 1.5 | IF | `wribSvcKeiMap_74 != wribSvcKeiMap` [Different record — not cancelled due to address change] |
| 1.5.1 | SET | `cnt = nullToBlank(Rtrim(wribSvcKeiMap.getString("cnt")))` |
| 1.5.2 | IF | `"0"` **equals** `cnt` |
| 1.5.2.1 | EXEC | `continue` // Skip — cancelled for non-address-change reason with zero count |
| 2 | ELSE | [Not cancelled] — fall through to service code check |

**Block 3.2** — IF/IF (discount service code branching) (L3613)

> Check the discount service code to determine if it is a Security Pack or SmartLink Premium type, and set the corresponding target flags.

| # | Type | Code |
|---|------|------|
| 1 | SET | `wribSvcCd = Rtrim(wribSvcKeiMap.getString(WRIB_SVC_CD))` |
| 2 | IF | `JKKStrConst.WRIB_SVC_CD_SECURITY_PACK ("W00000010")` **equals** `wribSvcCd` [Security Pack] |
| 2.1 | SET | `cancelInfo.put("security_pack_tg_flg", "1")` // Security Pack target flag for cancellation |
| 2.2 | SET | `cancelInfo.put("security_pack_chrg_hichrg_cd", "")` // Security Pack non-billing code (empty) |
| 2.3 | SET | `addInfo.put("security_pack_tg_flg", "1")` // Security Pack target flag for registration |
| 3 | IF | `JKKStrConst.WRIB_SVC_SMARTLINK_PREMIUM ("W00000080")` **equals** `wribSvcCd` [SmartLink Premium] |
| 3.1 | SET | `cancelInfo.put("premium_pack_tg_flg", "1")` // Premium Pack target flag for cancellation |
| 3.2 | SET | `cancelInfo.put("premium_pack_chrg_hichrg_cd", "")` // Premium Pack non-billing code (empty) |
| 3.3 | SET | `addInfo.put("premium_pack_tg_flg", "1")` // Premium Pack target flag for registration |

**Block 4** — IF/ELSE (inheritable option service check) (L3635)

> After both loops complete, check whether any inheritable option services (McAfee, Internet SGW, or Notification Mail Premium) were found. If yes, assemble the final data into `wrib_op_svc_hktgi_upd_map`. If no, log an error but continue processing.

| # | Type | Code |
|---|------|------|
| 1 | IF | `cancelInfo.containsKey("mcafee_op_svc_kei_no")` **OR** `cancelInfo.containsKey("inetsgwl_op_svc_kei_no")` **OR** `cancelInfo.containsKey("ntfmlprm_op_svc_kei_no")` [Has inheritable option services] |
| 1.1 | SET | `cancelInfoList.add(cancelInfo)` // Add cancellation map to list |
| 1.2 | SET | `addInfoList.add(addInfo)` // Add registration map to list |
| 1.3 | SET | `wrib_op_svc_hktgi_upd_map.put("cancel_info_list", cancelInfoList)` |
| 1.4 | SET | `wrib_op_svc_hktgi_upd_map.put("add_info_list", addInfoList)` |
| 2 | ELSE | [No inheritable option services found] |
| 2.1 | SET | `mesInfo = "Inheritable option services (McAfee Multi Access, Internet SGW, Notification Mail Premium) do not exist (address change number: " + inAdchgNo + ")"` |
| 2.2 | CALL | `printBusinessErrorLog(EKKB0010CW, mesInfo)` // Log error (non-fatal) |
| 2.3 | CALL | `commonItem.addErrorCount(1)` // Increment error counter |

**Block 5** — RETURN (L3658)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return;` // void method — processing complete |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `inAdchgNo` | Field | Address change number (住所変更番号) — unique identifier for an address change event in the batch |
| `opSvcKeiSecurityOpList` | Field | Option service contract list (オプションサービス契約) — list of optional add-on service contracts tied to the address change |
| `wribSvcKeiSecurityOpList` | Field | Discount write service contract list (割引サービス契約) — list of discounted/bundled service contracts to check for security-related entries |
| `inMskmNo` | Field | Application detail number (申請明細番号) — top-level application dossier number for the address change request |
| `dslSvcKeiNo` | Field | DSL service key number — the pre-move (転居元) service contract number, derived from CHBF_SKBT_NO |
| `newSvcKeiNo` | Field | New service key number — the post-move (転居先) service contract number, derived from CHAF_SKBT_NO |
| `cancelInfo` | Field | Cancellation information map — holds data needed to cancel services at the old address |
| `addInfo` | Field | Registration information map — holds data needed to register services at the new address |
| `wrib_op_svc_hktgi_upd_map` | Field | Write operation service inheritance update map (割引オプションサービス継承更新マップ) — instance-level map storing all update parameters for the address change inheritance process |
| `wrib_op_svc_hktgi_upd_map.func_code` | Field | Function code — set to "1" to identify the operation type |
| `wrib_op_svc_hktgi_upd_map.base_ymd` | Field | Reference date (基準年月日) — the operational date used for all date-based operations |
| `wrib_op_svc_hktgi_upd_map.hikitugi_um` | Field | Inheritance presence (継承有無) — set to "1" indicating inheritance is requested |
| `wrib_op_svc_hktgi_upd_map.ido_div` | Field | Move notification division (異動区分) — set to "00019" for address change registration |
| `wrib_op_svc_hktgi_upd_map.cancel_info_list` | Field | List of cancellation info maps — populated when inheritable option services exist |
| `wrib_op_svc_hktgi_upd_map.add_info_list` | Field | List of registration info maps — populated when inheritable option services exist |
| `opeDate` | Field | Operational date (処理年月日) — batch processing date, used as base_ymd |
| B130 | Code | Option service code - McAfee Multi Access (マカフィーマルチアクセス) — antivirus security add-on service |
| B131 | Code | Option service code - Internet SGW (インターネットセキュリティ) — secure gateway service for network protection |
| B132 | Code | Option service code - Notification Mail Premium (ノーテンファンメールプレミアム) — premium notification mail service |
| W00000010 | Code | Discount service code - Security Pack (セキュリティパック) — bundled security discount service |
| W00000080 | Code | Discount service code - SmartLink Premium (スマートリンクプレミアム) — bundled premium discount service |
| "00019" | Code | Move notification division code - Address Change Registration (住所変更・登録) — indicates this is an address change registration event |
| "910" | Code | Service contract status - Cancelled/Ended (解約済) — service contract is in a cancelled or terminated state |
| CHBF_SKBT_NO | Field | Pre-move service bundle number (変更前サービス束番号) — service contract number before address change |
| CHAF_SKBT_NO | Field | Post-move service bundle number (変更後サービス束番号) — service contract number after address change |
| WRIB_SVC_KEI_STAT | Field | Discount service contract status (割引サービス契約ステータス) — e.g., "910" means cancelled |
| WRIB_SVC_CD | Field | Discount service code (割引サービスコード) — identifies the type of discount/bundled service |
| hikitugi_um | Field | Inheritance presence flag (継承有無) — "1" = inherit, indicates whether to carry over services to the new address |
| ido_div | Field | Move notification division (異動区分) — classifies the type of move/notification event |
| security_pack_tg_flg | Field | Security Pack target flag (セキュリティパック対象フラグ) — set to "1" to indicate this service requires inheritance handling |
| premium_pack_tg_flg | Field | Premium Pack target flag (プレミアムパック対象フラグ) — set to "1" for SmartLink Premium inheritance |
| inetsgwl_tg_flg | Field | Internet SGW target flag (インターネットセキュリティ対象フラグ) — set to "1" for Internet SGW inheritance |
| inetsgwl_chrg_hichrg_cd | Field | Internet SGW billing non-billing code (インターネットセキュリティ課金非課金コード) — empty means no billing restriction |
| ntfmlprm_tg_flg | Field | Notification Mail Premium target flag (ノーテンファンメールプレミアム対象フラグ) — set to "1" for Notification Mail Premium inheritance |
| ntfmlprm_chrg_hichrg_cd | Field | Notification Mail Premium billing non-billing code — empty means no billing restriction |
| inetsgwl_start_ymd | Field | Internet SGW desired start date (インターネットセキュリティ利用開始希望日) — the date from which the service should be active at the new address |
| ntfmlprm_start_ymd | Field | Notification Mail Premium desired start date (ノーテンファンメールプレミアム利用開始希望日) — the date from which the service should be active at the new address |
| EKKB0010CW | Code | Error message code — logged when no inheritable option services exist for a customer during address change |
| getAdChgDtlInfo | Method | Retrieve address change detail information from KK_T_ADCHG_DTL table |
| getSvcKeiInfo | Method | Retrieve service contract master information from KK_T_SVC_KEI table |
| executeKK_T_OP_SVC_KEI_KK_SELECT_133 | Method | Query option service contract to check cancellation status |
| executeKK_T_WRIB_SVC_KEI_KK_SELECT_011 | Method | Query discount service contract by contract number and date |
| executeKK_T_WRIB_SVC_KEI_KK_SELECT_074 | Method | Query discount service contract history to verify cancellation reason |
| KK_T_ADCHG_DTL | Table | Address change detail table — stores address change records with pre/post move service key numbers |
| KK_T_SVC_KEI | Table | Service contract master table — stores service contract information (SYSID, MSKM_DTL_NO, status, etc.) |
| KK_T_OP_SVC_KEI | Table | Option service contract table — stores optional add-on service contracts (McAfee, Internet SGW, etc.) |
| KK_T_WRIB_SVC_KEI | Table | Discount service contract table — stores bundled/discounted service contracts |
| KK_T_WRIB_SVC_KEI_74 | Table | Discount service contract history table (74) — used to verify cancellation reasons for discount services |
