Skip to content
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

Fix taxbreakdown casting #1301

Closed
wants to merge 29 commits into from
Closed

Conversation

alecritson
Copy link
Collaborator

Arguably this is an API change, however as it stands I think Taxbreakdown casting is a bit broken.

The current problem is when we save the data to the database, it doesn't have the same structure as the TaxBreakdown value object which it's meant to represent.

The other problem is when populating the tax_breakdown column we just map what we think the casting object is expecting and it will JSON encode it after some mapping. I think this is fairly inconsistent and not obvious to developers what they should be doing, should they want to populate a tax_breakdown column manually. This PR would enable a developer to simply pass a Taxbreakdown value object to any database column which uses the Taxbreakdown casting.

Furthermore this PR looks to make the Taxbreakdown casting actually cast back in the value object it represents so it's consistent.

@vercel
Copy link

vercel bot commented Oct 11, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lunar-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 12, 2023 10:53am

@ryanmitchell
Copy link
Contributor

This is great, we've tripped over this a few times so thank you.

@glennjacobs
Copy link
Contributor

@alecritson I think we need to target main for this.

@alecritson
Copy link
Collaborator Author

Closing to move to main

@alecritson alecritson closed this Oct 12, 2023
@alecritson alecritson deleted the fix/fix-taxbreakdown-casting branch October 30, 2023 08:28
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.

7 participants