# Repository Overview

Welcome to the **kopt** codebase. This is a Java project that models a batch processing and Start of Day (SOD) workflow for a financial operations system. The code currently consists of auto-generated fixture classes — lightweight scaffolding designed for the SPEC-SCOPED-WIKI test framework — that outline the structure of batch orchestration, contract processing, and SOD generation and dispatch. If you are new here, this page will orient you to the layout, key modules, and recommended reading order.

## Overview

This repository belongs to the `com.optage.kopt` package hierarchy. It appears to be a financial batch-processing framework where daily operations such as contract processing and Start of Day (SOD) generation are orchestrated through a set of controller classes. The classes in this repo today are minimal stubs and auto-generated fixtures; they model the *shape* of the system rather than containing full production logic. The design uses a delegator pattern: thin entry-point classes hand off work to sibling packages, keeping each concern isolated in its own module.

## Technology Stack

| Category | Details |
|---|---|
| **Language** | Java |
| **Build / Dependency Management** | Not detected from source analysis |
| **Testing** | JUnit (fixture tests present under `src/test/`) |
| **Frameworks** | No well-known frameworks detected from import analysis |
| **Code Generation** | Classes are marked as auto-generated fixtures for SPEC-SCOPED-WIKI tests |

No external frameworks (Spring, Micronaut, etc.) appear in the import statements. The codebase uses plain Java with a straightforward package structure.

## Architecture

The system is organized into several sibling packages under the `com.optage.kopt` root. Execution typically flows from batch entry points through contract processing into downstream triggers, while a separate SOD generation flow lives in the `bp` package.

```mermaid
flowchart TD
    subgraph kopt["com.optage.kopt"]
        subgraph batch["batch"]
            B1["KKPRC14901"]
            B2["KKPRC24901"]
            B3["KKPRC34901"]
        end
        subgraph bp["bp"]
            BP1["JKKHakkoSODCC"]
            BP2["JKKSodSendCC"]
            BP3["JKKHakkoSODHelper"]
            BP4["JKKBpServiceBase"]
        end
        subgraph ekk["ekk"]
            E1["EKK0301A010"]
        end
        subgraph kkw["kkw"]
            K1["KKW0100B001"]
        end
        subgraph dto["dto"]
            D1["JKKSodRequestDTO"]
            D2["JKKSodResponseDTO"]
        end
    end

    B1 --> E1
    B1 --> B2
    B1 --> B3
    E1 --> K1
    BP1 --> BP2
    BP1 --> BP3
    BP1 --> B1
```

Key flows:

- **Batch execution** — `KKPRC14901` creates an `EKK0301A010` instance and calls `process()`, which in turn may trigger `KKW0100B001.trigger()` via its `notify()` method.
- **SOD generation** — `JKKHakkoSODCC.dispatch()` delegates to `JKKSodSendCC.send()` for the actual dispatch, while `JKKHakkoSODCC.validate()` cross-references `KKPRC14901.check()`.
- **Data transfer** — DTOs in the `dto` package (`JKKSodRequestDTO`, `JKKSodResponseDTO`) appear to model the shape of SOD request/response payloads.

## Module Guide

### `com.optage.kopt.batch` — Batch Entry Points

This package contains three auto-generated fixture classes (`KKPRC14901`, `KKPRC24901`, `KKPRC34901`) that serve as batch orchestration entry points. `KKPRC14901` is the only class with meaningful logic today: its `run()` method instantiates `EKK0301A010` from the `ekk` package and calls `process()`. The other two classes (`KKPRC24901`, `KKPRC34901`) are stubs — their `run()` methods contain only comments and appear reserved for future batch categories. This package acts as a thin facade layer that delegates actual work to domain-specific sibling packages.

### `com.optage.kopt.bp` — SOD (Start of Day) Processing

The `bp` package models the Start of Day generation and dispatch workflow. Its central class, `JKKHakkoSODCC` ("Hakko" meaning "generation" in Japanese), coordinates the SOD flow by delegating to `JKKSodSendCC` for dispatch and to `KKPRC14901` for validation. `JKKHakkoSODHelper` provides simple string formatting utilities, and `JKKBpServiceBase` offers a shared initialization hook (`baseInit()`) for subclasses. A test class (`JKKHakkoSODCCTest`) exercises the controller with a placeholder JUnit test.

### `com.optage.kopt.ekk` — Contract Processing

This package contains `EKK0301A010`, which handles contract processing logic. Its `process()` method is the primary entry point invoked by batch controllers, while `notify()` delegates further downstream to `KKW0100B001`.

### `com.optage.kopt.kkw` — Downstream Trigger

`KKW0100B001` in this package provides a trigger method called by `EKK0301A010.notify()`. This appears to be the final step in the batch processing chain.

### `com.optage.kopt.dto` — Data Transfer Objects

Contains `JKKSodRequestDTO` and `JKKSodResponseDTO`, which define the shape of SOD request and response payloads. These DTOs model fields like `tenantId` and `serviceId` used in the SOD workflow.

## Getting Started

If you are exploring this codebase for the first time, here is a recommended reading order:

1. **Start with the `bp` package** (`JKKHakkoSODCC`) — it is the highest-level orchestrator and gives you the broadest picture of the SOD workflow.
2. **Follow the delegation chain** — read `JKKSodSendCC`, then `JKKHakkoSODHelper`, and then cross-reference `KKPRC14901` in the `batch` package.
3. **Continue downstream** — trace `EKK0301A010` in `ekk`, then `KKW0100B001` in `kkw` to see the full processing chain.
4. **Review the DTOs** — check `JKKSodRequestDTO` and `JKKSodResponseDTO` to understand the data contracts.
5. **Look at the test** — `JKKHakkoSODCCTest` shows how the fixture test infrastructure is structured.

Remember: all classes in this repository are auto-generated fixtures for the SPEC-SCOPED-WIKI test framework. They are structural scaffolding, not production code — use them to understand the intended system design rather than as runnable business logic.
