dakotahnorth-organization / CoralME-sweep

A simple, fast and garbage-free matching engine order book that you can use as a starting point for your matching engines.
Apache License 2.0
0 stars 0 forks source link

Refactor the enums in `Order.java` to separate files #1

Open dakotahNorth opened 1 day ago

dakotahNorth commented 1 day ago

Purpose

Refactor the enums in Order.java to separate files to improve code organization and maintainability.

Description

Moveg each enum type (like TimeInForce, RejectReason, etc.) from Order.java into its own Java file.

Summary

The changes in this pull request include:


Extract Order Enums to Separate Files

Description:

Move each enum from Order.java into its own file to improve code organization and maintainability. Each enum will maintain its existing functionality while being housed in a dedicated file.

Tasks:

  1. Create new enum files in src/main/java/com/coralblocks/coralme/:

    • TimeInForce.java
    • RejectReason.java
    • CancelRejectReason.java
    • CancelReason.java
    • ReduceRejectReason.java
    • Type.java
    • ExecuteSide.java
    • Side.java
  2. In Order.java:

    • Remove all enum definitions
    • Add imports for the new enum files
    • Update any direct enum references
  3. For each new enum file:

    • Include the same package declaration
    • Copy the complete enum definition including all fields, constructors and methods
    • Import required utility classes (CharEnum, CharMap, StringUtils)

Test:

sweep-ai[bot] commented 10 hours ago

❌ Error

Traceback (most recent call last):
  File "/app/sweepai/handlers/on_ticket.py", line 236, in on_ticket
    await fix_ci_failures(pull_request, tracking_id=tracking_id)
  File "/app/sweepai/handlers/fix_ci.py", line 491, in fix_ci_failures
    fix_issue_result = await fix_ci_failures_once(pull_request, tracking_id=f"{tracking_id}-ci-{i}", force=force)
  File "/app/sweepai/handlers/fix_ci.py", line 249, in fix_ci_failures_once
    pending_runs, successful_runs, error_runs = wait_for_ci_failures(pull_request)
ValueError: not enough values to unpack (expected 3, got 2)

not enough values to unpack (expected 3, got 2)

Sweep has encountered a runtime error unrelated to your request. Please let us know via this link or at support@sweep.dev directly.

:book: For more information on how to use Sweep, please read our documentation.

Tracking ID: 4f136bd62d