# Eo / Common / Constant

## Overview

The `eo.common.constant` package is a shared constants library that centralizes string and integer literals used across the EO customer foundation system. Rather than scattering magic strings and magic numbers throughout the codebase, every consumer-facing identifier — from file names and character encodings to service statuses, pricing plan codes, and error codes — is defined here once and referenced by the rest of the application. This makes configuration changes, internationalization audits, and cross-cutting bug fixes trivially safe.

The module contains three classes, each with a distinct responsibility:

| Class | Role |
|---|---|
| [JDKStrConst](Source/koptCommon/src/eo/common/constant/JDKStrConst.java) | Low-level infrastructure constants — file paths, encodings, device types, delivery and logistics statuses |
| [JKKStrConst](Source/koptCommon/src/eo/common/constant/JKKStrConst.java) | Business-domain constants for the contract management system — line provider codes, service categories, pricing plan codes, and display text |
| [JPCModelConstant](Source/koptCommon/src/eo/common/constant/JPCModelConstant.java) | Model-layer operational constants — function codes, search error flags, and DB/transaction error codes |

## Key Classes and Interfaces

### JDKStrConst

**[Source](Source/koptCommon/src/eo/common/constant/JDKStrConst.java)**

`JDKStrConst` is the lowest-level constant class in the package. Its constants describe the *mechanics* of data exchange and hardware management: file names, line separators, encodings, directory paths, device type identifiers, and logistics statuses. There is no constructor logic — the class is a private-ctor singleton of static `final` fields.

#### Subsections

##### File Path and Definition Constants

The class defines dozens of `.def` and `.csv` file names used in the dispatch information transmission system (`DKIFM`). These fall into header, data, and trailer sections, plus intermediate files:

| Constant | Value | Meaning |
|---|---|---|
| `DEF_HEAD_SHUKKA_INFO` | `DKIFM024.def` | Dispatch info transmission header |
| `DEF_DATA_SHUKKA_INFO` | `DKIFM025.def` | Dispatch info transmission data |
| `DEF_TRAILER_SHUKKA_INFO` | `DKIFM026.def` | Dispatch info transmission trailer |
| `DEF_MID_SHUKKA_INFO` | `DKIFM009.def` | Dispatch info intermediate definition |
| `OUT_MID_SHUKKA_INFO_NM` | `DKIFM009.csv` | Dispatch info intermediate file name |
| `DEF_SHKA_FIN_REQ_ERR` | `DKIFM005.def` | Dispatch completion error file |
| `DEF_SHKA_FIN_REQ_MOVE_LIST` | `DKIFM006.def` | Move list for dispatch completion |
| `DEF_HMPIN_MOVE_LIST` | `DKIFM001.def` | Return info file move list |
| `DEF_NYUKAFIN_MOVE_LIST` | `DKIFM015.def` | Inbound completion file move list |
| `DEF_NYUKA_ERR` | `DKIFM016.def` | Inbound error file definition |

Each `.def` file is a fixed-format template definition; the corresponding `.csv` files hold the actual data records. There are parallel sets for the `DKIFM` (dispatch) and `DKIFE` (dispatch completion) domains.

##### Record Type Codes

Transmission files use record type codes to distinguish sections. These are always single-digit or two-digit numeric strings:

| Constant | Value | Section |
|---|---|---|
| `RECORD_SBT_DKIFM024_HEADER` | `0` | Header |
| `RECORD_SBT_DKIFM025_DATA` | `1` | Data |
| `RECORD_SBT_DKIFM026_TRAILER` | `9` | Trailer |
| `RECORD_SBT_DKIFM017_DATA` | `61` | Data - basic info |
| `RECORD_SBT_DKIFM018_DATA` | `62` | Data - terminal info |
| `RECORD_SBT_DKIFM019_TRAILER` | `69` | Trailer |
| `RECORD_SBT_DKIFE01101_DATA` | `67` | Dispatch completion data |
| `RECORD_SBT_DKIFE01102_TRAILER` | `68` | Dispatch completion trailer |
| `RECORD_SBT_DKIFE01501_HEADER` | `51` | Inbound completion header |
| `RECORD_SBT_DKIFE01502_DATA` | `52` | Inbound completion data |
| `RECORD_SBT_DKIFE01503_TRAILER` | `53` | Inbound completion trailer |
| `RECORD_SBT_DKIFE01504_SEINONAS` | `54` | Inbound completion (no serial) |

##### Directory and Environment Variables

| Constant | Env Variable | Purpose |
|---|---|---|
| `DK_DIR_IND` | `IND` | Property key for output file definition directory |
| `ENV_MID_DIR` | `MID_DIR_DK` | Intermediate file directory |
| `ENV_GAIBU_SEND_DIR` | `GAIBU_SEND_DIR_DK` | Send file directory to other systems |
| `ENV_GAIBU_SEND_DIR_BK` | `GAIBU_SEND_DIR_BK_DK` | Backup send directory |
| `ENV_GAIBU_RECEIVE_DIR` | `GAIBU_RECEIVE_DIR_DK` | Receive file directory from other systems |
| `ENV_GAIBU_RECEIVE_DIR_BK` | `GAIBU_RECEIVE_DIR_BK_DK` | Backup receive directory |
| `ENV_BUS_LOG_DIR_DK` | `BUS_LOG_DIR_DK` | Business log output directory |

##### Device Type Codes

Home device types are identified by two-character hex-like strings:

| Constant | Value | Device |
|---|---|---|
| `STB` | `A0` | Set-Top Box |
| `BCAS` | `B0` | B-CAS card |
| `CCAS` | `C0` | C-CAS card |
| `ROUTER` | `F0` | Router |
| `VA` | `50` | eo Electric VA |
| `MODEM` | `60` | Modem |
| `ONU` | `D0` | ONU |
| `HGW` | `S0` | Home Gateway |
| `VONU` | `E0` | V-ONU |
| `TAKINORT` | `R0` | Multi-function router |

##### Character Encoding Constants

| Constant | Value | Use case |
|---|---|---|
| `ENCODE_SJIS` / `ENCODE_SJIS2` | `Shift_JIS` | Legacy file I/O |
| `CHAR_SET_WIN31J` | `Windows-31J` | Windows Japanese (Java alias for Shift_JIS) |
| `CHAR_SET_SJIS` | `Shift_JIS` | Standard Japanese encoding |
| `CHAR_SET_UTF8` | `UTF-8` | Universal encoding |
| `CHAR_SET_EUC` | `EUC-JP` | EUC Japanese |
| `CHAR_SET_JIS` | `ISO-2022-JP` | JIS encoding |

##### Service Contract Status Codes

| Constant | Value | Status |
|---|---|---|
| `SVC_KEI_STAT_UKETSUKE` | `010` | Reception complete |
| `SVC_KEI_STAT_SHOSA` | `020` | Under review |
| `SVC_KEI_STAT_TEIKETSU` | `030` | Contracted |
| `SVC_KEI_STAT_SVTEIKYO` | `100` | Service in progress |
| `SVC_KEI_STAT_HENKOU` | `110` | Contract modification in progress |
| `SVC_KEI_STAT_KYUSHI` | `210` | Suspension / mid-term termination |
| `SVC_KEI_STAT_TEISHI` | `220` | Stopped |
| `SVC_KEI_STAT_KAIYAKU` | `910` | Terminated |
| `SVC_KEI_STAT_CANCEL` | `920` | Canceled |

##### Logistics Protection (物流保全) Status

| Constant | Value | Status |
|---|---|---|
| `BTRYHOZN_STAT_UKETSUKE` | `001` | Received |
| `BTRYHOZN_STAT_SHURI_IRAI` | `002` | Repair requested |
| `BTRYHOZN_STAT_SHURI_FIN` | `003` | Repair complete |
| `BTRYHOZN_STAT_FIN` | `004` | Completed |
| `BTRYHOZN_STAT_CANCEL` | `009` | Canceled |

##### Storage / Shelf Codes

Shelf types categorize physical storage locations:

| Constant | Value | Shelf type |
|---|---|---|
| `TUJYO_TANA` | `000` | Normal shelf |
| `SAISEI_A_TANA` | `001` | Recovery shelf A |
| `SAISEI_B_TANA` | `002` | Recovery shelf B |
| `HAIKI_TANA` | `003` | Disposal shelf |
| `TORIOKI_TANA` | `004` | Temporary storage shelf |
| `HENPIN_TANA` | `005` | Return shelf |
| `SHURI_TANA` | `008` | Repair shelf |
| `SINSO_TANA` | `012` | New equipment shelf (renewal items) |

##### Return Item Category Codes

| Constant | Value | Category |
|---|---|---|
| `CANCEL` | `1` | Cancellation item |
| `RENTAL` | `2` | Rental item |
| `SUBSTITUTE` | `3` | Replacement unit |
| `BROKEN` | `4` | Defective item |
| `MODEL_CHANGE` | `5` | Model change (exchange) |

##### Property Key and Command Constants

These define property keys used for internal system settings:

| Constant | Value | Purpose |
|---|---|---|
| `TN_FLAG` | `TN_CONNECTION_MODE` | Home system switch property key |
| `TN_URL` | `TN_URL` | Home system connection destination property key |
| `FREE_DLMT` | `;` | Free delimiter |
| `CMD_RESULT_CD` | `CMD_RESULT_CD` | Command execution result field name |
| `CMD_RESULT_DETAIL` | `CMD_RESULT_DETAIL` | Command execution result detail |
| `CMD_ERROR_MESSAGE` | `CMD_ERROR_MESSAGE` | Command execution error |
| `CMD_URL` | `WC_CMD_URL` | Command execution URL |

##### Model Fix Pattern Codes

Used for determining device models during dispatch:

| Constant | Value | Pattern |
|---|---|---|
| `MDL_FIX_PTN_ONU_MAKER_SHITEI` | `1` | ONU manufacturer specified |
| `MDL_FIX_PTN_770M_VONU_MAKER_SHITEI` | `2` | 770MHz V-ONU manufacturer specified |
| `MDL_FIX_PTN_2_6G_VONU_MAKER_SHITEI` | `3` | 2.6GHz V-ONU manufacturer specified |
| `MDL_FIX_PTN_770M_VONU_ZIK_HRT_SHITEI` | `4` | 770MHz V-ONU stock ratio specified |
| `MDL_FIX_PTN_2_6G_VONU_ZIK_HRT_SHITEII` | `5` | 2.6GHz V-ONU stock ratio specified |
| `MDL_FIX_PTN_TKN_RT_ZIK_HRT_SHITEII` | `6` | Multi-function router stock ratio specified |
| `MDL_FIX_PTN_STB_HDD_YORYO` | `7` | STB HDD capacity |
| `MDL_FIX_PTN_STB_HDD_YORYO_HNBISBT_SHITEI` | `8` | STB HDD capacity + sales type specified |
| `MDL_FIX_PTN_STB_MAKER_SHITEI` | `9` | STB manufacturer specified |

##### Additional Business Parameter Keys

| Constant | Value | Purpose |
|---|---|---|
| `DK_KITEN_ERR_DAY_CNT` | `DK_KITEN_ERR_DAY_CNT` | Start-point voltage error day count limit |
| `KK_HDD_CAPA_BCASNONE` | `KK_HDD_CAPA_BCASNONE` | B-CAS unnecessary HDD capacity code |
| `MANS_PPLAN_CHG_001` | `MANS_PPLAN_CHG_001` | Mansion price plan code conversion 001 |

##### Device Usage Additional Info Codes

| Constant | Value | Equipment |
|---|---|---|
| `EQUIP_RYUYO_HUKA_INFO_ROUTER` | `078` | BBR + VA |
| `EQUIP_RYUYO_HUKA_INFO_VA` | `079` | VA |
| `EQUIP_RYUYO_HUKA_INFO_ROUTER_VA` | `080` | BBR + VA |
| `EQUIP_RYUYO_HUKA_INFO_TAKINORT` | `081` | Multi-function router |
| `EQUIP_RYUYO_HUKA_INFO_TAKINORT_VA` | `083` | Multi-function router + VA |

##### STB Equipment Exchange Info

| Constant | Value | Exchange |
|---|---|---|
| `STB_KIKI_KOKAN_INFO_STB_4KSTB` | `084` | STB → 4K STB |
| `STB_KIKI_KOKAN_INFO_4KSTB_STB` | `085` | 4K STB → STB |
| `STB_KIKI_KOKAN_INFO_4KSTB_4KSTB` | `086` | 4K STB → 4K STB |
| `STB_KIKI_KOKAN_INFO_STB_STB` | `087` | STB → STB |

##### Device Type Determination Groups

| Constant | Value | Purpose |
|---|---|---|
| `MTR1` | `MTR1` | Device type group 1 |
| `MTR2` | `MTR2` | Device type group 2 |
| `ONU2` | `ONU2` | ONU device type group |
| `HGW1` | `HGW1` | HGW device type group |

##### TV Course Codes

| Constant | Value | Course |
|---|---|---|
| `EOH_TV_SAISO_TACH_SD` | `A24` | eoTV resending (multi-channel) SD |
| `COSE_SD` | `A38` | SD course |
| `TV_COSE_GRP_CD_HD` | `1` | TV course group code: HD |

#### How to Use

All fields are `public static final`. Access via dot notation:
```java
String encoding = JDKStrConst.ENCODE_SJIS;   // "Shift_JIS"
String stbType  = JDKStrConst.STB;            // "A0"
```

The constructor is private — instantiation is prevented.

---

### JKKStrConst

**[Source](Source/koptCommon/src/eo/common/constant/JKKStrConst.java)**

`JKKStrConst` is the largest file in the module (~6,800 lines). Its purpose, per the file header, is "Manage constants used in the contract management system." This class is a business-domain constants repository, containing codes for:

1. **Line provider codes** — identifying which telecom provider services a customer
2. **Service category codes** (CD00130) — internet, telephone, TV, hoteling, power, etc.
3. **Price plan group codes** (CD00133) — broad product categories
4. **Price plan codes** (CD00134) — hundreds of specific pricing plans for every combination of product, speed tier, customer type, and add-on
5. **Fixed text strings** — Japanese display text used in forms, labels, and messages
6. **Contract status codes** — for billing/ops service contracts

The file's revision history (visible in the header comment) spans from v1.00.00 (May 2011) through v75.00.00 (May 2025), reflecting continuous evolution as new products were added and legacy systems were retired (e.g., the NTT uninstallation efforts in 2024).

#### Line Provider Codes (CD00092)

| Constant | Value | Provider |
|---|---|---|
| `CD00092_KOPT` | `01` | K-OPT |
| `CD00092_EACCESS` | `02` | eAccess |
| `CD00092_NTT_NISI_NHN` | `03` | NTT West Japan |
| `CD00092_EMOBILE` | `04` | e Mobile |
| `CD00092_UQWiMAX` | `05` | UQ WiMAX |

#### Service Category Codes (CD00130)

| Constant | Value | Service |
|---|---|---|
| `CD00130_01` | `01` | Internet service |
| `CD00130_02` | `02` | Telephone service |
| `CD00130_03` | `03` | TV service |
| `CD00130_04` | `04` | Hotelling service |
| `CD00130_05` | `05` | eo Electric service |
| `CD00130_51` | `51` | MNO service |

#### Price Plan Group Codes (CD00133)

These define broad categories that group individual plans:

| Constant | Value | Category |
|---|---|---|
| `CD00133_01` | `01` | eo64 Area |
| `CD00133_02` | `02` | eo Hikari Net Home Type |
| `CD00133_03` | `03` | eo Hikari Net Maison Type |
| `CD00133_04` | `04` | eo Hikari Net Mansion Type |
| `CD00133_05` | `05` | eo ADSL (eAccess) |
| `CD00133_06` | `06` | eo ADSL (Flets) |
| `CD00133_07` | `07` | eo Mobile (Wi-Fi) |
| `CD00133_08` | `08` | eo Mobile (EM) |
| `CD00133_09` | `09` | eo Mobile (UQ-WiMAX) |
| `CD00133_10` | `10` | eo Telephone |
| `CD00133_11` | `11` | eo Hikari TV (K-CAT) |
| `CD00133_12` | `12` | eo Hikari TV (KCN) |
| `CD00133_13` | `13` | eo Hikari TV (Resending) |
| `CD00133_14` | `14` | Hotelling |
| `CD00133_15` | `15` | IPTelement |
| `CD00133_16` | `16` | eo Mobile (Mail Address) |
| `CD00133_51` | `51` | MINEO |
| `CD00133_17` | `17` | eo Electric |
| `CD00133_MANS_OWNR` | `99` | Mansion Owner |

#### Price Plan Codes (CD00134)

This is the largest subsection, with over 150 price plan codes. The `CD00134` constants define individual pricing plans that combine:

- **Product family** (Hikari Net, ADSL, Mobile, TV, etc.)
- **Speed tier** (100M, 1G, 5G, 10G)
- **Customer type** (Home, Maison, Mansion)
- **Access technology** (VDSL, Ethernet, Fiber)
- **Add-ons** (Netflix, Smart Compact, CS Basic/Premium)
- **Plan version** (Basic, Premium, Standard)

Examples include:

| Constant | Value | Plan |
|---|---|---|
| `CD00134_A01` | `A01` | eo64 Area full course |
| `CD00134_A05` | `A05` | 1G course |
| `CD00134_A55` | `A55` | Maison Type Global 1G Internet |
| `CD00134_A89` | `A89` | 5G course |
| `CD00134_A91` | `A91` | 1G course Netflix plan |
| `CD00134_A97` | `A97` | Simple 10G course |
| `CD00134_AB0` | `AB0` | (Type N) Home Type 1G course .F Pack |
| `CD00134_AC0` | `AC0` | CS Course CS Basic |
| `CD00134_AC1` | `AC1` | CS Course CS Premium |

New price plans are added incrementally over time, as evidenced by the add markers in the source (e.g., `// ANK-4468-00-00 ADD START`).

#### Fixed Text Strings

These are Japanese display strings used in UI labels, messages, and forms:

| Constant | Value | Purpose |
|---|---|---|
| `DATE_JAPANESE_YEAR` | `年` | "Year" for Japanese date format |
| `DATE_JAPANESE_MONTH` | `月` | "Month" |
| `DATE_JAPANESE_DAY` | `日` | "Day" |
| `ROUND_PARENTHESES_BF` / `ROUND_PARENTHESES_AF` | `(` / `)` | Parentheses |
| `DIV_ADD` | `新規` | "New" |
| `DIV_TENYO` | `転用` | "Transfer" |
| `DIV_JIGYOSHA` | `事業者変更（新規）` | "Carrier change (new)" |
| `DIV_CSCH` | `変更` | "Change" |
| `DIV_DSL` | `廃止` | "Discontinuation" |
| `KIBONASHI` | `希望なし` | "No preference" |
| `KIBOSHINAI` | `希望しない` | "Do not want" |
| `PLAN` | `基本プラン` | "Basic plan" |
| `KOJIN` | `個人` | "Individual" |
| `HOJIN` | `法人` | "Corporate" |
| `SONOTA` | `その他` | "Other" |
| `ARI` | `あり` | "Yes / Present" |
| `NASHI` | `なし` | "No / Absent" |
| `TEIKETUARI` | `締結する` | "Conclude" |
| `TEIKETUNASHI` | `締結しない` | "Do not conclude" |

#### Device Type Determination Groups (JKKStrConst-specific)

| Constant | Value | Purpose |
|---|---|---|
| `HGW1` | `HGW1` | HGW device type group |
| `ONU2` | `ONU2` | ONU device type group |

#### typeN Telephone Additional Rights

| Constant | Value | Meaning |
|---|---|---|
| `TYPEN_TEL_KNKN_TRAT_CD_1` | `1` | Call restriction |
| `TYPEN_TEL_KNKN_TRAT_CD_2` | `2` | Non-notification call rejection |
| `TYPEN_TEL_KNKN_TRAT_CD_3` | `3` | International call restriction |

#### Billing/OPS Service Contract Status

| Constant | Value | Status |
|---|---|---|
| `SEIOPSVC_KEI_STAT_010` | `010` | Reception complete |
| `SEIOPSVC_KEI_STAT_020` | `020` | Under review |
| `SEIOPSVC_KEI_STAT_030` | `030` | Contracted |
| `SEIOPSVC_KEI_STAT_100` | `100` | Service in progress |
| `SEIOPSVC_KEI_STAT_210` | `210` | Suspended |
| `SEIOPSVC_KEI_STAT_910` | `910` | Terminated |
| `SEIOPSVC_KEI_STAT_920` | `920` | Canceled |

#### How to Use

```java
String provider = JKKStrConst.CD00092_KOPT;    // "01"
String plan     = JKKStrConst.CD00134_A05;     // "A05" (1G course)
String label    = JKKStrConst.KOJIN;            // "個人"
```

Like `JDKStrConst`, this class has a private constructor and only static fields. The file also imports `java.util.Arrays` and `java.util.List`, suggesting it may contain lists of related constant values (such as code enumeration sets), though the primary usage pattern is `public static final` fields.

---

### JPCModelConstant

**[Source](Source/koptCommon/src/eo/common/constant/JPCModelConstant.java)**

`JPCModelConstant` is the smallest file (~200 lines) but covers the most operationally critical constants — error codes and function codes used throughout the model layer. It is described in the file header as "Model layer constant class."

#### Function Codes (FUNC_CD_*)

These represent distinct business function identifiers:

| Constant | Value | Description |
|---|---|---|
| `FUNC_CD_1` | `1` | Function code 1 |
| `FUNC_CD_2` | `2` | Function code 2 |
| `FUNC_CD_3` | `3` | Function code 3 |
| ... | ... | ... up to `FUNC_CD_9` |
| `FUNC_CD_9` | `9` | Function code 9 |

These are likely used to route requests to specific handlers or to distinguish between different API endpoint behaviors.

#### Search Error Flags (SEARCH_ERR_FLG_*)

These flags indicate different failure modes when searching:

| Constant | Value | Condition |
|---|---|---|
| `SEARCH_ERR_FLG_ZERO` | `1` | Search error: zero results |
| `SEARCH_ERR_FLG_OVERMAX` | `2` | Search error: exceeds max search count |
| `SEARCH_ERR_FLG_NODATA` | `3` | Search error: no data on display page |
| `SEARCH_ERR_FLG_ERRCOUNT` | `4` | Search error: exceeds total error count (OM-2022-0000272) |
| `SEARCH_ERR_FLG_WARCOUNT` | `5` | Search error: exceeds total warning count (OM-2022-0000272) |

#### Search Processing Patterns

| Constant | Value | Type |
|---|---|---|
| `SAERCH_TYPE_IKT` | `1` | Batch retrieval |
| `SAERCH_TYPE_BBN` | `2` | Partial retrieval |

Note: `SAERCH_TYPE_IKT` contains a typo (`SAERCH` instead of `SEARCH`) that is preserved from the original source.

#### Normal Return / Warning Codes (int)

| Constant | Value | Meaning |
|---|---|---|
| `NORMAL_END` | `0` | Normal completion |
| `WARNING` | `4` | Warning occurred |
| `NOT_FOUND` | `6` | Zero results (list search error) |
| `NOT_FOUND_PK` | `7` | Zero results (single-item search error) |

#### Schema / Validation Error Codes (int)

These are returned when data validation fails at various levels:

| Constant | Value | Error Type |
|---|---|---|
| `SINGLEDATA_ERR` | `1000` | Single field check |
| `ITEM_RELATION_ERR` | `1050` | Single field related check |
| `RELATION_ERR` | `1100` | Internal schema related check |
| `STATUSTRANS_ERR` | `1150` | Internal schema state transition check |
| `REFER_RESTRICT_ERR` | `1200` | Reference restriction check |
| `TEMPLATE_CORRELATION_ERR` | `1300` | External schema related check |
| `ENTITY_CORRELATION_ERR` | `1350` | Concept schema related check |
| `ENTITY_RELATION_ERR` | `1400` | Concept schema related check |
| `ENTITY_STATUSTRANS_ERR` | `1450` | Concept schema state transition check |

#### Database and Transaction Error Codes (int)

| Constant | Value | Error |
|---|---|---|
| `OVER_MAX_SEARCH_NUM` | `2000` | Max search items exceeded |
| `EXTERNAL_IF_ERR1` | `6000` | External IF error 1 |
| `EXTERNAL_IF_ERR2` | `6100` | External IF error 2 |
| `CREATE_DB_ERR` | `8011` | Register-time DB error |
| `UPDATE_DB_ERR` | `8012` | Update-time DB error |
| `REMOVE_DB_ERR` | `8013` | Delete-time DB error |
| `FIND_DB_ERR` | `8014` | Search-time DB error |
| `TIMEOUT` | `8021` | DB timeout |
| `DB_DEADROCK` | `8022` | DB deadlock |
| `DB_DOWN` | `8023` | DB server down |

#### Request / Context Error Codes (int)

| Constant | Value | Error |
|---|---|---|
| `REQUEST_DATE_ERR` | `8051` | Request time error |
| `CLIENT_HOST_NAME_ERR` | `8052` | Client host name error |
| `CLIENT_IP_ADDRESS_ERR` | `8053` | Client IP address error |
| `INVOKE_GAMEN_ID_ERR` | `8054` | Calling page ID error |
| `TRANZACTION_ID_ERR` | `8055` | Transaction ID error |
| `MSG_OPERATOR_ID_ERR` | `8056` | Operator ID (message common) error |
| `USECASE_ID_ERR` | `8057` | Use case ID error |
| `OPERATION_ID_ERR` | `8058` | Operation ID error |
| `CALL_TYPE_ERR` | `8059` | Service calling division error |
| `TEMPLATE_ID_ERR` | `8071` | Template ID error |
| `IDENTIFY_CD_ERR` | `8072` | Identification code error |
| `OPERATOR_ID_ERR` | `8073` | Operator ID error |
| `OPERATE_DATE_ERR` | `8074` | Operation date error |
| `OPERATE_DATETIME_ERR` | `8075` | Operation date/time error |
| `FUNC_CODE_ERR` | `8076` | Function code error |
| `FATAL_ERR` | `8900` | Template processing exception |

#### Constructor

The private constructor prevents instantiation, following the same pattern as the other two classes:

```java
private JPCModelConstant() {
    // New Model layer constant class created.
}
```

---

## How It Works

Since this module contains only constant definitions (no methods beyond private constructors), there is no operational flow to trace. The "how it works" is purely about usage patterns:

### Access Pattern

All three classes follow the **constant class** pattern:

1. A **private no-argument constructor** prevents instantiation.
2. All fields are **`public static final`** — accessible via class name.
3. No instance state exists; the classes are pure namespace containers.

### Typical Usage

A service layer class that handles dispatch information might look like:

```java
// File name
String defFile = JDKStrConst.DEF_HEAD_SHUKKA_INFO;  // "DKIFM024.def"

// Record type
String recordType = JDKStrConst.RECORD_SBT_DKIFM024_HEADER;  // "0"

// Service contract status
if (status.equals(JKKStrConst.SVC_KEI_STAT_TEIKETSU)) {
    // Contracted
}

// Pricing plan
String plan = JKKStrConst.CD00134_A05;  // "A05"

// Model-layer error handling
if (result == JPCModelConstant.DB_DEADROCK) {
    // Handle deadlock
}
```

### File Transmission Workflow

The constants in `JDKStrConst` are organized to support a file-based dispatch information transmission protocol:

1. A dispatch job reads template definitions (`.def` files like `DKIFM024.def`).
2. Data records are written to intermediate CSV files (`DKIFM009.csv`).
3. Each record is tagged with a record type code (`"0"` for header, `"1"` for data, `"9"` for trailer).
4. After processing, files are moved based on move list definitions (`DKIFM006.def`) to either the send directory, receive directory, or error directory.
5. The directory paths themselves are resolved from environment variables (`MID_DIR_DK`, `GAIBU_SEND_DIR_DK`, etc.).

---

## Data Model

While this module has no entity classes, DTOs, or database models, the constants collectively define a **type system** used throughout the application. The most important categorical domains are:

### Service Contract Lifecycle

```
010 (Reception) → 020 (Review) → 030 (Contracted) → 100 (Service in progress)
    → 110 (Modification) → 210/220 (Suspended/Stopped) → 910 (Terminated) or 920 (Canceled)
```

This lifecycle is defined by `SVC_KEI_STAT_*` in JDKStrConst and mirrored in `SEIOPSVC_KEI_STAT_*` for billing/ops service contracts.

### Price Plan Hierarchy

```
CD00133 (Plan Group)
  → CD00134 (Individual Plans)
      → Product Family (Hikari, ADSL, Mobile, TV, etc.)
      → Speed Tier (100M, 1G, 5G, 10G)
      → Customer Type (Home, Maison, Mansion, Type N)
      → Add-ons (Netflix, CS, Smart Compact, etc.)
```

### Error Code Ranges

| Range | Domain | Example |
|---|---|---|
| 0–9 | Function codes | `FUNC_CD_1` |
| 1–5 | Search error flags | `SEARCH_ERR_FLG_ZERO` |
| 0–4 | Result codes | `NORMAL_END`, `WARNING` |
| 1000–1450 | Schema validation | `SINGLEDATA_ERR`, `ENTITY_RELATION_ERR` |
| 2000 | Search limit | `OVER_MAX_SEARCH_NUM` |
| 6000–6100 | External IF | `EXTERNAL_IF_ERR1` |
| 8011–8023 | DB | `CREATE_DB_ERR`, `DB_DOWN` |
| 8051–8076 | Request context | `CLIENT_IP_ADDRESS_ERR`, `FUNC_CODE_ERR` |
| 8900 | Template error | `FATAL_ERR` |

---

## Dependencies and Integration

This module has **no package dependencies** — it does not import any other application packages. It imports only standard Java libraries (`java.util.Arrays`, `java.util.List` in `JKKStrConst`).

It is consumed by every layer of the application:

- **Service/Controller layer** — reads service contract statuses, pricing plans, and function codes to route requests
- **Model/DAO layer** — uses DB error codes and search error flags for error handling
- **I/O layer** — uses file names, record type codes, and encoding constants for file transmission
- **UI layer** — uses fixed text strings for Japanese labels and messages

---

## Notes for Developers

### Naming Conventions

- **JDK prefix**: Infrastructure-level constants (`JDK` likely stands for the original system name or a team code)
- **JKK prefix**: Contract management constants (`JKK` likely stands for "JKK" — the contract management domain)
- **JPC prefix**: Model layer constants (`JPC` likely stands for "JPC" — the model/persistence layer)

### File Naming Pattern

`DKIFM` file names follow a consistent pattern:

- `DKIFM` = dispatch information file management
- Two-digit suffix indicates the specific template
- `.def` = template definition, `.csv` = data file

### Adding New Constants

When adding new constants:

1. **Check the right class** — infrastructure → `JDKStrConst`, business domain → `JKKStrConst`, model layer → `JPCModelConstant`.
2. **Follow the naming pattern** — group related constants with sequential suffixes.
3. **Add an add marker** — use `// ANK-XXXX-00-00 ADD START` / `ADD END` comments around new blocks (mirrors the existing revision history pattern).
4. **Document the value** — add a Javadoc comment describing the meaning in Japanese, following the existing convention.
5. **For new pricing plans** — add to the `CD00134` section in `JKKStrConst`, using the next available alphabetical code (`AA0`, `AB0`, `AC0`, etc.).

### Gotchas

- **Japanese encoding**: Many files use `Shift_JIS` (`ENCODE_SJIS`). Ensure file I/O respects this encoding, especially for dispatch files.
- **Typo preserved**: `JPCModelConstant.SAERCH_TYPE_IKT` has a misspelling in the field name (`SAERCH` vs `SEARCH`). This is intentional — the constant name must not change for backward compatibility.
- **Private constructors**: All three classes have private constructors. Attempting to instantiate them (e.g., for testing or mocking) will fail. Use reflection or mock the static access directly.
- **Large file**: `JKKStrConst.java` is ~6,800 lines. When searching for a specific constant, use the file search rather than scanning the whole file.
- **Environment variables**: The directory constants (`MID_DIR_DK`, `GAIBU_SEND_DIR_DK`, etc.) are resolved from the runtime environment, not hardcoded. Changing their values requires environment configuration, not code changes.

### Cross-Reference with JDKStrConst

Some constants appear in both `JDKStrConst` and `JKKStrConst` with overlapping semantics. When in doubt:

- Use `JDKStrConst` constants for file I/O, encodings, device types, and logistics
- Use `JKKStrConst` constants for pricing plans, service categories, and customer-facing business codes
- Use `JPCModelConstant` constants for error handling and function routing
