# Business Logic — JBSbatKKSmtvlMskmInfoTrkm.chkHissuKmk() [173 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.business.service.JBSbatKKSmtvlMskmInfoTrkm` |
| Layer | Service (Batch Service) |
| Module | `service` (Package: `eo.business.service`) |

## 1. Role

### JBSbatKKSmtvlMskmInfoTrkm.chkHissuKmk()

This method performs mandatory-field validation for discount pricing information (割引料金情報) as part of the Smart Balance application information intake reflection batch process. It serves as a gatekeeper: before any discount-related business logic proceeds, every required field must satisfy its domain-specific rules. The method branches by processing type (処理区分) into two distinct validation paths -- **Add (登録)** for discount registration and **Termination (解約)** for discount release -- with each path enforcing its own set of mandatory fields, format constraints, and business invariants. For the Add branch, it validates that the discount status is "Registered", the carryover type is either an application form number or a discount group number (validation code), and that the discount group code, registration date, carryover number, and carryover type are all present and correctly formatted. For the Termination branch, it validates the discount status is "Released", and that the group code, release date, and business operator contract management number are all present and correctly formatted. Both branches converge on identical format checks: the group code must be exactly 8 characters of half-width alphanumeric characters, and the date field must be a valid year-month-day value. The method returns `true` only when all applicable validations pass; on any failure, it logs the specific error, populates both the internal error code (ERR_CD) and the KDDI-external error code (KDDI_ERR_CD) into the workMap, and returns `false`.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["chkHissuKmk workMap"])

    START --> REC_GET["Get REC_DIV from workMap"]

    REC_GET --> REC_CHECK{REC_DIV equals REC_DIV_DATA}

    REC_CHECK -- No --> REC_ERR["Log error: REC_DIV not DATA
Set ERR_CD=E01
Set KDDI_ERR_CD=999
Return false"]

    REC_CHECK -- Yes --> TRAN_CHECK{TRAN_DIV equals TRAN_DIV_ADD}

    TRAN_CHECK -- Yes --> ADD_BRANCH["Processing Type=Add branch"]
    TRAN_CHECK -- No --> DSL_CHECK{TRAN_DIV equals TRAN_DIV_DSL}

    DSL_CHECK -- Yes --> DSL_BRANCH["Processing Type=Termination branch"]
    DSL_CHECK -- No --> ELSE_BRANCH["Processing Type=Other branch"]

    ELSE_BRANCH --> ELSE_ERR["Log error: invalid process type
Set ERR_CD=E02
Set KDDI_ERR_CD=901
Return false"]

    ADD_BRANCH --> ADD_STAT{WRIBPRC_GRP_STAT equals ADD}
    ADD_STAT -- No --> ADD_STAT_ERR["Log error: status not ADD
Set ERR_CD=E02
Set KDDI_ERR_CD=908
Return false"]

    ADD_STAT -- Yes --> ADD_HKTGI{HKTGI_SBT equals MSKMSHO OR VAL_CD}
    ADD_HKTGI -- No --> ADD_HKTGI_ERR["Log error: carryover type invalid
Set ERR_CD=E02
Set KDDI_ERR_CD=913
Return false"]

    ADD_HKTGI -- Yes --> ADD_MAND{Any mandatory field null or empty}
    ADD_MAND -- Yes --> ADD_MAND_ERR["Log error: mandatory fields missing
Set ERR_CD=E02
Set KDDI_ERR_CD=999
Return false"]

    ADD_MAND -- No --> ADD_KETASUU{GRP_CD char count equals 8}
    ADD_KETASUU -- No --> ADD_KETASUU_ERR["Log error: GRP_CD not 8 chars
Set ERR_CD=EA2
Set KDDI_ERR_CD=999
Return false"]

    ADD_KETASUU -- No --> ADD_HANNKAKU{GRP_CD is half-width alphanumeric}
    ADD_HANNKAKU -- No --> ADD_HANNKAKU_ERR["Log error: GRP_CD not half-width alphanum
Set ERR_CD=EA3
Set KDDI_ERR_CD=999
Return false"]

    ADD_HANNKAKU -- No --> ADD_YMD{ADD_YMD is valid date}
    ADD_YMD -- No --> ADD_YMD_ERR["Log error: add date invalid
Set ERR_CD=EA4
Set KDDI_ERR_CD=999
Return false"]

    ADD_YMD -- Yes --> ADD_OK["Return true"]

    DSL_BRANCH --> DSL_STAT{WRIBPRC_GRP_STAT equals RLS}
    DSL_STAT -- No --> DSL_STAT_ERR["Log error: status not RLS
Set ERR_CD=E02
Set KDDI_ERR_CD=908
Return false"]

    DSL_STAT -- Yes --> DSL_MAND{Any mandatory field null or empty}
    DSL_MAND -- Yes --> DSL_MAND_ERR["Log error: mandatory fields missing
Set ERR_CD=E02
Set KDDI_ERR_CD=999
Return false"]

    DSL_MAND -- No --> DSL_KETASUU{GRP_CD char count equals 8}
    DSL_KETASUU -- No --> DSL_KETASUU_ERR["Log error: GRP_CD not 8 chars
Set ERR_CD=EA2
Set KDDI_ERR_CD=999
Return false"]

    DSL_KETASUU -- No --> DSL_HANNKAKU{GRP_CD is half-width alphanumeric}
    DSL_HANNKAKU -- No --> DSL_HANNKAKU_ERR["Log error: GRP_CD not half-width alphanum
Set ERR_CD=EA3
Set KDDI_ERR_CD=999
Return false"]

    DSL_HANNKAKU -- No --> DSL_RLS_YMD{RLS_YMD is valid date}
    DSL_RLS_YMD -- No --> DSL_RLS_YMD_ERR["Log error: release date invalid
Set ERR_CD=EA5
Set KDDI_ERR_CD=999
Return false"]

    DSL_RLS_YMD -- Yes --> DSL_OK["Return true"]

    RETURN_FALSE["Return false"]
    RETURN_TRUE["Return true"]

    ADD_OK --> END(["End"])
    DSL_OK --> END
    ELSE_ERR --> END
    REC_ERR --> END
    ADD_STAT_ERR --> END
    ADD_HKTGI_ERR --> END
    ADD_MAND_ERR --> END
    ADD_KETASUU_ERR --> END
    ADD_HANNKAKU_ERR --> END
    ADD_YMD_ERR --> END
    DSL_STAT_ERR --> END
    DSL_MAND_ERR --> END
    DSL_KETASUU_ERR --> END
    DSL_HANNKAKU_ERR --> END
    DSL_RLS_YMD_ERR --> END
```

**CRITICAL -- Constant Resolution:**

| Constant | Resolved Value | Business Meaning | Source Location |
|----------|---------------|-----------------|-----------------|
| `REC_DIV_DATA` | `"20"` | Record division: Data type | JBSbatKKSmtvlMskmInfoTrkm.java:101 |
| `TRAN_DIV_ADD` | `"2"` | Processing division: Discount Registration (Add) | JBSbatKKSmtvlMskmInfoTrkm.java:104 |
| `TRAN_DIV_DSL` | `"4"` | Processing division: Discount Termination (Release) | JBSbatKKSmtvlMskmInfoTrkm.java:107 |
| `WRIBPRC_GRP_STAT_ADD` | `"010"` | Discount group status: Registered | JBSbatKKSmtvlMskmInfoTrkm.java:213 |
| `WRIBPRC_GRP_STAT_RLS` | `"040"` | Discount group status: Released | JBSbatKKSmtvlMskmInfoTrkm.java:216 |
| `WRIBPRC_HKTGI_SBT_MSKMSHO_NO` | `"1"` | Discount carryover type: Application form number | JBSbatKKSmtvlMskmInfoTrkm.java:223 |
| `WRIBPRC_HKTGI_SBT_VAL_CD` | `"3"` | Discount carryover type: Discount group number (Validation code) | JBSbatKKSmtvlMskmInfoTrkm.java:226 |
| `ERR_CD_E01` | `"E01"` | Error code: Format check error | JBSbatKKSmtvlMskmInfoTrkm.java:232 |
| `ERR_CD_E02` | `"E02"` | Error code: Mandatory field error | JBSbatKKSmtvlMskmInfoTrkm.java:235 |
| `ERR_CD_EA2` | `"EA2"` | Error code: Mandatory field error (discount group code character count) | JBSbatKKSmtvlMskmInfoTrkm.java:279 |
| `ERR_CD_EA3` | `"EA3"` | Error code: Mandatory field error (discount group code character type) | JBSbatKKSmtvlMskmInfoTrkm.java:282 |
| `ERR_CD_EA4` | `"EA4"` | Error code: Mandatory field error (discount registration date character type) | JBSbatKKSmtvlMskmInfoTrkm.java:285 |
| `ERR_CD_EA5` | `"EA5"` | Error code: Mandatory field error (discount release date character type) | JBSbatKKSmtvlMskmInfoTrkm.java:288 |
| `KDDI_ERR_CD_901` | `"901"` | KDDI error code: Process division invalid | JBSbatKKSmtvlMskmInfoTrkm.java:303 |
| `KDDI_ERR_CD_908` | `"908"` | KDDI error code: Cross-service pricing status invalid | JBSbatKKSmtvlMskmInfoTrkm.java:306 |
| `KDDI_ERR_CD_913` | `"913"` | KDDI error code: Cross-service pricing carryover type invalid | JBSbatKKSmtvlMskmInfoTrkm.java:309 |
| `KDDI_ERR_CD_999` | `"999"` | KDDI error code: Other error | JBSbatKKSmtvlMskmInfoTrkm.java:315 |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `workMap` | `HashMap<String, Object>` | The service execution context map carrying all business data required for the discount pricing validation. Contains fields such as `rec_div` (record division -- must be "20" data type), `tran_div` (processing division -- "2" for Add or "4" for Termination), `wribprc_grp_stat` (discount group status -- "010" for Add or "040" for Termination), `wribprc_grp_cd` (discount group code -- 8-char half-width alphanumeric), `wribprc_add_ymd` (discount registration date -- required in Add branch), `wribprc_rls_ymd` (discount release date -- required in Termination branch), `wribprc_hktgi_no` (discount carryover number -- required in Add), `wribprc_hktgi_sbt` (discount carryover type -- "1" application form number or "3" group validation code), and `jigyosha_kei_knri_no` (business operator contract management number -- required in Termination). On error, the method also writes back `ERR_CD` (internal error code) and `KDDI_ERR_CD` (external KDDI error code) into this map. |

**Instance fields / external state read by this method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `commonItem` | `JBSbatCommonItem` (inherited) | Common item infrastructure providing access to `getLogPrint().printDebugLog()` for debug logging |
| `isNullSpace(String)` | Helper method (same class) | Used to validate that strings are neither null nor blank |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `commonItem.getLogPrint().printDebugLog` | JACBatCommon | - | Calls `printDebugLog` for error message logging |
| - | `workMap.put` | - | - | Sets error codes (`ERR_CD`, `KDDI_ERR_CD`) into the workMap on validation failure |
| - | `workMap.get` | - | - | Retrieves field values from the workMap for validation |
| - | `JBSbatCheckUtil.invoke` (char count) | JBSbatCheckUtil | - | Validates character count (8 digits) of discount group code |
| - | `JBSbatCheckUtil.invoke` (alphanumeric) | JBSbatCheckUtil | - | Validates half-width alphanumeric format of discount group code |
| - | `JBSbatCheckUtil.invoke` (date) | JBSbatCheckUtil | - | Validates year-month-day date format of registration/release date |
| - | `String.trim` | - | - | Trims whitespace from group code before validation |
| - | `String.substring` | - | - | Extracts first 8 characters of group code for format check |
| - | `isNullSpace` | JBSbatKKSmtvlMskmInfoTrkm | - | Validates fields are not null or blank (Add: GRP_CD, ADD_YMD, HKTGI_NO, HKTGI_SBT; Termination: GRP_CD, RLS_YMD, JIGYOSHA_KEI_KNRI_NO) |

This method performs **no direct database operations**. It is a pure validation method that reads from and writes back to the `workMap` parameter. All `JBSbatCheckUtil.invoke` calls are in-memory format validators (character count, alphanumeric, date format). No SC codes, CBS, or entity tables are accessed.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Batch: chkMain | `JBSbatKKSmtvlMskmInfoTrkm.chkMain()` -> `JBSbatKKSmtvlMskmInfoTrkm.chkHissuKmk(workMap)` | `workMap.put [U] ERR_CD, KDDI_ERR_CD` / `isNullSpace [R] String check` / `JBSbatCheckUtil.invoke [R] format validation` |

**Explanation:** The only direct caller identified is `chkMain()` within the same class `JBSbatKKSmtvlMskmInfoTrkm`. The `chkMain()` method is a batch processing entry point that iterates over input records and delegates validation for discount pricing data to `chkHissuKmk`. No screen (KKSV) or external batch entry points were found within 8 hops of the call graph.

## 6. Per-Branch Detail Blocks

**Block 1** — IF (condition: REC_DIV retrieval) `(L1356)`

> Retrieve the record division field from workMap. This determines whether the current record is a data record.

| # | Type | Code |
|---|------|------|
| 1 | SET | `strValue = ""` // Initialize string buffer [-> `""`] |
| 2 | GET | `recDiv = (String)workMap.get(REC_DIV)` // Get record division [-> `REC_DIV="rec_div" (JBSbatKKSmtvlMskmInfoTrkm.java:348)`] |

---

**Block 2** — IF `(condition: recDiv != REC_DIV_DATA)` `(L1359)`

> The record division is NOT "20" (data type). This means the incoming record is either a header ("10"), trailer ("80"), or invalid. Reject immediately.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `commonItem.getLogPrint().printDebugLog("必須項目チェックエラー「処理区分 ≠ データ」")` // Log: Required field check error -- Process division != Data [-> `REC_DIV_DATA="20" (JBSbatKKSmtvlMskmInfoTrkm.java:101)`] |
| 2 | SET | `workMap.put(ERR_CD, ERR_CD_E01)` // Set internal error code [-> `ERR_CD="ERR_CD"`, `ERR_CD_E01="E01" (JBSbatKKSmtvlMskmInfoTrkm.java:232)`] |
| 3 | SET | `workMap.put(KDDI_ERR_CD, KDDI_ERR_CD_999)` // Set KDDI error code [-> `KDDI_ERR_CD="KDDI_ERR_CD"`, `KDDI_ERR_CD_999="999" (JBSbatKKSmtvlMskmInfoTrkm.java:315)`] |
| 4 | RETURN | `return false` // Validation failed |

---

**Block 3** — IF `(condition: TRAN_DIV == TRAN_DIV_ADD)` `(L1368)`

> Processing type is "2" (Add / Registration). Validate discount registration-specific fields.

**Block 3.1** — IF `(condition: WRIBPRC_GRP_STAT != WRIBPRC_GRP_STAT_ADD)` `(L1373)`

> Discount group status is not "010" (Registered). The status must match the expected state for an Add operation.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `commonItem.getLogPrint().printDebugLog("必須項目チェックエラー（登録）「割引料金ステータス ≠ 登録」")` // Log: Required field check error (Add) -- Discount status != Registered |
| 2 | SET | `workMap.put(ERR_CD, ERR_CD_E02)` // Set mandatory field error [-> `ERR_CD_E02="E02" (JBSbatKKSmtvlMskmInfoTrkm.java:235)`] |
| 3 | SET | `workMap.put(KDDI_ERR_CD, KDDI_ERR_CD_908)` // Set cross-service pricing status invalid [-> `KDDI_ERR_CD_908="908" (JBSbatKKSmtvlMskmInfoTrkm.java:306)`] |
| 4 | RETURN | `return false` |

**Block 3.2** — IF `(condition: WRIBPRC_HKTGI_SBT != MSKMSHO_NO AND != VAL_CD)` `(L1383)`

> Discount carryover type is neither "1" (application form number) nor "3" (discount group number / validation code). Invalid carryover type for Add.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `commonItem.getLogPrint().printDebugLog("必須項目チェックエラー（登録）「割引料金引継ぎ種別 ≠ 申込書番号、割引料金グループ番号」")` // Log: Required field check error (Add) -- Carryover type != application form number or discount group number [-> `WRIBPRC_HKTGI_SBT_MSKMSHO_NO="1" (JBSbatKKSmtvlMskmInfoTrkm.java:223)`, `WRIBPRC_HKTGI_SBT_VAL_CD="3" (JBSbatKKSmtvlMskmInfoTrkm.java:226)`] |
| 2 | SET | `workMap.put(ERR_CD, ERR_CD_E02)` // Set mandatory field error [-> `ERR_CD_E02="E02"`] |
| 3 | SET | `workMap.put(KDDI_ERR_CD, KDDI_ERR_CD_913)` // Set carryover type invalid [-> `KDDI_ERR_CD_913="913" (JBSbatKKSmtvlMskmInfoTrkm.java:309)`] |
| 4 | RETURN | `return false` |

**Block 3.3** — IF `(isNullSpace(GRP_CD) OR isNullSpace(ADD_YMD) OR isNullSpace(HKTGI_NO) OR isNullSpace(HKTGI_SBT))` `(L1395)`

> Any of the four mandatory fields for Add is null or blank: discount group code, registration date, carryover number, or carryover type.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `commonItem.getLogPrint().printDebugLog("必須項目チェックエラー（登録）「割引料金グループコード、割引料金登録年月日、割引料金引継ぎ番号、割引料金引継ぎ種別が未設定」")` // Log: Required field check error (Add) -- Group code, registration date, carryover number, carryover type not set |
| 2 | SET | `workMap.put(ERR_CD, ERR_CD_E02)` // Set mandatory field error [-> `ERR_CD_E02="E02"`] |
| 3 | SET | `workMap.put(KDDI_ERR_CD, KDDI_ERR_CD_999)` // Set other error [-> `KDDI_ERR_CD_999="999"`] |
| 4 | RETURN | `return false` |

**Block 3.4** — IF `(condition: JBSbatCheckUtil.invoke(GRP_CD.trim(), ["ketasuu1", "8"]) == false)` `(L1408)`

> Discount group code character count is not exactly 8. Validates the group code has the correct length.

| # | Type | Code |
|---|------|------|
| 1 | SET | `strValue = (String)workMap.get(WRIBPRC_GRP_CD)` // Retrieve group code [-> `WRIBPRC_GRP_CD="wribprc_grp_cd" (JBSbatKKSmtvlMskmInfoTrkm.java:379)`] |
| 2 | EXEC | `commonItem.getLogPrint().printDebugLog("必須項目チェックエラー（登録）「割引料金グループコードが8桁以外」")` // Log: Required field check error (Add) -- Group code not 8 digits |
| 3 | SET | `workMap.put(ERR_CD, ERR_CD_EA2)` // Set character count error [-> `ERR_CD_EA2="EA2" (JBSbatKKSmtvlMskmInfoTrkm.java:279)`] |
| 4 | SET | `workMap.put(KDDI_ERR_CD, KDDI_ERR_CD_999)` // Set other error |
| 5 | RETURN | `return false` |

**Block 3.5** — IF `(condition: JBSbatCheckUtil.invoke(strValue.substring(0, 8), ["hannkakuesuuji1"]) == false)` `(L1420)`

> Discount group code is not half-width alphanumeric characters (1 character type). Extract first 8 chars and validate character type.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `commonItem.getLogPrint().printDebugLog("必須項目チェックエラー（登録）「割引料金グループコードが半角英数字1以外」")` // Log: Required field check error (Add) -- Group code not half-width alphanumeric 1 |
| 2 | SET | `workMap.put(ERR_CD, ERR_CD_EA3)` // Set character type error [-> `ERR_CD_EA3="EA3" (JBSbatKKSmtvlMskmInfoTrkm.java:282)`] |
| 3 | SET | `workMap.put(KDDI_ERR_CD, KDDI_ERR_CD_999)` // Set other error |
| 4 | RETURN | `return false` |

**Block 3.6** — IF `(condition: JBSbatCheckUtil.invoke(ADD_YMD, ["year_month_day1"]) == false)` `(L1432)`

> Discount registration date is not in valid year-month-day format.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `commonItem.getLogPrint().printDebugLog("必須項目チェックエラー（登録）「割引料金登録年月日が日付以外」")` // Log: Required field check error (Add) -- Registration date not a date |
| 2 | SET | `workMap.put(ERR_CD, ERR_CD_EA4)` // Set date type error [-> `ERR_CD_EA4="EA4" (JBSbatKKSmtvlMskmInfoTrkm.java:285)`] |
| 3 | SET | `workMap.put(KDDI_ERR_CD, KDDI_ERR_CD_999)` // Set other error |
| 4 | RETURN | `return false` |

---

**Block 4** — ELSE-IF `(condition: TRAN_DIV == TRAN_DIV_DSL)` `(L1442)`

> Processing type is "4" (Termination / Release). Validate discount release-specific fields.

**Block 4.1** — IF `(condition: WRIBPRC_GRP_STAT != WRIBPRC_GRP_STAT_RLS)` `(L1449)`

> Discount group status is not "040" (Released). The status must match the expected state for a Termination operation.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `commonItem.getLogPrint().printDebugLog("必須項目チェックエラー（解約）「割引料金ステータス ≠ 解約」")` // Log: Required field check error (Termination) -- Discount status != Released |
| 2 | SET | `workMap.put(ERR_CD, ERR_CD_E02)` // Set mandatory field error [-> `ERR_CD_E02="E02"`] |
| 3 | SET | `workMap.put(KDDI_ERR_CD, KDDI_ERR_CD_908)` // Set cross-service pricing status invalid [-> `KDDI_ERR_CD_908="908"`] |
| 4 | RETURN | `return false` |

**Block 4.2** — IF `(isNullSpace(GRP_CD) OR isNullSpace(RLS_YMD) OR isNullSpace(JIGYOSHA_KEI_KNRI_NO))` `(L1461)`

> Any of the three mandatory fields for Termination is null or blank: discount group code, release date, or business operator contract management number.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `commonItem.getLogPrint().printDebugLog("必須項目チェックエラー（解約）「割引料金グループコード、割引料金解除年月日、事業者契約管理番号が未設定」")` // Log: Required field check error (Termination) -- Group code, release date, business operator contract management number not set |
| 2 | SET | `workMap.put(ERR_CD, ERR_CD_E02)` // Set mandatory field error [-> `ERR_CD_E02="E02"`] |
| 3 | SET | `workMap.put(KDDI_ERR_CD, KDDI_ERR_CD_999)` // Set other error |
| 4 | RETURN | `return false` |

**Block 4.3** — IF `(condition: JBSbatCheckUtil.invoke(GRP_CD.trim(), ["ketasuu1", "8"]) == false)` `(L1474)`

> Discount group code character count is not exactly 8. Same validation as the Add branch.

| # | Type | Code |
|---|------|------|
| 1 | SET | `strValue = (String)workMap.get(WRIBPRC_GRP_CD)` // Retrieve group code [-> `WRIBPRC_GRP_CD="wribprc_grp_cd"`] |
| 2 | EXEC | `commonItem.getLogPrint().printDebugLog("必須項目チェックエラー（解約）「割引料金グループコードが8桁以外」")` // Log: Required field check error (Termination) -- Group code not 8 digits |
| 3 | SET | `workMap.put(ERR_CD, ERR_CD_EA2)` // Set character count error [-> `ERR_CD_EA2="EA2"`] |
| 4 | SET | `workMap.put(KDDI_ERR_CD, KDDI_ERR_CD_999)` // Set other error |
| 5 | RETURN | `return false` |

**Block 4.4** — IF `(condition: JBSbatCheckUtil.invoke(strValue.substring(0, 8), ["hannkakuesuuji1"]) == false)` `(L1486)`

> Discount group code is not half-width alphanumeric characters. Same validation as the Add branch.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `commonItem.getLogPrint().printDebugLog("必須項目チェックエラー（解約）「割引料金グループコードが半角英数字1以外」")` // Log: Required field check error (Termination) -- Group code not half-width alphanumeric 1 |
| 2 | SET | `workMap.put(ERR_CD, ERR_CD_EA3)` // Set character type error [-> `ERR_CD_EA3="EA3"`] |
| 3 | SET | `workMap.put(KDDI_ERR_CD, KDDI_ERR_CD_999)` // Set other error |
| 4 | RETURN | `return false` |

**Block 4.5** — IF `(condition: JBSbatCheckUtil.invoke(RLS_YMD, ["year_month_day1"]) == false)` `(L1496)`

> Discount release date is not in valid year-month-day format.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `commonItem.getLogPrint().printDebugLog("必須項目チェックエラー（解約）「割引料金解除年月日が日付以外」")` // Log: Required field check error (Termination) -- Release date not a date |
| 2 | SET | `workMap.put(ERR_CD, ERR_CD_EA5)` // Set date type error [-> `ERR_CD_EA5="EA5" (JBSbatKKSmtvlMskmInfoTrkm.java:288)`] |
| 3 | SET | `workMap.put(KDDI_ERR_CD, KDDI_ERR_CD_999)` // Set other error |
| 4 | RETURN | `return false` |

---

**Block 5** — ELSE `(condition: TRAN_DIV is neither "2" nor "4")` `(L1510)`

> Processing division is neither Add ("2") nor Termination ("4"). This is an unrecognized process type. Reject with the most specific error code.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `commonItem.getLogPrint().printDebugLog("必須項目チェックエラー「処理区分が「登録、解約」以外」")` // Log: Required field check error -- Process division is neither Add nor Termination |
| 2 | SET | `workMap.put(ERR_CD, ERR_CD_E02)` // Set mandatory field error [-> `ERR_CD_E02="E02"`] |
| 3 | SET | `workMap.put(KDDI_ERR_CD, KDDI_ERR_CD_901)` // Set process division invalid [-> `KDDI_ERR_CD_901="901" (JBSbatKKSmtvlMskmInfoTrkm.java:303)`] |
| 4 | RETURN | `return false` |

---

**Block 6** — RETURN `(L1519)`

> All validations passed for the applicable processing type. Return success.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return true` // All checks passed, no error |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `rec_div` | Field | Record division -- classifies the input record type: "10" header, "20" data, "80" trailer. Only "20" records proceed to discount validation. |
| `tran_div` | Field | Processing division -- determines the transaction type: "2" for discount registration (Add), "4" for discount release (Termination). |
| `wribprc_grp_stat` | Field | Discount group status -- the current state of the discount pricing group. "010" means Registered, "040" means Released. |
| `wribprc_grp_cd` | Field | Discount group code -- an 8-character half-width alphanumeric identifier for the discount pricing group. |
| `wribprc_add_ymd` | Field | Discount registration year-month-day -- the date the discount pricing was registered. Required in Add branch. |
| `wribprc_rls_ymd` | Field | Discount release year-month-day -- the date the discount pricing was released/terminated. Required in Termination branch. |
| `wribprc_hktgi_no` | Field | Discount carryover number -- the number for discount carryover, used when transitioning discount information between contracts. Required in Add branch. |
| `wribprc_hktgi_sbt` | Field | Discount carryover type -- "1" for application form number, "3" for discount group number (validation code). Specifies how the discount is carried over. |
| `jigyosha_kei_knri_no` | Field | Business operator contract management number -- the contract management number assigned to a business operator (third-party discount provider). Required in Termination branch. |
| `ERR_CD` | Field | Internal error code -- system-internal error classification (e.g., "E01", "E02", "EA2" through "EA5"). |
| `KDDI_ERR_CD` | Field | KDDI external error code -- error classification visible to KDDI's external interface (e.g., "901", "908", "913", "999"). |
| `chkHissuKmk` | Method | Required field check processing -- the Japanese name literally means "required item check processing" for discount pricing data. |
| 割引料金 | Business term | Discount pricing -- promotional price reductions applied to telecom service contracts, typically for bundled services. |
| 登録 | Business term | Registration / Add -- the process of creating a new discount pricing entry in the system. |
| 解約 | Business term | Termination / Release -- the process of canceling an existing discount pricing entry. |
| 引継ぎ種別 | Business term | Carryover type -- determines how discount information is transferred: by application form number or by group validation code. |
| 事業者契約管理番号 | Business term | Business operator contract management number -- the unique identifier for a third-party business operator's contract with K-OPT. |
| JBSbatCheckUtil | Class | Batch service check utility -- provides format validation methods like character count, alphanumeric check, and date format check. |
| kasuu1 | Validation key | Character count validator -- checks that a string has the specified number of characters. |
| hannkakuesuuji1 | Validation key | Half-width alphanumeric validator -- checks that a string contains only half-width (single-byte) alphanumeric characters. |
| year_month_day1 | Validation key | Date format validator -- checks that a string is in a valid year-month-day date format. |
| Smart Balance | Business term | Smart Balance (スマートバランス) -- a K-OPT bundled service discount program where customers receive price reductions when subscribing to multiple services. |
| K-OPT | Business term | K-OPT (K-Opticom) -- KDDI's fiber optic internet and telecom service brand. |
| `E01` | Error code | Format check error -- the record division is not a data record ("20"). |
| `E02` | Error code | Mandatory field error -- a required field is missing, null, or has an invalid value. |
| `EA2` | Error code | Mandatory field error -- discount group code character count is not 8. |
| `EA3` | Error code | Mandatory field error -- discount group code is not half-width alphanumeric. |
| `EA4` | Error code | Mandatory field error -- discount registration date is not in valid date format. |
| `EA5` | Error code | Mandatory field error -- discount release date is not in valid date format. |
| `901` | KDDI Error code | Process division invalid -- the transaction type is neither Add ("2") nor Termination ("4"). |
| `908` | KDDI Error code | Cross-service pricing status invalid -- the discount group status does not match the expected state for the operation. |
| `913` | KDDI Error code | Cross-service pricing carryover type invalid -- the carryover type is neither "1" nor "3". |
| `999` | KDDI Error code | Other error -- a generic KDDI-level error for unspecified validation failures. |
