# Getting Started

## What This Project Does

This is a Maven-based Java fixture project (`optage-mini-fixture`) under the `com.optage.kopt` module. It provides a minimal set of stub and service classes used as test scaffolding — primarily for SPEC-SCOPED-WIKI automated testing. The codebase exercises cross-package dependencies (batch → contract → trigger → send) to validate integration test paths.

## Recommended Reading Order

Start here to build mental context quickly:

1. **pom.xml** — Maven project coordinates, packaging type, and artifact identity.
2. **dto/** — The `JKKSodRequestDTO` and `JKKSodResponseDTO` classes define the data contract. Reading these first clarifies what data flows through the system.
3. **bp/JKKBpServiceBase.java** — The base service class that other business processing classes extend or reference.
4. **bp/JKKHakkoSODCC.java** — The central coordination class; it dispatches to `JKKSodSendCC` and validates via `KKPRC14901`.
5. **batch/KKPRC14901.java** — The primary batch processor, which in turn invokes `EKK0301A010` for contract processing.
6. **ekk/EKK0301A010.java** — Contract processing that triggers `KKW0100B001`.
7. **kkw/KKW0100B001.java** — The terminal batch trigger.

After understanding the flow, read the remaining batch and contract stubs (`KKPRC24901`, `KKPRC34901`, `EKK0301A020`, `ESC0101B001`) to see the full coverage.

## Key Entry Points

| Class | Package | Why It Matters |
|---|---|---|
| `JKKHakkoSODCC` | `com.optage.kopt.bp` | Central coordination hub — connects dispatch and validation paths |
| `JKKSodSendCC` | `com.optage.kopt.bp` | Handles the SOD dispatch logic |
| `KKPRC14901` | `com.optage.kopt.batch` | Primary batch processor; the most connected class in the codebase |
| `EKK0301A010` | `com.optage.kopt.ekk` | Contract processing entry point |
| `JKKSodRequestDTO` | `com.optage.kopt.dto` | Request data model (tenantId, serviceId) |
| `JKKSodResponseDTO` | `com.optage.kopt.dto` | Response data model (status, message) |

## Project Structure

The source tree follows standard Maven conventions:

```
src/
  main/java/com/optage/kopt/
    batch/       # Batch processing classes (KKPRC*)
    bp/          # Business processing services and helpers
    dto/         # Data transfer objects for request/response
    ekk/         # Contract processing classes
    esc/         # Service control classes
    kkw/         # Batch trigger classes
    unrelated/   # Isolated classes (no cross-references)
  test/java/com/optage/kopt/
    bp/          # Unit tests (JUnit 4)
```

### Class dependencies at a glance

```mermaid
flowchart TD
    subgraph Batch["kkp - Batch Processes"]
        KKPRC14901["KKPRC14901"]
        KKPRC24901["KKPRC24901"]
        KKPRC34901["KKPRC34901"]
    end

    subgraph Bp["bp - Business Processing"]
        JKKBpServiceBase["JKKBpServiceBase"]
        JKKHakkoSODCC["JKKHakkoSODCC"]
        JKKHakkoSODHelper["JKKHakkoSODHelper"]
        JKKSodSendCC["JKKSodSendCC"]
    end

    subgraph Ekk["ekk - Contract Processing"]
        EKK0301A010["EKK0301A010"]
        EKK0301A020["EKK0301A020"]
    end

    subgraph Kkw["kkw - Batch Trigger"]
        KKW0100B001["KKW0100B001"]
    end

    subgraph Dto["dto - Data Transfer"]
        JKKSodRequestDTO["JKKSodRequestDTO"]
        JKKSodResponseDTO["JKKSodResponseDTO"]
    end

    KKPRC14901 -->|"calls"| EKK0301A010
    EKK0301A010 -->|"calls"| KKW0100B001
    JKKHakkoSODCC -->|"dispatches to"| JKKSodSendCC
    JKKHakkoSODCC -->|"validates via"| KKPRC14901
    JKKBpServiceBase -.->|"base for"| JKKHakkoSODCC
```

### Build flow summary

The primary execution path follows this pattern:

1. `JKKHakkoSODCC` receives a request
2. It dispatches to `JKKSodSendCC` for sending
3. It validates via `KKPRC14901` (batch check)
4. `KKPRC14901` delegates to `EKK0301A010` for contract processing
5. `EKK0301A010` triggers `KKW0100B001` (final action)

## Configuration

The project is configured through a single `pom.xml`:

| Property | Value | Purpose |
|---|---|---|
| `groupId` | `com.optage.kopt` | Maven coordinate group |
| `artifactId` | `optage-mini-fixture` | Artifact name |
| `version` | `1.0.0-SPEC-SCOPED-WIKI` | Build version (test fixture marker) |
| `packaging` | `jar` | Produces a JAR file |

No application properties, environment variables, or external config files are used. The project is self-contained.

### Building

```bash
mvn clean package          # Compile and package the JAR
mvn test                   # Run JUnit tests
```

The sole test class is `JKKHakkoSODCCTest` in `src/test/java/com/optage/kopt/bp/`.

## Common Patterns

- **Stub methods**: All business methods contain empty bodies with comment markers (e.g., `/* SOD dispatch logic */`). The codebase is designed as scaffolding — replace bodies to add real logic.
- **Cross-package delegation**: Classes instantiate and call methods on other package's classes directly (e.g., `new EKK0301A010().process()`). There is no dependency injection framework.
- **Naming convention**: Classes follow a pattern of `<prefix><type><number>` (e.g., `KKPRC14901`, `EKK0301A010`). Batch classes start with `KKP`, business processing with `JKK`, contract with `EKK`, and triggers with `KKW`.
- **No interface hierarchy**: Classes are standalone with simple inheritance (`JKKBpServiceBase` as a base class). No interfaces are defined.
- **Test scope**: Tests use JUnit 4 (`org.junit.Test` annotations). The only test class exercises the `bp` package.
