# Business Logic — JBSBatKKKkOpDlRvAdd.insertKkopSvcKei() [218 LOC]

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

## 1. Role

### JBSBatKKKkOpDlRvAdd.insertKkopSvcKei()

This method performs the core processing for **Machine Operation Service Contract Reservation Cancellation Fix** — a batch operation that finalizes a pre-registered service cancellation reservation for a machine operation (broadband/telecom) service. When a customer has scheduled a future cancellation (stored in the `KK_T_IDO_RSV` reservation table), this method executes the reservation by querying the existing service contract record (`KK_T_KKOP_SVC_KEI`), generating a new primary key for the updated row, applying billing rule logic via `RULE0091` to determine appropriate service billing dates, and then inserting the fully resolved contract record with cancellation status set to 910 ("Contract Canceled") and cancellation reason set to "01" (Normal Cancellation). The method implements a **builder-delegation pattern**: it gathers all existing contract field values from the queried entity, overlays the cancellation-related fields with fixed resolution values (cancellation code, completion flag, reservation-fixed dates), and delegates the final persistence to `executeKK_T_KKOP_SVC_KEI_PKINSERT`. Its role in the larger system is the transactional anchor of the reservation-fixing batch run — it transforms a pending reservation intent into a confirmed, immutable service contract record with full audit trail.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["insertKkopSvcKei()"])
    START --> A["Prepare param1: kkop_svc_kei_no, opeDate"]
    A --> B["executeKK_T_KKOP_SVC_KEI_KK_SELECT_001(param1)"]
    B --> C["Select next primary key from KK_T_KKOP_SVC_KEI"]
    C --> D["Calculate svc_chrg_endymd = adjustDate(idoRsvAplyYmd, -1)"]
    D --> E["callRule0091001(kkopSvKeiKeyMap, ...)"]
    E --> F["ruleDate returned by RULE0091"]
    F --> G["Allocate setParam array (size 74)"]
    G --> H["Fill setParam[0-8]: KKOP_SVC_KEI_NO, sysDate, status, codes, mskm_dtl_no"]
    H --> I["setParam[9]: opeDate (Reservation application date)"]
    I --> J["setParam[10]: RSV_CL_YMD from keyMap"]
    J --> K["setParam[11]: RSV_APLY_CD_RSV_FIX = '2' (Reservation fixed)"]
    K --> L["setParam[12-22]: Copy various date fields from keyMap"]
    L --> M["setParam[23]: idoRsvAplyYmd (Service end date)"]
    M --> N{"Is ruleDate = SPACE?"}
    N -->|Yes| O["setParam[24] = setParam[23]"]
    N -->|No| P["setParam[24] = ruleDate"]
    O --> Q["setParam[25]: svc_chrg_endymd"]
    P --> Q
    Q --> R["setParam[26-28]: continuation and plan start dates from keyMap"]
    R --> S["setParam[29]: idoRsvAplyYmd (Plan end date)"]
    S --> T{"Is ruleDate = SPACE?"}
    T -->|Yes| U["setParam[30] = setParam[23]"]
    T -->|No| V["setParam[30] = ruleDate"]
    U --> W["setParam[31]: adjustDate(idoRsvAplyYmd, -1)"]
    V --> W
    W --> X["setParam[32-47]: Cancel, stop, pause dates and codes from keyMap"]
    X --> Y["setParam[48]: idoRsvAplyYmd (Service contract end date)"]
    Y --> Z["setParam[49]: SVC_DLRE_CD_01 = '01' (Normal cancellation)"]
    Z --> AA["setParam[50-51]: cancellation memo and date from keyMap"]
    AA --> AB["setParam[52]: FIN_FLG_1 = '1' (Procedure completed)"]
    AB --> AC["setParam[53]: SPACE (Recovery date)"]
    AC --> AD["setParam[54-66]: Miscellaneous date, code, and flag fields from keyMap"]
    AD --> AE["setParam[73]: NEW_PCRS_APLY_FLG from keyMap"]
    AE --> AF["executeKK_T_KKOP_SVC_KEI_PKINSERT(setParam)"]
    AF --> END_NODE(["Return"])
```

**CRITICAL — Constant Resolution:**

| Constant | Actual Value | Business Meaning |
|----------|-------------|-----------------|
| `JBSbatKKConst.CD01616_KKOP_SVC_KEI_STAT_910` | `"910"` | Machine operation service contract status: Contract Canceled |
| `JBSbatKKConst.CD00879_SVC_DLRE_CD_01` | `"01"` | Service cancellation reason code: Normal Cancellation |
| `JBSbatKKConst.CD01359_FIN_FLG_1` | `"1"` | Service cancellation procedure completion flag: Completed |
| `JKKBatConst.RSV_APLY_CD_RSV_FIX` | `"2"` | Reservation application code: Reservation Fixed |
| `JKKBatConst.SPACE` | `" "` | Blank/space string (used as null-equivalent) |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `kkop_svc_kei_no` | `String` | Machine operation service contract number — the unique identifier of the service contract record to be processed. Used as the primary lookup key to query the existing contract from `KK_T_KKOP_SVC_KEI`. |
| 2 | `gene_add_dtm` | `String` | Registration date and time — the timestamp when the original service contract was registered. Passed to the rule engine for billing rule evaluation. |
| 3 | `plan_chrg_staymd` | `String` | Plan charge start date — the date from which the plan-level billing starts. Used by the RULE0091 engine as a reference date for billing date calculations. |
| 4 | `mskm_dtl_no` | `String` | Application detail number — the detail-level identifier for the service application. Stored in `setParam[8]` for audit and traceability. |
| 5 | `ido_div` | `String` | Movement division — a classification code indicating the type of service change/movement (e.g., new installation, transfer, modification). Passed to the rule engine for conditional billing logic. |
| 6 | `sysDate` | `String` | System date — used as the registered date and time (`setParam[1]`) for the new contract row. Represents the batch processing date. |
| 7 | `svc_kei_no` | `String` | Service contract number — the higher-level service contract identifier. Used by the `isKakinCheck` method inside the rule engine to determine billing applicability during cancellation. |
| 8 | `inMap` | `JBSbatServiceInterfaceMap` | Input message map — carries interface data including CSV-parsable fields (e.g., `KKTK_SVC_KEI_NO`, `GENE_ADD_DTM`) used by the rule engine for billing decision logic. |
| 9 | `idoRsvAplyYmd` | `String` | Reservation application date — the effective date on which the reservation cancellation is applied. This is the pivotal date: it replaces `opeDate` in multiple fields (service end date, plan end date, contract end date, service cancellation date) as part of the v7.00.05 fix for cancellation date accuracy. |

**Instance fields read by the method:**
| Field | Type | Business Description |
|-------|------|---------------------|
| `this.opeDate` | `String` | Operation date — the batch execution date used in the initial select query and as the reservation application date (`setParam[9]`). |
| `this.db_KK_T_KKOP_SVC_KEI` | `JBSbatSQLAccess` | Database access object for the `KK_T_KKOP_SVC_KEI` table, used to query and insert records. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JBSBatKKKkOpDlRvAdd.executeKK_T_KKOP_SVC_KEI_KK_SELECT_001` | (SQL key: KK_SELECT_001) | `KK_T_KKOP_SVC_KEI` | Selects the existing machine operation service contract record by contract number for processing. |
| R | `db_KK_T_KKOP_SVC_KEI.selectNext` | (SQL key: KK_SELECT_001) | `KK_T_KKOP_SVC_KEI` | Generates and retrieves the next primary key value from the sequence for the new contract row. |
| R | `JBSbatKK_T_KKOP_SVC_KEI.getString(...)` | - | `KK_T_KKOP_SVC_KEI` | Reads 60+ field values (dates, codes, flags) from the queried contract record to populate the output parameter array. |
| R | `JKKBatConst` (field access) | - | - | Reads constant values: `RSV_APLY_CD_RSV_FIX = "2"`, `SPACE = " "`. |
| R | `JBSbatKKConst` (field access) | - | - | Reads constant values: `CD01616_KKOP_SVC_KEI_STAT_910 = "910"`, `CD00879_SVC_DLRE_CD_01 = "01"`, `CD01359_FIN_FLG_1 = "1"`. |
| R | `JBSbatDateUtil.adjustDate` | - | - | Date arithmetic utility: computes `svc_chrg_endymd` as `idoRsvAplyYmd - 1 day`, and `setParam[31]` as `idoRsvAplyYmd - 1 day`. |
| - | `JBSBatKKKkOpDlRvAdd.callRule0091001` | (RULE0091001) | - | Invokes the RULE0091 billing rule engine to determine the appropriate billing start date based on service conditions, plan, and movement division. Returns `ruleDate` used for service charge start and plan charge start fields. |
| C | `JBSBatKKKkOpDlRvAdd.executeKK_T_KKOP_SVC_KEI_PKINSERT` | (SQL key: KK_SELECT_001) | `KK_T_KKOP_SVC_KEI` | Inserts the fully assembled 74-element parameter array as a new row into the machine operation service contract table, completing the reservation cancellation fix. |

### Rule Engine Internal Calls (within `callRule0091001`):

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JBSbatKKIFM554.getString` | - | - | Reads interface data (`KKTK_SVC_KEI_NO`, `GENE_ADD_DTM`) from the input map via CSV parsing. |
| - | `JCCBatCommon.createSokanRuleEngine` | - | - | Creates the RULE0091 XML rule engine handler in single-mode processing. |
| - | `JCCBatCommon.getCheckResultArray` | - | - | Executes the RULE0091 rule against the billing context map, returns the computed standard date (`STD_DT`) that determines which reference date to use for billing. |
| R | `JBSbatKKKkOpDlRvAdd.isKakinCheck` | - | - | Determines whether cancellation charges apply by comparing service billing conditions. |

## 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: `executeKK_T_KKOP_SVC_KEI_PKINSERT` [C], `getString` [R], `getString` [R], `getString` [R], `getString` [R], `getString` [R], `getString` [R], `getString` [R], `getString` [R], `getString` [R], `getString` [R], `getString` [R], `getString` [R], `getString` [R], `getString` [R], `getString` [R], `getString` [R], `getString` [R], `getString` [R], `getString` [R]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Batch: `JBSBatKKKkOpDlRvAdd.execute()` | `JBSBatKKKkOpDlRvAdd.execute()` → `insertKkopSvcKei()` | `executeKK_T_KKOP_SVC_KEI_PKINSERT [C] KK_T_KKOP_SVC_KEI` |

**Description:** This method is called directly from the `execute()` method of `JBSBatKKKkOpDlRvAdd` — the main entry point of the Machine Operation Service Contract Reservation Cancellation Fix batch. The batch runs periodically to process all pending reservation cancellations, and for each reservation, it invokes `insertKkopSvcKei` to finalize the contract record with cancellation status.

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] `(Prepare lookup parameters)` (L2490)

> Builds the parameter array for the select query and executes it to retrieve the existing service contract record.

| # | Type | Code |
|---|------|------|
| 1 | SET | `param1 = new String[2]` // Allocate 2-element string array |
| 2 | SET | `param1[0] = kkop_svc_kei_no` // Contract number as lookup key [-> parameter value] |
| 3 | SET | `param1[1] = this.opeDate` // Operation date [-> instance field] |
| 4 | CALL | `executeKK_T_KKOP_SVC_KEI_KK_SELECT_001(param1)` // Query existing contract from KK_T_KKOP_SVC_KEI |

**Block 2** — [EXEC] `(Generate next primary key)` (L2495)

> Retrieves the next available primary key from the database sequence.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kkopSvKeiKeyMap = db_KK_T_KKOP_SVC_KEI.selectNext()` // Next PK from KK_T_KKOP_SVC_KEI sequence |

**Block 3** — [SET] `(Calculate service charge end date)` (L2498)

> v7.00.05 fix: changed from `this.opeDate` to `idoRsvAplyYmd` for accurate cancellation date.

| # | Type | Code |
|---|------|------|
| 1 | SET | `svc_chrg_endymd = JBSbatDateUtil.adjustDate(idoRsvAplyYmd, -1)` // Service charge end date = reservation apply date minus 1 day |

**Block 4** — [CALL] `(Invoke billing rule engine)` (L2505)

> Calls RULE0091 to determine the appropriate billing reference date based on service conditions.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ruleDate = callRule0091001(kkopSvKeiKeyMap, ido_div, plan_chrg_staymd, svc_chrg_endymd, svc_kei_no, gene_add_dtm, inMap)` // Returns STD_DT reference date or SPACE |

**Block 5** — [SET] `(Allocate output parameter array)` (L2507)

> Prepares the 74-element array that will hold all fields for the new contract row.

| # | Type | Code |
|---|------|------|
| 1 | SET | `setParam = new String[74]` // 74-element output parameter array |

**Block 6** — [SET] `(Fill setParam[0-8]: Contract identification and system fields)` (L2510-L2519)

> Populates the first 9 elements with contract number, system date, status, various codes, and application detail number.

| # | Type | Code |
|---|------|------|
| 1 | SET | `setParam[0] = kkopSvKeiKeyMap.getString(KKOP_SVC_KEI_NO)` // Machine operation service contract number [-> keyMap] |
| 2 | SET | `setParam[1] = sysDate` // Registered date and time [-> parameter] |
| 3 | SET | `setParam[2] = JBSbatKKConst.CD01616_KKOP_SVC_KEI_STAT_910` // Status: Contract Canceled [-> CONSTANT="910"] |
| 4 | SET | `setParam[3] = kkopSvKeiKeyMap.getString(KKOP_SVC_CD)` // Machine operation service code [-> keyMap] |
| 5 | SET | `setParam[4] = kkopSvKeiKeyMap.getString(PCRS_CD)` // Billing code [-> keyMap] |
| 6 | SET | `setParam[5] = kkopSvKeiKeyMap.getString(PPLAN_CD)` // Billing plan code [-> keyMap] |
| 7 | SET | `setParam[6] = kkopSvKeiKeyMap.getString(KKTK_SVC_KEI_NO)` // Machine provided service contract number [-> keyMap] |
| 8 | SET | `setParam[7] = kkopSvKeiKeyMap.getString(SYSID)` // System ID [-> keyMap] |
| 9 | SET | `setParam[8] = mskm_dtl_no` // Application detail number [-> parameter] |

**Block 7** — [SET] `(Fill setParam[9-22]: Reservation and service dates)` (L2521-L2544)

> Populates reservation application date, cancellation date, application code, trial dates, registration dates, service start date, and service end date.

| # | Type | Code |
|---|------|------|
| 1 | SET | `setParam[9] = this.opeDate` // Reservation application date [-> instance field] |
| 2 | SET | `setParam[10] = kkopSvKeiKeyMap.getString(RSV_CL_YMD)` // Reservation cancellation date [-> keyMap] |
| 3 | SET | `setParam[11] = JKKBatConst.RSV_APLY_CD_RSV_FIX` // Reservation application code [-> CONSTANT="2" (Reservation fixed)] |
| 4 | SET | `setParam[12] = kkopSvKeiKeyMap.getString(FTRIAL_KANYU_YMD)` // Trial registration date [-> keyMap] |
| 5 | SET | `setParam[13] = kkopSvKeiKeyMap.getString(FTRIAL_PRD_ENDYMD)` // Trial period end date [-> keyMap] |
| 6 | SET | `setParam[14] = kkopSvKeiKeyMap.getString(HONKANYU_YMD)` // Actual registration date [-> keyMap] |
| 7 | SET | `setParam[15] = kkopSvKeiKeyMap.getString(HONKANYU_IKO_KIGEN_YMD)` // Actual registration deadline date [-> keyMap] |
| 8 | SET | `setParam[16] = kkopSvKeiKeyMap.getString(SVC_USE_STA_KIBO_YMD)` // Service use start desired date [-> keyMap] |
| 9 | SET | `setParam[17] = kkopSvKeiKeyMap.getString(RSV_TSTA_KIBO_YMD)` // Reservation start desired date [-> keyMap] |
| 10 | SET | `setParam[18] = kkopSvKeiKeyMap.getString(SHOUSA_YMD)` // Inspection date [-> keyMap] |
| 11 | SET | `setParam[19] = kkopSvKeiKeyMap.getString(SHOUSA_CL_YMD)` // Inspection cancellation date [-> keyMap] |
| 12 | SET | `setParam[20] = kkopSvKeiKeyMap.getString(SKEKKA_SEND_CD)` // Review result transmission code [-> keyMap] |
| 13 | SET | `setParam[21] = kkopSvKeiKeyMap.getString(KEI_CNC_YMD)` // Contract conclusion date [-> keyMap] |
| 14 | SET | `setParam[22] = kkopSvKeiKeyMap.getString(SVC_STAYMD)` // Service start date [-> keyMap] |
| 15 | SET | `setParam[23] = idoRsvAplyYmd` // Service end date [-> parameter, v7.00.05 fix] |

**Block 8** — [IF/ELSE] `(Service charge start date: ruleDate vs opeDate)` (L2545-L2552)

> v7.00.05 fix: Determines service charge start date based on RULE0091 output. If the rule returns a blank (SPACE), uses the service end date; otherwise uses the rule-computed date.

| # | Type | Code |
|---|------|------|
| 1 | IF | `JKKBatConst.SPACE.equals(ruleDate)` [CONSTANT_SPACE=" "] |
| 1.1 | SET | `setParam[24] = setParam[23]` // Use service end date as charge start [-> setParam[23]] |
| 1.2 | ELSE | |
| 1.2.1 | SET | `setParam[24] = ruleDate` // Use rule-computed date as charge start [-> callRule0091001 result] |

**Block 9** — [SET] `(Service charge end date)` (L2557)

> v7.00.05 fix: Uses the pre-calculated `svc_chrg_endymd` instead of `opeDate`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `setParam[25] = svc_chrg_endymd` // Service charge end date [-> pre-calculated: idoRsvAplyYmd - 1] |

**Block 10** — [SET] `(Fill setParam[26-31]: Continuation, plan dates, and plan charge period)` (L2559-L2580)

> Populates continuation service dates, plan start/end dates, and plan charge start/end dates.

| # | Type | Code |
|---|------|------|
| 1 | SET | `setParam[26] = kkopSvKeiKeyMap.getString(KEIZK_SVC_STAYMD)` // Continuation service start date [-> keyMap] |
| 2 | SET | `setParam[27] = kkopSvKeiKeyMap.getString(KEIZK_SVC_CHRG_STAYMD)` // Continuation service charge start date [-> keyMap] |
| 3 | SET | `setParam[28] = kkopSvKeiKeyMap.getString(PLAN_STAYMD)` // Plan start date [-> keyMap] |
| 4 | SET | `setParam[29] = idoRsvAplyYmd` // Plan end date [-> parameter, v7.00.05 fix] |
| 5 | IF | `JKKBatConst.SPACE.equals(ruleDate)` [CONSTANT_SPACE=" "] |
| 5.1 | SET | `setParam[30] = setParam[23]` // Plan charge start = service end date [-> setParam[23]] |
| 5.2 | ELSE | |
| 5.2.1 | SET | `setParam[30] = ruleDate` // Plan charge start = rule-computed date [-> callRule0091001 result] |
| 6 | SET | `setParam[31] = JBSbatDateUtil.adjustDate(idoRsvAplyYmd, -1)` // Plan charge end date [-> parameter - 1 day, v7.00.05 fix] |

**Block 11** — [SET] `(Fill setParam[32-47]: Cancellation, stop, and pause lifecycle fields)` (L2582-L2627)

> Populates 16 elements covering service cancellation, stop, and pause dates, reasons, and memo fields. All values are copied from the existing contract record in `keyMap`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `setParam[32] = kkopSvKeiKeyMap.getString(PLAN_END_SBT_CD)` // Plan end type code [-> keyMap] |
| 2 | SET | `setParam[33] = kkopSvKeiKeyMap.getString(SVC_CANCEL_YMD)` // Service cancellation date [-> keyMap] |
| 3 | SET | `setParam[34] = kkopSvKeiKeyMap.getString(SVC_CANCEL_RSN_CD)` // Service cancellation reason code [-> keyMap] |
| 4 | SET | `setParam[35] = kkopSvKeiKeyMap.getString(SVC_CANCEL_CL_YMD)` // Service cancellation cancel date [-> keyMap] |
| 5 | SET | `setParam[36] = kkopSvKeiKeyMap.getString(SVC_STP_YMD)` // Service stop date [-> keyMap] |
| 6 | SET | `setParam[37] = kkopSvKeiKeyMap.getString(SVC_STP_RSN_CD)` // Service stop reason code [-> keyMap] |
| 7 | SET | `setParam[38] = kkopSvKeiKeyMap.getString(SVC_STP_RLS_YMD)` // Service stop release date [-> keyMap] |
| 8 | SET | `setParam[39] = kkopSvKeiKeyMap.getString(SVC_STP_RLS_RSN_CD)` // Service stop release reason code [-> keyMap] |
| 9 | SET | `setParam[40] = kkopSvKeiKeyMap.getString(PAUSE_STP_CD)` // Pause stop code [-> keyMap] |
| 10 | SET | `setParam[41] = kkopSvKeiKeyMap.getString(SVC_PAUSE_YMD)` // Service pause date [-> keyMap] |
| 11 | SET | `setParam[42] = kkopSvKeiKeyMap.getString(SVC_PAUSE_CHRG_STA_YMD)` // Service pause charge start date [-> keyMap] |
| 12 | SET | `setParam[43] = kkopSvKeiKeyMap.getString(SVC_PAUSE_RSN_CD)` // Service pause reason code [-> keyMap] |
| 13 | SET | `setParam[44] = kkopSvKeiKeyMap.getString(SVC_PAUSE_RSN_MEMO)` // Service pause reason memo [-> keyMap] |
| 14 | SET | `setParam[45] = kkopSvKeiKeyMap.getString(SVC_PAUSE_RLS_YMD)` // Service pause release date [-> keyMap] |
| 15 | SET | `setParam[46] = kkopSvKeiKeyMap.getString(SVC_PAUSE_RLS_RSN_CD)` // Service pause release reason code [-> keyMap] |
| 16 | SET | `setParam[47] = kkopSvKeiKeyMap.getString(SVC_PAUSE_RLS_RSN_MEMO)` // Service pause release reason memo [-> keyMap] |

**Block 12** — [SET] `(Fill setParam[48-53]: Service contract end, cancellation reason, procedure flag, recovery date)` (L2629-L2654)

> Sets the service contract end date, cancellation reason code ("01" = Normal Cancellation), procedure completion flag ("1"), and clears the recovery date.

| # | Type | Code |
|---|------|------|
| 1 | SET | `setParam[48] = idoRsvAplyYmd` // Service contract end date [-> parameter, v7.00.05 fix] |
| 2 | SET | `setParam[49] = JBSbatKKConst.CD00879_SVC_DLRE_CD_01` // Service cancellation reason code [-> CONSTANT="01" (Normal Cancellation)] |
| 3 | SET | `setParam[50] = kkopSvKeiKeyMap.getString(SVC_DLRE_MEMO)` // Service cancellation reason memo [-> keyMap] |
| 4 | SET | `setParam[51] = kkopSvKeiKeyMap.getString(SVC_DSL_CL_YMD)` // Service dissolution cancel date [-> keyMap] |
| 5 | SET | `setParam[52] = JBSbatKKConst.CD01359_FIN_FLG_1` // Service dissolution procedure completion flag [-> CONSTANT="1" (Completed)] |
| 6 | SET | `setParam[53] = JKKBatConst.SPACE` // Recovery date — cleared to blank (v7.00.04 fix: was reading from keyMap) [-> CONSTANT=" "] |

**Block 13** — [SET] `(Fill setParam[54-66]: Miscellaneous operational fields)` (L2656-L2676)

> Populates charge adjustment flags, contract change dates, penalty codes, movement division, inspection dissolution codes, handheld contract change flags, and deletion/invalidity audit fields.

| # | Type | Code |
|---|------|------|
| 1 | SET | `setParam[54] = kkopSvKeiKeyMap.getString(CHRG_STA_YMD_HOSEI_UM)` // Charge start date correction flag [-> keyMap] |
| 2 | SET | `setParam[55] = kkopSvKeiKeyMap.getString(KKOP_SVC_KEI_HKHASYMD)` // Machine operation service contract occurrence date [-> keyMap] |
| 3 | SET | `setParam[56] = kkopSvKeiKeyMap.getString(PNLTY_HASSEI_CD)` // Penalty occurrence code [-> keyMap] |
| 4 | SET | `setParam[57] = ido_div` // Movement division [-> parameter] |
| 5 | SET | `setParam[58] = kkopSvKeiKeyMap.getString(SHOUSA_DSL_FIN_CD)` // Inspection dissolution completion code [-> keyMap] |
| 6 | SET | `setParam[59] = kkopSvKeiKeyMap.getString(KIKI_RNTAI_KEI_CHGECHU_FLG)` // Machine handheld contract change in-progress flag [-> keyMap] |
| 7 | SET | `setParam[64] = kkopSvKeiKeyMap.getString(DEL_DTM)` // Deletion date and time [-> keyMap] |
| 8 | SET | `setParam[65] = kkopSvKeiKeyMap.getString(DEL_OPEACNT)` // Deletion operator account [-> keyMap] |
| 9 | SET | `setParam[66] = kkopSvKeiKeyMap.getString(MK_FLG)` // Invalid flag [-> keyMap] |
| 10 | SET | `setParam[71] = kkopSvKeiKeyMap.getString(DEL_UNYO_YMD)` // Deletion operation date [-> keyMap] |
| 11 | SET | `setParam[72] = kkopSvKeiKeyMap.getString(DEL_TRN_ID)` // Deletion process transaction ID [-> keyMap] |

**Block 14** — [SET] `(Fill setParam[73]: New payment application flag)` (L2680)

> ANK-4287-00-00 add: Populates the new payment application flag field for the eo定期 (regular payment) reservation feature.

| # | Type | Code |
|---|------|------|
| 1 | SET | `setParam[73] = kkopSvKeiKeyMap.getString(NEW_PCRS_APLY_FLG)` // New payment code application flag [-> keyMap, ANK-4287-00-00] |

**Block 15** — [CALL] `(Insert finalized contract record)` (L2702)

> Persists the fully assembled contract row with cancellation status to the database.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `executeKK_T_KKOP_SVC_KEI_PKINSERT(setParam)` // Insert new row into KK_T_KKOP_SVC_KEI with 74 fields |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `kkop_svc_kei_no` | Field | Machine operation service contract number — unique identifier for a machine operation (broadband/telecom) service contract line |
| `gene_add_dtm` | Field | Registration date and time — timestamp when the service contract was originally registered |
| `plan_chrg_staymd` | Field | Plan charge start date — date when plan-level billing begins |
| `mskm_dtl_no` | Field | Application detail number — detail-level identifier for the service application request |
| `ido_div` | Field | Movement division — classification code for service change type (new installation, transfer, modification, etc.) |
| `svc_kei_no` | Field | Service contract number — higher-level service contract identifier used in billing rule evaluation |
| `idoRsvAplyYmd` | Field | Reservation application date — the effective date when the reservation cancellation takes effect |
| `opeDate` | Field | Operation date — batch processing date used as the system operation timestamp |
| `KKOP_SVC_KEI_STAT_910` | Constant | Machine operation service contract status "910" — Contract Canceled (service has been terminated) |
| `SVC_DLRE_CD_01` | Constant | Service cancellation reason code "01" — Normal Cancellation (customer-initiated standard cancellation) |
| `RSV_APLY_CD_RSV_FIX` | Constant | Reservation application code "2" — Reservation Fixed (the pending reservation has been executed/finalized) |
| `FIN_FLG_1` | Constant | Procedure completion flag "1" — Service cancellation procedure is completed |
| `RSV_CL_YMD` | Field | Reservation cancellation date — date when the reservation was canceled |
| `SVC_STAYMD` | Field | Service start date — date when the service was first activated |
| `SVC_ENDYMD` | Field | Service end date — date when the service terminates |
| `SVC_CHRG_STAYMD` | Field | Service charge start date — date when billing for the service begins |
| `HONKANYU_YMD` | Field | Actual registration date — date when the service was actually provisioned |
| `FTRIAL_KANYU_YMD` | Field | Trial registration date — date when the trial period began |
| `KEIZK_SVC_STAYMD` | Field | Continuation service start date — date when continuation service begins after primary service |
| `PLAN_STAYMD` | Field | Plan start date — date when the billing plan starts |
| `PLAN_END_SBT_CD` | Field | Plan end type code — classification of how/why the plan ended |
| `SVC_STP_YMD` | Field | Service stop date — date when service was temporarily stopped |
| `SVC_PAUSE_YMD` | Field | Service pause date — date when service billing/usage was paused |
| `SHOSA_YMD` | Field | Inspection date — date when equipment/service inspection was performed |
| `KEI_CNC_YMD` | Field | Contract conclusion date — date when the service contract was finalized |
| `RULE0091` | Rule | Billing rule engine rule — determines service charge start date based on service conditions, plan type, and movement classification |
| `KK_T_KKOP_SVC_KEI` | Table | Machine operation service contract table — stores all machine operation (broadband/telecom) service contract records |
| `KK_T_IDO_RSV` | Table | Movement reservation table — stores pending service change/reservation cancellation requests |
| `JBSbatDateUtil.adjustDate` | Utility | Date arithmetic utility — adds or subtracts days from a date string |
| `JCCBatCommon.createSokanRuleEngine` | Utility | Rule engine factory — creates an XML-based rule processing handler |
| SPACE | Constant | Single space character " " — used as a null-equivalent placeholder in string fields |
| UPD_OPTY | Field | Update opportunity — flag indicating update context (0 = cancellation) |
| CHRG_STA_ZENGO | Field | Charge start before/after flag — indicates whether charge start date is before or after end date |
| DSLJI_CHRG | Field | Cancellation charge flag — indicates whether cancellation charges apply (1 = charge applies, 0 = no charge) |
