feat(investment): add missing API fields issueDate, purchaseDate, issuerCNPJ#71
Open
victor-garcia-orbi wants to merge 1 commit into
Open
Conversation
…uerCNPJ The Pluggy REST API returns three fields in the Investment response that are not captured by the current DTO, causing Gson (FieldNamingPolicy.IDENTITY — exact byte-for-byte key matching) to silently discard them. issuerDate has been misnamed since it was introduced: the API emits 'issueDate' (no trailing 'r'), so Gson never populates the Java field. It is kept @deprecated for backward compatibility. Fields added: - issuerCNPJ (String) — CNPJ of the issuing institution - issueDate (Date) — emission/issue date of the instrument - purchaseDate (Date) — date the investor purchased/applied Verified against live Pluggy API responses for CDB and Tesouro IPCA+ products. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The Pluggy REST API returns three Investment fields that are not mapped in the
InvestmentDTO. The SDK usesFieldNamingPolicy.IDENTITY(Gson), which requires exact byte-for-byte field name matches — misnamed or missing Java fields are silently discarded.Fields affected
issueDateissuerDate(misnamed — extrar)nullpurchaseDatenullissuerCNPJnullissuerDatewas misnamed when first introduced. BecauseFieldNamingPolicy.IDENTITYrequires an exact match, the API keyissueDatenever maps to the Java fieldissuerDate.Solution
issueDate(Date) — correct name for the instrument's emission/issue datepurchaseDate(Date) — date the investor purchased/applied for the investmentissuerCNPJ(String) — CNPJ of the issuing institutionissuerDateas@Deprecatedwith a migration note (kept for backward compatibility — removing it would surface the pre-existing null in callers, not a real regression)Verified against live API
Tested against two investment types from real API responses:
CDB (NU FINANCEIRA):
Tesouro IPCA+ 2045:
🤖 Generated with Claude Code