Skip to content

Add stock lending transaction types#237

Merged
Nef10 merged 1 commit intomainfrom
types
Jun 3, 2025
Merged

Add stock lending transaction types#237
Nef10 merged 1 commit intomainfrom
types

Conversation

@Nef10
Copy link
Owner

@Nef10 Nef10 commented Jun 3, 2025

No description provided.

@Nef10 Nef10 requested a review from Copilot June 3, 2025 03:56
@Nef10 Nef10 added the enhancement Improvement to an existing feature label Jun 3, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds support for new stock lending transaction types to the TransactionType enum so that loan, return, and manufactured dividend events can be decoded.

  • Introduce three new enum cases for stock lending: loaned securities, recalled securities, and manufactured dividends.
  • Map each case to its corresponding raw JSON key.
Comments suppressed due to low confidence (3)

Sources/Wealthsimple/WealthsimpleTransaction.swift:80

  • [nitpick] The name stockLoanBorrow is misleading (it suggests borrowing stock, but the comment says "Loaning out stock"). Consider renaming to stockLent or stockLoanOut to match the documented behavior and raw value.
case stockLoanBorrow = "fPLLoanedSecurities"

Sources/Wealthsimple/WealthsimpleTransaction.swift:82

  • [nitpick] The case name stockLoanReturn doesn’t align with fPLRecalledSecurities. Consider renaming to stockLoanRecall to more closely mirror the raw key and meaning of recalling lent shares.
case stockLoanReturn = "fPLRecalledSecurities"

Sources/Wealthsimple/WealthsimpleTransaction.swift:76

  • New enum cases have been added here; ensure there are corresponding unit tests that verify TransactionType can decode fPLLoanedSecurities, fPLRecalledSecurities, and manufacturedDividend correctly.
public enum TransactionType: String {

@github-actions
Copy link

github-actions bot commented Jun 3, 2025

Minimum coverage required: 0%


Coverage after merging types into main

1.88%

Coverage Report
FileStmtsFuncsLinesUncovered Lines
Sources/Wealthsimple
   Token.swift0%0%0%100–104, 111–124, 132–154, 156–167, 169–192, 194–198, 200–206, 208–210, 212–220, 222–226, 47–52, 54–66, 68–79, 81–99
   TransactionError.swift0%0%0%29–46
   WealthsimpleAccount.swift0%0%0%100–114, 116–139, 141–160, 82–97, 99
   WealthsimpleAsset.swift0%0%0%52–68
   WealthsimpleDownloader.swift0%0%0%102–115, 122–135, 137–149, 48–51, 55–78, 82–95
   WealthsimplePosition.swift0%0%0%100–117, 119–142, 144–163, 53–57, 66–92, 94–99
   WealthsimpleTransaction.swift0%0%0%125–129, 148–192, 194–219, 221–244, 246–265
Sources/Wealthsimple/Extensions
   String+CamelCase.swift100%100%100%

@Nef10 Nef10 merged commit 9ef0a84 into main Jun 3, 2025
4 checks passed
@Nef10 Nef10 deleted the types branch June 3, 2025 04:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improvement to an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants