Open sweep-nightly[bot] opened 3 weeks ago
Some of the CI runs failed, but I couldn't access the logs. Check Sweep's permissions at https://github.com/organizations/kevinlu1248/settings/installations/.
:book: For more information on how to use Sweep, please read our documentation.
Purpose
This pull request implements several enum classes to represent various aspects of an order management system and adds corresponding unit tests to ensure their correctness.
This pull request was created to solve the following GitHub issue:
(Refactor) 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
Move enums from Order.java to separate files
Description:
Refactor the
Order.java
file by moving the enum definitions to their own separate files. This will improve code organization and maintainability. Update all necessary imports and references in affected files.Tasks:
Create new enum files in the
src/main/java/com/coralblocks/coralme
directory:CancelReason.java
ExecuteSide.java
RejectReason.java
Side.java
TimeInForce.java
Type.java
CancelRejectReason.java
ReduceRejectReason.java
Move the corresponding enum definitions from
Order.java
to their respective new filesUpdate
Order.java
:Update any other files that reference these enums:
Review and update any documentation that mentions these enums
Test:
src/test/java/com/coralblocks/coralme
still pass after the refactoringSideTest.java
,TypeTest.java
, etc.) to ensure they function correctly after the moveDescription
This pull request introduces the following enum classes:
CancelReason
: Represents reasons for order cancellationCancelRejectReason
: Represents reasons for rejecting a cancel requestExecuteSide
: Represents whether an order is a taker or makerReduceRejectReason
: Represents reasons for rejecting an order reductionRejectReason
: Represents reasons for rejecting an orderSide
: Represents the side of an order (buy or sell)TimeInForce
: Represents the time in force of an orderType
: Represents the type of an order (market or limit)Each enum class implements the
CharEnum
interface and includes aCharMap
for efficient lookup by character representation. The classes also include methods for converting between enum values and FIX protocol codes where applicable.Additionally, this pull request adds comprehensive unit tests for each enum class to verify their functionality, including value retrieval, character representation, and FIX code conversion.
The
Order
class has been updated to use these new enum classes, improving type safety and readability.Summary
CancelReason
,CancelRejectReason
,ExecuteSide
,ReduceRejectReason
,RejectReason
,Side
,TimeInForce
, andType
Order
class to use the new enum classesFixes
Fixes #5. Continue the conversation here: http://localhost:3000/c/3561a532-beb1-40da-ac7c-c6edab41e1da.
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.