# Business Logic — JBSbatKKBandWidthOverLmtDtTst.initial() [26 LOC]

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

## 1. Role

### JBSbatKKBandWidthOverLmtDtTst.initial()

The `initial()` method performs the **startup initialization** for a batch job responsible for extracting bandwidth over-limit notification data for Fiber To The Home (FTTH) customers in the k-Opticom (eo Hikari) customer backbone system. Specifically, this batch identifies FTTH subscribers whose data usage has exceeded contracted bandwidth thresholds and prepares the processing environment for downstream notification workflows.

The method follows the **template method / lifecycle initialization** design pattern: it is the first phase of the batch processing lifecycle (followed by the `execute()` method), responsible solely for setting up the structural prerequisites — common parameter wiring, database access object instantiation, and operational date preparation. It does not perform any business logic decisions, conditional routing, or data manipulation beyond basic string extraction.

As a batch entry-point initializer, `initial()` is called by the batch framework infrastructure (via the parent class `JBSbatBusinessService` lifecycle) before the main `execute()` method runs. Its role is purely preparatory: it configures SQL access handlers for seven underlying tables (operational service contracts, service contract line items, billing contracts, customer master, communication volume over-limit notification settings, FTTH over-limit records, work parameter management, and contact/phone records) and extracts the day-of-month component from the batch operation date for use in day-specific processing. This method has **no conditional branches** — it executes a flat, deterministic sequence of setup steps.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["initial(commonItem)"])
    START --> STEP1["SET super.setCommonInfo(commonItem)"]
    STEP1 --> STEP2["SET db_KK_T_OP_SVC_KEI = new JBSbatSQLAccess(D_TBL_NAME_KK_T_OP_SVC_KEI)"]
    STEP2 --> STEP3["SET db_KK_T_SVKEI_KAISEN_UW = new JBSbatSQLAccess(D_TBL_NAME_KK_T_SVKEI_KAISEN_UW)"]
    STEP3 --> STEP4["SET db_KK_T_SEIKY_KEI = new JBSbatSQLAccess(D_TBL_NAME_KK_T_SEIKY_KEI)"]
    STEP4 --> STEP5["SET db_CK_T_CUST = new JBSbatSQLAccess(D_TBL_NAME_CK_T_CUST)"]
    STEP5 --> STEP6["SET db_AC_M_TSRYO_CKTCSETE = new JBSbatSQLAccess(D_TBL_NAME_AC_M_TSRYO_CKTCSETE)"]
    STEP6 --> STEP7["SET db_KK_T_FTTH_TSRCK_JSK = new JBSbatSQLAccess(D_TBL_NAME_KK_T_FTTH_TSRCK_JSK)"]
    STEP7 --> STEP8["SET db_ZM_M_WORK_PARAM_KNRI = new JBSbatSQLAccess(D_TBL_NAME_ZM_M_WORK_PARAM_KNRI)"]
    STEP8 --> STEP9["SET db_CK_T_RRKS = new JBSbatSQLAccess(D_TBL_NAME_CK_T_RRKS)"]
    STEP9 --> STEP10["SET opeDateDay = super.opeDate.substring(6, 8)"]
    STEP10 --> END_NODE(["Return / Next"])
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `commonItem` | `JBSbatCommonItem` | Batch common parameter message — carries shared batch execution context including the operation date (`opeDate`), database connection settings, and batch identification metadata required by all batch service components. |

**Instance fields read by this method:**

| # | Field | Business Description |
|---|-------|---------------------|
| 1 | `super.opeDate` | Operation date string (from parent `JBSbatBusinessService`) — carries the batch execution date in a date-string format where characters at indices 6–7 represent the day-of-month (e.g., `"20240729"` → `"29"`) |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JBSbatBusinessService.setCommonInfo` | - | - | Sets common batch parameters into this service instance via the parent class |
| - | `JBSbatSQLAccess` constructor | - | `KK_T_OP_SVC_KEI` | Initializes SQL access for the Operational Service Contract table |
| - | `JBSbatSQLAccess` constructor | - | `KK_T_SVKEI_KAISEN_UW` | Initializes SQL access for the Service Contract Line Details table |
| - | `JBSbatSQLAccess` constructor | - | `KK_T_SEIKY_KEI` | Initializes SQL access for the Billing Contract table |
| - | `JBSbatSQLAccess` constructor | - | `CK_T_CUST` | Initializes SQL access for the Customer master table |
| - | `JBSbatSQLAccess` constructor | - | `AC_M_TSRYO_CKTCSETE` | Initializes SQL access for the Communication Volume Over-limit Notification Settings table |
| - | `JBSbatSQLAccess` constructor | - | `KK_T_FTTH_TSRCK_JSK` | Initializes SQL access for the FTTH Communication Volume Over-limit Records table |
| - | `JBSbatSQLAccess` constructor | - | `ZM_M_WORK_PARAM_KNRI` | Initializes SQL access for the Work Parameter Management table (added in ANK-4552-00-00 for domain-limit inhibition targeting specific customers) |
| - | `JBSbatSQLAccess` constructor | - | `CK_T_RRKS` | Initializes SQL access for the Contact (Mail/Phone) table (added in ANK-4468-00-00 for eo Hikari Simple Plan) |

**Note:** No CRUD (Create/Read/Update/Delete) operations are performed in this method. It is a pure initialization routine that instantiates `JBSbatSQLAccess` wrappers for seven (now eight) database tables. Actual data access (SQL queries via `KK_SELECT_062`, `KK_SELECT_024`, `KK_SELECT_023`, `KK_SELECT_027`, `KK_SELECT_001`, `KK_SELECT_002`, `KK_SELECT_005`, `KK_SELECT_012`, `KK_SELECT_019`) occurs in downstream methods called from `execute()`.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Batch: JBSbatKKBandWidthOverLmtDtTst | Batch Framework → `JBSbatBusinessService.lifecycle` → `JBSbatKKBandWidthOverLmtDtTst.initial(commonItem)` | `setCommonInfo [U] in-memory state` |

**Notes:** The `initial()` method is invoked by the batch processing framework through the parent class `JBSbatBusinessService` lifecycle. No external screens or CBS components directly call this method — it is a batch-internal entry point. The terminal endpoint is the in-memory state update via `setCommonInfo()`.

## 6. Per-Branch Detail Blocks

Since this method contains **no conditional branches** (no if/else, switch, loops, or try/catch), the entire method is a single linear processing block.

**Block 1** — [LINEAR PROCESSING] `(no condition — flat sequence)` (L181–L206)

> Batch job initialization: wire common parameters, instantiate seven database SQL access handlers, and extract the day-of-month from the operation date.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `super.setCommonInfo(commonItem);` // Set common batch parameters into this service instance [-> L188] |
| 2 | SET | `db_KK_T_OP_SVC_KEI = new JBSbatSQLAccess(commonItem, "KK_T_OP_SVC_KEI");` // Instantiate SQL access for Operational Service Contract table [-> L191] [-> D_TBL_NAME_KK_T_OP_SVC_KEI="KK_T_OP_SVC_KEI" (JBSbatKKBandWidthOverLmtDtTst.java:58)] |
| 3 | SET | `db_KK_T_SVKEI_KAISEN_UW = new JBSbatSQLAccess(commonItem, "KK_T_SVKEI_KAISEN_UW");` // Instantiate SQL access for Service Contract Line Details table [-> L192] [-> D_TBL_NAME_KK_T_SVKEI_KAISEN_UW="KK_T_SVKEI_KAISEN_UW" (JBSbatKKBandWidthOverLmtDtTst.java:61)] |
| 4 | SET | `db_KK_T_SEIKY_KEI = new JBSbatSQLAccess(commonItem, "KK_T_SEIKY_KEI");` // Instantiate SQL access for Billing Contract table [-> L193] [-> D_TBL_NAME_KK_T_SEIKY_KEI="KK_T_SEIKY_KEI" (JBSbatKKBandWidthOverLmtDtTst.java:64)] |
| 5 | SET | `db_CK_T_CUST = new JBSbatSQLAccess(commonItem, "CK_T_CUST");` // Instantiate SQL access for Customer master table [-> L194] [-> D_TBL_NAME_CK_T_CUST="CK_T_CUST" (JBSbatKKBandWidthOverLmtDtTst.java:67)] |
| 6 | SET | `db_AC_M_TSRYO_CKTCSETE = new JBSbatSQLAccess(commonItem, "AC_M_TSRYO_CKTCSETE");` // Instantiate SQL access for Communication Volume Over-limit Notification Settings table [-> L195] [-> D_TBL_NAME_AC_M_TSRYO_CKTCSETE="AC_M_TSRYO_CKTCSETE" (JBSbatKKBandWidthOverLmtDtTst.java:70)] |
| 7 | SET | `db_KK_T_FTTH_TSRCK_JSK = new JBSbatSQLAccess(commonItem, "KK_T_FTTH_TSRCK_JSK");` // Instantiate SQL access for FTTH Communication Volume Over-limit Records table [-> L196] [-> D_TBL_NAME_KK_T_FTTH_TSRCK_JSK="KK_T_FTTH_TSRCK_JSK" (JBSbatKKBandWidthOverLmtDtTst.java:73)] |
| 8 | SET | `db_ZM_M_WORK_PARAM_KNRI = new JBSbatSQLAccess(commonItem, "ZM_M_WORK_PARAM_KNRI");` // Instantiate SQL access for Work Parameter Management table — enables domain-limit inhibition targeting for specific customers [Added in ANK-4552-00-00, L198] [-> D_TBL_NAME_ZM_M_WORK_PARAM_KNRI="ZM_M_WORK_PARAM_KNRI" (JBSbatKKBandWidthOverLmtDtTst.java:77)] |
| 9 | SET | `db_CK_T_RRKS = new JBSbatSQLAccess(commonItem, "CK_T_RRKS");` // Instantiate SQL access for Contact (Mail/Phone) table — enables contact lookups for eo Hikari Simple Plan [Added in ANK-4468-00-00, L201] [-> D_TBL_NAME_CK_T_RRKS="CK_T_RRKS" (JBSbatKKBandWidthOverLmtDtTst.java:82)] |
| 10 | SET | `opeDateDay = super.opeDate.substring(6, 8);` // Extract day-of-month from operation date string (e.g., "20240729" → "29") — used for day-specific processing decisions [-> L204] |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `opeDate` | Field | Operation date — the batch execution date in YYYYMMDD string format |
| `opeDateDay` | Field | Day-of-month extracted from operation date — used for day-specific batch processing logic |
| `commonItem` | Parameter | Batch common parameter message — shared execution context for batch services |
| `JBSbatSQLAccess` | Class | Database SQL access wrapper — provides query and data manipulation capabilities for a specific database table |
| `KK_T_OP_SVC_KEI` | Table | Operational Service Contract table — stores active service contract records for operational processing |
| `KK_T_SVKEI_KAISEN_UW` | Table | Service Contract Line Details table — stores detailed line-item information within a service contract (e.g., individual FTTH line details) |
| `KK_T_SEIKY_KEI` | Table | Billing Contract table — stores billing-related contract records |
| `CK_T_CUST` | Table | Customer master table — stores customer account information |
| `AC_M_TSRYO_CKTCSETE` | Table | Communication Volume Over-limit Notification Settings table — stores per-customer notification configuration for bandwidth over-limit alerts |
| `KK_T_FTTH_TSRCK_JSK` | Table | FTTH Communication Volume Over-limit Records table — stores actual over-limit usage records for FTTH services |
| `ZM_M_WORK_PARAM_KNRI` | Table | Work Parameter Management table — stores configurable batch parameters including domain-limit inhibition settings |
| `CK_T_RRKS` | Table | Contact Records table — stores customer contact information (mail addresses, phone numbers) |
| FTTH | Business term | Fiber To The Home — fiber-optic broadband internet service offered by k-Opticom (eo Hikari) |
| Bandwidth Over-limit | Business term | Condition where a customer's data usage exceeds their contracted bandwidth threshold, triggering notification processing |
| SEND_KBN_YOKOKU | Constant | Send classification: Advance notice — notification sent in advance before enforcement |
| SEND_KBN_HIKITSUGI | Constant | Send classification: Rollover only — notification for usage carryover |
| SEND_KBN_JISHI | Constant | Send classification: Actual notification — enforcement notification sent on the execution date |
| GYM_KNR_PRM_CD_YKK | Constant | Work parameter code: Advance notice — parameter key for pre-enforcement notification configuration |
| GYM_KNR_PRM_CD_JSSI | Constant | Work parameter code: Actual notification — parameter key for enforcement notification configuration |
| TIK_CTL_YOKSI_JSSI_FLG_1 | Constant | Domain limit inhibition implementation flag: "1" = inhibition implemented — indicates domain control has been applied |
| T_C_Y_SCM_JGS_CD | Constant | Domain control inhibition target customer SKU business partner code — used to identify customers eligible for domain-limit inhibition |
| UPPL_CHOK_TCH_SBT_CD_2 | Constant | Upper limit over-notice type code: "2" — classification code for a specific notification type |
| `JBSbatBusinessService` | Class | Parent batch business service base class providing common batch lifecycle methods including `setCommonInfo` and `opeDate` |
| `JBSbatCommonItem` | Class | Batch common parameter item — carries shared batch metadata (date, connection info, batch ID) |
| `JBSbatBusinessError` | Class | Framework error handling class for batch business errors |
| ANK-4468-00-00 | Change ticket | eo Hikari Net "Simple Plan" addition — added contact table access for Simple Plan customers |
| ANK-4552-00-00 | Change ticket | Domain limit inhibition targeting for specific users — added work parameter management table for selective inhibition |
