# Business Logic — KKA14901SFLogic.singleChkForOneStop() [192 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKA14901SF.KKA14901SFLogic` |
| Layer | Service (Web Logic / Controller Layer — `eo.web.webview`) |
| Module | `KKA14901SF` (Package: `eo.web.webview.KKA14901SF`) |

## 1. Role

### KKA14901SFLogic.singleChkForOneStop()

This method performs field-level input validation for the K-Opticom One-Stop (ワントップ) API service contract cancellation workflow. It is a private validation gate that receives a flat `requestMap` (parsed from incoming XML) and checks each mandatory business parameter for presence, format, length, and reference-value correctness. The method handles seven distinct input fields: functional code (`func_code`), system ID (`sysid`), service contract number (`svc_kei_no`), cancellation reason major category code (`ido_rsn_dbri_cd`), cancellation reason minor category code (`ido_rsn_cbri_cd`), cancellation reason memo (`ido_rsn_memo`), user ID (`user_id`), and service end date (`svc_endymd`). Each field follows a consistent validation pattern — required field check, format/character-set check, length check, and for `func_code` specifically, a reference-value whitelist check against allowed function codes `1` (confirmation mode) and `2` (update mode). The method collects all detected errors into an `errList`, and if any errors exist, it invokes `JKKOneStopApiCommonUtil.setReturnXml()` with status `"10"` (validation failure) and returns `false`; otherwise it returns `true` to allow the calling `apiControl()` method to proceed to the next validation stage. The design pattern used is a **sequential validation gate** (also known as a guard/interceptor pattern) — errors accumulate across all fields rather than failing fast, enabling the API consumer to receive a complete list of validation issues in a single response.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["singleChkForOneStop"])
    INIT["Initialize errList, itemName, itemValue"]

    FUNC_CHK_START{"func_code present in requestMap?"}
    FUNC_REQ_ERR["Add required field error for func_code"]
    FUNC_GET["itemValue = requestMap.get(func_code)"]
    FUNC_FMT{"isNumber1Check(itemValue)?"}
    FUNC_FMT_ERR["Add format error for func_code"]
    FUNC_LEN{"isLength1Check(itemValue, 1)?"}
    FUNC_LEN_ERR["Add length error for func_code"]
    FUNC_REF{"FUNC_CODE_1 != itemValue AND FUNC_CODE_2 != itemValue?"}
    FUNC_REF_ERR["Add reference error for func_code"]

    SYSID_CHK_START{"sysid present in requestMap?"}
    SYSID_REQ_ERR["Add required field error for sysid"]
    SYSID_GET["itemValue = requestMap.get(sysid)"]
    SYSID_FMT{"isEnNumber1Check(itemValue)?"}
    SYSID_FMT_ERR["Add format error for sysid"]
    SYSID_LEN{"isLength1Check(itemValue, 10)?"}
    SYSID_LEN_ERR["Add length error for sysid"]

    SVCKEI_CHK_START{"svc_kei_no present in requestMap?"}
    SVCKEI_REQ_ERR["Add required field error for svc_kei_no"]
    SVCKEI_GET["itemValue = requestMap.get(svc_kei_no)"]
    SVCKEI_FMT{"isEnNumber1Check(itemValue)?"}
    SVCKEI_FMT_ERR["Add format error for svc_kei_no"]
    SVCKEI_LEN{"isLength1Check(itemValue, 10)?"}
    SVCKEI_LEN_ERR["Add length error for svc_kei_no"]

    IDODBRI_CHK_START{"ido_rsn_dbri_cd present in requestMap?"}
    IDODBRI_REQ_ERR["Add required field error for ido_rsn_dbri_cd"]
    IDODBRI_GET["itemValue = requestMap.get(ido_rsn_dbri_cd)"]
    IDODBRI_FMT{"isEnNumber1Check(itemValue)?"}
    IDODBRI_FMT_ERR["Add format error for ido_rsn_dbri_cd"]
    IDODBRI_LEN{"isLength1Check(itemValue, 2)?"}
    IDODBRI_LEN_ERR["Add length error for ido_rsn_dbri_cd"]

    IDOCBRI_CHK{"ido_rsn_cbri_cd in requestMap?"}
    IDOCBRI_GET["itemValue = requestMap.get(ido_rsn_cbri_cd)"]
    IDOCBRI_FMT{"isEnNumber1Check(itemValue)?"}
    IDOCBRI_FMT_ERR["Add format error for ido_rsn_cbri_cd"]
    IDOCBRI_LEN{"isLength1Check(itemValue, 2)?"}
    IDOCBRI_LEN_ERR["Add length error for ido_rsn_cbri_cd"]

    IDOMEMO_CHK{"ido_rsn_memo in requestMap?"}
    IDOMEMO_GET["itemValue = requestMap.get(ido_rsn_memo)"]
    IDOMEMO_FMT{"isMix1Check(itemValue)?"}
    IDOMEMO_FMT_ERR["Add format error for ido_rsn_memo"]
    IDOMEMO_LEN{"isLength2Check(itemValue, 1, 100)?"}
    IDOMEMO_LEN_ERR["Add length error for ido_rsn_memo"]

    USERID_CHK_START{"user_id present in requestMap?"}
    USERID_REQ_ERR["Add required field error for user_id"]
    USERID_GET["itemValue = requestMap.get(user_id)"]
    USERID_FMT{"isEnNumber1Check(itemValue)?"}
    USERID_FMT_ERR["Add format error for user_id"]
    USERID_LEN{"isLength2Check(itemValue, 6, 10)?"}
    USERID_LEN_ERR["Add length error for user_id"]

    SVCEOF_CHK_START{"svc_endymd present in requestMap?"}
    SVCEOF_REQ_ERR["Add required field error for svc_endymd"]
    SVCEOF_CHK2{"svc_endymd in requestMap?"}
    SVCEOF_GET["itemValue = requestMap.get(svc_endymd)"]
    SVCEOF_FMT{"isDateCheck OR checkDate(itemValue, 8)?"}
    SVCEOF_FMT_ERR["Add format error for svc_endymd"]
    SVCEOF_LEN{"isLength1Check(itemValue, 8)?"}
    SVCEOF_LEN_ERR["Add length error for svc_endymd"]

    ERR_CHECK{"errList.size() > 0?"}
    ERR_RETURN["setReturnXml(status=\"10\", errList, warnList, funcCode, IF_ID)"]
    ERR_RETURN2["return false"]
    SUCCESS_RETURN["return true"]
    END(["End / Return"])

    START --> INIT
    INIT --> FUNC_CHK_START
    FUNC_CHK_START -- "no" --> FUNC_REQ_ERR --> SYSID_CHK_START
    FUNC_CHK_START -- "yes" --> FUNC_GET
    FUNC_GET --> FUNC_FMT
    FUNC_FMT -- "no" --> FUNC_FMT_ERR --> FUNC_LEN
    FUNC_FMT -- "yes" --> FUNC_LEN
    FUNC_LEN -- "no" --> FUNC_LEN_ERR --> FUNC_REF
    FUNC_LEN -- "yes" --> FUNC_REF
    FUNC_REF -- "yes" --> FUNC_REF_ERR --> SYSID_CHK_START
    FUNC_REF -- "no" --> SYSID_CHK_START
    FUNC_REQ_ERR --> SYSID_CHK_START

    SYSID_CHK_START -- "no" --> SYSID_REQ_ERR --> SVCKEI_CHK_START
    SYSID_CHK_START -- "yes" --> SYSID_GET
    SYSID_GET --> SYSID_FMT
    SYSID_FMT -- "no" --> SYSID_FMT_ERR --> SYSID_LEN
    SYSID_FMT -- "yes" --> SYSID_LEN
    SYSID_LEN -- "no" --> SYSID_LEN_ERR --> SVCKEI_CHK_START
    SYSID_LEN -- "yes" --> SVCKEI_CHK_START
    SYSID_REQ_ERR --> SVCKEI_CHK_START

    SVCKEI_CHK_START -- "no" --> SVCKEI_REQ_ERR --> IDODBRI_CHK_START
    SVCKEI_CHK_START -- "yes" --> SVCKEI_GET
    SVCKEI_GET --> SVCKEI_FMT
    SVCKEI_FMT -- "no" --> SVCKEI_FMT_ERR --> SVCKEI_LEN
    SVCKEI_FMT -- "yes" --> SVCKEI_LEN
    SVCKEI_LEN -- "no" --> SVCKEI_LEN_ERR --> IDODBRI_CHK_START
    SVCKEI_LEN -- "yes" --> IDODBRI_CHK_START
    SVCKEI_REQ_ERR --> IDODBRI_CHK_START

    IDODBRI_CHK_START -- "no" --> IDODBRI_REQ_ERR --> IDOCBRI_CHK
    IDODBRI_CHK_START -- "yes" --> IDODBRI_GET
    IDODBRI_GET --> IDODBRI_FMT
    IDODBRI_FMT -- "no" --> IDODBRI_FMT_ERR --> IDODBRI_LEN
    IDODBRI_FMT -- "yes" --> IDODBRI_LEN
    IDODBRI_LEN -- "no" --> IDODBRI_LEN_ERR --> IDOCBRI_CHK
    IDODBRI_LEN -- "yes" --> IDOCBRI_CHK
    IDODBRI_REQ_ERR --> IDOCBRI_CHK

    IDOCBRI_CHK -- "no" --> IDOMEMO_CHK
    IDOCBRI_CHK -- "yes" --> IDOCBRI_GET
    IDOCBRI_GET --> IDOCBRI_FMT
    IDOCBRI_FMT -- "no" --> IDOCBRI_FMT_ERR --> IDOCBRI_LEN
    IDOCBRI_FMT -- "yes" --> IDOCBRI_LEN
    IDOCBRI_LEN -- "no" --> IDOCBRI_LEN_ERR --> IDOMEMO_CHK
    IDOCBRI_LEN -- "yes" --> IDOMEMO_CHK

    IDOMEMO_CHK -- "no" --> USERID_CHK_START
    IDOMEMO_CHK -- "yes" --> IDOMEMO_GET
    IDOMEMO_GET --> IDOMEMO_FMT
    IDOMEMO_FMT -- "no" --> IDOMEMO_FMT_ERR --> IDOMEMO_LEN
    IDOMEMO_FMT -- "yes" --> IDOMEMO_LEN
    IDOMEMO_LEN -- "no" --> IDOMEMO_LEN_ERR --> USERID_CHK_START
    IDOMEMO_LEN -- "yes" --> USERID_CHK_START

    USERID_CHK_START -- "no" --> USERID_REQ_ERR --> SVCEOF_CHK_START
    USERID_CHK_START -- "yes" --> USERID_GET
    USERID_GET --> USERID_FMT
    USERID_FMT -- "no" --> USERID_FMT_ERR --> USERID_LEN
    USERID_FMT -- "yes" --> USERID_LEN
    USERID_LEN -- "no" --> USERID_LEN_ERR --> SVCEOF_CHK_START
    USERID_LEN -- "yes" --> SVCEOF_CHK_START
    USERID_REQ_ERR --> SVCEOF_CHK_START

    SVCEOF_CHK_START -- "no" --> SVCEOF_REQ_ERR --> ERR_CHECK
    SVCEOF_CHK_START -- "yes" --> SVCEOF_CHK2
    SVCEOF_CHK2 -- "no" --> ERR_CHECK
    SVCEOF_CHK2 -- "yes" --> SVCEOF_GET
    SVCEOF_GET --> SVCEOF_FMT
    SVCEOF_FMT -- "no" --> SVCEOF_FMT_ERR --> SVCEOF_LEN
    SVCEOF_FMT -- "yes" --> SVCEOF_LEN
    SVCEOF_LEN -- "no" --> SVCEOF_LEN_ERR --> ERR_CHECK
    SVCEOF_LEN -- "yes" --> ERR_CHECK
    SVCEOF_REQ_ERR --> ERR_CHECK

    ERR_CHECK -- "yes" --> ERR_RETURN --> ERR_RETURN2 --> END
    ERR_CHECK -- "no" --> SUCCESS_RETURN --> END
```

**Block-level description:**

The method processes fields sequentially. Each field follows the same pattern:
- **Required fields** (`func_code`, `sysid`, `svc_kei_no`, `ido_rsn_dbri_cd`, `user_id`, `svc_endymd`): Check presence via `checkRequireNotNull()` -> extract value -> validate format -> validate length -> (for `func_code` only) validate against allowed reference values.
- **Optional fields** (`ido_rsn_cbri_cd`, `ido_rsn_memo`): Check presence via `containsKey()` -> if present, validate format -> validate length.
- **Date field** (`svc_endymd`): After presence and value extraction, performs date format validation (`DatetimeCheck.isDateCheck`) and date validity check (`JPCUtilCommon.checkDate`), plus a separate length check.

**CRITICAL — Constant Resolution:**
- `JKKCommonConst.FUNC_CODE_1 = "1"` — Confirmation mode (requires confirmation button press processing)
- `JKKCommonConst.FUNC_CODE_2 = "2"` — Update mode (allows direct update without confirmation)
- These two codes represent the two functional modes of the One-Stop API: mode `1` triggers the action-fix/confirmation flow, while mode `2` permits direct API updates.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| - | (none — reads from instance field) | - | - |

The method reads from the instance field `requestMap` (type `Map<String, Object>`), which contains the deserialized request data parsed from the incoming XML. The method does not accept direct parameters; instead, it operates on the class-level state populated by the caller (`apiInit()`).

| No | Source | Type | Business Description |
|----|--------|------|---------------------|
| 1 | `requestMap` (instance field) | `Map<String, Object>` | Incoming request parameters from the One-Stop API, keyed by field names like `func_code`, `sysid`, `svc_kei_no`, etc. |
| 2 | `errList` (instance field) | `List<Map<String, String>>` | Accumulator for all validation error entries found during this method's execution. Pre-initialized as empty `ArrayList`. |
| 3 | `funcCode` (instance field) | `String` | The functional code extracted from `requestMap`, used in error response formatting |
| 4 | `IF_ID` (instance field) | `String` | The interface identifier used in error XML response construction |
| 5 | `warnList` (instance field) | `List<Map<String, String>>` | Warning list passed to `setReturnXml` for error response generation |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JKKOneStopApiCommonUtil.checkRequireNotNull` | - | - | Checks if a required key exists in requestMap (read from in-memory map) |
| R | `JKKOneStopApiCommonUtil.getReqErrInfMap` | - | - | Returns error info map for required-field validation failure |
| R | `JKKOneStopApiCommonUtil.getFormErrInfMap` | - | - | Returns error info map for format/validation failure |
| R | `JKKOneStopApiCommonUtil.getLenErrInfMap` | - | - | Returns error info map for length-validation failure |
| R | `JKKOneStopApiCommonUtil.getRefErrInfMap` | - | - | Returns error info map for reference-value whitelist failure |
| R | `HalfCharCheck.isNumber1Check` | - | - | Validates that value contains only half-width numeric characters (1 digit) |
| R | `HalfCharCheck.isEnNumber1Check` | - | - | Validates that value contains only half-width alphanumeric characters (1-10 digits) |
| R | `MixCharCheck.isMix1Check` | - | - | Validates that value contains mixed characters (full-width, half-width, alphanumeric, symbols) |
| R | `LengthCheck.isLength1Check` | - | - | Validates string length equals exact number (1 or 10 or 2 digits) |
| R | `LengthCheck.isLength2Check` | - | - | Validates string length falls within range (6-10 or 1-100 characters) |
| R | `DatetimeCheck.isDateCheck` | - | - | Validates that value is a properly formatted date string (YYYYMMDD) |
| R | `JPCUtilCommon.checkDate` | - | - | Validates date value is a valid calendar date with specified length (8 chars) |
| C | `JKKOneStopApiCommonUtil.setReturnXml` | - | - | Constructs and sets error response XML with status code "10" (validation failure), error list, warning list, function code, and IF_ID |

Analyze all method calls within this method and classify each as a CRUD operation. This method is a pure validation gate — it does not perform database reads/writes. All operations are read (R) from in-memory structures (`requestMap`) or utility validation services. The only write (C) operation is constructing the error response XML via `setReturnXml`.

## 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: `setReturnXml` [-], `setReturnXml` [-], `setReturnXml` [-], `getLenErrInfMap` [R], `getLenErrInfMap` [R], `getLenErrInfMap` [R], `getLenErrInfMap` [R], `getLenErrInfMap` [R], `getFormErrInfMap` [R], `getFormErrInfMap` [R], `getFormErrInfMap` [R], `getFormErrInfMap` [R], `getFormErrInfMap` [R], `checkDate` [-], `checkDate` [-], `isDateCheck` [-], `isDateCheck` [-]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Controller: KKA14901SFLogic.apiControl() | `apiControl()` -> `apiInit()` -> `singleChkForOneStop()` | `setReturnXml [C] XML response`, `getFormErrInfMap [R]`, `getLenErrInfMap [R]`, `getReqErrInfMap [R]`, `getRefErrInfMap [R]` |

**Call chain description:** `apiControl()` is the public entry point of the KKA14901SFLogic class. It first calls `apiInit()` to initialize the request parsing and error message maps, then calls `singleChkForOneStop()` for field-level validation. If `singleChkForOneStop()` returns `false`, `apiControl()` returns `true` early (the error response is already set by `setReturnXml`). If validation passes, `apiControl()` proceeds to `commonKnrnChkForOneStop()` and subsequent business validation steps.

## 6. Per-Branch Detail Blocks

Analyze the method's control flow block by block. Analyze ALL nesting levels — no depth limit.

> Each branch of the control flow is displayed as a hierarchical block structure.

**Block 1** — [IF] required field check `(func_code)` L{490}

> Required field check for `func_code` (機能コード — functional code). The method checks if the key exists in requestMap via `checkRequireNotNull()`. If absent, a required-field error is added.

| # | Type | Code |
|---|------|------|
| 1 | SET | `itemName = "func_code"` |
| 2 | EXEC | `JKKOneStopApiCommonUtil.checkRequireNotNull(requestMap, itemName)` // 必須チェック (required field check) |
| 3 | EXEC | `errList.add(JKKOneStopApiCommonUtil.getReqErrInfMap(itemName))` // 必須チェックエラー (required check error) |
| 4 | SET | `itemValue = (String)requestMap.get(itemName)` |

**Block 1.1** — [IF] format check `(HalfCharCheck.isNumber1Check)` L{501}

> Format check: func_code must be a single half-width digit.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `HalfCharCheck.isNumber1Check(itemValue)` // 形式チェック (format check) |
| 2 | EXEC | `errList.add(JKKOneStopApiCommonUtil.getFormErrInfMap(itemName))` // 形式チェックエラー (format check error) |

**Block 1.2** — [IF] length check `(LengthCheck.isLength1Check)` L{507}

> Length check: func_code must be exactly 1 character.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `LengthCheck.isLength1Check(itemValue, 1)` // 桁数チェック (digit count check) |
| 2 | EXEC | `errList.add(JKKOneStopApiCommonUtil.getLenErrInfMap(itemName))` // 桁数チェックエラー (digit count check error) |

**Block 1.3** — [IF] reference value check `(FUNC_CODE_1 / FUNC_CODE_2)` [FUNC_CODE_1="1"] [FUNC_CODE_2="2"] L{513}

> Reference whitelist check: func_code must be either "1" (confirmation mode) or "2" (update mode). If neither, a reference-value error is added.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `JKKCommonConst.FUNC_CODE_1.equals(itemValue)` // check equals "1" |
| 2 | EXEC | `JKKCommonConst.FUNC_CODE_2.equals(itemValue)` // check equals "2" |
| 3 | EXEC | `errList.add(JKKOneStopApiCommonUtil.getRefErrInfMap(itemName))` // リファレンスチェックエラー (reference check error) |

---

**Block 2** — [IF] required field check `(sysid)` L{522}

> Required field check for `sysid` (システムID — system ID). Must be present, must be half-width alphanumeric, must be exactly 10 characters.

| # | Type | Code |
|---|------|------|
| 1 | SET | `itemName = "sysid"` |
| 2 | EXEC | `JKKOneStopApiCommonUtil.checkRequireNotNull(requestMap, itemName)` // 必須チェック (required field check) |
| 3 | EXEC | `errList.add(JKKOneStopApiCommonUtil.getReqErrInfMap(itemName))` // 必須チェックエラー (required check error) |
| 4 | SET | `itemValue = (String)requestMap.get(itemName)` |

**Block 2.1** — [IF] format check `(HalfCharCheck.isEnNumber1Check)` L{533}

> Format check: sysid must be half-width alphanumeric (English + digits).

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `HalfCharCheck.isEnNumber1Check(itemValue)` // 形式チェック (format check) |
| 2 | EXEC | `errList.add(JKKOneStopApiCommonUtil.getFormErrInfMap(itemName))` // 形式チェックエラー (format check error) |

**Block 2.2** — [IF] length check `(LengthCheck.isLength1Check)` L{539}

> Length check: sysid must be exactly 10 characters.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `LengthCheck.isLength1Check(itemValue, 10)` // 桁数チェック (digit count check) |
| 2 | EXEC | `errList.add(JKKOneStopApiCommonUtil.getLenErrInfMap(itemName))` // 桁数チェックエラー (digit count check error) |

---

**Block 3** — [IF] required field check `(svc_kei_no)` L{548}

> Required field check for `svc_kei_no` (サービス契約番号 — service contract number). Must be present, half-width alphanumeric, exactly 10 characters.

| # | Type | Code |
|---|------|------|
| 1 | SET | `itemName = "svc_kei_no"` |
| 2 | EXEC | `JKKOneStopApiCommonUtil.checkRequireNotNull(requestMap, itemName)` // 必須チェック (required field check) |
| 3 | EXEC | `errList.add(JKKOneStopApiCommonUtil.getReqErrInfMap(itemName))` // 必須チェックエラー (required check error) |
| 4 | SET | `itemValue = (String)requestMap.get(itemName)` |

**Block 3.1** — [IF] format check `(HalfCharCheck.isEnNumber1Check)` L{559}

> Format check: svc_kei_no must be half-width alphanumeric.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `HalfCharCheck.isEnNumber1Check(itemValue)` // 形式チェック (format check) |
| 2 | EXEC | `errList.add(JKKOneStopApiCommonUtil.getFormErrInfMap(itemName))` // 形式チェックエラー (format check error) |

**Block 3.2** — [IF] length check `(LengthCheck.isLength1Check)` L{565}

> Length check: svc_kei_no must be exactly 10 characters.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `LengthCheck.isLength1Check(itemValue, 10)` // 桁数チェック (digit count check) |
| 2 | EXEC | `errList.add(JKKOneStopApiCommonUtil.getLenErrInfMap(itemName))` // 桁数チェックエラー (digit count check error) |

---

**Block 4** — [IF] required field check `(ido_rsn_dbri_cd)` L{574}

> Required field check for `ido_rsn_dbri_cd` (異動理由大分類コード — cancellation reason major category code). Must be present, half-width alphanumeric, exactly 2 characters.

| # | Type | Code |
|---|------|------|
| 1 | SET | `itemName = "ido_rsn_dbri_cd"` |
| 2 | EXEC | `JKKOneStopApiCommonUtil.checkRequireNotNull(requestMap, itemName)` // 必須チェック (required field check) |
| 3 | EXEC | `errList.add(JKKOneStopApiCommonUtil.getReqErrInfMap(itemName))` // 必須チェックエラー (required check error) |
| 4 | SET | `itemValue = (String)requestMap.get(itemName)` |

**Block 4.1** — [IF] format check `(HalfCharCheck.isEnNumber1Check)` L{585}

> Format check: cancellation reason major category code must be half-width alphanumeric.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `HalfCharCheck.isEnNumber1Check(itemValue)` // 形式チェック (format check) |
| 2 | EXEC | `errList.add(JKKOneStopApiCommonUtil.getFormErrInfMap(itemName))` // 形式チェックエラー (format check error) |

**Block 4.2** — [IF] length check `(LengthCheck.isLength1Check)` L{591}

> Length check: cancellation reason major category code must be exactly 2 characters.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `LengthCheck.isLength1Check(itemValue, 2)` // 桁数チェック (digit count check) |
| 2 | EXEC | `errList.add(JKKOneStopApiCommonUtil.getLenErrInfMap(itemName))` // 桁数チェックエラー (digit count check error) |

---

**Block 5** — [IF] optional field check `(ido_rsn_cbri_cd)` L{600}

> Optional field check for `ido_rsn_cbri_cd` (異動理由中分類コード — cancellation reason minor category code). This field is **not required** — validation only runs if the key exists in requestMap. If present, must be half-width alphanumeric, exactly 2 characters.

| # | Type | Code |
|---|------|------|
| 1 | SET | `itemName = "ido_rsn_cbri_cd"` |
| 2 | EXEC | `requestMap.containsKey(itemName)` // 存在チェック（省略可）(presence check — optional) |
| 3 | SET | `itemValue = (String)requestMap.get(itemName)` |

**Block 5.1** — [IF] format check `(HalfCharCheck.isEnNumber1Check)` L{610}

> Format check (optional field): half-width alphanumeric only.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `HalfCharCheck.isEnNumber1Check(itemValue)` // 形式チェック (format check) |
| 2 | EXEC | `errList.add(JKKOneStopApiCommonUtil.getFormErrInfMap(itemName))` // 形式チェックエラー (format check error) |

**Block 5.2** — [IF] length check `(LengthCheck.isLength1Check)` L{616}

> Length check (optional field): exactly 2 characters.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `LengthCheck.isLength1Check(itemValue, 2)` // 桁数チェック (digit count check) |
| 2 | EXEC | `errList.add(JKKOneStopApiCommonUtil.getLenErrInfMap(itemName))` // 桁数チェックエラー (digit count check error) |

---

**Block 6** — [IF] optional field check `(ido_rsn_memo)` L{625}

> Optional field check for `ido_rsn_memo` (異動理由メモ — cancellation reason memo). Not required. If present, must pass mixed-character validation (allows full-width, half-width, alphanumeric, symbols) and be 1-100 characters.

| # | Type | Code |
|---|------|------|
| 1 | SET | `itemName = "ido_rsn_memo"` |
| 2 | EXEC | `requestMap.containsKey(itemName)` // 存在チェック（省略可）(presence check — optional) |
| 3 | SET | `itemValue = (String)requestMap.get(itemName)` |

**Block 6.1** — [IF] format check `(MixCharCheck.isMix1Check)` L{633}

> Format check (optional field): allows mixed character types (full-width, half-width, alphanumeric, symbols).

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `MixCharCheck.isMix1Check(itemValue)` // 形式チェック (format check) |
| 2 | EXEC | `errList.add(JKKOneStopApiCommonUtil.getFormErrInfMap(itemName))` // 形式チェックエラー (format check error) |

**Block 6.2** — [IF] length check `(LengthCheck.isLength2Check)` L{639}

> Length check (optional field): 1-100 characters range.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `LengthCheck.isLength2Check(itemValue, 1, 100)` // 桁数チェック (digit count check) |
| 2 | EXEC | `errList.add(JKKOneStopApiCommonUtil.getLenErrInfMap(itemName))` // 桁数チェックエラー (digit count check error) |

---

**Block 7** — [IF] required field check `(user_id)` L{648}

> Required field check for `user_id` (ユーザーID — user ID). Must be present, half-width alphanumeric, 6-10 characters.

| # | Type | Code |
|---|------|------|
| 1 | SET | `itemName = "user_id"` |
| 2 | EXEC | `JKKOneStopApiCommonUtil.checkRequireNotNull(requestMap, itemName)` // 必須チェック (required field check) |
| 3 | EXEC | `errList.add(JKKOneStopApiCommonUtil.getReqErrInfMap(itemName))` // 必須チェックエラー (required check error) |
| 4 | SET | `itemValue = (String)requestMap.get(itemName)` |

**Block 7.1** — [IF] format check `(HalfCharCheck.isEnNumber1Check)` L{659}

> Format check: user_id must be half-width alphanumeric.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `HalfCharCheck.isEnNumber1Check(itemValue)` // 形式チェック (format check) |
| 2 | EXEC | `errList.add(JKKOneStopApiCommonUtil.getFormErrInfMap(itemName))` // 形式チェックエラー (format check error) |

**Block 7.2** — [IF] length check `(LengthCheck.isLength2Check)` L{665}

> Length check: user_id must be 6-10 characters.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `LengthCheck.isLength2Check(itemValue, 6, 10)` // 桁数チェック (digit count check) |
| 2 | EXEC | `errList.add(JKKOneStopApiCommonUtil.getLenErrInfMap(itemName))` // 桁数チェックエラー (digit count check error) |

---

**Block 8** — [IF] required field check `(svc_endymd)` L{674}

> Required field check for `svc_endymd` (サービス終了年月日 — service end date). Must be present, must be a valid YYYYMMDD date string of exactly 8 characters.

| # | Type | Code |
|---|------|------|
| 1 | SET | `itemName = "svc_endymd"` |
| 2 | EXEC | `JKKOneStopApiCommonUtil.checkRequireNotNull(requestMap, itemName)` // 必須チェック (required field check) |
| 3 | EXEC | `errList.add(JKKOneStopApiCommonUtil.getReqErrInfMap(itemName))` // 必須チェックエラー (required check error) |
| 4 | SET | `itemValue = (String)requestMap.get(itemName)` |

**Block 8.1** — [IF] optional sub-check `(svc_endymd in requestMap)` L{682}

> Nested guard: after passing the required check, a second `containsKey` check is applied. This is a redundant defensive guard — the required check already ensures the key exists. The purpose appears to be ensuring the date validation only runs if the key is truly present (avoids NPE if value was set to null between checks). If the key is NOT present, validation is skipped (no error added — the required check already handled absence).

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `requestMap.containsKey(itemName)` // 再チェック（防御的ガード）(redundant guard check) |
| 2 | SET | `itemValue = (String)requestMap.get(itemName)` |

**Block 8.1.1** — [IF] date format check `(DatetimeCheck.isDateCheck OR JPCUtilCommon.checkDate)` L{684}

> Date validation: `svc_endymd` must be a valid date format AND pass the date range/validity check with length 8. Both checks must pass; failure of either triggers a format error.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `DatetimeCheck.isDateCheck(itemValue)` // 日付形式チェック (date format check) |
| 2 | EXEC | `JPCUtilCommon.checkDate(itemValue, 8)` // 日付妥当性チェック・桁数8 (date validity check, length 8) |
| 3 | EXEC | `errList.add(JKKOneStopApiCommonUtil.getFormErrInfMap(itemName))` // 形式チェックエラー (format check error) |

**Block 8.1.2** — [IF] length check `(LengthCheck.isLength1Check)` L{692}

> Length check: service end date must be exactly 8 characters (YYYYMMDD).

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `LengthCheck.isLength1Check(itemValue, 8)` // 桁数チェック (digit count check) |
| 2 | EXEC | `errList.add(JKKOneStopApiCommonUtil.getLenErrInfMap(itemName))` // 桁数チェックエラー (digit count check error) |

---

**Block 9** — [IF] error list check `(errList.size() > 0)` L{698}

> Final gate: if any errors were accumulated, construct error response XML with status "10" (validation failure) and return `false`. Otherwise return `true` to allow `apiControl()` to proceed.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `errList.size() > 0` // エラーが存在する場合 (errors exist) |
| 2 | EXEC | `JKKOneStopApiCommonUtil.setReturnXml(this, "10", errList, warnList, funcCode, IF_ID)` // エラーレスポンス設定 (error response setup) |
| 3 | RETURN | `return false` // エラー発生で処理終了 (abort due to errors) |

**Block 9.1** — [ELSE] L{703}

> No errors detected — method returns `true` to allow downstream processing in `apiControl()`.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return true` // バリデーション合格 (validation passed) |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `func_code` | Field | Functional code — distinguishes confirmation mode ("1") from update mode ("2") in the One-Stop API workflow |
| `sysid` | Field | System ID — the unique identifier for the K-Opticom system session/user context (10 alphanumeric characters) |
| `svc_kei_no` | Field | Service contract number — the unique identifier for a customer's service contract line item (10 alphanumeric characters) |
| `ido_rsn_dbri_cd` | Field | Cancellation reason major category code — the primary classification for why a service is being cancelled (2 alphanumeric characters) |
| `ido_rsn_cbri_cd` | Field | Cancellation reason minor category code — the secondary/detailed classification for cancellation reason (2 alphanumeric characters, optional) |
| `ido_rsn_memo` | Field | Cancellation reason memo — free-text supplementary explanation for the cancellation reason (1-100 mixed characters, optional) |
| `user_id` | Field | User ID — the authenticated user performing the cancellation operation (6-10 alphanumeric characters) |
| `svc_endymd` | Field | Service end date — the effective date when the service contract terminates, in YYYYMMDD format (8 digits) |
| One-Stop (ワントップ) | Business term | K-Opticom's One-Stop API service — a unified API interface allowing customers to perform multiple service contract operations (cancellation, modification) through a single endpoint |
| `requestMap` | Field | The in-memory Map representation of the incoming XML request, parsed by `JKKOneStopApiCommonUtil.getReceiveXml()` |
| `errList` | Field | Error accumulator list — collects all validation error entries during method execution, each entry is a Map containing error key and description |
| `IF_ID` | Field | Interface ID — identifies which API interface endpoint is being invoked, used in error response construction |
| `JKKCommonConst` | Class | K-Opticom common constants class — defines standardized constant values including function codes, service status codes, and transaction type codes |
| FUNC_CODE_1 | Constant | Function code "1" — confirmation mode. Triggers the action-fix (確定ボタン押下) flow where changes require explicit confirmation |
| FUNC_CODE_2 | Constant | Function code "2" — update mode. Allows direct API updates without confirmation step |
| `checkRequireNotNull` | Method | Utility method that checks if a key exists in requestMap and is not null — used for required field validation |
| `isNumber1Check` | Method | Half-width numeric-only validator (digits 0-9, exactly 1 character) |
| `isEnNumber1Check` | Method | Half-width alphanumeric validator (English letters + digits, 1-10 characters) |
| `isMix1Check` | Method | Mixed-character validator allowing full-width, half-width, alphanumeric, and symbol characters |
| `isLength1Check` | Method | Exact-length validator — checks if string length equals the specified number |
| `isLength2Check` | Method | Range-length validator — checks if string length falls within the specified min/max range |
| `isDateCheck` | Method | Date format validator — checks if string matches YYYYMMDD date format |
| `checkDate` | Method | Date validity validator — checks if YYYYMMDD string represents a real calendar date |
| `setReturnXml` | Method | Error response constructor — builds the XML response with error status code, error list, warning list, function code, and IF_ID for the API consumer |
| `getReqErrInfMap` | Method | Returns a pre-formatted error info map for required-field validation failures |
| `getFormErrInfMap` | Method | Returns a pre-formatted error info map for format/validation rule failures |
| `getLenErrInfMap` | Method | Returns a pre-formatted error info map for length validation failures |
| `getRefErrInfMap` | Method | Returns a pre-formatted error info map for reference-value whitelist failures |
| apiControl | Method | Public entry point of KKA14901SFLogic — orchestrates the full One-Stop API workflow including init, validation, business processing, and terminal operations |
| apiInit | Method | API initialization — parses incoming XML to requestMap, retrieves func_code, checks business regulation rules, and initializes error message maps |
| KKSV0004 | Screen | A K-Opticom screen that serves as an entry point for the One-Stop API (referenced in pre-computed dependency chain) |
| KKA14901SF | Module | Fixed-global IP address information update — the business module for managing and updating customer fixed-global IP address contract data via the One-Stop API |
