# Getting Started

## What This Project Does

**Optage Mini Fixture** is a test fixture project under the `com.optage.kopt` namespace. It provides a minimal Java/Maven codebase used for SPEC-SCOPED-WIKI test generation and documentation scaffolding. The project demonstrates a layered architecture with batch processing, service coordination, and data transfer objects — all within a standard Maven layout.

## Recommended Reading Order

1. **pom.xml** — the build configuration. This tells you the group, artifact name, version, and packaging type.
2. **com/optage/kopt/bp/JKKBpServiceBase.java** — the base service class all business-path components extend.
3. **com/optage/kopt/bp/JKKHakkoSODCC.java** — the primary orchestration class that coordinates dispatch and validation logic.
4. **com/optage/kopt/dto/** — the request/response data models.
5. **src/test/java/com/optage/kopt/bp/** — the test case that shows how the service class is exercised.

## Key Entry Points

### JKKHakkoSODCC
The central coordination class in the `bp` package. Its `dispatch()` and `validate()` methods are the two entry points into the system.

```java
public class JKKHakkoSODCC {
  public void dispatch() { new JKKSodSendCC().send(); }
  public void validate() { new KKPRC14901().check(); }
}
```

### KKPRC14901
The batch processing validator. Called by `KKKHakkoSODCC.validate()`. Its `run()` method chains into the EKK processing layer.

```java
public class KKPRC14901 {
  public void check() { /* KKPRC batch check */ }
  public void run() { new EKK0301A010().process(); }
}
```

### EKK0301A010
The contract processor in the `ekk` package. Triggered by the batch layer, it can also notify downstream via KKW.

```java
public class EKK0301A010 {
  public void process() { /* Contract processing */ }
  public void notify() { new KKW0100B001().trigger(); }
}
```

### JKKSodRequestDTO / JKKSodResponseDTO
The data transfer objects in the `dto` package. `JKKSodRequestDTO` carries the `tenantId` and `serviceId` inputs; `JKKSodResponseDTO` returns `status` and `message` results.

## Project Structure

```
src/
  main/java/com/optage/kopt/
    batch/    — batch processing components
      KKPRC14901.java    — primary batch checker
      KKPRC24901.java    — secondary batch checker
      KKPRC34901.java    — tertiary batch checker
    bp/       — business path (service layer)
      JKKBpServiceBase.java       — base service class
      JKKHakkoSODCC.java          — dispatch orchestrator
      JKKHakkoSODHelper.java      — formatting utility
      JKKSodSendCC.java           — send/dispatch logic
    dto/      — data transfer objects
      JKKSodRequestDTO.java       — request model
      JKKSodResponseDTO.java      — response model
    ekk/      — contract processing
      EKK0301A010.java            — main contract processor
      EKK0301A020.java            — secondary contract processor
    esc/      — service control
      ESC0101B001.java            — ESC control
    kkw/      — batch triggers
      KKW0100B001.java            — KKW trigger
    unrelated/  — placeholder
      XYZ99999Unrelated.java      — unrelated stub
  test/java/com/optage/kopt/
    bp/
      JKKHakkoSODCCTest.java      — JUnit test for the service
```

### Architecture Overview

The codebase follows a layered pattern where requests flow through the business path (`bp`), trigger batch processing (`batch`), feed contract logic (`ekk`), and may notify downstream via triggers (`kkw`).

```mermaid
flowchart TD
    A["JKKHakkoSODCC"] -->|"dispatch"| B["JKKSodSendCC"]
    A -->|"validate"| C["KKPRC14901"]
    C -->|"run"| D["EKK0301A010"]
    D -->|"notify"| E["KKW0100B001"]
    F["JKKSodRequestDTO"] -->|"input"| A
    A -->|"output"| G["JKKSodResponseDTO"]
    H["JKKBpServiceBase"] -->|"base"| A
```

## Configuration

### pom.xml

The project uses a minimal Maven POM with no dependencies and no plugins beyond the default lifecycle. Key properties:

| Property | Value |
|---|---|
| groupId | `com.optage.kopt` |
| artifactId | `optage-mini-fixture` |
| version | `1.0.0-SPEC-SCOPED-WIKI` |
| packaging | `jar` |

Since there are no dependencies configured, you can build with the standard Maven command:

```bash
mvn package
```

No external configuration files (properties, YAML, XML) are used. All behavior is driven by the Java source classes themselves.

## Common Patterns

### Class naming convention
- **`CC` suffix** — "Controller / Coordinator" classes that orchestrate logic (`JKKHakkoSODCC`, `JKKSodSendCC`)
- **`PRC` prefix** — batch processing classes (`KKPRC14901`)
- **`DTO` suffix** — data transfer objects (`JKKSodRequestDTO`, `JKKSodResponseDTO`)
- **Numeric codes** (`0301A010`, `0100B001`) — internal business code identifiers embedded in class names
- **`Base` suffix** — base/parent classes (`JKKBpServiceBase`)

### Single-responsibility methods
Each method performs one clear action and delegates to other classes rather than embedding logic inline:

```java
public void dispatch() { new JKKSodSendCC().send(); }
public void validate() { new KKPRC14901().check(); }
```

### Fixture-style Javadoc
Every class includes a brief Javadoc comment indicating its purpose and origin:

```java
/**
 * JKKHakkoSODCC — auto-generated fixture class for SPEC-SCOPED-WIKI tests.
 */
```

### Testing
The only test class (`JKKHakkoSODCCTest`) uses JUnit 4 (`@Test` from `org.junit`). It exercises the `bp` package's service class. To run tests:

```bash
mvn test
```

## Where to Go Next

- Read the **Wiki** section for domain-specific deep dives into each package.
- Check the **API Reference** for method-level details on each class.
- Review `src/test/java/` to see how components are exercised in practice.
