Skip to content

Conversation

@Trefex
Copy link

@Trefex Trefex commented Jul 8, 2024

Add missing attributes

Summary by Sourcery

This pull request introduces new attributes to the Trade and CashTransaction classes, and adds a new enum value to the Code enum to enhance the data model.

  • New Features:
    • Added 'initialInvestment' attribute to the Trade class.
    • Added 'issuerCountryCode' and 'availableForTradingDate' attributes to the CashTransaction class.
    • Added 'AUTOFX' enum value to the Code enum.

@sourcery-ai
Copy link

sourcery-ai bot commented Jul 8, 2024

Reviewer's Guide by Sourcery

This pull request adds several missing attributes to the Trade, CashTransaction, and Code classes in the ibflex module. These changes ensure that the classes have all necessary attributes for proper functionality.

File-Level Changes

Files Changes
ibflex/Types.py
ibflex/enums.py
Added missing attributes to the Trade, CashTransaction classes, and Code enum to ensure completeness and proper functionality.

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Trefex - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 4 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

cusip: Optional[str] = None
isin: Optional[str] = None
rtn: Optional[str] = None
initialInvestment: Optional[str] = None
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Consider using snake_case for consistency.

The rest of the attributes in the class use snake_case. It would be more consistent to name this attribute initial_investment.

Suggested change
initialInvestment: Optional[str] = None
initial_investment: Optional[str] = None

weight: Optional[str] = None
figi: Optional[str] = None

issuerCountryCode: Optional[str] = None
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): Duplicate attribute in CashTransaction class.

The issuerCountryCode attribute is already defined in the CashTransaction class. This could lead to confusion or unintended behavior.

figi: Optional[str] = None

issuerCountryCode: Optional[str] = None
availableForTradingDate: Optional[datetime.date] = None
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Consider using snake_case for consistency.

The rest of the attributes in the class use snake_case. It would be more consistent to name this attribute available_for_trading_date.

Suggested change
availableForTradingDate: Optional[datetime.date] = None
available_for_trading_date: Optional[datetime.date] = None

"""
ASSIGNMENT = "A"
AUTOEXERCISE = "AEx" # Automatic exercise for dividend-related recommendation
AUTOFX = "AFx" # FX Auto Conversion
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Consider using consistent casing for enum values.

The other enum values use uppercase letters only. Consider changing AFx to AFX for consistency.

Suggested change
AUTOFX = "AFx" # FX Auto Conversion
AUTOFX = "AFX" # FX Auto Conversion

@Ation
Copy link

Ation commented Sep 2, 2024

@agusalex is this fork still supported?

@agusalex
Copy link
Owner

agusalex commented Sep 2, 2024

@agusalex is this fork still supported?

The only purpose of this fork is to contribute to https://github.com/csingley/ibflex

@agusalex agusalex merged commit e41e220 into agusalex:master Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants