# Eo / Web / Webview / Kkw02504sf

## Overview

The `KKW02504SF` package is the **My Homepage Information Change** component of the contract management system. It provides a web screen that allows users to modify, cancel, recover, or reserve-cancel their My Homepage (custom homepage) subscription settings — including the homepage capacity (storage tier), access analysis settings, and URL/account configuration. It is invoked from the "Option Service Contract List" screen and follows the X31/X33 web framework's standard flow: initialize screen data, confirm changes, and commit with a second confirmation.

## Architecture

The module follows a standard three-tier web presentation pattern within the X31/X33 framework:

```mermaid
flowchart TD
    subgraph KKW02504SF["KKW02504SF Module - My Homepage Info Change"]
        direction TB

        UI["UI Layer
Web View Screen"]

        subgraph BEAN["Data Layer"]
            direction TB
            MAIN_Bean["KKW02504SFBean
Master Data Bean
- view properties (update/value/enabled/state)
- lists: hp_capa_info_list
  accss_bnsk_info_list
  cust_kei_hktgi_list_list"]
            DETAIL_01["KKW02504SF01DBean
Detail Bean for lists
- cd_div_list_list
- cd_div_nm_list_list
- nm_list_list"]
            DETAIL_02["KKW02504SF02DBean
Detail Bean for lists
- ido_rsn_cd_list
- op_svc_kei_no_list"]
        end

        subgraph LOGIC["Business Logic"]
            direction TB
            MAIN_Logic["KKW02504SFLogic
Extends JCCWebBusinessLogic
- actionInit() : screen initialize
- actionUpdMyHPInfo() : update confirm
- actionFixMyHPInfo() : confirm commit
- actionShusei() : correction
- actionBack() : return
- actionFin() : finish"]
        end

        CHECKER["KKW02504SFChecker
GUI Check (extends X31SGuiCheckBase)"]

        CONST["KKW02504SFConst
String constants
- HPAD_DOMAIN, HPAD_ACCOUNT
- HP_CAPA, WEB_ID, ACCSS_BNSK
- TRANDIV, SYSID, MSKM_NO
- use_endymd_year/mon/day..."]

        subgraph SERVICES["Backend Services"]
            direction TB
            SVC7["KKSV0007 / KKSV0007OP
Homepage information inquiry"]
            SVC8["KKSV0008 / KKSV0008OP
Homepage info update confirm"]
            SVC9["KKSV0009 / KKSV0009OP
Homepage info cancel confirm"]
            SVC4["KKSV0004 / KKSV0004OP
Homepage info recovery"]
            SVC17["KKSV0017 / KKSV0017OP
Reservation cancellation"]
        end

        subgraph MAPPERS["DB Mappers"]
            direction TB
            MAP7["KKSV0007_KKSV0007OPDBMapper"]
            MAP8["KKSV0008_KKSV0008OPDBMapper"]
            MAP9["KKSV0009_KKSV0009OPDBMapper"]
            MAP4["KKSV0004_KKSV0004OPDBMapper"]
            MAP17["KKSV0017_KKSV0017OPDBMapper"]
        end

        UI -->|"request"| MAIN_Bean
        MAIN_Bean -->|"contains"| DETAIL_01
        MAIN_Bean -->|"contains"| DETAIL_02

        MAIN_Bean -->|"fed by"| MAIN_Logic
        MAIN_Logic -->|"invokeService"| SVC7
        MAIN_Logic -->|"invokeService"| SVC8
        MAIN_Logic -->|"invokeService"| SVC9
        MAIN_Logic -->|"invokeService"| SVC4
        MAIN_Logic -->|"invokeService"| SVC17

        SVC7 -->|"maps"| MAP7
        SVC8 -->|"maps"| MAP8
        SVC9 -->|"maps"| MAP9
        SVC4 -->|"maps"| MAP4
        SVC17 -->|"maps"| MAP17

        MAIN_Bean -->|"uses"| CONST
        MAIN_Logic -->|"uses"| CONST
    end
```

## Key Classes and Interfaces

### KKW02504SFLogic — Business Orchestrator

**File:** [`KKW02504SFLogic.java`](source/koptWebB/src/eo/web/webview/KKW02504SF/KKW02504SFLogic.java)

The central orchestrator of this module. Extends `JCCWebBusinessLogic` and implements the full life cycle for modifying My Homepage subscription information.

#### Main Action Methods

| Method | Purpose |
|---|---|
| `actionInit()` | Screen initialization — fetches screen info, calls the backend inquiry service (KKSV0007), maps results to the DataBean, calculates billing flags, and populates pulldown lists for homepage capacity and access analysis. |
| `actionUpdMyHPInfo()` | Update/Cancel **confirmation** — validates input (e.g., prevents removing a URL when one was previously set), determines the change type (capacity upgrade/downgrade/no-change, access analysis toggle, URL change), calls the confirm service (KKSV0008 or KKSV0009), and redirects to the confirmation screen. |
| `actionFixMyHPInfo()` | **Final commit** — based on the `trandiv` (processing section), calls the appropriate service: KKSV0008 for update, KKSV0009 for cancel, KKSV0004 for recovery, or KKSV0017 for reservation cancellation. Sets the next screen ID and displays a completion message. |
| `actionShusei()` | Correction — returns to the edit screen. |
| `actionBack()` | Return — goes back to the calling screen. |
| `actionFin()` | Finish — goes back to the calling screen. |
| `actionClear()` | Clear — resets all pulldown and form data, then re-invokes `actionInit()`. |

#### Internal Data-Setting Methods

The logic class uses several private methods to prepare DataBean fields before calling backend services:

| Method | Called From | What It Does |
|---|---|---|
| `setDataInit()` | `actionInit()` | Sets initial values: operation date, plan codes, cost codes, sub-op service codes (HP and Access Analysis), customer contract inheritance data, processing section, SYSID, service contract number, operation start, application number, and detail number. |
| `storeGetDataInit()` | `actionInit()` | Post-service initialization. Determines free-capacity threshold, checks whether sub-op service data exists for HP capacity and access analysis, selects the appropriate pulldown values, and sets processing-section-specific values (e.g., end date for cancel mode). |
| `setDataUpd()` | `actionUpdMyHPInfo()` | For the **update** path. Validates that no-URL-to-URL removal is not allowed. Sets selected capacity code, access analysis code, billing type flags, application info, and dates. Returns `false` if nothing actually changed. |
| `setDataDsl()` | `actionUpdMyHPInfo()` | For the **cancel** path. Determines cancel type (immediate vs. scheduled), sets end date, service end date, billing end date, URL/WebID aging targets, and progression special items. |
| `setDataKaihk()` | `actionFixMyHPInfo()` | For the **recovery** path. Sets recovery date, URL/WebID aging targets, and progression special items. |
| `setDataDslStp()` | `actionFixMyHPInfo()` | For the **reservation cancel** path. Sets URL/WebID aging targets and progression special items. |

#### Change-Type Determination Methods

| Method | Purpose |
|---|---|
| `getUpd_kind_hp(bf, sel)` | Determines the change type for **homepage capacity**: paid conversion (`"1"`), free conversion (`"2"`), paid continuation (`"3"`), free continuation (`"4"`), or no change (`"5"`). Depends on whether a sub-op service contract exists and whether values cross the free-tier threshold. |
| `getUpd_kind_accs(sel)` | Determines the change type for **access analysis**: paid (`"1"`), free (`"2"`), or no change (`"5"`). |
| `getUpd_kind_url()` | Determines the change type for **URL**: changed (`"1"`) or unchanged (`"5"`). Compares pre-change account with change-information account, handling null cases. |
| `getDsl_kind(opeDate)` | Determines the cancel type: immediate (`"2"`) if the end date equals the operation date, otherwise scheduled (`"1"`). |

#### Mapper Setup Methods

| Method | Purpose |
|---|---|
| `setMappedKKSV0008(func_cd)` | Configures the KKSV0008 mapper for update/confirm. Sets ~25 mapping methods covering application content approval, URL, homepage capacity, access analysis, billing inquiry, progress information, and SODCC. |
| `setMappedKKSV0009(func_cd)` | Configures the KKSV0009 mapper for cancel/confirm. Sets the cancel CC and SODCC mappings. |

#### Other Internal Methods

| Method | Purpose |
|---|---|
| `invokeService(uSecId, opId)` | Central service invocation. Builds the parameter map, clears message results, calls the parent `invokeService`, and logs the DataBean before and after. |
| `getPulldownSelected(bean, code, param)` | Searches a pulldown list for a matching code and returns its index, code, and two name variants. |
| `getMsgRep(trandiv, rtn_msg_id)` | Returns substitution text arrays for specific error message IDs (e.g., "end date is in the past" for cancel mode). |

### KKW02504SFBean — Master Data Container

**File:** [`KKW02504SFBean.java`](source/koptWebB/src/eo/web/webview/KKW02504SF/KKW02504SFBean.java)

The master DataBean that holds all view-state properties for the screen. Extends `X33VViewBaseBean` and implements `X33VListedBeanInterface` and `X31CBaseBean`.

#### Property Groups

The bean contains 120+ properties, each following a consistent `*_update`, `*_value`, `*_enabled`, `*_state` pattern for UI binding. They fall into these categories:

| Category | Key Properties | Purpose |
|---|---|---|
| **Homepage settings** | `hpad_domain_*`, `hpad_account_*`, `hp_capa_*`, `hp_capa_cd_*`, `hp_capa_nm_*` | URL domain, account name, capacity selection |
| **Authentication** | `web_id_*`, `accss_bnsk_*`, `accss_bnsk_cd_*`, `accss_bnsk_nm_*` | WebID and access analysis settings |
| **Dates** | `svc_staymd_*`, `svc_endymd_*`, `svc_chrg_staymd_*`, `svc_chrg_endymd_*`, `use_endymd_*` | Service start/end dates, billing dates, usage end dates |
| **Contract info** | `sysid_*`, `svc_kei_no_*`, `op_svc_kei_no_*`, `mskm_no_*`, `mskm_dtl_no_*` | System ID, service contract number, application number |
| **Processing section** | `trandiv_*` | Determines whether the screen is in update, cancel, recovery, or reservation-cancel mode |
| **Capacity pulldown** | `capa_*`, `add_capa_*`, `svctk_but_*_value_*` | Service item capacity: initial, max, increase, free values |
| **Validation flags** | `val_sts_dsl_*`, `val_sts_cancel_*` | Service contract status codes (canceled, canceled pending) |
| **Change type flags** | `upd_kind_hp_*`, `upd_kind_accs_*`, `upd_kind_url_*` | Change type codes set by logic for confirmation display |
| **Cancel type** | `dsl_kind_*`, `val_rsv_*`, `val_soku_*` | Cancel type (scheduled vs. immediate) |
| **Application info** | `mskm_sbt_cd_*`, `mskm_ymd_*`, `consmbsn_mskm_stat_skbt_cd_*` | Application subtype code, date, status |
| **Aging targets** | `aging_sbt_cd_*`, `aging_tg_value_*` | Encoding type codes and target values for URL/WebID |
| **Billing** | `pplan_cd_*`, `pcrs_cd_*` | Plan codes and cost codes for HP capacity and access analysis |
| **Progress tracking** | `ido_dtm_*`, `prg_stat_*`, `prg_tkjk_1_*`, `kzkwrk_reqymd_*` | Progress timestamps, status, special items, follow-up work date |
| **Timestamps** | `gene_add_dtm_*`, `upd_dtm_bf_*`, `kk0361_*`, `kk0401_*`, `kk0081_*` | Generation and pre-update timestamps for various contract tables |

#### List Properties

The bean contains three `X33VDataTypeList` fields that hold nested beans:

| Property | Element Type | Purpose |
|---|---|---|
| `hp_capa_info_list` | `KKW02504SF01DBean` | Homepage capacity pulldown options |
| `accss_bnsk_info_list` | `KKW02504SF01DBean` | Access analysis pulldown options |
| `cust_kei_hktgi_list_list` | `KKW02504SF02DBean` | Customer contract inheritance data |

### KKW02504SF01DBean — Pulldown Detail Bean

**File:** [`KKW02504SF01DBean.java`](source/koptWebB/src/eo/web/webview/KKW02504SF/KKW02504SF01DBean.java)

A nested data bean used within list properties (`hp_capa_info_list`, `accss_bnsk_info_list`). Implements `X33VDataTypeBeanInterface` and `X33VListedBeanInterface`.

#### Key Fields

| Field | Type | Purpose |
|---|---|---|
| `index_*` | String/Boolean | Index selection state for the pulldown |
| `cd_div_list_list` | `X33VDataTypeList` | Code list values for pulldown options |
| `cd_div_nm_list_list` | `X33VDataTypeList` | Code list display names (with sequence numbers) |
| `nm_list_list` | `X33VDataTypeList` | Code list display names (without sequence numbers) |

#### Important Methods

| Method | Purpose |
|---|---|
| `loadModelData(key, subkey)` | Loads data from the model store by key and subkey. Returns `Object`. Implementation spans ~100 lines of type-specific data retrieval. |
| `storeModelData(...)` | Three overloads for storing data back to the model store, including one with an `isSetAsString` flag for type coercion. |
| `typeModelData(key, subkey)` | Returns the `Class<?>` of a field given its key/subkey, enabling dynamic type-aware access. ~100 lines of type mapping. |
| `addListDataInstance(key)` | Creates a new element instance in a list property by key. Returns the index of the added element. |
| `removeElementFromListData(key, index)` | Removes an element from a list property at the given index. |
| `clearListDataInstance(key)` | Clears all elements from a list property. |
| `listKoumokuIds()` | Returns an `ArrayList<String>` of all field names for type introspection. |

### KKW02504SF02DBean — Inheritance Detail Bean

**File:** [`KKW02504SF02DBean.java`](source/koptWebB/src/eo/web/webview/KKW02504SF/KKW02504SF02DBean.java)

A nested data bean used within the `cust_kei_hktgi_list_list` property for customer contract inheritance data. Implements the same interfaces as `01DBean`.

#### Key Fields

| Field | Type | Purpose |
|---|---|---|
| `sysid_*` | String | System ID (display/edit/hidden states) |
| `svc_kei_no_*` | String | Service contract number |
| `ido_div_*` | String | Change classification code |
| `op_svc_kei_no_*` | String | Option service contract number |
| `mskm_no_*`, `mskm_dtl_no_*` | String | Application number and detail number |
| `ido_rsn_cd_list` | `X33VDataTypeList` | Change reason code list |
| `op_svc_kei_no_list` | `X33VDataTypeList` | Option service contract number list |
| `tran_div_*` | String | Processing section code |
| `tokutei_id_kmk_nm_*`, `tokutei_id_kmk_value_*` | String | Specified ID/marketing name/value fields |
| `ido_rsn_memo_*` | String | Change reason memo |

Like `01DBean`, it includes `loadModelData`, `storeModelData`, `typeModelData`, `addListDataInstance`, `removeElementFromListData`, and `clearListDataInstance` for dynamic data model access.

### KKW02504SFChecker — GUI Validation Hook

**File:** [`KKW02504SFChecker.java`](source/koptWebB/src/eo/web/webview/KKW02504SF/KKW02504SFChecker.java)

Implements `X31SGuiCheckBase` with a single `checkMethod(X31SGuiCheckParam, X31GUtilStockMessage)`. Currently, this method always returns `true` and performs no validation. It receives a reference to `KKW02504SFLogic` via its constructor but does not use it. This appears to be a reserved extension point for future GUI-level validation rules.

### KKW02504SFConst — Constants Registry

**File:** [`KKW02504SFConst.java`](source/koptWebB/src/eo/web/webview/KKW02504SF/KKW02504SFConst.java)

A utility class containing only `public static final String` constants. The constructor is private to prevent instantiation. Constants are organized by domain:

| Group | Constants |
|---|---|
| **Homepage settings** | `HPAD_DOMAIN`, `HPAD_ACCOUNT`, `HP_CAPA`, `HP_CAPA_CD`, `HP_CAPA_INFO`, `HP_CAPA_NM` |
| **Authentication/Analysis** | `WEB_ID`, `ACCSS_BNSK`, `ACCSS_BNSK_CD`, `ACCSS_BNSK_INFO`, `ACCSS_BNSK_NM` |
| **Processing section** | `TRANDIV` |
| **Contract identification** | `SYSID`, `SVC_KEI_NO`, `OP_SVC_KEI_NO`, `MSKM_NO`, `MSKM_DTL_NO` |
| **Dates** | `OPE_YMD`, `USE_STAYMD`, `USE_ENDYMD`, `USE_ENDYMD_YEAR/MON/DAY`, `SVC_STAYMD`, `SVC_ENDYMD`, `SVC_CHRG_STAYMD`, `SVC_CHRG_ENDYMD` |
| **Change type flags** | `UPD_KIND_HP`, `UPD_KIND_ACCS`, `UPD_KIND_URL` |
| **Capacity service item** | `CAPA`, `ADD_CAPA`, `SVCTK_BUT_SHK_VALUE`, `SVCTK_BUT_MAX_VALUE`, `SVCTK_BUT_ZOUGEN_VALUE`, `SVCTK_BUT_MRYO_VALUE` |
| **Status codes** | `VAL_STS_DSL`, `VAL_STS_CANCEL`, `DSL_KIND`, `VAL_RSV`, `VAL_SOKU` |
| **Sub-op service codes** | `SBOP_SVC_CD_0170` (HP), `SBOP_SVC_CD_0440` (Access), `SBOP_SVC_KEI_NO_0170/0440`, `SBOP_SVC_KEI_STAT_0440` |
| **Billing** | `PPLAN_CD_0170/0440`, `PCRS_CD_0170/0440` |
| **Aging/encoding** | `AGING_SBT_CD_URL`, `AGING_SBT_CD_WEBID`, `AGING_TG_VALUE_URL/URL_DSL/WEBID` |
| **Progress tracking** | `IDO_DTM`, `PRG_STAT`, `PRG_TKJK_1`, `KZKWRK_REQYMD` |
| **Work parameters** | `WORK_PARAM_URL_DOMAIN`, `CHG_KAHI_FLG`, `RTN_MSG_ID` |

## How It Works

### Screen Initialization Flow

When a user first accesses the My Homepage edit screen, the following sequence occurs:

```mermaid
sequenceDiagram
    participant UI as WebUI
    participant BEAN as KKW02504SFBean
    participant LOGIC as KKW02504SFLogic
    participant SVC as BackendService
    participant MAP as DBMapper

    rect rgb(240,248,255)
    Note over UI,MAP: Screen initialization flow
    UI->>LOGIC: actionInit()
    LOGIC->>LOGIC: getScreenInfo()
    LOGIC->>LOGIC: setDataInit()
    LOGIC->>MAP: create KKSV0007Mapper
    loop set mapping methods
        LOGIC->>MAP: setKKSV0007*SC()
    end
    MAP->>SVC: invokeService KKSVC0007
    SVC-->>MAP: return results
    MAP-->>LOGIC: getKKSV0007*SC()
    LOGIC->>LOGIC: jdgHiChrg() for billing check
    LOGIC->>LOGIC: setPulldownListNoIndex()
    LOGIC->>LOGIC: storeGetDataInit()
    LOGIC->>BEAN: populate view properties
    end

    rect rgb(255,250,240)
    Note over UI,MAP: Update/Cancel/Fix flow
    UI->>LOGIC: actionUpdMyHPInfo()
    alt trandiv = CHGE (update)
        LOGIC->>LOGIC: setDataUpd()
        LOGIC->>MAP: setMappedKKSV0008(FUNC_CD_2)
        MAP->>SVC: invokeService KKSVC0008 check
    else trandiv = DSL (cancel)
        LOGIC->>LOGIC: setDataDsl()
        LOGIC->>MAP: setMappedKKSV0009(FUNC_CD_2)
        MAP->>SVC: invokeService KKSVC0009 check
    end
    SVC-->>MAP: return rtn_msg_id
    alt rtn_msg_id is empty
        MAP-->>LOGIC: set next screen to KKW02505
        LOGIC->>UI: redirect to confirm screen
    else rtn_msg_id has error
        LOGIC->>UI: show substitution message
    end

    UI->>LOGIC: actionFixMyHPInfo()
    alt trandiv = CHGE (update)
        LOGIC->>MAP: setMappedKKSV0008(FUNC_CD_1)
        MAP->>SVC: invokeService KKSVC0008 execute
    else trandiv = DSL (cancel)
        LOGIC->>MAP: setMappedKKSV0009(FUNC_CD_1)
        MAP->>SVC: invokeService KKSVC0009 execute
    else trandiv = KAIHK (recovery)
        LOGIC->>LOGIC: setDataKaihk()
        LOGIC->>MAP: setOpsvckeiKaihkCC(FUNC_CD_1)
        MAP->>SVC: invokeService KKSVC0004 execute
    else trandiv = RSV_CL (reservation cancel)
        LOGIC->>LOGIC: setDataDslStp()
        LOGIC->>MAP: setOpsvckeiCnslCC(FUNC_CD_1)
        MAP->>SVC: invokeService KKSVC0017 execute
    end
    SVC-->>MAP: return
    MAP-->>LOGIC: get results
    LOGIC->>UI: set next screen, show message
    end
```

1. **`actionInit()`** is called by the framework when the screen loads.
2. It retrieves screen context via `JCCWebCommon.getScreenInfo()`.
3. `setDataInit()` populates the service form bean with initial parameters: operation date, plan codes, cost codes, sub-op service codes, customer contract inheritance data, the processing section (`trandiv`), system ID, service contract number, and application numbers.
4. An `KKSV0007_KKSV0007OPDBMapper` is created and approximately 15 `setKKSV0007*SC()` mapping methods are called to map screen fields to service input parameters.
5. `invokeService("KKSV0007", "KKSV0007OP")` calls the backend inquiry service.
6. Results are unmapped via `getKKSV0007*SC()` methods.
7. A billing judgment (`JKKWebCommon.jdgHiChrg`) is performed if the sub-op service status indicates active service delivery, to determine the billing end date and billing flag.
8. Pulldown lists for homepage capacity and access analysis are populated via `JKKWebCommon.setPulldownListNoIndex()`.
9. `storeGetDataInit()` handles post-service initialization: it reads the free-capacity threshold, checks if sub-op service data exists, and sets pulldown selections appropriately. It also checks the processing section and sets editability flags (`chg_kahi_flg`) with error messages for invalid states.
10. The DataBean is logged for debugging.

### Update Confirmation Flow

When the user submits the edit form:

1. **`actionUpdMyHPInfo()`** retrieves the processing section (`trandiv`) and acts accordingly:
   - **Update mode (`CHGE`)**: Validates that URL removal is not allowed when a URL was previously set. Validates that URL is mandatory after review approval. Calls `setDataUpd()` which determines change types for capacity, access analysis, and URL. Sets billing type codes, application subtype, timestamps, and aging targets. Then calls `setMappedKKSV0008(FUNC_CD_2)` (check-only mode) and invokes `KKSV0008/KKSV0008OP`.
   - **Cancel mode (`DSL`)**: Calls `setDataDsl()` which determines the cancel type, end date, and aging targets. Then calls `setMappedKKSV0009(FUNC_CD_2)` (check-only mode) and invokes `KKSV0009/KKSV0009OP`.

2. The service returns a `rtn_msg_id`. If empty, the next screen is set to `KKW02505` (confirmation screen) and an informational message is displayed. If non-empty, a substitution message is shown and the user stays on the current screen.

### Final Commit Flow

When the user confirms on the confirmation screen:

1. **`actionFixMyHPInfo()`** is called. It routes based on `trandiv`:
   - **Update (`CHGE`)**: Calls `setMappedKKSV0008(FUNC_CD_1)` (execute mode) and invokes `KKSV0008/KKSV0008OP`.
   - **Cancel (`DSL`)**: Calls `setMappedKKSV0009(FUNC_CD_1)` and invokes `KKSV0009/KKSV0009OP`.
   - **Recovery (`KAIHK`)**: Calls `setDataKaihk()`, sets up the `KKSV0004` mapper for recovery (`setOpsvckeiKaihkCC`), and invokes `KKSV0004/KKSV0004OP`.
   - **Reservation Cancel (`RSV_CL`)**: Calls `setDataDslStp()`, sets up the `KKSV0017` mapper (`setOpsvckeiCnslCC`), and invokes `KKSV0017/KKSV0017OP`.

2. After the service returns, the next screen is set to `KKW02506` (completion screen) and a completion message is displayed.

## Data Model

### Screen Data Properties (KKW02504SFBean)

The bean follows a uniform four-field pattern per property:

| Suffix | Meaning |
|---|---|
| `*_update` | Indicates whether this field is being updated in this request |
| `*_value` | The current data value |
| `*_enabled` | Boolean flag for UI enable/disable state |
| `*_state` | Display state (e.g., normal, error, hidden) |

### List-Based Properties

Three list properties hold arrays of nested beans:

- `hp_capa_info_list` → `KKW02504SF01DBean` entries for homepage capacity options
- `accss_bnsk_info_list` → `KKW02504SF01DBean` entries for access analysis options
- `cust_kei_hktgi_list_list` → `KKW02504SF02DBean` entries for customer contract inheritance data

Each nested bean manages its own pulldown data via `cd_div_list_list`, `cd_div_nm_list_list`, and `nm_list_list` fields.

### Processing Section (trandiv)

The `trandiv` field determines the entire flow and is set from customer contract inheritance data. Possible values:

| Value | Meaning |
|---|---|
| `CHGE` | Update mode — user is modifying existing settings |
| `DSL` | Cancel mode — user is canceling the subscription |
| `KAIHK` | Recovery mode — user is re-activating a canceled subscription |
| `RSV_CL` | Reservation cancel — user is canceling a scheduled (not yet active) subscription |

### Change Type Codes

When updating, the system determines one change type for each of three dimensions:

| Dimension | Code | Meaning |
|---|---|---|
| **Homepage capacity** | `"1"` | Free → Paid conversion |
| | `"2"` | Paid → Free conversion |
| | `"3"` | Paid continuation |
| | `"4"` | Free continuation |
| | `"5"` | No change |
| **Access analysis** | `"1"` | Activate (paid) |
| | `"2"` | Deactivate (free) |
| | `"5"` | No change |
| **URL** | `"1"` | Changed |
| | `"5"` | No change |
| **Cancel type** | `"1"` | Scheduled cancel |
| | `"2"` | Immediate cancel |

## Dependencies and Integration

### XML Configuration Files

This module is referenced by four XML configuration files:

| File | References |
|---|---|
| `WEBGAMEN_KKA142010PJP.xml` | `KKW02504SFBean` |
| `WEBGAMEN_KKW025040PJP.xml` | `KKW02504SFBean`, `KKW02504SFLogic` |
| `WEBGAMEN_KKW025050PJP.xml` | `KKW02504SFBean`, `KKW02504SFLogic` |
| `WEBGAMEN_KKW025060PJP.xml` | `KKW02504SFBean`, `KKW02504SFLogic` |
| `x31business_logic_KKW02504SF.xml` | `KKW02504SFLogic` |

### Backend Services

| Service | Operation | Used By |
|---|---|---|
| `KKSV0007` | `KKSV0007OP` | Inquiry — fetches My Homepage info, contract status, sub-op details, billing, progress |
| `KKSV0008` | `KKSV0008OP` | Update confirm/execute — validates and applies changes |
| `KKSV0009` | `KKSV0009OP` | Cancel confirm/execute — validates and applies cancellation |
| `KKSV0004` | `KKSV0004OP` | Recovery — re-activates a canceled subscription |
| `KKSV0017` | `KKSV0017OP` | Reservation cancel — cancels a scheduled subscription |

### External Dependencies

| Package/Class | Usage |
|---|---|
| `eo.web.webview.JCCWebBusinessLogic` | Parent class for `KKW02504SFLogic` |
| `eo.web.webview.common.JCCWebCommon` | Screen info retrieval, date handling, message display, billing judgment |
| `eo.web.webview.common.JKKWebCommon` | Billing judgment (`jdgHiChrg`), pulldown list setup |
| `eo.web.webview.common.JKKCommonConst` | Common constants (service status codes, processing section codes, plan codes) |
| `eo.web.webview.CommonInfoCF.CommonInfoCFConst` | Next screen ID/name constants |
| `eo.common.constant.JPCModelConstant` | Function codes (`FUNC_CD_1` = check+register, `FUNC_CD_2` = check-only) |
| `eo.common.constant.JPCOnlineMessageConstant` | Message ID constants for errors and info |
| `eo.common.util.JPCUtilCommon` | Zero-padding utility for capacity codes |
| `eo.web.webview.mapping.KKSV*OPDBMapper` | DataBean-to-service parameter mapping |
| `com.fujitsu.futurity.web.x33.beans.X33VViewBaseBean` | Base class for `KKW02504SFBean` |
| `com.fujitsu.futurity.web.x31.X31SGuiCheckBase` | Interface implemented by `KKW02504SFChecker` |

## Notes for Developers

### Processing Section Determines Everything

The `trandiv` field is the single most important piece of state. It is inherited from the calling screen (customer contract inheritance data) and determines which code paths are executed throughout the entire life cycle. Do not assume the user can freely choose between update, cancel, recovery, and reservation cancel — the system enforces this based on the contract's current status.

### Editability Is Not Static

The `chg_kahi_flg` (change allowable flag) is dynamically computed in `actionInit()` based on the service contract status (`op_svc_kei_stat`). For example:
- Update mode only allows editing when the option service status is "received", "under review", "contracted", or "service delivery" (codes `010`, `020`, `030`, `100`).
- Cancel mode requires a URL to be set before allowing cancel.
- Recovery mode requires the status to be "canceled" (`910`).

### URL Changes Have Asymmetric Rules

You cannot remove an existing URL (if a URL was previously set and the change-information account is empty, the system rejects the update with error `EKB0010`). However, you can set a URL where none existed before. This is documented in the `setMappedKKSV0008` method's URL section mappings.

### Billing Judgment Is Performed at Init Time

When the sub-op service status is "service delivery" (`100`), the `actionInit()` method calls `JKKWebCommon.jdgHiChrg()` to determine the billing end date and billing flag. This is computed using the service billing start date, service start/end dates, and the current operation date. The result is stored in `svc_chrg_endymd` and `dslji_chrg_flg` for display on the screen.

### Capacity Pulldown Calculation

The homepage capacity pulldown is built from service item capacity data (initial value, max value, increase value). The `CAPA_ZERO_MASK` constant (`4`) is used to zero-pad capacity codes. The free-tier threshold (`hp_capa_mryo_val`) determines whether a capacity selection is considered "paid" or "free" for change-type determination.

### The Checker Is a Placeholder

`KKW02504SFChecker.checkMethod()` currently always returns `true` with no validation logic. This is likely a reserved extension point if future GUI-level validation is needed.

### Screen Navigation

- **Initialization** (`KKW02504`): Entry point, called from `WEBGAMEN_KKW025040PJP.xml`
- **Confirmation** (`KKW02505`): Shown after `actionUpdMyHPInfo()` succeeds, configured via `WEBGAMEN_KKW025050PJP.xml`
- **Completion** (`KKW02506`): Shown after `actionFixMyHPInfo()` succeeds, configured via `WEBGAMEN_KKW025060PJP.xml`

### Version History

The logic class carries a detailed change log from v1.00 (2011/04/01) through v5.05 (2013/07/25), with changes covering:
- Confirmation screen message display
- Date field initial display support
- Discrepancy memo support
- Option cancel return message support
- Post-cancellation status binding
- Paid/unpaid flag control for option cancellation
- Progress supplement item support
- URL conditional mandatory support
- Recovery original URL reuse
- Access analysis active/inactive control
- Homepage URL encoding support
- Post-review URL mandatory enforcement
- Progress second discrepancy year/month/day handling
- Access analysis availability display optimization

### Important Implementation Details

- All service invocations go through `invokeService()` which logs the DataBean state before and after the call at `DataBean_Dump` log level. This is important for debugging.
- The `setMappedKKSV0008()` and `setMappedKKSV0009()` methods each call ~15-25 mapper setup methods to configure the parameter mapping between the web-level DataBean and the backend service's expected parameters. These mappings cover application content, billing inquiry, URL, capacity, access analysis, progress tracking, and SODCC (system of record detection).
- The `getStoreDataInit()` method reads from the service form bean (which contains results from the KKSV0007 inquiry) and maps them to the view bean's pulldown selections. This is a two-step process: service inquiry → intermediate bean → view bean.
- The `cust_kei_hktgi_list_list` property carries customer contract inheritance data from the calling screen into this module, including the processing section code, system ID, service contract number, and application numbers. This is how the module knows which subscription the user is editing.
