# Eo / Web / Webview / Kkw00816sf

## Overview

The `KKW00816SF` package is the **multi-session information registration** view module within the K-Opticom contract management system. It provides the web front-end logic for registering (creating) a multi-session — a collection of related service contracts grouped under a single authentication ID — as well as managing the confirmation and completion workflows for that operation. The package sits on top of the Futurity X31/X33 web framework, using data beans for view-state management, a logic class for business orchestration, and database mappers to call backend business procedures.

---

## Key Classes and Interfaces

### [KKW00816SFLogic](source/koptWebB/src/eo/web/webview/KKW00816SF/KKW00816SFLogic.java) — View Logic Controller

This is the heart of the module. It extends `JCCWebBusinessLogic` (the framework's standard web-business logic base class) and implements the `action` methods that correspond to user interactions on the registration screen.

**Purpose**: Orchestrates the full lifecycle of the multi-session registration screen — from initial display, through data gathering and validation, to final submission.

**Key methods and what they do**:

- **`actionInit()`** — The entry point called when the screen loads. Reads the `NEXT_SCREEN_ID` from the common info bean to determine which screen mode to enter. Routes to `actionMltiseInit()` for screen `KKW00816` (the main registration screen). Screens `KKW00817` and `KKW00818` are stub entry points for the confirmation and completion screens respectively.

- **`actionMltiseInit()`** — Handles the initial load of the registration screen. Performs three major steps:
  1. Retrieves screen transfer source information via `setDataBean()`.
  2. Calls the `KKSV0030` mapper with 9 different service contract lookups (customer agreement, option service agreement, session limits, reservation limits, option service contract list, service contract details, E-HikariNet agreement, fee code/plan, and billing contract list). This populates the form bean with all the reference data needed for the screen.
  3. Determines whether the user holds a Fixed Global IP Address Operation Contract via `getMltiseId()`, which sets business codes accordingly.
  4. Sets system fields on the bean: operating date (`UNYO_YMD`), operating datetime stamp, initial multi-session auth ID password, auth ID, request type code, order content code, service contract detail number, and breaks down the operating date into year/month/day fields.

- **`actionClear()`** — Resets the form to defaults. Restores the operating date, resets the session count to `1`, resets the start-of-use date, and redirects back to the main registration screen (`KKW00816`).

- **`actionAddMltise()`** — Called when the user clicks "Register Confirmation" (登録確認). Maps the view fields to the data bean, then calls the `KKSV0031` mapper via `setAddMltiseInfo()` to perform the initial multi-session information registration. After the service call, sets a success message (`EKB0370--I`) and redirects to screen `KKW00817` (confirmation screen).

- **`actionBack()`** — Called when the user clicks "Back" (戻る). Redirects to the screen stored in the common info bean.

- **`actionFixAddMltise()`** — Called when the user clicks "Confirm" (確定) on the confirmation screen. Calls `KKSV0031` again (with a different function code `FUNC_CODE_1` indicating finalization) to commit the registration. Sets a completion message (`EKB4390--I`) and redirects to screen `KKW00818` (completion screen).

- **`actionShusei()`** — Called when the user clicks "Edit" (修正) on the confirmation screen. Redirects back to screen `KKW00816` to allow changes.

- **`actionFin()`** — Called when the user clicks "Finish" (完了) on the completion screen. Redirects to the option service contract list screen (stored in common info bean).

- **`getMltiseId()`** — A private helper method that checks whether the user has a "Fixed Global IP Address Operation Contract". It iterates over the `op_svc_kei_list_list` (option service contract list) and checks if the option service code is `B015` (value `0040` per `OP_SVC_CD_VALUE_0040`) and the contract status is `100` (active), `030` (service provision), or `020` (in service). If so, it flags `isFixipad = true`, appends `"P"` to the auth ID using `editIspNinshoId()`, and sets the request type to "new" (`YOKYU_SBT_CD_02`) with order content code `ODR_NAIYO_CD_144` (multi-session static registration). Otherwise, it sets the request type to "change" (`YOKYU_SBT_CD_04`) with order content code `ODR_NAIYO_CD_142` (multi-session dynamic registration).

- **`editIspNinshoId()`** — A private helper that edits the ISP auth ID. If the auth ID contains `"@"`, it inserts `"P"` just before the `"@"` (for single-auth cases). Otherwise, it appends `"P"` to the end. This was fixed in version 5.03 to correct the multi-session auth ID editing behavior.

- **`mappingDataBean()`** — Called during the registration confirmation flow. Sets non-auto-mapped view fields: concatenates year/month/day into a full start-of-use date (`staymd`), sets the implementation option service contract status to `100` (service provision), computes the service charge start date (month + 1), and sets the progress status to `5101` (operation information application in progress). Also computes and sets the datetime stamp with system date (`IDO_DTM`).

---

### [KKW00816SFBean](source/koptWebB/src/eo/web/webview/KKW00816SF/KKW00816SFBean.java) — Form Data Bean

This is the main view-state bean that holds all data for the registration screen. It extends `X33VViewBaseBean` and implements `X33VListedBeanInterface` and `X31CBaseBean`.

**Purpose**: Carries all form data between the view (JSP) and the logic layer. Contains both simple fields (String values for each screen item) and list fields (for the customer contract list and option service contract list).

**Key fields and their roles**:

| Field Group | Fields | Purpose |
|---|---|---|
| **Lists** | `cust_kei_hktgi_list_list` (X33VDataTypeList) | Customer contract succession list — each item is a `KKW00816SF01DBean` |
| | `op_svc_kei_list_list` (X33VDataTypeList) | Option service contract list — each item is a `KKW00816SF02DBean` |
| **Defaults** | `mskm_sbt_cd_value` = `"00026"` | Default application type code |
| | `op_svc_cd_value` = `"B015"` | Default option service code |
| | `oya_kei_skbt_cd_value` = `"01"` | Default parent contract identification code |
| | `work_param_id_session_uppl_value` = `"KK_SESSIONUPPL"` | Session upper limit parameter ID |
| | `work_param_id_rsv_uppl_prd_value` = `"KK_RSVUPPLPRD"` | Reservation upper limit days parameter ID |
| | `rule0059_auto_aply_value` = `"0"` | Business handling fee auto-apply flag |
| | `order_sbt_cd_value` = `"1"` | Order type code |
| | `svc_order_cd_value` = `"06"` | Service order code |
| | `odr_hakko_joken_cd_value` = `"01"` | Order issuance condition code |
| | `pplan_kotei_tanka_no_value` = `"123456789012"` | Default price plan fixed unit price number |
| | `session_cnt_value` = `"1"` | Default session count |
| | `session_cnt_enabled` = `false` | Session count field is read-only by default |
| **User-editable** | `shk_mltise_ninsho_id_pwd_value` | Initial multi-session auth ID password |
| | `mltise_ninsho_id_value` | Multi-session auth ID |
| | `use_staymd_year_value`, `use_staymd_mon_value`, `use_staymd_day_value` | Start-of-use date (split into parts) |
| | `session_cnt_enabled`, `use_staymd_year_enabled` | Field enable/disable flags |
| **Read-only / computed** | `unyo_ymd_value`, `unyo_dtm_value` | Operating date and datetime (set by logic) |
| | `svc_kei_stat_value`, `jssi_op_svc_kei_stat_value` | Service contract status (returned from BP) |

**Key methods**:

- **Constructor** — Initializes the two list beans: `cust_kei_hktgi_list_list` with capacity 1 (containing one `KKW00816SF01DBean`), and `op_svc_kei_list_list` as an empty `X33VDataTypeList`.

- **`getJsflist_typelist_cust_kei_hktgi_list()`** — Builds a `SelectItem` list from the customer contract succession list, used for display dropdowns in the view.

- **`getJsflist_typelist_op_svc_kei_list()`** — Builds a `SelectItem` list from the option service contract list, used for display dropdowns.

- Each simple field has standard `getXxx_update()`, `getXxx_value()`, and `getXxx_state()` accessor methods, following the framework's update-state-value triad convention:
  - `_value` — the data value
  - `_update` — whether the field has been modified
  - `_state` — the display state (e.g., enabled, disabled, error)

---

### [KKW00816SF01DBean](source/koptWebB/src/eo/web/webview/KKW00816SF/KKW00816SF01DBean.java) — Customer Contract List Item

An individual item within the customer contract succession list (`cust_kei_hktgi_list_list`). Implements `X33VDataTypeBeanInterface` and `X33VListedBeanInterface`.

**Fields**:

| Field | Type | Purpose |
|---|---|---|
| `sysid_value` | String | System ID for the customer contract succession |
| `svc_kei_no_value` | String | Service contract number |
| `ido_div_value` | String | Change classification (異動区分局) |
| `ido_rsn_cd_list` | X33VDataTypeList | Change reason code list (for dropdown) |
| `ido_rsn_memo_value` | String | Change reason memo |
| `index` | int | Row index in the list |

Each field follows the update-state-value pattern (`xxx_update`, `xxx_value`, `xxx_state`).

**Key methods**:

- **`loadModelData(String key, String subkey)`** — Retrieves data by field name and subkey (`"value"` or `"state"`). Maps Japanese field names like "顧客契約引継リスト" (customer contract succession list) and subkeys to the corresponding getter.

- **`storeModelData(String key, String subkey, Object in_value)`** — Stores data by field name and subkey. Has an overloaded version accepting an `isSetAsString` flag for type control.

- **`listKoumokuIds()`** — Returns the list of field names (item IDs) defined in this bean.

- **`typeModelData(String key, String subkey)`** — Returns the Class type for a given field.

- **`getJsflist_ido_rsn_cd()`** — Converts the `ido_rsn_cd_list` into a `List<SelectItem>` for view dropdown rendering.

- **`addListDataInstance()`, `removeElementFromListData()`, `clearListDataInstance()`** — List management methods inherited from the framework interface.

---

### [KKW00816SF02DBean](source/koptWebB/src/eo/web/webview/KKW00816SF/KKW00816SF02DBean.java) — Option Service Contract Item

An individual item within the option service contract list (`op_svc_kei_list_list`). Implements `X33VDataTypeBeanInterface` and `X33VListedBeanInterface`.

**Fields**:

| Field | Type | Purpose |
|---|---|---|
| `op_svc_kei_no_value` | String | Option service contract number |
| `op_svc_kei_stat_value` | String | Option service contract status |
| `op_svc_cd_value` | String | Option service code |
| `index` | int | Row index in the list |

Each field follows the update-state-value pattern.

**Key methods**:

- **`loadModelData(String key, String subkey)`** — Retrieves data by field name and subkey. Maps Japanese field names ("オプションサービス契約番号", "オプションサービス契約ステータス", "オプションサービスコード") to the corresponding getters. Returns `null` if the key/subkey combination is not found.

- **`storeModelData(...)`** — Three overloaded versions:
  - `(String key, String subkey, Object in_value)` — Generic store, delegates to the detailed version.
  - `(String gamenId, String key, String subkey, Object in_value)` — X31CBaseBean interface implementation with a screen ID parameter (reserved).
  - `(String key, String subkey, Object in_value, boolean isSetAsString)` — Detailed store with type control. Uses `String` assignment when `isSetAsString` is true, otherwise uses `X31CWebComponent.stringSet()` for type-aware assignment.

- **`listKoumokuIds()`** — Returns the list of field names defined in this bean.

- **`typeModelData(String key, String subkey)`** — Returns the Class type for a given field.

---

### [KKW00816SFChecker](source/koptWebB/src/eo/web/webview/KKW00816SF/KKW00816SFChecker.java) — GUI Validation

Implements the `X31SGuiCheckBase` interface from the X31 framework.

**Purpose**: Provides client-side and server-side GUI validation hooks for the screen. Currently, the `checkMethod()` implementation is a pass-through that always returns `true`, meaning no validation rules are enforced at the GUI check layer. This leaves validation to the logic layer and the backend business procedures.

**Key methods**:

- **Constructor** — Accepts a reference to the `X31BBusinessLogic` instance (which will be `KKW00816SFLogic`).

- **`checkMethod(X31SGuiCheckParam param, X31GUtilStockMessage errMsgStock)`** — The validation entry point. Extracts the `patternID` from the param but takes no action, returning `true` (valid). The `patternID` can be used to dispatch to different validation patterns in future extensions.

---

### [KKW00816SFConst](source/koptWebB/src/eo/web/webview/KKW00816SF/KKW00816SFConst.java) — Field Name Constants

A utility class holding `public static final String` constants for all field names used in this module. It has a private constructor (no instantiation) and organizes constants by domain:

**Constant categories**:

- **List names**: `CUST_KEI_HKTGI_LIST` (顧客契約引継リスト), `OP_SVC_KEI_LIST` (オプションサービス契約リスト)
- **Screen/item names**: `MSKM_SBT_CD` (申請種別コード), `OP_SVC_CD` (オプションサービスコード), `OYA_KEI_SKBT_CD` (親契約識別コード)
- **Business parameters**: `WORK_PARAM_ID_SESSION_UPPL` (業務パラメータID: セッション上限数), `WORK_PARAM_SETTE_RSV_UPPL_PRD` (業務パラメータ設定値: 予約上限日数)
- **Pricing**: `RULE0059_AUTO_APLY` (事務手数料自動適用可否), `PCRS_CD` (料金コードコード), `PPLAN_CD` (料金プランコード), `PPLAN_KOTEI_TANKA_NO` (料金プラン固定単価番号)
- **Authentication**: `SHK_MLTISE_NINSHO_ID_PWD` (初期マルチセッション認証IDパスワード), `MLTISE_NINSHO_ID` (マルチセッション認証ID)
- **Dates**: `SESSION_CNT` (セッション数), `USE_STAYMD_YEAR/MON/DAY` (利用開始日), `SVC_CHRG_STAYMD` (サービス課金開始年月日), `UNYO_YMD` (運用年月日), `UNYO_DTM` (運用年月日时分秒)
- **Status**: `JSSI_OP_SVC_KEI_STAT` (実施オプションサービス契約ステータス), `SVC_KEI_STAT` (サービス契約ステータス), `CUST_STAT` (お客様ステータス), `PRG_STAT` (進捗ステータス), `PRG_TKJK_1` (進捗特記事項1)
- **Order codes**: `ORDER_SBT_CD` (注文種別コード), `SVC_ORDER_CD` (サービスオーダコード), `YOKYU_SBT_CD` (要求種別コード), `ODR_HAKKO_JOKEN_CD` (オーダ発行条件コード), `ODR_NAIYO_CD` (オーダ内容コード)
- **Sub-item keys** (with `_01` / `_02` suffixes): `SYSID_01`, `SVC_KEI_NO_01`, `IDO_DIV_01`, `IDO_RSN_CD_01`, `IDO_RSN_MEMO_01`, `OP_SVC_KEI_NO_02`, `OP_SVC_KEI_STAT_02`, `OP_SVC_CD_02`, `LAST_UPD_DTM`, `IDO_DTM`, `SVC_KEI_UCWK_STAT`

---

## How It Works

### Screen Flow

The module manages a 3-screen flow:

```
Screen KKW00816 (Registration)
    ├── [Clear] → stays on KKW00816 (reset)
    └── [Register Confirmation] → Screen KKW00817 (Confirmation)
        ├── [Back] → Screen KKW00816 (edit mode)
        ├── [Confirm] → Screen KKW00818 (Completion)
        └── [Edit] → Screen KKW00816 (edit mode)
            └── [Finish] → Option Service Contract List Screen
```

### Detailed Request Flow

**1. Initial Load (`actionInit` → `actionMltiseInit`)**

1. The framework calls `actionInit()`, which reads `NEXT_SCREEN_ID` from the common info bean.
2. If the screen ID is `KKW00816`, it delegates to `actionMltiseInit()`.
3. `actionMltiseInit()` retrieves the service form bean and calls `setDataBean()` to pull in screen transfer source info.
4. It sets the operating date (`UNYO_YMD`) to the online operation date.
5. It creates a `KKSV0030_KKSV0030OPDBMapper` and calls 9 service contract lookup stored procedures (SC), each populating different lists and fields on the bean:
   - Customer agreement info (KKSV003001SC)
   - Customer agreement details (KKSV003002SC)
   - Session limit business parameters (KKSV003003SC) — changed to `FUNC_CODE_2` (fee code / option service) in v5.00
   - Reservation limit days parameters (KKSV003004SC)
   - Option service contract list (KKSV003005SC)
   - Service contract details (KKSV003006SC)
   - E-HikariNet agreement (KKSV003007SC)
   - Fee code/plan (KKSV003008SC)
   - Billing contract list (KKSV003009SC)
6. After invoking the service, it maps results back to the bean via `getSC()` methods.
7. `getMltiseId()` checks for Fixed Global IP Address Operation Contract, setting auth ID suffix and business codes accordingly.
8. The logic sets computed fields on the bean: operating date components, auth ID password, and system timestamps.

**2. Registration Confirmation (`actionAddMltise`)**

1. The user fills in the form and clicks "Register Confirmation".
2. `actionAddMltise()` retrieves the service form bean.
3. It calls `mappingDataBean()` to set computed fields (start-of-use date, service charge start date, progress status).
4. It creates a `KKSV0031_KKSV0031OPDBMapper` and calls `setAddMltiseInfo()` to prepare the multi-session registration data.
5. It invokes the backend service via `invokeService()`.
6. On success, it sets message `EKB0370--I` ("Multi-session information registered") and redirects to screen `KKW00817`.

**3. Final Commit (`actionFixAddMltise`)**

1. The user reviews and clicks "Confirm" on the confirmation screen.
2. `actionFixAddMltise()` calls `KKSV0031`'s `setAddMltiseInfo()` again, this time with `FUNC_CODE_1` (finalization code instead of inquiry code).
3. The backend service executes the actual registration.
4. On success, it sets message `EKB4390--I` ("Multi-session information registration complete") and redirects to screen `KKW00818`.

---

## Data Model

The module uses a layered data bean structure typical of the X33/X31 framework:

```
KKW00816SFBean (Form Bean)
├── cust_kei_hktgi_list_list  [X33VDataTypeList]
│   └── KKW00816SF01DBean[]   (Customer Contract Succession items)
│       ├── sysid              (String: System ID)
│       ├── svc_kei_no         (String: Service contract number)
│       ├── ido_div            (String: Change classification)
│       ├── ido_rsn_cd_list    (X33VDataTypeList: Change reason codes)
│       └── ido_rsn_memo       (String: Change reason memo)
│
├── op_svc_kei_list_list  [X33VDataTypeList]
│   └── KKW00816SF02DBean[]   (Option Service Contract items)
│       ├── op_svc_kei_no      (String: Option service contract number)
│       ├── op_svc_kei_stat    (String: Option service contract status)
│       └── op_svc_cd          (String: Option service code)
│
└── Simple fields (30+)
    ├── Each field has xxx_value, xxx_update, xxx_state
    └── Some fields have xxx_enabled (Boolean) for read-only toggle
```

The `_update`, `_value`, `_state` triad is a framework convention:
- `_value` holds the actual data
- `_update` tracks whether the field has been modified by the user
- `_state` controls the field's display state (e.g., enabled, disabled, error)
- `_enabled` (where present) provides an additional Boolean toggle for field interactivity

---

## Dependencies and Integration

### Internal Dependencies

The module depends on numerous other packages within the application, including:
- `eo.business.common` — Common business utilities
- `eo.business.service` — Business service layer
- `eo.ejb.common` — EJB common components
- `eo.ejb.cbs.mainproc` — CBS main processing EJBs
- `eo.ejb.common.edit` — EJB edit operations
- `eo.web.webview.CommonInfoCF` — Common information control flow
- `eo.web.webview.common` — Shared web view utilities
- `eo.web.webview.mapping` — Database mapper classes
- `eo.common.util` — Common utilities (`JKKStringUtil`, `JPCDateUtil`)
- Various sibling screen packages (`SCW00101SF`, `FUW00162SF`, `KKA17101SF`, etc.)

### External Mapper Integration

The module integrates with two key database mapper packages:

| Mapper | Use Case | When Called |
|---|---|---|
| `KKSV0030_KKSV0030OPDBMapper` | Service information lookup | `actionMltiseInit()` — initial screen load |
| `KKSV0031_KKSV0031OPDBMapper` | Multi-session registration | `actionAddMltise()` / `actionFixAddMltise()` — registration flow |

The `KKSV0030` mapper handles the initial data gathering — it queries the backend to populate all the lists and reference data that appear on the registration screen (customer contracts, option services, session limits, pricing, etc.).

The `KKSV0031` mapper handles the actual registration operations. A key evolution in this module: in version 5.03 (OM-2013-0002398), the mapper call was consolidated from 9 individual `setKKSV0031xx` calls to a single `setAddMltiseInfo()` method, simplifying the code and improving maintainability.

### XML Configuration

The module's data bean and logic are referenced by 4 XML configuration files:

| XML Config | References |
|---|---|
| `WEBGAMEN_KKW008160PJP.xml` | `KKW00816SFBean`, `KKW00816SFLogic` |
| `WEBGAMEN_KKW008170PJP.xml` | `KKW00816SFBean`, `KKW00816SFLogic` |
| `WEBGAMEN_KKW008180PJP.xml` | `KKW00816SFBean`, `KKW00816SFLogic` |
| `x31business_logic_KKW00816SF.xml` | `KKW00816SFLogic` |

The three `WEBGAMEN_*.xml` files correspond to the three screens in the flow (registration, confirmation, completion), while `x31business_logic_KKW00816SF.xml` configures the logic class within the X31 framework.

---

## Architecture Diagram

```mermaid
flowchart TD
    subgraph ControllerLayer["Controller Layer"]
        Logic["KKW00816SFLogic
View Logic"]
        Checker["KKW00816SFChecker
GUI Validation"]
    end

    subgraph DataBeanLayer["Data Bean Layer"]
        Bean["KKW00816SFBean
Form Data Bean
(30+ fields)"]
        DBean01["KKW00816SF01DBean
Customer Contract
List Item"]
        DBean02["KKW00816SF02DBean
Option Service
Contract Item"]
        Const["KKW00816SFConst
Field Name Constants"]
    end

    subgraph ExternalLayers["External Dependencies"]
        Mapper0["KKSV0030 Mapper
Service Info Lookup"]
        Mapper1["KKSV0031 Mapper
Multi-Session
Registration"]
    end

    Logic -->|uses| Bean
    Logic -->|uses| Checker
    Bean -->|contains| DBean01
    Bean -->|contains| DBean02
    Bean -->|references| Const
    DBean01 -->|references| Const
    DBean02 -->|references| Const
    Logic -->|calls| Mapper0
    Logic -->|calls| Mapper1
    Bean -->|referenced by| WEBG0P["WEBGAMEN_KKW008160PJP"]
    Bean -->|referenced by| WEBG0P2["WEBGAMEN_KKW008170PJP"]
    Bean -->|referenced by| WEBG0P3["WEBGAMEN_KKW008180PJP"]
```

---

## Notes for Developers

### Screen ID conventions

The module uses three screen IDs managed via `JKKScreenConst`:
- `KKW00816` — Multi-session information registration screen (main form)
- `KKW00817` — Registration confirmation screen
- `KKW00818` — Registration completion screen

### Multi-session authentication ID suffix logic

When a user has a Fixed Global IP Address Operation Contract, the auth ID gets a `"P"` suffix. The insertion logic was fixed in v5.03 to handle auth IDs containing `"@"` — the `"P"` is inserted just before the `"@"` rather than at the end. This ensures proper identification for single-auth (1つ) cases.

### Status code conventions

- `SVC_KEI_STAT_100` — Service provision (active)
- `SVC_KEI_STAT_030` — Service provision in progress
- `SVC_KEI_STAT_020` — In service
- `OP_SVC_CD_VALUE_0040` — Fixed Global IP Address Operation Contract code

### Func codes and their meanings

- `FUNC_CODE_1` — Finalize/commit operations
- `FUNC_CODE_2` — Inquiry/reference operations

The distinction matters especially in `actionMltiseInit()` (where session limit lookup uses `FUNC_CODE_2` for "fee code / option service" mode) vs. `actionFixAddMltise()` (where finalization uses `FUNC_CODE_1`).

### Commented-out code

Several sections of `KKW00816SFLogic.java` contain commented-out mapper calls and business logic (particularly around `KKSV0031` individual SC calls, discount service auto-apply, and future-date SOD registration). These represent features that were either removed, consolidated, or are planned for future implementation. Do not assume these sections are ready to be uncommented — consult the change history comments for context.

### Business parameter IDs

Key hardcoded business parameter IDs:
- `KK_SESSIONUPPL` — Session upper limit parameter
- `KK_RSVUPPLPRD` — Reservation upper limit days parameter

These are used by the backend to look up configurable limits for the current customer context.

### Validation

Currently, `KKW00816SFChecker.checkMethod()` is a no-op (always returns `true`). All validation logic resides in the logic layer (`KKW00816SFLogic`) and the backend business procedures called via the mappers. If new GUI-level validation is needed, it should be added to the `checkMethod()` switch on `patternID`.

### Version history highlights

| Version | Date | Key Change |
|---|---|---|
| v1.00 | 2011/04/04 | Initial creation |
| v3.00 | 2012/04/18 | Discount change message support |
| v4.00 | 2012/10/16 | Progress supplement items support |
| v5.00 | 2013/03/02 | Session upper limit acquisition method change |
| v5.01 | 2013/05/30 | Reference service contract status during option running/completed/service provision |
| v5.02 | 2013/10/18 | Consolidated mapper processing |
| v5.03 | 2013/11/14 | Fixed multi-session auth ID editing for ISP auth IDs |
