-
Notifications
You must be signed in to change notification settings - Fork 7
Sep25 Release #302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sep25 Release #302
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements a comprehensive "Sep25 Release" for Hastructure, involving significant API modernization and enhanced error handling. The release introduces strong typing through new type classes and refactors core payment and calculation logic to use monadic error handling instead of runtime exceptions.
- Major API restructuring with new type classes (Payable, Drawable, Accruable) and improved error handling patterns
- Separation of deal collection logic into dedicated module with enhanced type safety
- Updated test suites to align with new API patterns and data structures
Reviewed Changes
Copilot reviewed 56 out of 59 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| test/UT/UtilTest.hs | Updated bond transaction tests to use new payment API with DuePrincipal and proper interest rates |
| test/UT/StmtTest.hs | Replaced Just with ByAvailAmount in support transaction constructors |
| test/UT/RateHedgeTest.hs | Updated import path for accrueRC function |
| test/UT/DealTest*.hs | Updated collection rules to use new CollectionRule constructors and support availability types |
| test/UT/CeTest.hs | Modernized liquidity facility tests with ByAvailAmount wrapper |
| test/UT/BondTest.hs | Updated bond payment and pricing tests to use new monadic API patterns |
| test/UT/AssetTest.hs | Disabled delinquency tests and updated pool run function calls |
| test/MainTest.hs | Commented out delinquency test execution |
| swagger.json | Updated API schema to reflect new data structures and version bump |
| src/Waterfall.hs | Removed CollectionRule type and moved to dedicated module |
| src/Util.hs | Enhanced utility functions with monadic error handling and new lookup operations |
| src/Types.hs | Major expansion with new type classes, data types, and enhanced error handling patterns |
| src/Triggers.hs | Updated import for CollectionRule from new module |
| src/Stmt.hs | Enhanced statement handling with new support availability types |
| src/Reports.hs | Code cleanup and removal of unused comments |
| src/Pool.hs | Added comprehensive runPool function for asset pool execution |
| src/Lib.hs | Enhanced date handling and added decimal conversion utilities |
| src/Liability.hs | Complete rewrite implementing new Payable, Drawable, and HasStmt type classes |
| src/InterestRate.hs | Enhanced interest rate calculations and renamed methods for consistency |
| src/Expense.hs | Implemented new Payable and Accruable type classes for fee management |
| src/Deal/ modules | New modular structure separating collection, validation, and query logic |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 59 out of 62 changed files in this pull request and generated 3 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| | ExpTxn Date Balance Amount Balance TxnComment -- ^ expense transaction record | ||
| | SupportTxn Date (Maybe Balance) Balance DueInt DuePremium Cash TxnComment -- ^ liquidity provider transaction record | ||
| | ExpTxn Date FeeDue Amount FeeArrears TxnComment -- ^ expense transaction record | ||
| | SupportTxn Date SupportAvailType Balance DueInt DuePremium Cash TxnComment -- ^ liquidity provider transaction record |
Copilot
AI
Sep 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The transaction record constructors have many parameters which makes them hard to maintain. Consider using record syntax or breaking them into smaller, more focused types.
| | SupportTxn Date SupportAvailType Balance DueInt DuePremium Cash TxnComment -- ^ liquidity provider transaction record | |
| | SupportTxn { supportTxnDate :: Date | |
| , supportTxnAvailType :: SupportAvailType | |
| , supportTxnBalance :: Balance | |
| , supportTxnDueInt :: DueInt | |
| , supportTxnDuePremium :: DuePremium | |
| , supportTxnCash :: Cash | |
| , supportTxnComment :: TxnComment | |
| } -- ^ liquidity provider transaction record |
| writeOff d (DueInterest Nothing) amt b@(Bond {bndDueInt = dueInt, bndStmt = mStmt}) | ||
| | amt > dueInt = Left $ "Cannot write off interest "++ show amt ++ " which is greater than due interest "++ show dueInt ++ " bond name "++ show (bndName b) |
Copilot
AI
Sep 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message concatenation creates inconsistent spacing. Consider using proper string formatting or template functions for better readability and consistency.
git remote set-url origin https://github.com/absbox/Hastructure.git