# Business Logic — JKKWrisvcAutoAplyCCMapper.callEKK0841B004_2() [314 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `com.fujitsu.futurity.bp.custom.common.JKKWrisvcAutoAplyCCMapper` |
| Layer | CC / Common Component (Cross-component service mapper) |
| Module | `common` (Package: `com.fujitsu.futurity.bp.custom.common`) |

## 1. Role

### JKKWrisvcAutoAplyCCMapper.callEKK0841B004_2()

This method serves as the **discount service candidate retrieval bridge** for the auto-apply discount service feature in the K-Opticom customer core system. It queries the SC (Service Component) `EKK0841B004` — "Discount Service Condition List Inquiry (for Discount)" — to discover all discount services whose application conditions are satisfied at a specified base date (reference year/month/day), based on the customer's subscription type code. The method implements a **mapping/adapter pattern** between CC (Cross-Component) work area maps and SC-level message structures: it lifts work-area parameters into an SC input message envelope, dispatches the request via `ServiceComponentRequestInvoker`, then unpacks the flat tabular SC result list into a hierarchical Java object structure.

The SC returns records in a flattened format, distinguished by a `DATA_KBN` (data classification) discriminator field: value `"1"` encodes discount service header information, `"2"` encodes discount service application conditions (multi-valued per header), and `"3"` encodes target services eligible for the discount (multi-valued per header). This method de-flattens the result into a list of `HashMap` entries, each containing a discount service header, its associated application condition list, and its target service list. This structured list is then stored into the caller's work area (`ccMap.wrib_svc_list`) and returned directly.

The design pattern implemented is a **delegating mapper** — it does not contain business rules itself, but rather transforms, routes, and restructures data between the CC layer (which works with flat `HashMap` work areas) and the SC layer (which operates on typed message envelopes). It is a shared utility called by the `JKKWrisvcAutoAplyCC.searchWrisvcDchskm()` screen controller, serving as the single data-retrieval gateway for the discount auto-apply candidate listing screen.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["callEKK0841B004_2 ccMap, funcCd"])
    START --> BUILD_MAP["Build mapName = this.ccMapNm + KKSV031382SC"]
    BUILD_MAP --> CREATE_INMAP["Create inMap HashMap"]
    CREATE_INMAP --> SET_DATA["cmnParam.setData mapName, inMap"]
    SET_DATA --> PUT_PARAMS["Map CC params to SC params:
- FUNC_CODE = funcCd
- KEY_KJNYMD = ccMap.MSKM_YMD
- KEY_WRIB_APLY_OPTNTY_CD = 2 (Auto-Apply)
- KEY_MSKM_SBT_CD = ccMap.MSKM_SBT_CD"]
    PUT_PARAMS --> CREATE_MAPPER["Create KKSV0313_KKSV0313OP_EKK0841B004BSMapper mapName"]
    CREATE_MAPPER --> EDIT_IN["mapper.editInMsg cmnParam"]
    EDIT_IN --> RUN_SC["Create ServiceComponentRequestInvoker
scCall.run paramMap, cmnHandle"]
    RUN_SC --> EDIT_OUT["mapper.editResultRP result, cmnParam"]
    EDIT_OUT --> CHECK_RESULT["checkExecutionResult result"]
    CHECK_RESULT --> GET_OUT["outMap = cmnParam.getData mapName"]
    GET_OUT --> GET_LIST["list = outMap.get EKK0841B004CBSMSG1LIST"]
    GET_LIST --> CHECK_NULL["wribSvcList == null?"]
    CHECK_NULL -->|yes| NEW_LIST["wribSvcList = new ArrayList
ccMap.put WRIB_SVC_LIST"]
    CHECK_NULL -->|no| CLEAR_LIST["wribSvcList.clear"]
    NEW_LIST --> INIT_LOCALS["Initialize:
- ccMapWribSvc
- wrisvcAplyJknList
- WrisvcTgSvcList
- ccMapWribSvcCnt = 0"]
    CLEAR_LIST --> INIT_LOCALS
    INIT_LOCALS --> FOR_START["for each outMapWribSvc in list"]
    FOR_START --> INCR_COUNT["ccMapWribSvcCnt++"]
    INCR_COUNT --> CHECK_KBN1{"DATA_KBN == 1?"}
    CHECK_KBN1 -->|yes| DATA_KBN_1["Map discount service fields:
WRIB_SVC_CD, WRIB_TYPE_CD, WRIB_SVC_NM
UPPL_APLY_CNT, WRIB_AGING_PRD, UPPL_KEI_CNT
DSP_JUN, YUSEN_JUN_MDL_CD, YUSEN_JUN_KIND_CD
YUSEN_JUN_TYPE_CD, YUSEN_JUN_TYPE_JUN
APLY_JOKEN_CD, WRIB_ADD_JOKEN_CD"]
    DATA_KBN_1 --> CHECK_KBN2{"DATA_KBN == 2?"}
    CHECK_KBN1 -->|no| CHECK_KBN2
    CHECK_KBN2 -->|yes| DATA_KBN_2["Create wrisvcAplyJkn
Map application condition fields
Add to wrisvcAplyJknList"]
    DATA_KBN_2 --> CHECK_KBN3{"DATA_KBN == 3?"}
    CHECK_KBN2 -->|no| CHECK_KBN3
    CHECK_KBN3 -->|yes| DATA_KBN_3["Create WrisvcTgSvc
Map target service fields
Add to WrisvcTgSvcList"]
    DATA_KBN_3 --> CHECK_END{"ccMapWribSvcCnt == list.size OR
next record DATA_KBN == 1 AND WRIB_SVC_CD changed?"}
    CHECK_KBN3 -->|no| CHECK_END
    CHECK_END -->|yes| ADD_AND_RESET["Add ccMapWribSvc to wribSvcList
Reset wrisvcAplyJknList = new
Reset WrisvcTgSvcList = new"]
    ADD_AND_RESET --> NEXT_ITER
    CHECK_END -->|no| NEXT_ITER
    NEXT_ITER["Next iteration of for loop"]
    NEXT_ITER --> FOR_START
    FOR_START --> END_CHECK{"end of list?"}
    END_CHECK -->|no| FOR_START
    END_CHECK -->|yes| RETURN_END["return wribSvcList"]
    RETURN_END --> END(["End"])
```

**Processing flow summary:**

1. **Input Mapping (CC-to-SC lift):** The method builds a unique work-area map name, creates an input map, and copies four CC-layer parameters into SC-layer keys — the function code, the base date (reference year/month/day), the application opportunity code fixed to `"2"` (auto-apply), and the subscription type code.
2. **SC Invocation (Service dispatch):** Creates a BS mapper to structure the SC input message envelope, invokes the SC via `ServiceComponentRequestInvoker.run()`, and processes the SC result back through the mapper.
3. **Result Extraction:** Unpacks the SC response list from the work area.
4. **Hierarchical Reconstruction:** Iterates the flat SC result list, classifying each record by `DATA_KBN` into one of three entity types, accumulating conditions and target services, and assembling them into discount service header objects that are added to the final result list when a group boundary is detected (end-of-list or new discount service code).

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `ccMap` | `HashMap<String, Object>` | The **work area** (operational data context) shared across CC methods. It carries the subscription date (`mskm_ymd`), subscription type code (`mskm_sbt_cd`), and receives the resulting discount service list (`wrib_svc_list`). This map is the primary data exchange vehicle between screen controllers and component mappers. |
| 2 | `funcCd` | `String` | The **function code** identifying the calling business function. Passed through to the SC layer as `FUNC_CODE` for audit logging and SC-level routing. |

**Instance fields read:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `this.ccMapNm` | `String` | The base name of the calling CC method's work area, used as a prefix to create a unique SC-level map namespace (`this.ccMapNm + KKSV031382SC`). |
| `this.cmnParam` | Common parameter object | The shared parameter context holding the work area data; used for `setData()` and `getData()` throughout the method. |
| `this.cmnHandle` | ServiceComponentHandle | The SC call handle for routing the service component request. |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `ServiceComponentRequestInvoker.run` | EKK0841B004CBS | Discount service condition list (SC result) | Calls the `EKK0841B004` SC to query discount service candidate records satisfying the conditions at the base date. This is a Read (inquiry) operation. |
| U | `KKSV0313_KKSV0313OP_EKK0841B004BSMapper.editInMsg` | EKK0841B004CBS | - | Transforms CC work-area input map into the SC-level message envelope structure (CAANMsg). |
| U | `KKSV0313_KKSV0313OP_EKK0841B004BSMapper.editResultRP` | EKK0841B004CBS | - | Transforms the SC response message envelope back into the CC work-area map structure. |
| - | `JKKWrisvcAutoAplyCCMapper.checkExecutionResult` | - | - | Validates the SC execution result for errors/exceptions. Internal error-checking method. |
| - | `JBSbatAKKshkmRsltInfoTukiawsday.setData` | - | - | Called indirectly through cmnParam for setting work area data. |
| - | `JBSbatAKKshkmRsltInfoTukiaws.setData` | - | - | Called indirectly through cmnParam for setting work area data. |
| - | `JBSbatAKKshkmRsltInfoTukiawsRealSkh.setData` | - | - | Called indirectly through cmnParam for setting work area data. |
| - | `JBSbatAKKshkmRsltInfTkCvsNCnsl.setData` | - | - | Called indirectly through cmnParam for setting work area data. |
| R | `JBSbatDKNyukaFinAdd.getData` | - | - | Called indirectly through cmnParam for reading work area data. |
| - | `JBSbatKKGetCTITelno.setData` | - | - | Called indirectly through cmnParam for setting work area data. |
| R | `JFUeoTelOpTransferCC.getData` | - | - | Called indirectly through cmnParam for reading work area data. |
| R | `JFUTransferCC.getData` | - | - | Called indirectly through cmnParam for reading work area data. |
| R | `JFUTransferListToListCC.getData` | - | - | Called indirectly through cmnParam for reading work area data. |
| R | `KKW12701SFLogic.getData` | - | - | Called indirectly through cmnParam for reading work area data. |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | JKKWrisvcAutoAplyCC.searchWrisvcDchskm | `searchWrisvcDchskm()` -> `getMapper().callEKK0841B004_2(ccMap, funcCd)` | `EKK0841B004CBS [R] Discount Service Condition List` |

**Caller details:** The sole direct caller is `JKKWrisvcAutoAplyCC.searchWrisvcDchskm()`, which is the screen controller for the discount service condition listing screen (KKSV0313). It invokes this mapper to retrieve all discount service candidates that satisfy the auto-apply conditions at the reference date for the customer's subscription type.

**Terminal operations reached from this method:** The method's final terminal data operation is the SC read via `ServiceComponentRequestInvoker.run`, which queries the discount service condition list (EKK0841B004CBS). This is a Read (R) operation returning discount service header records, application conditions, and target service eligibility data.

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] Build map name and initialize input map (L11862)

> Creates a unique SC-level map namespace by concatenating the CC work area name with the SC identifier `KKSV031382SC`, then prepares an input HashMap for parameter mapping.

| # | Type | Code |
|---|------|------|
| 1 | SET | `mapName = this.ccMapNm + KKSV0313_KKSV0313OP.KKSV031382SC` // SC namespace key [-> "KKSV031382SC"] |
| 2 | SET | `inMap = new HashMap<String, Object>()` // Input map for CC-to-SC parameter mapping |
| 3 | EXEC | `this.cmnParam.setData(mapName, inMap)` // Store input map in common parameter work area |

**Block 2** — [EXEC] Map CC parameters to SC parameters (L11873-L11887)

> Transfers four parameters from the CC work area into the SC-level input map. The application opportunity code is hardcoded to `"2"` representing auto-apply mode.

| # | Type | Code |
|---|------|------|
| 1 | SET | `inMap.put(FUNC_CODE, funcCd)` // Function code passed from caller |
| 2 | SET | `inMap.put(KEY_KJNYMD, (String)ccMap.get(MSKM_YMD))` // [-> "mskm_ymd"] Base date (reference year/month/day) |
| 3 | SET | `inMap.put(KEY_WRIB_APLY_OPTNTY_CD, WRIB_APLY_OPTNTY_CD_AUTO_APLY)` // [-> "2"] Auto-Apply discount opportunity code |
| 4 | SET | `inMap.put(KEY_MSKM_SBT_CD, (String)ccMap.get(MSKM_SBT_CD))` // [-> "mskm_sbt_cd"] Subscription type code |

**Block 3** — [EXEC] Service IF execution (L11892-L11905)

> Creates the SC mapper, builds the SC input message, dispatches the service component call, and validates the result.

| # | Type | Code |
|---|------|------|
| 1 | SET | `mapper = new KKSV0313_KKSV0313OP_EKK0841B004BSMapper(mapName)` // SC BS mapper for message transformation |
| 2 | CALL | `paramMap = mapper.editInMsg(this.ccmParam)` // Transform CC map to SC message envelope |
| 3 | SET | `scCall = new ServiceComponentRequestInvoker()` // SC call invoker |
| 4 | CALL | `result = scCall.run(paramMap, this.cmnHandle)` // Invoke SC EKK0841B004BS |
| 5 | SET | `this.cmnParam = mapper.editResultRP(result, this.cmnParam)` // Transform SC response back to CC map |
| 6 | CALL | `checkExecutionResult(result)` // Validate SC execution result for errors |

**Block 4** — [EXEC] Result extraction (L11911-L11914)

> Retrieves the de-mapped output map and extracts the discount service condition list from the SC response.

| # | Type | Code |
|---|------|------|
| 1 | SET | `outMap = (HashMap) this.cmnParam.getData(mapName)` // Unpack SC response |
| 2 | SET | `list = (ArrayList) outMap.get(EKK0841B004CBSMSG1LIST)` // [-> "EKK0841B004CBSMsg1List"] Flat SC result list |
| 3 | SET | `wribSvcList = (ArrayList) ccMap.get(WRIB_SVC_LIST)` // [-> "wrib_svc_list"] Existing list from caller |

**Block 5** — [IF/ELSE] Initialize or clear work area discount service list (L11915-L11925)

> Ensures the work area discount service list exists — creates a new one if null, or clears an existing one.

| # | Type | Code |
|---|------|------|
| 1 | IF | `wribSvcList == null` (L11915) |
| 1.1 | SET | `wribSvcList = new ArrayList<HashMap<String, Object>>()` |
| 1.2 | SET | `ccMap.put(WRIB_SVC_LIST, wribSvcList)` // [-> "wrib_svc_list"] |
| 2 | ELSE | (L11921) |
| 2.1 | EXEC | `wribSvcList.clear()` // Reuse existing list |

**Block 6** — [SET] Initialize accumulator variables for hierarchical reconstruction (L11930-L11938)

> Creates the working accumulators for the group-by-discount-service reconstruction.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ccMapWribSvc = new HashMap<String, Object>()` // Current discount service accumulator |
| 2 | SET | `wrisvcAplyJknList = new ArrayList<HashMap<String, Object>>()` // Application conditions accumulator |
| 3 | SET | `WrisvcTgSvcList = new ArrayList<HashMap<String, Object>>()` // Target services accumulator |
| 4 | SET | `ccMapWribSvcCnt = 0` // Record counter |

**Block 7** — [FOR] Iterate SC result list (L11940-L12167)

> Main processing loop. For each flat SC record, classifies it by `DATA_KBN` into discount service header, application condition, or target service, then groups them hierarchically.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ccMapWribSvcCnt++` // Increment record counter |

**Block 7.1** — [IF] DATA_KBN == "1" — Discount service header (L11943-L11998)

> When the data classification is `"1"`, this record contains discount service header information. Fields are mapped from the SC result into a `ccMapWribSvc` HashMap.

| # | Type | Code |
|---|------|------|
| 1 | IF | `DATA_KBN.equals("1")` [-> `"data_kbn"` equals `"1"`] |
| 1.1 | SET | `ccMapWribSvc = new HashMap<String, Object>()` // Reset for new discount service |
| 1.2 | SET | `ccMapWribSvc.put(WRIB_SVC_CD, outMapWribSvc.get(WRIB_SVC_CD))` // Discount service code |
| 1.3 | SET | `ccMapWribSvc.put(WRIB_TYPE_CD, outMapWribSvc.get(WRIB_TYPE_CD))` // Discount type code |
| 1.4 | SET | `ccMapWribSvc.put(WRIB_SVC_NM, outMapWribSvc.get(WRIB_SVC_NM))` // Discount service name |
| 1.5 | SET | `ccMapWribSvc.put(UPPL_APLY_CNT, outMapWribSvc.get(UPPL_APLY_CNT))` // Maximum application count |
| 1.6 | SET | `ccMapWribSvc.put(WRIB_AGING_PRD, outMapWribSvc.get(WRIB_AGING_PRD))` // Discount aging period |
| 1.7 | SET | `ccMapWribSvc.put(UPPL_KEI_CNT, outMapWribSvc.get(UPPL_KEI_CNT))` // Maximum contract count |
| 1.8 | SET | `ccMapWribSvc.put(DSP_JUN, outMapWribSvc.get(DSP_JUN))` // Display order |
| 1.9 | SET | `ccMapWribSvc.put(YUSEN_JUN_MDL_CD, outMapWribSvc.get(YUSEN_JUN_MDL_CD))` // Priority model code |
| 1.10 | SET | `ccMapWribSvc.put(YUSEN_JUN_KIND_CD, outMapWribSvc.get(YUSEN_JUN_KIND_CD))` // Priority type code |
| 1.11 | SET | `ccMapWribSvc.put(YUSEN_JUN_TYPE_CD, outMapWribSvc.get(YUSEN_JUN_TYPE_CD))` // Priority type code |
| 1.12 | SET | `ccMapWribSvc.put(YUSEN_JUN_TYPE_JUN, outMapWribSvc.get(YUSEN_JUN_TYPE_JUN))` // Priority type order |
| 1.13 | SET | `ccMapWribSvc.put(APLY_JOKEN_CD, outMapWribSvc.get(APLY_JOKEN_CD))` // Application condition code |
| 1.14 | SET | `ccMapWribSvc.put(WRIB_ADD_JOKEN_CD, outMapWribSvc.get(WRIB_ADD_JOKEN_CD))` // Registration condition code |

**Block 7.2** — [IF] DATA_KBN == "2" — Discount service application condition (L12001-L12044)

> When `DATA_KBN == "2"`, the record encodes application condition details. A condition HashMap is created with up to 5 condition value fields and added to the current condition list.

| # | Type | Code |
|---|------|------|
| 1 | IF | `DATA_KBN.equals("2")` [-> `"data_kbn"` equals `"2"`] |
| 1.1 | SET | `wrisvcAplyJkn = new HashMap<String, Object>()` // New condition entry |
| 1.2 | SET | `wrisvcAplyJkn.put(WRSV_APLY_JKN_SBT_CD, ...)` // Application condition type |
| 1.3 | SET | `wrisvcAplyJkn.put(WRSV_APLY_JKN_NO, ...)` // Application condition number |
| 1.4 | SET | `wrisvcAplyJkn.put(WRSV_APLY_JKN_VALUE_1, ...)` // Condition value 1 |
| 1.5 | SET | `wrisvcAplyJkn.put(WRSV_APLY_JKN_VALUE_2, ...)` // Condition value 2 |
| 1.6 | SET | `wrisvcAplyJkn.put(WRSV_APLY_JKN_VALUE_3, ...)` // Condition value 3 |
| 1.7 | SET | `wrisvcAplyJkn.put(WRSV_APLY_JKN_VALUE_4, ...)` // Condition value 4 |
| 1.8 | SET | `wrisvcAplyJkn.put(WRSV_APLY_JKN_VALUE_5, ...)` // Condition value 5 |
| 1.9 | EXEC | `wrisvcAplyJknList.add(wrisvcAplyJkn)` // Add condition to accumulator |

**Block 7.3** — [IF] DATA_KBN == "3" — Discount service target service (L12050-L12144)

> When `DATA_KBN == "3"`, the record encodes target service eligibility details. A target service HashMap is created with extensive service identification fields and added to the target service list.

| # | Type | Code |
|---|------|------|
| 1 | IF | `DATA_KBN.equals("3")` [-> `"data_kbn"` equals `"3"`] |
| 1.1 | SET | `WrisvcTgSvc = new HashMap<String, Object>()` // New target service entry |
| 1.2 | SET | `WrisvcTgSvc.put(WRIB_SVC_TRGT_SVC_CD, ...)` // Target service code |
| 1.3 | SET | `WrisvcTgSvc.put(APLY_JOKEN_GRP, ...)` // Application condition group |
| 1.4 | SET | `WrisvcTgSvc.put(SVC_CD, ...)` // Service code |
| 1.5 | SET | `WrisvcTgSvc.put(PRC_GRP_CD, ...)` // Price group code |
| 1.6 | SET | `WrisvcTgSvc.put(PCRS_CD, ...)` // Price course code |
| 1.7 | SET | `WrisvcTgSvc.put(PPLAN_CD, ...)` // Price plan code |
| 1.8 | SET | `WrisvcTgSvc.put(OP_SVC_CD, ...)` // Option service code |
| 1.9 | SET | `WrisvcTgSvc.put(SBOP_SVC_CD, ...)` // Sub-option service code |
| 1.10 | SET | `WrisvcTgSvc.put(KKTK_SVC_CD, ...)` // Device provision service code |
| 1.11 | SET | `WrisvcTgSvc.put(KKTK_SBT_CD, ...)` // Device provision type code |
| 1.12 | SET | `WrisvcTgSvc.put(SEIOPSVC_CD, ...)` // Billing option service code |
| 1.13-1.25 | SET | `WrisvcTgSvc.put(CHGE_BF_*, ...)` // Pre-change counterparts for svc/price/service-course/price-plan/option/sub-option/device-provision/billing-option |
| 1.26 | SET | `WrisvcTgSvc.put(SVC_KEI_YEAR_CNT, ...)` // Service contract term count |
| 1.27 | SET | `WrisvcTgSvc.put(TRGT_KEI_SVC_CNT, ...)` // Target contract service count |
| 1.28 | SET | `WrisvcTgSvc.put(TRGT_KEI_SVC_UPPL, ...)` // Target contract service maximum |
| 1.29 | SET | `WrisvcTgSvc.put(TRGT_SVC_HAMBET_CD, ...)` // Target service discrimination code |
| 1.30 | SET | `WrisvcTgSvc.put(UPPL_AUTO_APLY_KH, ...)` // Over-limit auto-apply flag |
| 1.31 | SET | `WrisvcTgSvc.put(KKOP_SVC_CD, ...)` // Device option service code |
| 1.32 | SET | `WrisvcTgSvc.put(CHGE_BF_KKOP_SVC_CD, ...)` // Pre-change device option service code |
| 1.33 | EXEC | `WrisvcTgSvcList.add(WrisvcTgSvc)` // Add to accumulator |

**Block 7.4** — [IF] Group boundary detection — commit accumulated discount service (L12147-L12166)

> At the end of each discount service group (last record in the list, or when the next record starts a new discount service — i.e., DATA_KBN changes back to `"1"` and WRIB_SVC_CD differs), the accumulated header is finalized with its conditions and target services, then added to the result list. Accumulators are reset for the next group.

| # | Type | Code |
|---|------|------|
| 1 | IF | `ccMapWribSvcCnt == list.size()` OR (`list[ccMapWribSvcCnt].DATA_KBN == "1"` AND `list[ccMapWribSvcCnt].WRIB_SVC_CD != list[ccMapWribSvcCnt-1].WRIB_SVC_CD`) [Group boundary] |
| 1.1 | SET | `ccMapWribSvc.put(WRSV_APLY_JKN_LIST, wrisvcAplyJknList)` // Attach condition list to header |
| 1.2 | SET | `ccMapWribSvc.put(WRISVC_TG_SVC_LIST, WrisvcTgSvcList)` // Attach target service list to header |
| 1.3 | EXEC | `wribSvcList.add(ccMapWribSvc)` // Add completed discount service to result |
| 1.4 | SET | `wrisvcAplyJknList = new ArrayList<HashMap<String, Object>>()` // Reset condition accumulator |
| 1.5 | SET | `WrisvcTgSvcList = new ArrayList<HashMap<String, Object>>()` // Reset target service accumulator |

**Block 8** — [RETURN] Return result (L12172)

> Returns the constructed discount service candidate list.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return wribSvcList` // Hierarchical discount service candidate list |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `callEKK0841B004_2` | Method | Discount service condition list inquiry (for discount) — retrieves auto-apply eligible discount services |
| `ccMap` | Field | Work area — shared HashMap carrying data between CC methods in the screen flow |
| `funcCd` | Field | Function code — identifies the calling business function for the SC layer |
| `mskm_ymd` | Field | Subscription date — the contract/subscription date in YYYYMMDD format (reference date for discount eligibility) |
| `mskm_sbt_cd` | Field | Subscription type code — classifies the type of service contract (e.g., new subscription, change, renewal) |
| `wrib_svc_list` | Field | Discount service list — the result list of discount service candidates returned to the caller |
| `wrib_svc_cd` | Field | Discount service code — unique identifier for a discount service offering |
| `wrib_type_cd` | Field | Discount type code — classifies the type of discount (e.g., percentage, fixed amount) |
| `wrib_svc_nm` | Field | Discount service name — human-readable name of the discount service |
| `uppl_aply_cnt` | Field | Maximum application count — how many times this discount can be applied |
| `wrib_aging_prd` | Field | Discount aging period — duration over which the discount applies (e.g., months) |
| `uppl_kei_cnt` | Field | Maximum contract count — maximum number of contracts this discount can apply to |
| `dsp_jun` | Field | Display order — sorting order for displaying discount services on screen |
| `yusen_jun_mdl_cd` | Field | Priority display model code — model for priority ranking of discount services |
| `yusen_jun_kind_cd` | Field | Priority display type code — classification for priority ranking |
| `yusen_jun_type_cd` | Field | Priority display type code — detailed type for priority ranking |
| `yusen_jun_type_jun` | Field | Priority display type order — ordering within priority type |
| `aply_joken_cd` | Field | Application condition code — condition code for discount service eligibility |
| `wrib_add_joken_cd` | Field | Registration condition code — condition code for discount registration eligibility |
| `wrsv_aply_jkn_sbt_cd` | Field | Discount service application condition type code — type of application condition |
| `wrsv_aply_jkn_no` | Field | Discount service application condition number — sequence number of the condition |
| `wrsv_aply_jkn_value_*` | Field | Discount service application condition value 1-5 — up to 5 condition value fields |
| `data_kbn` | Field | Data classification — SC result record discriminator: "1"=header, "2"=conditions, "3"=target services |
| `EKK0841B004CBS` | SC Code | Discount service condition list inquiry (for discount) — Service Component for querying discount service eligibility |
| `KKSV031382SC` | Constant | SC namespace identifier for discount service condition list inquiry (for discount) |
| `WRIB_APLY_OPTNTY_CD_AUTO_APLY` | Constant | Application opportunity code for auto-apply mode (value: "2") |
| SC | Acronym | Service Component — Fujitsu middleware layer for enterprise service invocation |
| CC | Acronym | Cross-Component — shared component layer between screen controllers and CBS |
| BS | Acronym | Business Service — the service layer handling business logic |
| CBS | Acronym | Core Business System — the core telecom billing/account system |
| CAANMsg | Acronym | Fujitsu message envelope format — structured message container for SC communication |
| Auto-Apply | Business term | Discount service auto-application — the system automatically identifies and applies eligible discounts without manual intervention |
| WRIB (割引) | Business term | Discount / Price reduction — Japanese billing concept for service price reductions |
| SKH (申込) | Business term | Application / Subscription — Japanese billing concept for service orders/contracts |
| JOKEN (条件) | Business term | Condition — Japanese billing concept for eligibility criteria |
| VC (KKSV0313) | Screen ID | Discount service auto-apply screen module — the KKSV0313 screen series for discount management |
| KKOP_SVC_CD | Field | Device option service code — identifies device-related optional services |
| SVC_KEI_YEAR_CNT | Field | Service contract term count — the duration/term of the service contract |
| TRGT_KEI_SVC_CNT | Field | Target contract service count — number of target services in a contract |
| TRGT_KEI_SVC_UPPL | Field | Target contract service maximum — maximum allowed target services |
| TRGT_SVC_HAMBET_CD | Field | Target service discrimination code — code to differentiate target service types |
| UPPL_AUTO_APLY_KH | Field | Over-limit auto-apply flag — whether auto-apply is permitted even when exceeding limits |
| CHGE_BF_* | Field prefix | Pre-change — Japanese billing convention for "before change" state of a field during service modification |
