# Business Logic — JBSbatKKMiStcKikiCncl.insertKktk() [230 LOC]

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

## 1. Role

### JBSbatKKMiStcKikiCncl.insertKktk()

The `insertKktk` method registers a new **Equipment Provision Service Contract** (機器提供サービス契約) record into the database table `T_KKTK_SVC_KEI`. It acts as the primary data-binding and persistence entry point for creating a new contract line item during equipment move/transfer operations. The method receives source contract data through a `db_map` parameter, extracts all 168 fields from it, and populates a parameter array with field values, date calculations, timestamps, audit metadata, and fixed business codes. It then delegates the actual database insert to `executeKK_T_KKTK_SVC_KEI_PKINSERT`.

The method implements a **data extraction and enrichment** pattern: it reads raw data from the input map, applies business logic for conditional date computation (specifically for the service billing end date, field index 125, which is calculated from the plan start date minus one day when the contract status is "100" / service in progress), and enriches the data with system-generated values (timestamps, batch user IDs, fixed status codes). It uses a **delegation design** by delegating to the PK insert method as the final persistence step.

This method is a shared utility called by multiple DSL (Downstream Line) execution methods — `executeDsl`, `executeDslRouter`, `executeDslTknrt`, and `executeStbDsl` — as part of the batch processing pipeline for equipment provision service contract line changes during indoor equipment moves. Its role in the larger system is to materialize a new `T_KKTK_SVC_KEI` contract record that captures the full state of an equipment provision service contract at the time of a move/change operation, ensuring data consistency in the batch record.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["insertKktk(kktk_svc_no, db_map, ido_cd)"])
    A["Read KKTK_SVC_KEI_STAT from db_map"] --> B["Compute opeDate_bf = adjustDate(opeDate, -1)"]
    B --> C["Init kktk_param[168]"]
    C --> D["Set param[0-97] from db_map fields"]
    D --> E["Set param[98] = super.opeDate"]
    E --> F["Set param[99-124]"]
    F --> G{"stat == CD00056_KKTK_SVC_KEI_STAT_100?"}
    G -->|Yes: 100 - Service in Progress| H["param[125] = adjustDate(planStaYmd, -1)"]
    G -->|No: stat != 100| I["param[125] = opeDate_bf"]
    H --> J["Set param[126] = super.opeDate"]
    I --> J
    J --> K["Set param[127] = SVC_DLRE_CD_NORMAL (01)"]
    K --> L["Set param[128-154] from db_map"]
    L --> M["Set param[155] = getSysDateTimeStamp()"]
    M --> N["Set param[156] = batchUserId"]
    N --> O["Set param[157] = getSysDateTimeStamp()"]
    O --> P["Set param[158] = batchUserId"]
    P --> Q["Set param[159-160] blank"]
    Q --> R["Set param[161] = MK_FLG_YK (0)"]
    R --> S["Set param[162-167] blank"]
    S --> T["executeKK_T_KKTK_SVC_KEI_PKINSERT(kktk_param)"]
    T --> END(["Return void"])
```

**Constant Resolution:**

| Constant | Actual Value | Business Meaning |
|----------|-------------|------------------|
| `JBSbatKKConst.CD00056_KKTK_SVC_KEI_STAT_910` | (assigned to param[2]) | Equipment Provision Service Contract Status — set to a fixed status value (v22.00.00 change from dynamic `SVC_KEI_STAT`) |
| `JBSbatKKConst.RSV_APLY_CD_FIX` | `"2"` | Reservation Application Code — Fixed (v22.00.00 change from dynamic `RSV_APLY_CD`) |
| `JBSbatKKConst.SVC_DLRE_CD_NORMAL` | `"01"` | Service Dissolution Reason Code — Normal Dissolution (v22.00.00 change from dynamic `SVC_DLRE_CD`) |
| `JBSbatKKConst.CD01359_FIN_FLG_1` | `"1"` | Service Dissolution Handling Completion Flag — Completed (v22.00.00 change from dynamic `SVC_DSL_TTDKI_FIN_FLG_FIN`) |
| `JBSbatKKConst.CD01375_PNLTY_HASSEI_CD_0` | `"0"` | Penalty Occurrence Code — None (v22.00.00 change; v7.00.05 removed dynamic lookup) |
| `JBSbatKKConst.MK_FLG_YK` | `"0"` | Invalidation Flag — Valid (v22.00.00 change from `"0"`) |
| `JBSbatKKConst.CD00056_KKTK_SVC_KEI_STAT_100` | `"100"` | Equipment Provision Service Contract Status — Service in Progress (used in conditional branch for param[125] computation) |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `kktk_svc_no` | `String` | Equipment Provision Service Contract Number (機器提供サービス契約番号) — Unique identifier for the equipment provision service contract being registered. |
| 2 | `db_map` | `JBSbatCommonDBInterface` | Equipment Provision Service Contract Information Map (機器提供サービス契約情報) — A key-value data structure containing 100+ fields extracted from the source contract record. This is the primary data source for populating the 168-element parameter array. |
| 3 | `ido_cd` | `String` | Indoor Equipment Move Code (宅内機器異動コード) — A code indicating the type of indoor equipment movement (e.g., change, transfer, replacement). This is used as field param[143] in the output array. |

**Instance Fields Read:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `super.opeDate` | `String` | Operation Apply Date (予約適用年月日) — The batch processing date, used for multiple date fields (param[98], [103], [124], [126]). |
| `batchUserId` | `String` | Batch User Account (登録オペレータアカウント) — The system batch user ID used for audit trail in registration/update operations. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `db_map.getString` | - | KK_T_KKTK_SVC_KEI | Reads 100+ fields from the input db_map data structure, representing reads from the equipment provision service contract table |
| - | `JBSbatDateUtil.adjustDate` | - | - | Computes date adjustments (operation date minus 1 day; plan start date minus 1 day) |
| R | `JCCBatCommon.getSysDateTimeStamp` | JCCBatCommon | - | Gets the current system timestamp for audit trail (registered/update timestamps) |
| C | `executeKK_T_KKTK_SVC_KEI_PKINSERT` | - | KK_T_KKTK_SVC_KEI | Inserts a new record into the equipment provision service contract table with all 168 populated fields |

**Detailed Analysis:**

This method performs a **Create (C)** operation primarily through the final call to `executeKK_T_KKTK_SVC_KEI_PKINSERT`. The 168-element `kktk_param` array is populated with data extracted from the `db_map` parameter (which represents **Read (R)** operations on the source contract data) and enriched with computed values:

- **Reads (R):** The method reads over 100 fields from `db_map`, each corresponding to a column in the `KK_T_KKTK_SVC_KEI` table. These include service codes, plan codes, delivery information, customer address data, equipment details, dates, and metadata.
- **Date Adjustments (-):** `JBSbatDateUtil.adjustDate` is called twice: once to compute `opeDate_bf` (operation date - 1) for field param[1], and conditionally to compute the service billing end date from the plan start date.
- **System Timestamps (R):** `JCCBatCommon.getSysDateTimeStamp()` is called 3 times to provide registered timestamp (param[1], param[155]) and updated timestamp (param[157]).
- **Create (C):** `executeKK_T_KKTK_SVC_KEI_PKINSERT(kktk_param)` performs the actual database insert into `KK_T_KKTK_SVC_KEI`, creating a new equipment provision service contract record.

**Business Significance:** This method is the core data insertion point for recording a new equipment provision service contract during batch processing of equipment move operations. The 168 fields capture a comprehensive snapshot of the contract including service details, billing periods, equipment specifications, delivery/installation addresses, contract dates, and audit metadata.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | JBSbatKKMiStcKikiCncl.executeDsl | `executeDsl` → `insertKktk(kktk_svc_no, db_map, ido_cd)` | `executeKK_T_KKTK_SVC_KEI_PKINSERT [C] KK_T_KKTK_SVC_KEI` |
| 2 | JBSbatKKMiStcKikiCncl.executeDslRouter | `executeDslRouter` → `insertKktk(kktk_svc_no, db_map, ido_cd)` | `executeKK_T_KKTK_SVC_KEI_PKINSERT [C] KK_T_KKTK_SVC_KEI` |
| 3 | JBSbatKKMiStcKikiCncl.executeDslTknrt | `executeDslTknrt` → `insertKktk(kktk_svc_no, db_map, ido_cd)` | `executeKK_T_KKTK_SVC_KEI_PKINSERT [C] KK_T_KKTK_SVC_KEI` |
| 4 | JBSbatKKMiStcKikiCncl.executeStbDsl | `executeStbDsl` → `insertKktk(kktk_svc_no, db_map, ido_cd)` | `executeKK_T_KKTK_SVC_KEI_PKINSERT [C] KK_T_KKTK_SVC_KEI` |

**Terminal operations from this method:**
- `getSysDateTimeStamp` [R] — system timestamp retrieval (3 calls for audit trail)
- `getString` [R] — field extraction from db_map (100+ field reads from KK_T_KKTK_SVC_KEI)
- `executeKK_T_KKTK_SVC_KEI_PKINSERT` [C] — record creation in KK_T_KKTK_SVC_KEI table

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] — Initialize status variable (L4587)

> Reads the current contract status from the input db_map to determine downstream date computation logic.

| # | Type | Code |
|---|------|------|
| 1 | SET | `stat = db_map.getString(JBSbatKK_T_KKTK_SVC_KEI.KKTK_SVC_KEI_STAT)` // Equipment Provision Service Contract Status — read from source map |

**Block 2** — [SET] — Compute previous operation date (L4601)

> Calculates the day before the operation date for use as a default billing end date.

| # | Type | Code |
|---|------|------|
| 1 | SET | `opeDate_bf = JBSbatDateUtil.adjustDate(opeDate, -1)` // Previous day (operation date - 1) |

**Block 3** — [SET] — Initialize parameter array (L4603)

> Creates a 168-element string array that will hold all fields for the new contract record.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kktk_param = new String[168]` // Parameter array with 168 elements for contract fields |

**Block 4** — [SET] — Populate param[0] (L4606)

| # | Type | Code |
|---|------|------|
| 1 | SET | `kktk_param[0] = kktk_svc_no` // Equipment Provision Service Contract Number — input parameter |

**Block 5** — [SET] — Populate param[1] (L4607)

| # | Type | Code |
|---|------|------|
| 1 | SET | `kktk_param[1] = JCCBatCommon.getSysDateTimeStamp()` // Registered Year-Month-Day-Hour-Min-Second — system timestamp |

**Block 6** — [SET] — Populate param[2] with status (L4610)

> v22.00.00 change: Replaced dynamic `SVC_KEI_STAT` constant with fixed `CD00056_KKTK_SVC_KEI_STAT_910`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kktk_param[2] = JBSbatKKConst.CD00056_KKTK_SVC_KEI_STAT_910` // Equipment Provision Service Contract Status (v22.00.00) |

**Block 7** — [SET] — Populate param[3]–param[38] (L4611–L4646)

> Extracts core service contract fields from db_map: service code, cost code, plan code, delivery method contract number, equipment type code, sales type code, service start desired date, reservation application start desired date, maker code, equipment designation type, indoor equipment type/model, serial number, accessory info, equipment change info, communication equipment set code, HDD capacity, installation place number, parent contract identification, service contract number, and internal detail numbers.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kktk_param[3] = db_map.getString(KKTK_SVC_CD)` // Equipment Provision Service Code |
| 2 | SET | `kktk_param[4] = db_map.getString(PCRS_CD)` // Cost Code |
| 3 | SET | `kktk_param[5] = db_map.getString(PPLAN_CD)` // Plan Code |
| 4 | SET | `kktk_param[6] = db_map.getString(TK_HOSHIKI_KEI_NO)` // Delivery Method Contract Number |
| 5 | SET | `kktk_param[7] = db_map.getString(KKTK_SBT_CD)` // Equipment Provision Type Code |
| 6 | SET | `kktk_param[8] = db_map.getString(HAMBAI_SBT_CD)` // Sales Type Code |
| 7 | SET | `kktk_param[9] = db_map.getString(SVC_USE_STA_KIBO_YMD)` // Service Usage Start Desired Date |
| 8 | SET | `kktk_param[10] = db_map.getString(RSV_TSTA_KIBO_YMD)` // Reservation Application Start Desired Date |
| 9 | SET | `kktk_param[11] = db_map.getString(KIBO_MAKER_CD)` // Desired Maker Code |
| 10 | SET | `kktk_param[12] = db_map.getString(KIKI_SHITEI_SBT_CD)` // Equipment Designation Type Code |
| 11 | SET | `kktk_param[13] = db_map.getString(TAKNKIKI_SBT_CD)` // Indoor Equipment Type Code |
| 12 | SET | `kktk_param[14] = db_map.getString(TAKNKIKI_MODEL_CD)` // Indoor Equipment Model Code |
| 13 | SET | `kktk_param[15] = db_map.getString(KIKI_SEIZO_NO)` // Equipment Serial Number |
| 14 | SET | `kktk_param[16] = db_map.getString(HUZOKUHIN_SBT_CD)` // Accessory Type Code |
| 15 | SET | `kktk_param[17] = db_map.getString(HUZOKUHIN_MODEL_CD)` // Accessory Model Code |
| 16 | SET | `kktk_param[18] = db_map.getString(TAKNKIKI_SETHIN_MODEL_CD)` // Indoor Equipment Set Model Code |
| 17 | SET | `kktk_param[19] = db_map.getString(KIKI_CHG_NO)` // Equipment Change Number |
| 18 | SET | `kktk_param[20] = db_map.getString(KIKI_CHG_RSN_CD)` // Equipment Change Reason Code |
| 19 | SET | `kktk_param[21] = db_map.getString(TSUSHIN_KIKI_SET_CD)` // Communication Equipment Set Code |
| 20 | SET | `kktk_param[22] = db_map.getString(HDD_CAPA_CD)` // HDD Capacity Code |
| 21 | SET | `kktk_param[23] = db_map.getString(KIKI_STC_SAKI_PLACE_NO)` // Equipment Installation Place Number |
| 22 | SET | `kktk_param[24] = db_map.getString(OYA_KEI_SKBT_CD)` // Parent Contract Identification Code |
| 23 | SET | `kktk_param[25] = db_map.getString(SVC_KEI_NO)` // Service Contract Number |
| 24 | SET | `kktk_param[26] = db_map.getString(SVC_KEI_UCWK_NO)` // Service Contract Detail Number |
| 25 | SET | `kktk_param[27] = db_map.getString(SVC_KEI_KAISEN_UCWK_NO)` // Service Contract Line Detail Number |
| 26 | SET | `kktk_param[28] = db_map.getString(OP_SVC_KEI_NO)` // Option Service Contract Number |
| 27 | SET | `kktk_param[29] = db_map.getString(SYSID)` // SYSID |
| 28 | SET | `kktk_param[30] = db_map.getString(MSKM_DTL_NO)` // Submission Detail Number |
| 29 | SET | `kktk_param[31] = db_map.getString(LINK_STB_FLG)` // Link STB Flag |
| 30 | SET | `kktk_param[32] = db_map.getString(KIKI_HKAT_SHITEI_SOKO_CD)` // Equipment Attraction Designation Stock Code |
| 31 | SET | `kktk_param[33] = db_map.getString(KIKI_HKAT_SHITEI_SKDN_CD)` // Equipment Attraction Designation Stock Column Code |
| 32 | SET | `kktk_param[34] = db_map.getString(KIKI_STI_JI_KRIPLACE_SKCD)` // Equipment Designation Management Place Identification Code |
| 33 | SET | `kktk_param[35] = db_map.getString(KIKI_STI_JI_KOCOMP_CD)` // Equipment Designation Construction Company Code |
| 34 | SET | `kktk_param[36] = db_map.getString(KIKI_STI_JI_KOCOMP_SLF_CD)` // Equipment Designation Construction Company Column Code |
| 35 | SET | `kktk_param[37] = db_map.getString(KIKI_STI_JI_YTKSKOF_CD)` // Equipment Designation Pre-payment Office Code |
| 36 | SET | `kktk_param[38] = db_map.getString(KIKI_STI_JI_YTKSKOF_SLF_CD)` // Equipment Designation Pre-payment Office Column Code |

**Block 8** — [SET] — Populate param[39]–param[54] (L4647–L4662)

> Sets contract inheritance date, equipment shipping info (presence, creation date, name, kana, address, phone), and mansion reference data.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kktk_param[39] = db_map.getString(KKTK_SVC_KEI_HKHASYMD)` // Equipment Provision Service Contract Inheritance Date |
| 2 | SET | `kktk_param[40] = db_map.getString(KIKI_SORYO_UM)` // Equipment Shipping Presence/Absence |
| 3–14 | SET | `kktk_param[41-54] = db_map.getString(...)` // Equipment shipping address fields (name, kana, address code, postal, state, city, oaza, azacho, banchigo, supplemental, room), manual input flag, phone number |

**Block 9** — [SET] — Populate param[55]–param[75] (L4663–L4683)

> Sets mansion reference, install-to-customer-different flag, install address, install phone, and area separation processing flag.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kktk_param[55] = db_map.getString(MANSION_BUKKEN_NO)` // Mansion Property Number |
| 2 | SET | `kktk_param[56] = db_map.getString(KIKI_SOHUS_KSH_AD_SAI_FLG)` // Equipment Shipping Address-to-Customer-Different Flag |
| 3–19 | SET | `kktk_param[57-75] = db_map.getString(...)` // Install-to address fields, install-to phone, area separation processing flag, address undecided flag, auto-registration code, address undecided release date |

**Block 10** — [SET] — Populate param[76]–param[97] (L4684–L4705)

> Sets billing adjustment, installment codes, post-contract work request date, inspection dates, delivery info, trial/full application dates, contract date, JASSS documents date, guarantee info, and application date.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kktk_param[76] = db_map.getString(AD_MI_FIX_FLG)` // Address Undecided Flag |
| 2 | SET | `kktk_param[77] = db_map.getString(AUTO_ADD_CD)` // Auto-registration Code |
| 3 | SET | `kktk_param[78] = db_map.getString(CHRG_STA_YMD_HOSEI_UM)` // Billing Start Date Adjustment Presence/Absence |
| 4–16 | SET | `kktk_param[79-97] = db_map.getString(...)` // Install-to installment codes, post-contract work request date, inspection dates, delivery division/date/arrival designation, trial application/date, full application/date, contract date, JASSS application date, guarantee code |

**Block 11** — [SET] — Populate param[98] (L4706)

| # | Type | Code |
|---|------|------|
| 1 | SET | `kktk_param[98] = super.opeDate` // Reservation Apply Date — from instance field |

**Block 12** — [SET] — Populate param[99]–param[124] (L4707–L4732)

> Sets reservation cancel date, applies v22.00.00 fixed constant for application code, equipment change date, plan start/end dates, service cancel/reason dates, service start/billing start/stop dates, service stop reason/release info, pause info, and service end date.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kktk_param[99] = db_map.getString(RSV_CL_YMD)` // Reservation Cancel Date |
| 2 | SET | `kktk_param[100] = JBSbatKKConst.RSV_APLY_CD_FIX` // Reservation Application Code = "2" (v22.00.00) |
| 3 | SET | `kktk_param[101] = db_map.getString(KIKI_CHG_YMD)` // Equipment Change Date |
| 4 | SET | `kktk_param[102] = db_map.getString(PLAN_STAYMD)` // Plan Start Date |
| 5 | SET | `kktk_param[103] = super.opeDate` // Plan End Date — from instance field |
| 6 | SET | `kktk_param[104] = db_map.getString(PLAN_CHRG_STAYMD)` // Plan Billing Start Date |
| 7 | SET | `kktk_param[105] = opeDate_bf` // Plan Billing End Date |
| 8–16 | SET | `kktk_param[106-124] = db_map.getString(...)` // Plan end type code, service cancel date/reason, service start/billing start/stop dates, service stop reason/release codes, pause codes/dates/reasons, service end date |

**Block 13** — [IF / ELSE] — Compute service billing end date (L4734–L4743)

> v7.00.05 fix: Conditional date calculation for param[125] based on contract status.
> v22.00.00 change: Replaced dynamic `SVC_KEI_STAT_SVC_START` with `CD00056_KKTK_SVC_KEI_STAT_100`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `planStaYmd = db_map.getString(PLAN_STAYMD)` // Plan Start Date — extracted within the yes branch |

**Block 13.1** — [IF-BRANCH] — [IF-ELSE] `(stat == CD00056_KKTK_SVC_KEI_STAT_100)` `[CD00056_KKTK_SVC_KEI_STAT_100="100"]` (L4734)

> When the contract status is "100" (Service in Progress), compute the billing end date from the plan start date minus 1 day.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kktk_param[125] = JBSbatDateUtil.adjustDate(planStaYmd, -1)` // Service Billing End Date (Plan Start Date - 1 day) |

**Block 13.2** — [ELSE-BRANCH] — (L4739)

> For all other statuses, use the operation date minus 1 day as the billing end date.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kktk_param[125] = opeDate_bf` // Service Billing End Date (Operation Date - 1 day) |

**Block 14** — [SET] — Populate param[126] (L4744)

| # | Type | Code |
|---|------|------|
| 1 | SET | `kktk_param[126] = super.opeDate` // Service Dissolution Date — from instance field |

**Block 15** — [SET] — Populate param[127] (L4747)

> v22.00.00 change: Uses fixed constant instead of dynamic `SVC_DLRE_CD`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kktk_param[127] = JBSbatKKConst.SVC_DLRE_CD_NORMAL` // Service Dissolution Reason Code = "01" (Normal Dissolution, v22.00.00) |

**Block 16** — [SET] — Populate param[128]–param[135] (L4749–L4755)

> Sets service dissolution memo, remaining flag, dissolution handling completion flag, recovery date, cancel delete date, dissolution cancel date, review result sending code, and service pause billing start date.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kktk_param[128] = db_map.getString(SVC_DLRE_MEMO)` // Service Dissolution Reason Memo |
| 2 | SET | `kktk_param[129] = db_map.getString(ZANCHI_FLG)` // Remaining Flag |
| 3 | SET | `kktk_param[130] = JBSbatKKConst.CD01359_FIN_FLG_1` // Service Dissolution Handling Completion Flag = "1" (Completed, v22.00.00) |
| 4 | SET | `kktk_param[131] = ""` // Recovery Date — blank |
| 5 | SET | `kktk_param[132] = db_map.getString(SVC_CANCEL_CL_YMD)` // Service Cancel Delete Date |
| 6 | SET | `kktk_param[133] = ""` // Service Dissolution Cancel Date — blank |
| 7 | SET | `kktk_param[134] = db_map.getString(SKEKKA_SEND_CD)` // Review Result Sending Code |
| 8 | SET | `kktk_param[135] = db_map.getString(SVC_PAUSE_CHRG_STA_YMD)` // Service Pause Billing Start Date |

**Block 17** — [SET] — Populate param[136] (L4760)

> v7.00.05 fix: Removed dynamic penalty code lookup. v22.00.00: Uses fixed constant instead of literal `"0"`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kktk_param[136] = JBSbatKKConst.CD01375_PNLTY_HASSEI_CD_0` // Penalty Occurrence Code = "0" (None, v22.00.00; v7.00.05 removed dynamic lookup) |

**Block 18** — [SET] — Populate param[137]–param[154] (L4762–L4779)

> Sets equipment authentication ID/password, move division, installation actual receipt date, EO TV installation approval status date, move code, CAS card usage date, additional equipment info, inspection dissolution completion code, router dissolution reservation processing status/result, delivery method, equipment transfer move operator, return equipment presence, delivery request date, departure completion processing flag, and service start delivery status.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kktk_param[137] = db_map.getString(KIKI_NINSHO_ID)` // Equipment Authentication ID |
| 2 | SET | `kktk_param[138] = db_map.getString(KIKI_NINSHO_ID_PWD)` // Equipment Authentication ID Password |
| 3 | SET | `kktk_param[139] = db_map.getString(IDO_DIV)` // Move Division |
| 4 | SET | `kktk_param[140] = db_map.getString(KKST_JSEKI_UK_YMD)` // Equipment Installation Actual Receipt Date |
| 5 | SET | `kktk_param[141] = db_map.getString(EO_TV_KKST_SNN_STAT_CD)` // EO TV Equipment Installation Approval Status Code |
| 6 | SET | `kktk_param[142] = db_map.getString(KKST_SNN_YMD)` // Equipment Installation Approval Date |
| 7 | SET | `kktk_param[143] = ido_cd` // Indoor Equipment Move Code — input parameter |
| 8 | SET | `kktk_param[144] = db_map.getString(CAS_CARD_USE_KYODAK_YMD)` // CAS Card Usage Permission Date |
| 9–18 | SET | `kktk_param[145-154] = db_map.getString(...)` // Equipment additional info, inspection dissolution code, router dissolution reservation status/result, delivery method, equipment transfer move operator, return equipment presence, delivery request date, departure completion flag, service start delivery status |

**Block 19** — [SET] — Populate param[155]–param[161] (L4780–L4792)

> Sets audit trail values: registered timestamp, batch user ID, updated timestamp, batch user ID, blank delete timestamp, blank delete user ID, and invalidation flag.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kktk_param[155] = JCCBatCommon.getSysDateTimeStamp()` // Registered Year-Month-Day-Hour-Min-Second |
| 2 | SET | `kktk_param[156] = batchUserId` // Registered Operator Account — from instance field |
| 3 | SET | `kktk_param[157] = JCCBatCommon.getSysDateTimeStamp()` // Updated Year-Month-Day-Hour-Min-Second |
| 4 | SET | `kktk_param[158] = batchUserId` // Updated Operator Account — from instance field |
| 5 | SET | `kktk_param[159] = ""` // Deleted Year-Month-Day-Hour-Min-Second — blank |
| 6 | SET | `kktk_param[160] = ""` // Deleted Operator Account — blank |
| 7 | SET | `kktk_param[161] = JBSbatKKConst.MK_FLG_YK` // Invalidation Flag (v22.00.00) |

**Block 20** — [SET] — Populate param[162]–param[167] (L4793–L4799)

> Sets blank audit operation fields: registered operation date, registered processing ID, updated operation date, updated processing ID, deleted operation date, deleted processing ID.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kktk_param[162] = ""` // Registered Operation Date — blank |
| 2 | SET | `kktk_param[163] = ""` // Registered Processing ID — blank |
| 3 | SET | `kktk_param[164] = ""` // Updated Operation Date — blank |
| 4 | SET | `kktk_param[165] = ""` // Updated Processing ID — blank |
| 5 | SET | `kktk_param[166] = ""` // Deleted Operation Date — blank |
| 6 | SET | `kktk_param[167] = ""` // Deleted Processing ID — blank |

**Block 21** — [CALL] — Execute insert (L4802)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `executeKK_T_KKTK_SVC_KEI_PKINSERT(kktk_param)` // Insert new record into KK_T_KKTK_SVC_KEI with all 168 fields |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `kktk_svc_no` | Field | Equipment Provision Service Contract Number — Unique identifier for the equipment provision service contract being registered in the batch |
| `ido_cd` | Field | Indoor Equipment Move Code — Classifies the type of indoor equipment movement/change operation being processed |
| `KKTK_SVC_KEI_STAT` | Field | Equipment Provision Service Contract Status — Status code for the equipment provision service contract (e.g., "100" = in service, "910" = dissolution complete) |
| `KKTK_SVC_CD` | Field | Equipment Provision Service Code — Identifies the type of equipment provision service (e.g., router, CAS card, VoVA) |
| `PCRS_CD` | Field | Cost Code — Billing cost classification code |
| `PPLAN_CD` | Field | Plan Code — Service plan identification code |
| `TK_HOSHIKI_KEI_NO` | Field | Delivery Method Contract Number — Contract number for the delivery method |
| `KKTK_SBT_CD` | Field | Equipment Provision Type Code — Classification of the equipment provision type |
| `HAMBAI_SBT_CD` | Field | Sales Type Code — Classification of the sales type |
| `SVC_USE_STA_KIBO_YMD` | Field | Service Usage Start Desired Date — Customer-requested service start date |
| `RSV_TSTA_KIBO_YMD` | Field | Reservation Application Start Desired Date — Desired date for reservation application start |
| `KIKI_SHITEI_SBT_CD` | Field | Equipment Designation Type Code — Type of equipment designation |
| `TAKNKIKI_SBT_CD` | Field | Indoor Equipment Type Code — Classification of indoor equipment |
| `TAKNKIKI_MODEL_CD` | Field | Indoor Equipment Model Code — Model code for indoor equipment |
| `KIKI_SEIZO_NO` | Field | Equipment Serial Number — Manufacturer-assigned serial number |
| `KIKI_CHG_YMD` | Field | Equipment Change Date — Date when equipment was changed |
| `SVC_KEI_NO` | Field | Service Contract Number — Master service contract identifier |
| `SVC_KEI_UCWK_NO` | Field | Service Contract Detail Number — Internal detail number for service contract line items |
| `SYSID` | Field | SYSID — System identifier |
| `MSKM_DTL_NO` | Field | Submission Detail Number — Detail number for the submission |
| `LINK_STB_FLG` | Field | Link STB Flag — Flag indicating STB linking status |
| `KIKI_SORYO_UM` | Field | Equipment Shipping Presence/Absence — Whether shipping charges apply (yes/no) |
| `KIKI_SOHUS_NM` | Field | Equipment Shipping Destination Name — Name of the shipping address |
| `KIKI_STC_SAKI_NM` | Field | Equipment Installation Destination Name — Name of the installation address |
| `ZANCHI_FLG` | Field | Remaining Flag — Flag for remaining balance/attachment |
| `SVC_DLRE_CD_NORMAL` | Field | Service Dissolution Reason Code — "01" = Normal Dissolution (standard service cancellation) |
| `CD00056_KKTK_SVC_KEI_STAT_100` | Constant | Equipment Provision Service Contract Status = "100" (Service in Progress) — triggers plan-based billing end date calculation |
| `CD00056_KKTK_SVC_KEI_STAT_910` | Constant | Equipment Provision Service Contract Status = "910" (Dissolution Complete) — fixed status code assigned to new records (v22.00.00) |
| `RSV_APLY_CD_FIX` | Constant | Reservation Application Code = "2" (Fixed) — fixed application code (v22.00.00) |
| `CD01359_FIN_FLG_1` | Constant | Service Dissolution Handling Completion Flag = "1" (Completed) — indicates dissolution handling is complete (v22.00.00) |
| `CD01375_PNLTY_HASSEI_CD_0` | Constant | Penalty Occurrence Code = "0" (None) — no penalty applies (v22.00.00) |
| `MK_FLG_YK` | Constant | Invalidation Flag — "0" = Valid (v22.00.00) |
| `opeDate` | Instance Field | Operation Apply Date — Batch processing date used as reference for date calculations |
| `batchUserId` | Instance Field | Batch Operator Account — System user ID for audit trail in batch operations |
| KK_T_KKTK_SVC_KEI | DB Table | Equipment Provision Service Contract Table — Main table storing equipment provision service contract records |
| T_KKTK_SVC_KEI | DB Table | Equipment Provision Service Contract Table (alias) — The table targeted by the insert operation |
| executeKK_T_KKTK_SVC_KEI_PKINSERT | Method | Primary Key Insert Method — Performs the actual INSERT into the KK_T_KKTK_SVC_KEI table |
| DB_MAP | Parameter | Data Map Interface — Key-value interface for accessing contract record fields |
| JCCBatCommon.getSysDateTimeStamp | Method | System DateTime Stamp — Returns current system timestamp as a string |
| JBSbatDateUtil.adjustDate | Method | Date Adjustment — Adjusts a date string by a specified number of days |
| FTTH | Business term | Fiber To The Home — Fiber-optic broadband internet service (context: equipment provision services include FTTH routers) |
| CAS | Business term | Conditional Access System — Smart card system for cable television subscription management |
| STB | Acronym | Set-Top Box — Equipment for receiving and decoding television signals |
| DSL | Acronym | Downstream Line — Batch processing methods for service contract line changes |
| EO | Business term | eo (Big Edo Optical) — NTT West's broadband brand; equipment provision services are eo-branded |
