wwzeng1 / CoralME

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 Order Enums into Separate Files #38

Open sweep-nightly[bot] opened 2 weeks ago

sweep-nightly[bot] commented 2 weeks ago

Purpose

This PR improves code organization and maintainability by extracting enum classes from the Order.java file into separate files in a dedicated enums package.

This pull request was created to solve the following GitHub issue:

Move enums from Order.java to separate files and delete the enums from Order.java

Currently, several enums are defined within the Order.java file. To improve code organization and maintainability, move these enums to their own respective files.

Handle all imports and references in the files.

Enums to be moved (this is not an exhaustive list, please check for any additional enums): Remove the enums from the original Order.java file and move them to their own files.

  • CancelReason
  • ExecuteSide
  • RejectReason
  • Side
  • TimeInForce
  • Type

Description

The changes involve moving several enum classes that were previously nested within the Order class into their own dedicated files under the com.coralblocks.coralme.enums package. This refactoring improves code organization, makes the codebase more maintainable, and follows better Java practices for enum management.

The following enums were extracted and given their own files:

Each enum maintains its original functionality including FIX code mappings and character-based representations. The Order class has been updated to import these enums from their new location.

Summary

Fixes

Fixes #1. Continue the conversation here: http://localhost:3000/c/1b87bbf7-6d14-4254-bbe2-b9237f929c26.

To have Sweep make further changes, please add a comment to this PR starting with "Sweep:".

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

Tracking ID: dev-bb7b0350d1
sweep-nightly[bot] commented 2 weeks ago

❌ Error while fixing CI

Traceback (most recent call last):
  File "/Users/williamzeng/Documents/GitHub/sweep-internal/sweepai/handlers/fix_ci.py", line 320, in fix_ci_failures_once
    _, _, pulls_message = get_pr_snippets(
  File "/Users/williamzeng/Documents/GitHub/sweep-internal/sweepai/backend/api_utils.py", line 232, in get_pr_snippets
    max(num_changes_per_patch),
ValueError: max() arg is an empty sequence

max() arg is an empty sequence

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: dev-7055b71d79-ci-4