From 76b2c3abae2b4d3243cd87ef915dc52e9a4fd6a6 Mon Sep 17 00:00:00 2001 From: victor-garcia-orbi Date: Sat, 23 May 2026 18:01:33 -0300 Subject: [PATCH] feat(investment): add missing API fields issueDate, purchaseDate, issuerCNPJ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/main/java/ai/pluggy/client/response/Investment.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/ai/pluggy/client/response/Investment.java b/src/main/java/ai/pluggy/client/response/Investment.java index f12adf3..e617e03 100644 --- a/src/main/java/ai/pluggy/client/response/Investment.java +++ b/src/main/java/ai/pluggy/client/response/Investment.java @@ -36,7 +36,12 @@ public class Investment { String amountProfit = null; Double amountWithdrawal; String issuer; + String issuerCNPJ; + /** @deprecated The API key is {@code issueDate} — this field is always {@code null} due to a naming mismatch. Use {@link #issueDate} instead. */ + @Deprecated Date issuerDate; + Date issueDate; + Date purchaseDate; InvestmentStatus status; /** * @deprecated use