# Business Logic — JKKWribSvcKeiOperateCC.generateContentViewForView() [211 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `com.fujitsu.futurity.bp.custom.common.JKKWribSvcKeiOperateCC` |
| Layer | CC / Common Component (shared utility class in the `common` package) |
| Module | `common` (Package: `com.fujitsu.futurity.bp.custom.common`) |

## 1. Role

### JKKWribSvcKeiOperateCC.generateContentViewForView()

This method is the central **view-data transformer** for the Discount Service Contract (割引サービス契約) confirmation/detail screen in the K-Opticom customer management system. It accepts a service category type (`keiKind`) and an account number (`keiNo`), then populates a `HashMap<String, Object>` with all fields required to render the contract information display area.

The method implements a **routing/dispatch pattern**: it resolves `keiKind` into an enum (`KeiKind`) and branches into two distinct processing tracks. For `HNSOKU` (data extraction items / データ抽出項目 — promotional campaign configuration records), it fetches campaign item details and their parent campaign metadata from the discount campaign master tables. For `WRIB` (discount service contracts / 割引サービス — contracted discount lines tied to a customer account), it fetches the contract-level data and the associated discount service definition, including optional penalty information when applicable.

This method plays the role of a **shared data assembler** called by the long-term continuation discount info screen (`getChoukiKeizokuWaribInfo`) and the content resolution view method (`resolveContentForView`). It does not perform any database operations itself — instead, it delegates all data retrieval to the `resolveDchskmst`, `resolveDchskm`, `resolveWribSvcKei`, and `resolveWribSvc` methods, acting purely as a presentation-layer data coordinator.

If `keiKind` does not match any known enum value, the method returns an empty HashMap, effectively producing a blank display area.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["generateContentViewForView keiKind, keiNo"])
    START --> INIT["Create HashMap result"]
    INIT --> RESOLVE["KeiKind keiKindEnum = KeiKind.resolve keiKind"]
    RESOLVE --> SWITCH{"keiKindEnum"}

    SWITCH -->|HNSOKU| HNSOKU_BLOCK["HNSOKU Branch"]
    SWITCH -->|WRIB| WRIB_BLOCK["WRIB Branch"]
    SWITCH -->|NULL / default| DEFAULT["No-op (default)"]

    HNSOKU_BLOCK --> H_RESOLVE_DCHSKMST["CAANMsg dchskmst = resolveDchskmst keiNo"]
    H_RESOLVE_DCHSKMST --> H_FETCH["Extract fields from dchskmst: dchskm_cd, fin_sbt_cd_nm, aply_jun, stat, sta_ymd, end_ymd, chsht_cnt, mskm_kisan_ymd, intr_cd"]
    H_FETCH --> H_RESOLVE_DCHSKM["CAANMsg dchskm = resolveDchskm dchskmCd"]
    H_RESOLVE_DCHSKM --> H_FETCH_DCHSKM["Extract: dsp_dchskm_cd, campaignCd, dchskmNm, dchsSbtCdNm, dchsTypeCdNm"]
    H_FETCH_DCHSKM --> H_3TEN_CHECK{DCHSKM_CD_3TEN_MOSHIKOMI equals dchskmCd?}

    H_3TEN_CHECK -->|true| H_CLEAR_DATES["Set dchskmstStaYmd = empty, dchskmstEndYmd = empty"]
    H_CLEAR_DATES --> H_PUT
    H_3TEN_CHECK -->|false| H_PUT["Put all fields into result map"]
    H_PUT --> H_PUT_INTR["Put intrCd and hi_svc_kei_no from retHiSvcKeiNo"]
    H_PUT_INTR --> H_END(["End HNSOKU branch"])

    WRIB_BLOCK --> W_RESOLVE_WRIB["CAANMsg wribSvcKei = resolveWribSvcKei keiNo"]
    W_RESOLVE_WRIB --> W_FETCH["Extract: wrib_svc_cd, stat, stat_nm, aply_jun, pauseStat, pauseEnd, mskm_kisan_ymd, lenWariAtKeizk"]
    W_FETCH --> W_2013["Extract: svc_chrg_staymd, useStaymd, wribAmntSnstStdardymd"]
    W_2013 --> W_RESOLVE_WRIB_SVC["CAANMsg wribSvc = resolveWribSvc wribSvcCd"]
    W_RESOLVE_WRIB_SVC --> W_FETCH_SVC["Extract: dsp_campaign_cd, wribSvcNm, wribTypeCdNm, wribTypeCd"]
    W_FETCH_SVC --> W_PUT["Put all fields into result map"]
    W_PUT --> W_RESOLVE_KIBO["Resolve riyo_sta_ymd: use svc_use_sta_kibo_ymd if not MAX_YMD"]
    W_RESOLVE_KIBO --> W_PNLTY_CHECK{isWrStaCset wribSvcCd AND WribSvcKeiStat.KAIYAKU_ZUMI matches wribSvcKeiStat?}

    W_PNLTY_CHECK -->|true| W_GET_PNLTY["String pnltyNm = resolveCd CD00002 pnlty_hassei_cd"]
    W_GET_PNLTY --> W_PUT_PNLTY["Put pnlty_nm into result"]
    W_PUT_PNLTY --> W_END(["End WRIB branch"])
    W_PNLTY_CHECK -->|false| W_END

    W_END --> RETURN["Return result map"]
    H_END --> RETURN
    DEFAULT --> RETURN
```

### HNSOKU Branch Details (Data Extraction Items / データ抽出項目)

```mermaid
flowchart TD
    H_START(["HNSOKU branch start"])
    H_START --> H1["dchskmst = resolveDchskmst keiNo"]
    H1 --> H2["dchskm = resolveDchskm dchskm_cd from dchskmst"]

    H2 --> H3("dchskmCd == DT0000002?")
    H3 -->|Yes - DCHSKM_CD_3TEN_MOSHIKOMI| H_CLEAR["Clear dchskmstStaYmd and dchskmstEndYmd to empty string
(Net Phone TV 3-Contract Application does not show setting date range)"]
    H3 -->|No| H_BUILD["Build result map with all fields"]
    H_CLEAR --> H_BUILD
    H_BUILD --> H4["retHiSvcKeiNo intrCd to get hi_svc_kei_no"]
    H4 --> H_END(["End HNSOKU"])
```

The comment `ネット電話テレビ三点申し込の場合は、データ抽出項目設定開始年月日・データ抽出項目設定終了年月日を表示しない` translates to "For Net Phone TV 3-Contract Applications, do not display the data extraction item setting start/end year-month-day." The constant `DCHSKM_CD_3TEN_MOSHIKOMI` with value `"DT0000002"` identifies this special campaign type.

### WRIB Branch Details (Discount Service Contracts / 割引サービス)

```mermaid
flowchart TD
    W_START(["WRIB branch start"])
    W_START --> W1["wribSvcKei = resolveWribSvcKei keiNo"]
    W1 --> W2["wribSvc = resolveWribSvc wrib_svc_cd"]
    W2 --> W3["Build result map with all fields"]
    W3 --> W4["Resolve riyo_sta_ymd: use svc_use_sta_kibo_ymd if != 20991231"]
    W4 --> W5("isWrStaCset AND KAIYAKU_ZUMI?")
    W5 -->|Yes| W_PNLTY["Get pnlty_nm from resolveCd CD00002 pnlty_hassei_cd"]
    W5 -->|No| W_END(["End WRIB"])
    W_PNLTY --> W_END
```

The penalty output condition comment reads `違約金有無出力用：条件不一致は放置` ("For penalty occurrence flag output: skip if conditions not met"). The `isWrStaCset` check verifies if the service is the Star Channel Set bundle (`WRIB_STAR_C_SET = "W00000009"`), and `KAIYAKU_ZUMI = "910"` means the contract has been completed. Only when both conditions are true does it resolve and include penalty information.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `keiKind` | `String` | Service category type that determines which data source and display format to use. Takes values `"w"` for discount service contracts (割引サービス契約) or `"d"` for data extraction items (データ抽出項目). The value is resolved into a `KeiKind` enum that drives the routing switch statement. |
| 2 | `keiNo` | `String` | The unique account/item number (契約番号・項目番号) used to look up the specific contract record or data extraction configuration. Passed directly to `resolveDchskmst` or `resolveWribSvcKei` as the lookup key. |

**Instance fields / external state read:**
| Source | Description |
|--------|-------------|
| `WRIB_STAR_C_SET` | Static constant `"W00000009"` — identifies the Star Channel Set bundle discount service; used by `isWrStaCset()` to determine if penalty info should be displayed. |
| `DCHSKM_CD_3TEN_MOSHIKOMI` | Static constant `"DT0000002"` — identifies the special Net Phone TV 3-Contract Application campaign type that suppresses date range display. |
| `MAX_YMD` | Static constant `"20991231"` from `JKKSvcConst` / `JKKAdchgInitDspCC` — sentinel value indicating no specific usage start date preference is set. |
| `KeiKind` enum | Internal enum with values `WRIB("w")`, `HNSOKU("d")`, `NULL("")` — used for routing the method into the correct processing branch. |
| `WribSvcKeiStat` enum | Internal enum with status values `UKETSUKE_ZUMI("010")`, `SVC_TEIKYOU_CHUU("100")`, `TEKIYOU_ZUMI("300")`, `KAIYAKU_ZUMI("910")`, `CANCEL_ZUMI("920")` — represents contract lifecycle states. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `resolveDchskmst` | (inferred) | Campaign Item Master (data extraction item setting) | Fetches the data extraction item configuration by item number; returns dchskm_cd, status, date range, count, referral date, etc. |
| R | `resolveDchskm` | (inferred) | Campaign Master | Looks up campaign details using the dchskm_cd from the master table; returns campaign code, name, type, and subject code names. |
| R | `resolveWribSvcKei` | (inferred) | Discount Service Contract Master | Fetches the discount service contract record by keiNo; returns service code, status, application date, pause dates, long-term continuation discount code, service charge start date, and usage start preference date. |
| R | `resolveWribSvc` | (inferred) | Discount Service Definition Table | Looks up the discount service definition by service code; returns campaign code, service name, discount type code and name. |
| R | `resolveCd` | (inferred) | Code Master Table (CD00002) | Resolves the penalty occurrence code (pnlty_hassei_cd) into a human-readable name using the CD00002 code division. |
| R | `retHiSvcKeiNo` | (inferred) | Referral Service Contract Table | Resolves the referral code (intrCd) into the referenced service contract number. |
| - | `JKKStringUtil.isNullBlank` | - | - | Utility method; checks if strings are null or blank for safe null-handling on intrCd, pauseStat, pauseEnd. |
| - | `isWrStaCset` | - | - | Internal method; checks if the service code matches the Star Channel Set bundle discount service (`"W00000009"`). |

### Called methods detail

| Method | Purpose |
|--------|---------|
| `resolveDchskmst(String keiNo)` | Fetches data extraction item setting details (データ抽出項目設定) — the configuration record for promotional data extraction items. Returns CAANMsg containing dchskm_cd, status codes and names, date range (start/end ymd), count, and referral code. |
| `resolveDchskm(String dchskmCd)` | Fetches discount campaign details (割引キャンペーン詳細) — parent campaign information for a given campaign code. Returns CAANMsg with display campaign code, campaign name, type name, and subject code. |
| `resolveWribSvcKei(String keiNo)` | Fetches discount service contract details (割引サービス契約詳細) — the contracted discount line item for a customer. Returns CAANMsg with service code, status, application date, pause dates, long-term continuation info, service charge dates, and usage start preference. |
| `resolveWribSvc(String wribSvcCd)` | Fetches discount service definition (割引サービス定義) — the catalog definition of a discount service. Returns CAANMsg with display campaign code, service name, and discount type. |
| `resolveCd(String cdDivCd, String cd)` | Resolves a code value (辞書コード解決) — looks up a code's display name from a code division master table. Used to resolve the penalty occurrence code in CD00002. |
| `retHiSvcKeiNo(String intrCd)` | Returns the referral service contract number (被紹介者サービス契約番号) — resolves the referral/affiliate code into the actual service contract number of the referred party. |
| `isWrStaCset(String wSvcCd)` | Checks if the service is a Star Channel Set bundle discount (スターチャンネルセット割判定) — returns true only for service code `"W00000009"`. |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Method: `JKKWribSvcKeiOperateCC.getChoukiKeizokuWaribInfo` (L11287) | `getChoukiKeizokuWaribInfo` -> `generateContentViewForView(keiKindEnum3, wribSvcKei.getString("wrib_svc_kei_no"))` | `resolveDchskmst [R] Campaign Item Master`, `resolveDchskm [R] Campaign Master`, `resolveWribSvcKei [R] Discount Service Contract Master`, `resolveWribSvc [R] Discount Service Definition`, `resolveCd [R] Code Master (CD00002)` |
| 2 | Method: `JKKWribSvcKeiOperateCC.resolveContentForView` (L1996) | `resolveContentForView` -> `generateContentViewForView(keiKind, keiNo)` | Same as above |

Both callers are internal methods within the same `JKKWribSvcKeiOperateCC` class. This method does not appear to be called directly from any screen (KKSV*) or batch entry point — it serves as an internal helper that assembles view data for the discount service contract display.

## 6. Per-Branch Detail Blocks

### Block 1 — SWITCH (KeiKind enum dispatch) (L2285)

The method resolves `keiKind` into an enum and dispatches based on the service category type. Two branches are implemented: `HNSOKU` (data extraction items) and `WRIB` (discount service contracts). The default branch is a no-op.

| # | Type | Code |
|---|------|------|
| 1 | RESOLVE | `KeiKind keiKindEnum = KeiKind.resolve(keiKind)` // Resolves "d" -> HNSOKU, "w" -> WRIB, "" -> NULL |
| 2 | SWITCH | `switch (keiKindEnum)` // Dispatches to HNSOKU, WRIB, or default |

### Block 1.1 — IF-BRANCH [HNSOKU] (データ抽出項目 / Data Extraction Items) (L2291)

Handles the data extraction item (promotional campaign setting) display data. Fetches campaign item master data, then its parent campaign details. For the special Net Phone TV 3-Contract Application (`DCHSKM_CD_3TEN_MOSHIKOMI = "DT0000002"`), the date range display fields are cleared.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `CAANMsg dchskmst = resolveDchskmst(keiNo)` // Fetches data extraction item configuration [R] Campaign Item Master |
| 2 | SET | `String dchskmCd = dchskmst.getString("dchskm_cd")` // Campaign item code |
| 3 | SET | `String finSbtCdNm = dchskmst.getString("dchskmst_fin_sbt_cd_nm")` // Final subject code name |
| 4 | SET | `String aplyJun = dchskmst.getString("aply_jun")` // Application date |
| 5 | SET | `String aplyJunNm = dchskmst.getString("aply_jun_nm")` // Application date name |
| 6 | SET | `String dchskmstStat = dchskmst.getString("dchskmst_stat")` // Data extraction item status code |
| 7 | SET | `String dchskmstStatNm = dchskmst.getString("dchskmst_stat_nm")` // Status name |
| 8 | SET | `String dchskmstStaYmd = dchskmst.getString("dchskmst_sta_ymd")` // Setting start year-month-day |
| 9 | SET | `String dchskmstEndYmd = dchskmst.getString("dchskmst_end_ymd")` // Setting end year-month-day |
| 10 | SET | `String chshtCnt = dchskmst.getString("chsht_cnt")` // Number of applications (long-term continuation discount contract system) |
| 11 | SET | `String dchskmstMskmKisanYmd = dchskmst.getString(EKK1391A010CBSMsg1List.MSKM_KISAN_YMD)` // Discount service start date |
| 12 | CALL | `CAANMsg dchskm = resolveDchskm(dchskmCd)` // Fetches parent campaign details [R] Campaign Master |
| 13 | SET | `String campaignCd = dchskm.getString("dsp_dchskm_cd")` // Display campaign code |
| 14 | SET | `String dchskmNm = dchskm.getString("dchskm_nm")` // Campaign name |
| 15 | SET | `String dchsTypeCdNm = dchskm.getString("dchs_type_cd_nm")` // Campaign subject type name |
| 16 | SET | `String dchsSbtCd = dchskm.getString("dchs_sbt_cd")` // Campaign subject code |
| 17 | SET | `String dchsSbtCdNm = dchskm.getString("dchs_sbt_cd_nm")` // Campaign subject code name |
| 18 | SET | `String intrCd = JKKStringUtil.isNullBlank(dchskmst.getString("intr_cd")) ? "" : dchskmst.getString("intr_cd")` // Referral code (null-safe) |

#### Block 1.1.1 — IF [DCHSKM_CD_3TEN_MOSHIKOMI = "DT0000002"] (Net Phone TV 3-Contract Application) (L2319)

For the special Net Phone TV 3-Contract Application campaign type, the setting date range is hidden from display. The comment reads `ネット電話テレビ三点申し込の場合は、データ抽出項目設定開始年月日・データ抽出項目設定終了年月日を表示しない` ("For Net Phone TV 3-Contract Applications, do not display the data extraction item setting start/end year-month-day").

| # | Type | Code |
|---|------|------|
| 1 | SET | `dchskmstStaYmd = ""` // Clear start date for 3-Contract Application |
| 2 | SET | `dchskmstEndYmd = ""` // Clear end date for 3-Contract Application |

### Block 1.2 — RESULT POPULATION (HNSOKU) (L2325)

All resolved fields are populated into the result HashMap for the HNSOKU branch.

| # | Type | Code |
|---|------|------|
| 1 | SET | `result.put("kei_kind", keiKind)` |
| 2 | SET | `result.put("no", keiNo)` |
| 3 | SET | `result.put("sbt_cd", dchsSbtCd)` |
| 4 | SET | `result.put("sbt_cd_nm", dchsSbtCdNm)` |
| 5 | SET | `result.put("stat", dchskmstStat)` |
| 6 | SET | `result.put("stat_nm", dchskmstStatNm)` |
| 7 | SET | `result.put("svc_cd", dchskmCd)` |
| 8 | SET | `result.put("campaign_cd", campaignCd)` |
| 9 | SET | `result.put("campaign_cd_nm", dchskmNm)` |
| 10 | SET | `result.put("type_cd_nm", dchsTypeCdNm)` |
| 11 | SET | `result.put("aply_jun", aplyJun)` |
| 12 | SET | `result.put("aply_jun_nm", aplyJunNm)` |
| 13 | SET | `result.put("staymd", dchskmstStaYmd)` |
| 14 | SET | `result.put("endymd", dchskmstEndYmd)` |
| 15 | SET | `result.put("chsht_cnt", chshtCnt)` // Long-term continuation discount contract system |
| 16 | SET | `result.put("fin_sbt_cd_nm", finSbtCdNm)` |
| 17 | SET | `result.put("mskm_kisan_ymd", dchskmstMskmKisanYmd)` // Discount service start date |
| 18 | SET | `result.put("intr_cd", intrCd)` |
| 19 | SET | `result.put("hi_svc_kei_no", JKKStringUtil.isNullBlank(intrCd) ? "" : retHiSvcKeiNo(intrCd))` // Referral service contract number |

### Block 2 — IF-BRANCH [WRIB] (割引サービス / Discount Service Contracts) (L2339)

Handles the discount service contract display data. Fetches the contract record and its associated service definition. Populates all fields into the result map, then conditionally resolves and displays penalty information if the service is a Star Channel Set bundle and the contract is completed.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `CAANMsg wribSvcKei = resolveWribSvcKei(keiNo)` // Fetches discount service contract [R] Discount Service Contract Master |
| 2 | SET | `String wribSvcCd = wribSvcKei.getString("wrib_svc_cd")` // Discount service code |
| 3 | SET | `String wribSvcKeiStat = wribSvcKei.getString("wrib_svc_kei_stat")` // Contract status code |
| 4 | SET | `String wribSvcKeiStatNm = wribSvcKei.getString("wrib_svc_kei_stat_nm")` // Status name |
| 5 | SET | `String aplyJun = wribSvcKei.getString("aply_jun")` // Application date |
| 6 | SET | `String aplyJunNm = wribSvcKei.getString("aply_jun_nm")` // Application date name |
| 7 | SET | `String pauseStat = wribSvcKei.getString("wrtgkei_svc_pause_ymd")` // Pause start date |
| 8 | SET | `String pauseEnd = wribSvcKei.getString("wrtgkei_svc_pause_rls_ymd")` // Pause release date |
| 9 | SET | `String mskmKisanYmd = wribSvcKei.getString(EKK0451A010CBSMsg1List.MSKM_KISAN_YMD)` // Discount service start date |
| 10 | SET | `String lenWariAtKeizk = wribSvcKei.getString("wrib_svc_kei_at_keizk_skcd")` // Long-term continuation discount code |
| 11 | SET | `String lenWariAtKeizkNm = wribSvcKei.getString("wrib_svc_kei_at_keizk_skcd_nm")` // Long-term continuation discount code name |
| 12 | SET | `String svcChrgStaymd = wribSvcKei.getString("svc_chrg_staymd")` // Service charge start date |
| 13 | SET | `String useStaymd = wribSvcKei.getString("wrib_amnt_snst_stdardymd")` // Usage start date |
| 14 | SET | `String wribAmntSnstStdardymd = wribSvcKei.getString("wrib_amnt_snst_stdardymd")` // Discount amount preference standard date |
| 15 | CALL | `CAANMsg wribSvc = resolveWribSvc(wribSvcCd)` // Fetches discount service definition [R] Discount Service Definition |
| 16 | SET | `String campaignCd = wribSvc.getString("dsp_campaign_cd")` // Display campaign code |
| 17 | SET | `String campaignCdNm = wribSvc.getString("wrib_svc_nm")` // Service name |
| 18 | SET | `String wribTypeCdNm = wribSvc.getString("wrib_type_cd_nm")` // Discount type name |
| 19 | SET | `String wribTypeCd = wribSvc.getString("wrib_type_cd")` // Discount type code |

### Block 2.1 — RESULT POPULATION (WRIB) (L2386)

Populates all resolved fields into the result HashMap for the WRIB branch.

| # | Type | Code |
|---|------|------|
| 1 | SET | `result.put("kei_kind", keiKind)` |
| 2 | SET | `result.put("no", keiNo)` |
| 3 | SET | `result.put("stat", wribSvcKeiStat)` |
| 4 | SET | `result.put("stat_nm", wribSvcKeiStatNm)` |
| 5 | SET | `result.put("svc_cd", wribSvcCd)` |
| 6 | SET | `result.put("campaign_cd", campaignCd)` |
| 7 | SET | `result.put("campaign_cd_nm", campaignCdNm)` |
| 8 | SET | `result.put("type_cd_nm", wribTypeCdNm)` |
| 9 | SET | `result.put("aply_jun", aplyJun)` |
| 10 | SET | `result.put("aply_jun_nm", aplyJunNm)` |
| 11 | SET | `result.put("fin_sbt_cd_nm", finSbtCdNm)` // Empty string (not used for WRIB) |
| 12 | SET | `result.put("mskm_kisan_ymd", mskmKisanYmd)` |
| 13 | SET | `result.put("type_cd", wribTypeCd)` |
| 14 | SET | `result.put("len_wari_at_keizk", lenWariAtKeizk)` |
| 15 | SET | `result.put("len_wari_at_keizk_nm", lenWariAtKeizkNm)` |
| 16 | SET | `result.put("svc_chrg_staymd", svcChrgStaymd)` |
| 17 | SET | `result.put("use_staymd", useStaymd)` |
| 18 | SET | `result.put("wrib_amnt_snst_stdardymd", wribAmntSnstStdardymd)` |
| 19 | SET | `result.put("pause_stat", JKKStringUtil.isNullBlank(pauseStat) ? "" : pauseStat)` |
| 20 | SET | `result.put("pause_end", JKKStringUtil.isNullBlank(pauseEnd) ? "" : pauseEnd)` |

### Block 2.2 — IF [riyo_sta_ymd resolve, v10.00.01 MOD] (L2433)

Resolves the usage start date (`riyo_sta_ymd`). If the preference date equals `MAX_YMD = "20991231"` (meaning no preference is set), the field is set to empty string; otherwise it uses the preference date value.

| # | Type | Code |
|---|------|------|
| 1 | SET | `String kiboYmd = ""` // Default empty |
| 2 | IF | `!MAX_YMD.equals(wribSvcKei.getString("svc_use_sta_kibo_ymd"))` // Not equal to 20991231 |
| 3 | SET | `kiboYmd = wribSvcKei.getString("svc_use_sta_kibo_ymd")` // Use the preference date |
| 4 | SET | `result.put("riyo_sta_ymd", kiboYmd)` // Set the resolved value |

### Block 2.3 — IF [Penalty info for Star Channel Set bundle, v10.00.00 ADD] (L2439)

Displays penalty information only when the service is a Star Channel Set Set bundle discount and the contract status is "Contract Completed" (KAIYAKU_ZUMI = "910"). The comment reads `違約金有無出力用：条件不一致は放置` ("For penalty occurrence flag output: skip if conditions not met").

#### Block 2.3.1 — COMPOUND CONDITION (L2439)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `isWrStaCset(wribSvcCd)` // Returns true if wribSvcCd == "W00000009" (Star Channel Set bundle) |
| 2 | CALL | `WribSvcKeiStat.KAIYAKU_ZUMI.isMatch(wribSvcKeiStat)` // Checks if status == "910" (Contract Completed) |

#### Block 2.3.2 — INNER BLOCK (Penalty resolution) (L2441)

| # | Type | Code |
|---|------|------|
| 1 | SET | `String pnltyNm = resolveCd("CD00002", wribSvcKei.getString("pnlty_hassei_cd")).getString("cd_div_nm")` // Resolves penalty code to name [R] Code Master CD00002 |
| 2 | SET | `result.put("pnlty_nm", JKKStringUtil.isNullBlank(pnltyNm) ? "" : pnltyNm)` // Null-safe penalty name |

### Block 3 — RETURN (L2454)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return result` // Returns the populated HashMap to the caller |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `keiKind` | Field | Service category type — distinguishes between data extraction items ("d") and discount service contracts ("w") |
| `keiNo` | Field | Contract/item number — unique identifier for the specific contract line item or data extraction configuration |
| `dchskm` | Field | Discount Campaign (Master) — the campaign item configuration record for promotional data extraction |
| `dchskmst` | Field | Discount Campaign Master (Setting) — data extraction item setting master table, containing status, date range, and referral code |
| `dchskm_cd` | Field | Discount campaign code — the campaign identifier linking the setting to its parent campaign |
| `dchskmst_sta_ymd` | Field | Data extraction item setting start date — when the campaign setting becomes effective |
| `dchskmst_end_ymd` | Field | Data extraction item setting end date — when the campaign setting expires |
| `dchskmst_stat` | Field | Data extraction item status code — current state of the campaign setting |
| `chsht_cnt` | Field | Number of applications — count of applications under the long-term continuation discount contract system |
| `wrib` | Field | Discount (Warihibiki) — short for "discount service" in the telecom context |
| `wrib_svc_cd` | Field | Discount service code — identifies the specific discount service type (e.g., Star Channel Set bundle) |
| `wrib_svc_kei_stat` | Field | Discount service contract status — lifecycle state of the contract (pending, in-service, completed, cancelled) |
| `KAIYAKU_ZUMI` | Enum | Contract Completed — status code "910" indicating the contract has been completed (potential penalty applicable) |
| `Uketsuke Zumi` | Enum | Registration Complete — status code "010" indicating the contract has been registered |
| `Svc Teikyou Chuu` | Enum | Service Provision in Progress — status code "100" indicating the service is actively being provided |
| `Teikiyou Zumi` | Enum | Application Complete — status code "300" indicating the application has been fully processed |
| `Cancel Zumi` | Enum | Cancellation Complete — status code "920" indicating the contract has been cancelled |
| `pnlty_hassei_cd` | Field | Penalty occurrence code — code indicating whether and why a penalty (違約金) has been incurred |
| `intr_cd` | Field | Referral/Affiliate code — identifies the referral relationship between service contracts |
| `hi_svc_kei_no` | Field | Referral service contract number — the service contract number of the referred (affiliate) party |
| `len_wari_at_keizk` | Field | Long-term continuation discount code — code identifying the long-term contract continuation discount type |
| `svc_chrg_staymd` | Field | Service charge start date — when billing for the service begins |
| `riyo_sta_ymd` | Field | Usage start date — the customer's preferred service usage start date (or empty if no preference) |
| `svc_use_sta_kibo_ymd` | Field | Service usage start preference date — customer's requested start date, or "20991231" if not set |
| `mskm_kisan_ymd` | Field | Discount service start date — when the discount service billing commences |
| `pause_stat` / `pause_end` | Field | Pause period — the start and end dates of a service pause (e.g., customer traveling abroad) |
| `DCHSKM_CD_3TEN_MOSHIKOMI` | Constant | Campaign code "DT0000002" — Net Phone TV 3-Contract Application; a special campaign type that suppresses date range display |
| `WRIB_STAR_C_SET` | Constant | Service code "W00000009" — Star Channel Set bundle discount service; triggers penalty info display |
| `MAX_YMD` | Constant | Date "20991231" — sentinel value representing "no preference set" or "unbounded future" |
| `KeiKind` | Enum | Internal enum for routing: WRIB ("w"), HNSOKU ("d"), NULL ("") |
| HNSOKU | Enum value | Data Extraction Items (データ抽出項目) — promotional campaign configuration records |
| WRIB | Enum value | Discount Service Contracts (割引サービス) — contracted discount line items |
| K-Opticom | Business term | Japanese telecom operator providing fiber (eo Hikari), mobile (mineo), and bundled services |
| Star Channel Set | Business term | A bundled TV service offering from K-Opticom that includes BS/CS channels; subject to special penalty rules |
| 違約金 | Business term | Penalty / Liquidated damages — charges incurred when a customer cancels a service contract before the term expires |
| スターチャンネルセット割 | Business term | Star Channel Set bundle discount — a discount plan tied to subscribing to the Star Channel Set TV package |
| 長期継続利用割引 | Business term | Long-term continuation utilization discount — a discount for maintaining service over an extended period |
| 割引サービス契約 | Business term | Discount service contract — the contractual agreement for a discounted service line item |
| データ抽出項目設定 | Business term | Data extraction item setting — configuration of a promotional campaign's data extraction parameters |
| 三点申し込 | Business term | 3-Contract Application — subscribing to three services simultaneously (Net + Phone + TV) |
