# Business Logic — JBSbatKKSkaWrkCnclProc.insertOpsvckei() [177 LOC]

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

## 1. Role

### JBSbatKKSkaWrkCnclProc.insertOpsvckei()

This method registers (inserts) an Option Service Contract (`オプションサービス契約`) into the `KK_T_OP_SVC_KEI` database table. It is the core data-persistence step within the skip-work cancellation batch process (`JBSbatKKSkaWrkCnclProc`). The method extracts 70+ fields from the input `outMap` (which carries the Option Service Contract search result), enriches them with system-derived values (system datetime, operation date, batch user ID), and hardcodes several business constants (service status: terminated, reservation code: confirmed, termination reason: normal). It then delegates to `executeKK_T_OP_SVC_KEI_PKINSERT` to perform the actual SQL INSERT on the Option Service Contract table, and subsequently calls `JKKBatCommon.createSubTypeKK0351` to register the associated sub-type contract record. As a private method invoked only by `execute()`, it implements a builder-delegation pattern: assemble all required contract data into a structured parameter array, then delegate to the dedicated INSERT executor.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["insertOpsvckei outMap opeDate idoDiv mskmDtlNo"])

    START --> INIT["Initialize param_add 79-element array"]
    INIT --> SYSDATE["Get system datetime stamp via JBSbatDateUtil.getSystemDateTimeStamp"]
    SYSDATE --> READ_OPID["Read OP_SVC_KEI_NO from outMap"]
    READ_OPID --> MAP0_1["Set param_add[0]=opsvckeino param_add[1]=sysdate"]
    MAP0_1 --> MAP2["Set param_add[2]=910 SVC_KEI_STAT_DLS_ZM Service contract terminated"]
    MAP2 --> MAP3_5["Set param_add[3-6] from outMap: OP_SVC_CD PCRS_CD PPLAN_CD OYA_KEI_SKBT_CD"]
    MAP3_5 --> MAP7_9["Set param_add[7-9] from outMap: SVC_KEI_NO SVC_KEI_UCWK_NO HOJIN_SVC_KEI_UK_NO"]
    MAP7_9 --> MAP10_11["Set param_add[10]=SYSID param_add[11]=mskmDtlNo"]
    MAP10_11 --> MAP12_19["Set param_add[12-19] from outMap: trial registration dates inspection dates"]
    MAP12_19 --> MAP20_25["Set param_add[20-25]: inspection cancel SKEKKA_SEND_CD KEI_CNC_YMD RSV_APLY_YMD RSV_CL_YMD"]
    MAP20_25 --> MAP25CONST["Set param_add[25]=2 CD00343_2 Reservation confirmed"]
    MAP25CONST --> MAP26_29["Set param_add[26-29]: PLAN_STAYMD PLAN_ENDYMD=opeDate PLAN_CHRG_STAYMD PLAN_CHRG_ENDYMD=opeDate"]
    MAP26_29 --> MAP30["Set param_add[30]=1 PLAN_END_SBT_CD_PLANCHG Plan termination by plan change"]
    MAP30 --> MAP31_38["Set param_add[31-38] from outMap: SVC_CANCEL_YMD SVC_CANCEL_RSN_CD SVC_STAYMD SVC_STA_HMS SVC_CHRG_STAYMD SVC_STP_YMD"]
    MAP31_38 --> MAP39_47["Set param_add[39-47] from outMap: SVC pause/stop resolution dates and reasons"]
    MAP39_47 --> MAP48_51["Set param_add[48]=opeDate param_add[49]=SVC_END_HMS param_add[50]=opeDate param_add[51]=SVC_DSL_YMD"]
    MAP48_51 --> MAP52["Set param_add[52]=01 CD00879_TUJYO_DSL Normal termination"]
    MAP52 --> MAP53_62["Set param_add[53-62] from outMap: SVC_DLRE_MEMO DSL_TNT_USER_ID KAIHK_YMD SVC_CANCEL_CL_YMD OP_SVC_KEI_HKHASYMD PNLTY_HASSEI_CD"]
    MAP53_62 --> MAP63_64["Set param_add[63]=idoDiv param_add[64]=SHOSA_DSL_FIN_CD"]
    MAP63_64 --> MAP65_66["Set param_add[65]=SVCTK_BUT_DEL_TRN_JSSI_DTM param_add[66]=sysdate"]
    MAP65_66 --> MAP67_71["Set param_add[67]=batchUserId param_add[68]=sysdate param_add[69]=batchUserId param_add[70-71]=empty"]
    MAP67_71 --> MAP72_78["Set param_add[72]=0 valid flag param_add[73-78]=empty operation flags"]
    MAP72_78 --> CALL_INSERT["Execute executeKK_T_OP_SVC_KEI_PKINSERT param_add"]
    CALL_INSERT --> CALL_SUBTYPE["Execute JKKBatCommon.createSubTypeKK0351 commonItem opsvckeino geneAddDtm sysdate"]
    CALL_SUBTYPE --> END_NODE(["Return"])

    START --> INIT
    INIT --> SYSDATE
    SYSDATE --> READ_OPID
```

**CRITICAL - Constant Resolution:**

| Constant | Value | Business Meaning |
|----------|-------|------------------|
| `SVC_KEI_STAT_DLS_ZM` | `"910"` | Service contract status: Terminated (解約済) |
| `CD00343_2` | `"2"` | Reservation application code: Reservation confirmed (予約確定) |
| `PLAN_END_SBT_CD_PLANCHG` | `"1"` | Plan termination subtype: Termination by plan change (プラン変更による終了) |
| `CD00879_TUJYO_DSL` | `"01"` | Service termination reason: Normal termination (通常解約) |

**Requirements:**
- Every method call is represented as a node.
- Diamond nodes are not needed here because there are no conditional branches - the method executes sequentially.
- All 79 parameter slots are set linearly, then two terminal method calls are made.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `outMap` | `JBSbatCommonDBInterface` | Option Service Contract search result data transfer object carrying all fields retrieved from the `KK_T_OP_SVC_KEI` table. The method extracts 50+ fields from this map, including contract numbers, dates, codes, flags, and memo fields that together define the full lifecycle state of an option service contract at the point of termination processing. |
| 2 | `opeDate` | `String` | Operation date (運用手続き日) - the business date of the batch execution. Used to set plan end date, plan charge end date, service end date, and service charge end date in the inserted record. Format: YYYYMMDD. |
| 3 | `idoDiv` | `String` | Disposition division (異動区分) - identifies the type of contract change/migration event that triggered this registration. Set from the method parameter and stored at `param_add[63]`. In the context of skip-work cancellation, this represents the anomalous reservation disposition. |
| 4 | `mskmDtlNo` | `String` | Application detail number (申請明細番号) - a unique identifier for the specific application line item. Set at `param_add[11]` and associated with the anomalous reservation record. |

**Instance fields read by the method:**
| Field | Type | Business Meaning |
|-------|------|------------------|
| `commonItem` | (entity type) | Common item entity passed to `createSubTypeKK0351` for sub-type contract creation. |
| `batchUserId` | `String` | Batch processing user ID used as the registered/updated operator account (param_add[67], param_add[69]). |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JBSbatDateUtil.getSystemDateTimeStamp` | - | - | Retrieves the current system date and timestamp for audit fields (registration/update datetime). |
| R | `JBSbatStringUtil.Rtrim` | - | - | Utility call applied repeatedly to trim trailing whitespace from every string field extracted from `outMap`. |
| C | `JKKBatCommon.createSubTypeKK0351` | - | - | Creates sub-type contract records (sub-contract line items) associated with the Option Service Contract. |
| C | `JBSbatKKSkaWrkCnclProc.executeKK_T_OP_SVC_KEI_PKINSERT` | EKK0351 | `KK_T_OP_SVC_KEI` | Core INSERT method that writes the fully assembled 79-element parameter array to the Option Service Contract table via primary-key-based insert. |

**How to classify:**
- **R** (Read): Methods with names like `getString`, `getSystemDateTimeStamp`, `Rtrim` - query/fetch operations
- **C** (Create): Methods with names like `executeKK_T_OP_SVC_KEI_PKINSERT`, `createSubTypeKK0351` - insert/create operations

**How to find SC Code:**
- The `executeKK_T_OP_SVC_KEI_PKINSERT` method is a private method within `JBSbatKKSkaWrkCnclProc` and corresponds to SC `EKK0351` operating on the `KK_T_OP_SVC_KEI` table.
- The `createSubTypeKK0351` method corresponds to sub-type processing under CBS `EKK0351`.

**How to find Entity/DB tables:**
- `KK_T_OP_SVC_KEI` is the Option Service Contract table, confirmed from `JBSbatKK_T_OP_SVC_KEI.TABLE_NAME`.
- The sub-type table is not explicitly referenced by name in this method (delegated to `createSubTypeKK0351`).

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Batch: `JBSbatKKSkaWrkCnclProc.execute()` | `execute()` -> `insertOpsvckei(outMap, opeDate, idoDiv, mskmDtlNo)` | `executeKK_T_OP_SVC_KEI_PKINSERT [C] KK_T_OP_SVC_KEI` |
| 2 | Batch: `JBSbatKKSkaWrkCnclProc.execute()` | `execute()` -> `insertOpsvckei()` -> `createSubTypeKK0351()` | `createSubTypeKK0351 [C] sub-type contract entity` |

**Instructions:**
- Only one direct caller was found: `JBSbatKKSkaWrkCnclProc.execute()`.
- This method is a private helper within the skip-work cancellation batch process.
- The Terminal column lists all CRUD endpoints reached from this method.

## 6. Per-Branch Detail Blocks

> This method has **no conditional branches** (no if/else, no switch, no loops). It is a straight-line sequential data-assembly and delegation method. Each parameter slot is set one at a time, then two terminal methods are invoked.

---

**Block 1** — [SEQUENTIAL DATA ASSEMBLY] `(no condition)` (L667)

> Initialize the 79-element parameter array and retrieve system datetime stamp.

| No | Type | Code |
|----|------|------|
| 1 | SET | `param_add = new Object[79]` // Registration data container |
| 2 | CALL | `sysdate = JBSbatDateUtil.getSystemDateTimeStamp()` // Get system date [-> SYSDATE] |

---

**Block 2** — [PARAMETER SLOT ASSIGNMENT 0-6] `(no condition)` (L673-L678)

> Set primary key, system datetime, service status constant, and service-level codes.

| No | Type | Code |
|----|------|------|
| 1 | CALL | `opsvckeino = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.OP_SVC_KEI_NO))` // Option service contract number |
| 2 | SET | `param_add[0] = opsvckeino` // Option service contract number |
| 3 | SET | `param_add[1] = sysdate` // Registration datetime |
| 4 | SET | `param_add[2] = JBSbatKKConst.SVC_KEI_STAT_DLS_ZM` [-> `"910"`] // Service contract status: Terminated (解約済) |
| 5 | CALL | `param_add[3] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.OP_SVC_CD))` // Option service code |
| 6 | CALL | `param_add[4] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.PCRS_CD))` // Price code |
| 7 | CALL | `param_add[5] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.PPLAN_CD))` // Price plan code |
| 8 | CALL | `param_add[6] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.OYA_KEI_SKBT_CD))` // Parent contract identification code |

---

**Block 3** — [PARAMETER SLOT ASSIGNMENT 7-11] `(no condition)` (L679-L683)

> Set service contract identifiers and the application detail number.

| No | Type | Code |
|----|------|------|
| 1 | CALL | `param_add[7] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.SVC_KEI_NO))` // Service contract number |
| 2 | CALL | `param_add[8] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.SVC_KEI_UCWK_NO))` // Service contract detail number |
| 3 | CALL | `param_add[9] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.HOJIN_SVC_KEI_UK_NO))` // Corporate service contract receipt number |
| 4 | CALL | `param_add[10] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.SYSID))` // SYSID |
| 5 | SET | `param_add[11] = mskmDtlNo` // Application detail number (異動予約・申請明細番号) |

---

**Block 4** — [PARAMETER SLOT ASSIGNMENT 12-25] `(no condition)` (L684-L698)

> Set trial/registration dates, inspection dates, contract conclusion dates, reservation codes. Hardcoded constant: reservation application code = `"2"` (Reservation confirmed).

| No | Type | Code |
|----|------|------|
| 1 | CALL | `param_add[12] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.FTRIAL_KANYU_YMD))` // Trial registration date |
| 2 | CALL | `param_add[13] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.FTRIAL_PRD_ENDYMD))` // Trial period end date |
| 3 | CALL | `param_add[14] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.HONKANYU_YMD))` // Actual registration date |
| 4 | CALL | `param_add[15] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.HONKANYU_IKO_KIGEN_YMD))` // Actual registration transfer deadline |
| 5 | CALL | `param_add[16] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.SVC_USE_STA_KIBO_YMD))` // Service usage start desired date |
| 6 | CALL | `param_add[17] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.RSV_TSTA_KIBO_YMD))` // Reservation application start desired date |
| 7 | CALL | `param_add[18] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.OP_SVC_KEI_KZKWRK_REQYMD))` // Option service contract follow-up work request date |
| 8 | CALL | `param_add[19] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.SHOSA_YMD))` // Inspection date |
| 9 | CALL | `param_add[20] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.SHOSA_CL_YMD))` // Inspection cancellation date |
| 10 | CALL | `param_add[21] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.SKEKKA_SEND_CD))` // Screening result notification code |
| 11 | CALL | `param_add[22] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.KEI_CNC_YMD))` // Contract conclusion date |
| 12 | CALL | `param_add[23] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.RSV_APLY_YMD))` // Reservation application date |
| 13 | CALL | `param_add[24] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.RSV_CL_YMD))` // Reservation cancellation date |
| 14 | SET | `param_add[25] = JKKStrConst.CD00343_2` [-> `"2"`] // Reservation application code: Reservation confirmed (予約確定) |

---

**Block 5** — [PARAMETER SLOT ASSIGNMENT 26-30] `(no condition)` (L699-L706)

> Set plan dates, with the operation date used for plan end date and plan charge dates. Hardcoded constant: plan termination subtype = `"1"` (Plan change).

| No | Type | Code |
|----|------|------|
| 1 | CALL | `param_add[26] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.PLAN_STAYMD))` // Plan start date |
| 2 | SET | `param_add[27] = opeDate` // Plan end date -> Operation date (運用手続き日) |
| 3 | CALL | `param_add[28] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.PLAN_CHRG_STAYMD))` // Plan charge start date |
| 4 | SET | `param_add[29] = opeDate` // Plan charge end date -> Operation date (運用手続き日) |
| 5 | SET | `param_add[30] = JBSbatKKConst.PLAN_END_SBT_CD_PLANCHG` [-> `"1"`] // Plan termination subtype: Plan change (プラン変更による終了) |

---

**Block 6** — [PARAMETER SLOT ASSIGNMENT 31-47] `(no condition)` (L707-L723)

> Set service cancellation, service start, service stop/pause dates and reason codes.

| No | Type | Code |
|----|------|------|
| 1 | CALL | `param_add[31] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.SVC_CANCEL_YMD))` // Service cancellation date |
| 2 | CALL | `param_add[32] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.SVC_CANCEL_RSN_CD))` // Service cancellation reason code |
| 3 | CALL | `param_add[33] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.SVC_STAYMD))` // Service start date |
| 4 | CALL | `param_add[34] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.SVC_STA_HMS))` // Service start time (HMS) |
| 5 | CALL | `param_add[35] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.DSP_SVCTK_STAYMD))` // Display service provision start date |
| 6 | CALL | `param_add[36] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.SVC_CHRG_STAYMD))` // Service charge start date |
| 7 | CALL | `param_add[37] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.SVC_STP_YMD))` // Service stop date |
| 8 | CALL | `param_add[38] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.SVC_STP_RSN_CD))` // Service stop reason code |
| 9 | CALL | `param_add[39] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.SVC_STP_RLS_YMD))` // Service stop release date |
| 10 | CALL | `param_add[40] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.SVC_STP_RLS_RSN_CD))` // Service stop release reason code |
| 11 | CALL | `param_add[41] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.PAUSE_STP_CD))` // Pause stop code |
| 12 | CALL | `param_add[42] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.SVC_PAUSE_YMD))` // Service pause date |
| 13 | CALL | `param_add[43] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.SVC_PAUSE_RSN_CD))` // Service pause reason code |
| 14 | CALL | `param_add[44] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.SVC_PAUSE_RSN_MEMO))` // Service pause reason memo |
| 15 | CALL | `param_add[45] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.SVC_PAUSE_RLS_YMD))` // Service pause release date |
| 16 | CALL | `param_add[46] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.SVC_PAUSE_RLS_RSN_CD))` // Service pause release reason code |
| 17 | CALL | `param_add[47] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.SVC_PAUSE_RLS_RSN_MEMO))` // Service pause release reason memo |

---

**Block 7** — [PARAMETER SLOT ASSIGNMENT 48-52] `(no condition)` (L724-L730)

> Set service end, termination dates, and the termination reason constant. Hardcoded: termination reason = `"01"` (Normal termination).

| No | Type | Code |
|----|------|------|
| 1 | SET | `param_add[48] = opeDate` // Service end date -> Operation date (運用手続き日) |
| 2 | CALL | `param_add[49] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.SVC_END_HMS))` // Service end time (HMS) |
| 3 | SET | `param_add[50] = opeDate` // Service charge end date -> Operation date (運用手続き日) |
| 4 | CALL | `param_add[51] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.SVC_DSL_YMD))` // Service termination date |
| 5 | SET | `param_add[52] = JKKStrConst.CD00879_TUJYO_DSL` [-> `"01"`] // Service termination reason code: Normal termination (通常解約) |

---

**Block 8** — [PARAMETER SLOT ASSIGNMENT 53-64] `(no condition)` (L731-L742)

> Set termination memo, assigned user, completion flag, recovery date, cancellation dates, correction flags, penalty codes, disposition division, and inspection termination completion code.

| No | Type | Code |
|----|------|------|
| 1 | CALL | `param_add[53] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.SVC_DLRE_MEMO))` // Service termination reason memo |
| 2 | CALL | `param_add[54] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.DSL_TNT_USER_ID))` // Termination assigned user ID |
| 3 | CALL | `param_add[55] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.SVC_DSL_TTDKI_FIN_FLG))` // Service termination completion flag |
| 4 | SET | `param_add[56] = ""` // Recovery date -> Empty string |
| 5 | CALL | `param_add[57] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.SVC_CANCEL_CL_YMD))` // Service cancellation reversal date |
| 6 | CALL | `param_add[58] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.SVC_DSL_CL_YMD))` // Service termination reversal date |
| 7 | CALL | `param_add[59] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.CHRG_STA_YMD_HOSEI_UM))` // Charge start date correction flag |
| 8 | CALL | `param_add[60] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.SVC_PAUSE_CHRG_STA_YMD))` // Service pause charge start date |
| 9 | CALL | `param_add[61] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.OP_SVC_KEI_HKHASYMD))` // Option service contract occurrence date |
| 10 | CALL | `param_add[62] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.PNLTY_HASSEI_CD))` // Penalty occurrence code |
| 11 | SET | `param_add[63] = idoDiv` // Disposition division (異動区分) |
| 12 | CALL | `param_add[64] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.SHOSA_DSL_FIN_CD))` // Inspection termination completion code |

---

**Block 9** — [PARAMETER SLOT ASSIGNMENT 65-78] `(no condition)` (L743-L760)

> Set the final fields: service provision deletion transaction datetime, audit fields (sysdate, batchUserId), and empty strings for unused fields. Hardcode valid flag = `"0"`.

| No | Type | Code |
|----|------|------|
| 1 | CALL | `param_add[65] = JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.SVCTK_BUT_DEL_TRN_JSSI_DTM))` // Service provision deletion transaction datetime |
| 2 | SET | `param_add[66] = sysdate` // Registration datetime (登録年月日時分秒) |
| 3 | SET | `param_add[67] = batchUserId` // Registered operator account (登録オペレータアカウント) |
| 4 | SET | `param_add[68] = sysdate` // Updated datetime (更新年月日時分秒) |
| 5 | SET | `param_add[69] = batchUserId` // Updated operator account (更新オペレータアカウント) |
| 6 | SET | `param_add[70] = ""` // Deleted datetime (削除年月日時分秒) |
| 7 | SET | `param_add[71] = ""` // Deleted operator account (削除オペレータアカウント) |
| 8 | SET | `param_add[72] = "0"` // Invalid flag: 0 = Valid (無効フラグ: 0=有効) |
| 9 | SET | `param_add[73] = ""` // Registration operation date (登録運用年月日) |
| 10 | SET | `param_add[74] = ""` // Registration processing ID (登録処理ID) |
| 11 | SET | `param_add[75] = ""` // Updated operation date (更新運用年月日) |
| 12 | SET | `param_add[76] = ""` // Updated processing ID (更新処理ID) |
| 13 | SET | `param_add[77] = ""` // Deleted operation date (削除運用年月日) |
| 14 | SET | `param_add[78] = ""` // Deleted processing ID (削除処理ID) |

---

**Block 10** — [TERMINAL INSERT CALL] `(no condition)` (L762)

> Delegate to the primary-key-based INSERT executor for the Option Service Contract table.

| No | Type | Code |
|----|------|------|
| 1 | CALL | `this.executeKK_T_OP_SVC_KEI_PKINSERT(param_add)` // Register Option Service Contract (オプションサービス契約の登録) |

---

**Block 11** — [SUB-TYPE CONTRACT REGISTRATION] `(no condition)` (L765-L766)

> Register sub-type contract records associated with the Option Service Contract number.

| No | Type | Code |
|----|------|------|
| 1 | CALL | `JKKBatCommon.createSubTypeKK0351(commonItem, opsvckeino, JBSbatStringUtil.Rtrim(outMap.getString(JBSbatKK_T_OP_SVC_KEI.GENE_ADD_DTM)), sysdate)` // Register sub-type contracts linked by Option Service Contract number (オプションサービス契約番号に紐くサブクラスの登録) |

---

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `OP_SVC_KEI_NO` | Field | Option Service Contract Number - the unique primary key identifier for an option service contract record in `KK_T_OP_SVC_KEI` |
| `OP_SVC_CD` | Field | Option Service Code - the code identifying which option service (e.g., Netflix, Wi-Fi, etc.) |
| `PCRS_CD` | Field | Price Code - the pricing code associated with the option service contract |
| `PPLAN_CD` | Field | Price Plan Code - the pricing plan code for the option service |
| `OYA_KEI_SKBT_CD` | Field | Parent Contract Identification Code - identifies the parent (main) service contract to which this option contract is linked |
| `SVC_KEI_NO` | Field | Service Contract Number - the primary key of the parent service contract |
| `SVC_KEI_UCWK_NO` | Field | Service Contract Detail Number - internal tracking ID for service contract line items |
| `HOJIN_SVC_KEI_UK_NO` | Field | Corporate Service Contract Receipt Number - service contract receipt number for corporate (法人) customers |
| `SYSID` | Field | System ID - the system identifier for the service |
| `MSKM_DTL_NO` | Field | Application Detail Number - the specific application line item number for the transaction |
| `FTRIAL_KANYU_YMD` | Field | Trial Registration Date (試用加入年月日) - date when the trial period was registered |
| `FTRIAL_PRD_ENDYMD` | Field | Trial Period End Date (試用期間終了年月日) - end date of the trial period |
| `HONKANYU_YMD` | Field | Actual Registration Date (本加入年月日) - date of full/actual service registration |
| `SVC_USE_STA_KIBO_YMD` | Field | Service Usage Start Desired Date (サービス利用開始希望年月日) - customer's requested service start date |
| `RSV_TSTA_KIBO_YMD` | Field | Reservation Application Start Desired Date (予約適用開始希望年月日) - desired date for reservation application start |
| `OP_SVC_KEI_KZKWRK_REQYMD` | Field | Option Service Contract Follow-up Work Request Date (オプションサービス契約後続業務依頼年月日) - date when follow-up operations were requested |
| `SHOSA_YMD` | Field | Inspection Date (照会年月日) - date of inquiry/inspection |
| `SHOSA_CL_YMD` | Field | Inspection Cancellation Date (照会取消年月日) - date when the inspection was cancelled |
| `SKEKKA_SEND_CD` | Field | Screening Result Notification Code (審査結果送信コード) - code indicating whether the screening result was notified |
| `KEI_CNC_YMD` | Field | Contract Conclusion Date (契約締結年月日) - the date the contract was formally concluded |
| `RSV_APLY_YMD` | Field | Reservation Application Date (予約適用年月日) - date of reservation application |
| `RSV_APLY_CD` | Field | Reservation Application Code (予約適用コード) - code indicating reservation status (2=Confirmed/予約確定) |
| `RSV_CL_YMD` | Field | Reservation Cancellation Date (予約取消年月日) - date when the reservation was cancelled |
| `PLAN_STAYMD` | Field | Plan Start Date (プラン開始年月日) - the start date of the service plan |
| `PLAN_ENDYMD` | Field | Plan End Date (プラン終了年月日) - the end date of the service plan |
| `PLAN_CHRG_STAYMD` | Field | Plan Charge Start Date (プラン課金開始年月日) - the date when plan-based billing begins |
| `PLAN_CHRG_ENDYMD` | Field | Plan Charge End Date (プラン課金終了年月日) - the date when plan-based billing ends |
| `PLAN_END_SBT_CD` | Field | Plan Termination Subtype Code (プラン終了種別コード) - code indicating how the plan ended |
| `SVC_CANCEL_YMD` | Field | Service Cancellation Date (サービスキャンセル年月日) - date of service cancellation |
| `SVC_CANCEL_RSN_CD` | Field | Service Cancellation Reason Code (サービスキャンセル理由コード) - reason for service cancellation |
| `SVC_STAYMD` | Field | Service Start Date (サービス開始年月日) - the date the service actually started |
| `SVC_STA_HMS` | Field | Service Start Time (サービス開始時分秒) - time component of service start |
| `DSP_SVCTK_STAYMD` | Field | Display Service Provision Start Date (表示用サービス提供開始年月日) - service provision start date for display purposes |
| `SVC_CHRG_STAYMD` | Field | Service Charge Start Date (サービス課金開始年月日) - date when service billing begins |
| `SVC_STP_YMD` | Field | Service Stop Date (サービス停止年月日) - date when the service was stopped |
| `SVC_STP_RSN_CD` | Field | Service Stop Reason Code (サービス停止理由コード) - code indicating reason for service stop |
| `SVC_STP_RLS_YMD` | Field | Service Stop Release Date (サービス停止解除年月日) - date when the service stop was lifted |
| `SVC_STP_RLS_RSN_CD` | Field | Service Stop Release Reason Code (サービス停止解除理由コード) - code indicating reason for stop release |
| `PAUSE_STP_CD` | Field | Pause Stop Code (休止中断コード) - code indicating pause/stop status |
| `SVC_PAUSE_YMD` | Field | Service Pause Date (サービス休止年月日) - date when the service was paused |
| `SVC_PAUSE_RSN_CD` | Field | Service Pause Reason Code (サービス休止理由コード) - reason code for service pause |
| `SVC_PAUSE_RSN_MEMO` | Field | Service Pause Reason Memo (サービス休止理由メモ) - free-text memo for pause reason |
| `SVC_PAUSE_RLS_YMD` | Field | Service Pause Release Date (サービス休止解除年月日) - date when the pause was lifted |
| `SVC_PAUSE_RLS_RSN_CD` | Field | Service Pause Release Reason Code (サービス休止解除理由コード) - reason code for pause release |
| `SVC_PAUSE_RLS_RSN_MEMO` | Field | Service Pause Release Reason Memo (サービス休止解除理由メモ) - free-text memo for pause release reason |
| `SVC_ENDYMD` | Field | Service End Date (サービス終了年月日) - date when the service ended |
| `SVC_END_HMS` | Field | Service End Time (サービス終了時分秒) - time component of service end |
| `SVC_CHRG_ENDYMD` | Field | Service Charge End Date (サービス課金終了年月日) - date when service billing ended |
| `SVC_DSL_YMD` | Field | Service Termination Date (サービス解約年月日) - date when the service was formally terminated |
| `SVC_DLRE_CD` | Field | Service Termination Reason Code (サービス解約理由コード) - code indicating the reason for service termination |
| `SVC_DLRE_MEMO` | Field | Service Termination Reason Memo (サービス解約理由メモ) -free-text memo for termination reason |
| `DSL_TNT_USER_ID` | Field | Termination Assigned User ID (解約担当ユーザーID) - the user ID of the person responsible for the termination |
| `SVC_DSL_TTDKI_FIN_FLG` | Field | Service Termination Completion Flag (サービス解約手続き完了フラグ) - flag indicating whether termination procedures are complete |
| `KAIHK_YMD` | Field | Recovery Date (復活年月日) - date of service recovery/reinstatement |
| `SVC_CANCEL_CL_YMD` | Field | Service Cancellation Reversal Date (サービスキャンセル取消年月日) - date when the cancellation was reversed |
| `SVC_DSL_CL_YMD` | Field | Service Termination Reversal Date (サービス解約取消年月日) - date when the termination was reversed |
| `CHRG_STA_YMD_HOSEI_UM` | Field | Charge Start Date Correction Flag (課金開始年月日補正有无) - flag indicating whether the charge start date was corrected |
| `SVC_PAUSE_CHRG_STA_YMD` | Field | Service Pause Charge Start Date (サービス休止課金開始年月日) - billing start date during service pause |
| `OP_SVC_KEI_HKHASYMD` | Field | Option Service Contract Occurrence Date (オプションサービス契約発生年月日) - date when the option service contract event occurred |
| `PNLTY_HASSEI_CD` | Field | Penalty Occurrence Code (違約金発生コード) - code indicating whether a penalty/penalty fee was incurred |
| `idoDiv` | Field | Disposition Division (異動区分) - classification of the contract change/migration event type |
| `SHOSA_DSL_FIN_CD` | Field | Inspection Termination Completion Code (照会解約完了コード) - code indicating inspection termination status |
| `SVCTK_BUT_DEL_TRN_JSSI_DTM` | Field | Service Provision Disposal Transaction Execution DateTime (サービス提供物消去処理実施年月日時分秒) - timestamp of the data disposal process |
| `GENE_ADD_DTM` | Field | Generation Registration Datetime (世代登録年月日時分秒) - timestamp of record generation/registration |
| `batchUserId` | Field | Batch Operator Account - the user account under which the batch process executes, recorded in audit fields |
| `commonItem` | Field | Common Item Entity - the common item object passed to sub-type contract creation |
| `KK_T_OP_SVC_KEI` | Entity | Option Service Contract Table - the database table storing option service contract lifecycle records |
| `SVC_KEI_STAT_DLS_ZM` | Constant | Service Contract Status: Terminated = `"910"` (サービス契約状態：解約済) |
| `CD00343_2` | Constant | Reservation Application Code: Reservation Confirmed = `"2"` (予約適用コード：予約確定) |
| `PLAN_END_SBT_CD_PLANCHG` | Constant | Plan Termination Subtype: Plan Change = `"1"` (プラン終了種別コード：プラン変更による終了) |
| `CD00879_TUJYO_DSL` | Constant | Service Termination Reason: Normal Termination = `"01"` (サービス解約理由：通常解約) |
| Option Service Contract | Domain term | An optional/add-on service contract linked to a main service contract, such as Netflix, Wi-Fi, or other premium services offered by K-Opticom |
| Skip Work (スキパー工事) | Domain term | A telecom installation work type; `JBSbatKKSkaWrkCnclProc` is the skip-work cancellation processing class |
| K-Opticom | Domain term | The telecommunications provider that owns this customer core system (eo customer main system) |
| `JBSbatCommonDBInterface` | Type | Common database interface for passing structured search/results data between service methods |
| `JBSbatKKConst` | Type | Contract management system constant class containing service status codes, plan codes, and other domain constants |
| `JKKStrConst` | Type | Shared string constant class containing standardized code values (reservation codes, termination reason codes, etc.) |
| `JKKBatCommon` | Type | Common batch processing utility class providing shared sub-type contract creation logic |
