KapJI / capital-gains-calculator

UK capital gains tax calculator which supports transaction history from different brokers
MIT License
125 stars 48 forks source link

Add parsing support for gift transactions (Schwab Equity Awards JSON). #539

Open m01 opened 4 months ago

m01 commented 4 months ago

This adds a new action type, as TRANSFER seems to deal with money transfers rather than share transfers, and SALEs also involve money whereas gifted shares do not.

The calculation code will raise a NotImplementedError if it encounters one of these transactions.

This may help #510. This contribution has been developed in my spare time.

vmartinv commented 4 months ago

If adding proper handling for gifts is out of the table, I think a better fix would be to raise an unknown transaction error in the parser if clarity is your concern. I see no need to add parsing for an unsupported transaction. If a new contributor decides to implement gifts for a different parser they will have to worry about them working with Schwab which adds more work.

m01 commented 4 months ago

If adding proper handling for gifts is out of the table,

It's not off the table - I plan to look into it but I don't really want to promise that I'll end up implementing it either at this stage.

If a new contributor decides to implement gifts for a different parser they will have to worry about them working with Schwab which adds more work.

I thought this would help progress support for gifts by one step, but also I don't mind if you want to hold off merging this until there's code using it for more than just error handling.