# Getting Started

Welcome to the **Optage Mini Fixture** project. This page will get you oriented in under 10 minutes.

---

## What This Project Does

This is a Maven-based Java project that exercises a set of domain classes across several modules — batch processing (`batch`), business processing (`bp`), contract processing (`ekk`), and auxiliary services (`esc`, `kkw`). It serves as a codebase fixture for automated wiki generation and static analysis tests.

---

## Recommended Reading Order

1. **[Project Structure](#project-structure)** — understand the directory layout first.
2. **[Key Entry Points](#key-entry-points)** — follow the class diagram below to see how modules connect.
3. **[Configuration](#configuration)** — review `pom.xml` for build and version details.
4. **[Common Patterns](#common-patterns)** — pick up the naming conventions and coding style.

---

## Key Entry Points

The most useful classes to understand first are the ones that act as hubs in the call graph.

### Core Classes

| File | Role |
|------|------|
| [KKPRC14901](src/main/java/com/optage/kopt/batch/KKPRC14901.java) | Primary batch runner; invokes contract processing and batch triggers |
| [JKKHakkoSODCC](src/main/java/com/optage/kopt/bp/JKKHakkoSODCC.java) | Business process dispatcher; delegates to send and batch check |
| [EKK0301A010](src/main/java/com/optage/kopt/ekk/EKK0301A010.java) | Contract processor; notifies KKW trigger |
| [JKKSodRequestDTO](src/main/java/com/optage/kopt/dto/JKKSodRequestDTO.java) | Request data transfer object |
| [JKKSodResponseDTO](src/main/java/com/optage/kopt/dto/JKKSodResponseDTO.java) | Response data transfer object |

### Module Call Graph

```
flowchart TD
    A["KKPRC14901"] --> B["EKK0301A010"]
    A --> C["KKW0100B001"]
    D["JKKHakkoSODCC"] --> E["JKKSodSendCC"]
    D --> F["KKPRC14901"]
    B --> C
    subgraph bp["bp - Business Process"]
        D
        G["JKKBpServiceBase"]
        H["JKKHakkoSODHelper"]
        E
    end
    subgraph batch["batch - Batch Jobs"]
        A
        I["KKPRC24901"]
        J["KKPRC34901"]
    end
    subgraph ekk["ekk - Contract Processing"]
        B
        K["EKK0301A020"]
    end
    subgraph dto["dto - Data Objects"]
        L["JKKSodRequestDTO"]
        M["JKKSodResponseDTO"]
    end
```

### Execution Flow

A typical flow through the `bp` module looks like this:

```
sequenceDiagram
    participant U as User
    participant SVC as ServiceBase
    participant HAK as HakkoSODCC
    participant SEND as SodSendCC
    participant BAT as BatchRunner
    U->>SVC: init()
    SVC->>HAK: dispatch()
    HAK->>SEND: send()
    HAK->>BAT: check()
    BAT-->>U: complete
```

---

## Project Structure

```
src/
  main/java/com/optage/kopt/
    batch/       -- Batch job runners (KKPRC*)
    bp/          -- Business processing (JKBp*, JKKSod*, JKKHakko*)
    dto/         -- Data transfer objects (JKKSodRequestDTO, JKKSodResponseDTO)
    ekk/         -- Contract processing (EKK*)
    esc/         -- Service control (ESC*)
    kkw/         -- Batch trigger (KKW*)
    unrelated/   -- Standalone class, no dependencies
  test/java/
    com/optage/kopt/bp/
      JKKHakkoSODCCTest.java  -- JUnit tests for the bp module
```

The top-level package is `com.optage.kopt`. Each subpackage corresponds to a functional area.

---

## Configuration

The project uses a minimal `pom.xml`:

```xml
<project>
  <groupId>com.optage.kopt</groupId>
  <artifactId>optage-mini-fixture</artifactId>
  <version>1.0.0-SPEC-SCOPED-WIKI</version>
  <packaging>jar</packaging>
</project>
```

**Key fields:**

- **groupId** (`com.optage.kopt`) — namespace for the module
- **artifactId** (`optage-mini-fixture`) — identifies this JAR
- **version** — `1.0.0-SPEC-SCOPED-WIKI`; the suffix signals the version is tied to wiki-generation test fixtures
- **packaging** (`jar`) — builds a standalone JAR

No external dependencies are declared; only JUnit is used for testing.

---

## Common Patterns

### Naming Conventions

All classes follow a pattern-code scheme:

- **Batch jobs** start with `KKPRC` followed by a numeric ID (e.g., `KKPRC14901`).
- **Business process** classes start with `JKK` (e.g., `JKKHakkoSODCC`, `JKKSodSendCC`).
- **DTOs** use the `JKKSod*DTO` pattern.
- **Contract processing** classes use the `EKK` prefix.
- **Service control** uses `ESC`.
- **Batch triggers** use `KKW`.

### Coding Style

- **One class per file**, matching the class name exactly.
- **Minimal classes**: each class has 1-2 public methods and a short Javadoc comment.
- **Single responsibility**: each method corresponds to one action (`dispatch()`, `send()`, `process()`, `trigger()`, `check()`).
- **Cross-module delegation**: classes instantiate and call other modules rather than using dependency injection.

### Testing

Tests live alongside the source in `src/test/java`, mirroring the main package structure. Currently only one test class exists:

- [JKKHakkoSODCCTest](src/test/java/com/optage/kopt/bp/JKKHakkoSODCCTest.java) — a JUnit test using `@Test` annotations.

### Build

```bash
mvn clean package
```

This compiles all sources and packages the result into `target/optage-mini-fixture-1.0.0-SPEC-SCOPED-WIKI.jar`.

---

## Quick Reference

| Question | Answer |
|----------|--------|
| Where do batch jobs live? | `src/main/java/com/optage/kopt/batch/` |
| Where are business process classes? | `src/main/java/com/optage/kopt/bp/` |
| Where are DTOs? | `src/main/java/com/optage/kopt/dto/` |
| Where are tests? | `src/test/java/com/optage/kopt/` (mirrors main structure) |
| How do I build? | `mvn clean package` |
