# Business Logic — MskmYmdCheckUpdater.execute() [10 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW01021SF.MskmYmdCheckUpdater` |
| Layer | Utility (Inner class within a screen logic controller) |
| Module | `KKW01021SF` (Package: `eo.web.webview.KKW01021SF`) |

## 1. Role

### MskmYmdCheckUpdater.execute()

This method is part of a date-matching utility used across multiple campaign-list screens (KKW01021SF, KKW01027SF, KKW01030SF, KKA15001SF, KKA15101SF) to synchronize the selection state of campaign items that share the same application date (申込年月日 — *oshimai nengetsuhi*). It is instantiated with a reference date (the application date of a specifically selected campaign) and then passed to `Items.each()`, which iterates over every campaign in the result list and invokes `execute()` on each item. The method performs a simple equality comparison between its stored reference date and the item's own application date. If the dates match, it marks the item as selected by setting the `CHOICE_03` flag (`選択` — *sentaku*, meaning "selection") to `Boolean.TRUE`. This enables the system to highlight all campaign entries that belong to the same application date group, so the user sees all campaigns submitted on the same day pre-checked. The method follows the Visitor/Closure pattern, functioning as a shared strategy object reused across screens.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["execute(BeanMap item)"])
    START --> GET_MSKM["Get mskmYmd from item key: MSKM_YMD_03"]
    GET_MSKM --> COMPARE{this.mskmYmd equals item mskmYmd?}
    COMPARE -->|true| SET_CHOICE["Set item key: CHOICE_03 = Boolean.TRUE"]
    SET_CHOICE --> END_NODE(["Return / Next"])
    COMPARE -->|false| END_NODE
```

**CRITICAL — Constant Resolution:**

| Constant Name | Actual Value | Business Meaning |
|---------------|-------------|------------------|
| `KKW01021SFConst.MSKM_YMD_03` | `"申込年月日"` | Application date/year-month-day — the date the campaign was submitted |
| `KKW01021SFConst.CHOICE_03` | `"選択"` | Selection flag — when set to TRUE, marks the item as selected in the campaign list UI |

The method compares the instance field `this.mskmYmd` (set via the constructor at creation time, containing the application date of the campaign the user explicitly selected) against the `mskmYmd` value extracted from the current `item` BeanMap entry. If they match, the item receives the `"選択"` (selection) key set to `Boolean.TRUE`, visually marking it as checked in the campaign list.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `item` | `BeanMap` | A single campaign entry from the retrieved campaign list. Contains fields such as application date (申込年月日), campaign code, campaign name, service type, discount code, status, etc. The method reads its `MSKM_YMD_03` ("申込年月日") field and, if matched, writes a `CHOICE_03` ("選択") flag to mark it as selected. |

**Instance fields read:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `mskmYmd` | `String` | The reference application date (申込年月日) captured from the user's explicit campaign selection. This is the value against which every item in the list is compared. Set via the constructor when the `MskmYmdCheckUpdater` is instantiated. |

## 4. CRUD Operations / Called Services

This method performs no CRUD operations and calls no service components (SC), service components (CBS), or database-layer methods. It operates entirely in memory, performing a simple string comparison and a map value assignment on the `BeanMap` parameter.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| — | — | — | — | No database or service calls. Pure in-memory comparison and BeanMap mutation. |

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 1 methods.
Terminal operations from this method: —

This method is not called directly by other business methods. Instead, it is invoked indirectly through the `Items.each()` iteration helper. The `Items.each()` method is a collection visitor that calls `execute()` on every `BeanMap` element in a campaign result list.

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKW01030 | `KKW01030SFLogic.processCampaignList()` → `Items.each(resultList, updater)` → `MskmYmdCheckUpdater.execute()` | — (no CRUD from this method) |
| 2 | Screen:KKA15101 | `KKA15101SFLogic.processCampaignList()` → `Items.each(resultList, updater)` → `MskmYmdCheckUpdater.execute()` | — (no CRUD from this method) |
| 3 | Screen:KKW01021SF | `KKW01021SFLogic` → `Items.each(resultList, updater)` → `MskmYmdCheckUpdater.execute()` | — (no CRUD from this method) |
| 4 | Screen:KKW01027SF | `KKW01027SFLogic` → `Items.each(resultList, updater)` → `MskmYmdCheckUpdater.execute()` | — (no CRUD from this method) |
| 5 | Screen:KKA15001SF | `KKA15001SFLogic` → `Items.each(resultList, updater)` → `MskmYmdCheckUpdater.execute()` | — (no CRUD from this method) |

## 6. Per-Branch Detail Blocks

**Block 1** — [EXEC] `(extract mskmYmd from item BeanMap)` (L1688)

> Extract the application date (申込年月日) from the current campaign item's BeanMap using the key `MSKM_YMD_03` ("申込年月日").

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `item.get(KKW01021SFConst.MSKM_YMD_03)` // Extract application date from item [-> MSKM_YMD_03="申込年月日"] |
| 2 | SET | `mskmYmd = (String) item.get(...)` // Cast to String — the year-month-day value from this campaign entry |

**Block 2** — [IF] `(this.mskmYmd.equals(mskmYmd))` (L1689)

> Compare the stored reference date (from the user's selected campaign) with the item's application date. If they match, mark this item as selected.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `this.mskmYmd.equals(mskmYmd)` // Compare instance field with extracted item date |

**Block 2.1** — [IF-true branch] `(dates match)` (L1690)

> The application dates match. Mark this campaign item as selected so it appears pre-checked in the UI.

| # | Type | Code |
|---|------|------|
| 1 | SET | `choice = Boolean.TRUE` // Selection flag set to true [-> CHOICE_03="選択"] |
| 2 | EXEC | `item.put(KKW01021SFConst.CHOICE_03, choice)` // Put selection flag into item BeanMap [-> CHOICE_03="選択"] |

**Block 2.2** — [IF-false branch] `(dates do not match)` (implicit L1690)

> The application dates differ. No action is taken — this item remains unselected.

| # | Type | Code |
|---|------|------|
| 1 | — | (no operation — silently skip) |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `mskmYmd` | Field | Application date/year-month-day (申込年月日) — the date a campaign was submitted, used as a grouping key for campaign entries |
| `MSKM_YMD_03` | Constant key | BeanMap key "申込年月日" — the field name used to store and retrieve the application date in campaign list items |
| `CHOICE_03` | Constant key | BeanMap key "選択" (selection) — when set to `Boolean.TRUE`, marks a campaign item as selected in the UI |
| `CHOICE_03` | Constant value | "選択" — Japanese for "selection" |
| `mskmYmd` (instance) | Instance field | Reference application date — the specific 申込年月日 value captured when the updater was constructed, derived from the user's explicitly selected campaign |
| `Items.each()` | Utility method | Apache-style collection visitor that iterates over a list and invokes a `Closure` (or visitor) on each element |
| `Closure` | Interface | Apache Commons Closure — a functional interface with an `execute(Object)` method, used here as a visitor pattern for list iteration |
| `BeanMap` | Type | Apache Commons BeanUtils BeanMap — a map-style view of a JavaBean's properties, used here to hold campaign list items as key-value pairs |
| Campaign (キャンペーン) | Domain term | A promotional offering (discount service, special plan) available to customers, listed in campaign search/display screens |
| KKW01030SF | Screen ID | Campaign list/search screen — displays registered campaigns and allows selection |
| KKW01021SF | Screen ID | Campaign display screen — uses the updater for date-based selection highlighting |
| KKA15101SF | Screen ID | Another campaign-related screen using the same updater pattern |
| KKA15001SF | Screen ID | Another campaign-related screen using the same updater pattern |
| KKW01027SF | Screen ID | Another campaign-related screen using the same updater pattern |
