Skip to content

feat(investment): add issueDate, purchaseDate, issuerCNPJ fields#82

Open
Gabrielpanga wants to merge 1 commit into
masterfrom
fix/investment-missing-fields-issuedate-cnpj
Open

feat(investment): add issueDate, purchaseDate, issuerCNPJ fields#82
Gabrielpanga wants to merge 1 commit into
masterfrom
fix/investment-missing-fields-issuedate-cnpj

Conversation

@Gabrielpanga

Copy link
Copy Markdown
Member

Problem

The Pluggy API returns three Investment fields that the DTO does not map. The SDK uses Gson FieldNamingPolicy.IDENTITY, so a Java field name must match the API JSON key byte-for-byte — unmapped or misnamed fields silently resolve to null.

API JSON key Before Effect
issueDate mapped as issuerDate (extra r) always null
purchaseDate not present always null
issuerCNPJ not present always null

Change

  • Add issueDate (Date), purchaseDate (Date), issuerCNPJ (String).
  • Keep the misnamed issuerDate but mark it @Deprecated, pointing to issueDate — no breaking change for existing consumers.

Casing / types verified against the spec

Checked api.pluggy.ai/oas3.jsoncomponents.schemas.Investment.properties:

  • issueDate: string / date-timeDate
  • purchaseDate: string / date-timeDate
  • issuerCNPJ: string (CNPJ upper-case in the spec) → String

issueDate/purchaseDate use Date to match the existing date/dueDate/issuerDate mapping.

Verification

mvn -B package → BUILD SUCCESS, 4/4 unit tests pass.

The Pluggy API returns three Investment fields the DTO does not map. Under
Gson's FieldNamingPolicy.IDENTITY, Java field names must match the API JSON
keys byte-for-byte, so unmapped/misnamed fields are silently dropped to null.

- issueDate: the existing `issuerDate` field is a misnaming (extra `r`) with
  no matching API key, so it was always null. Added the correct `issueDate`
  and marked `issuerDate` @deprecated (kept for backward compatibility).
- purchaseDate: was not mapped.
- issuerCNPJ: was not mapped (casing verified against api.pluggy.ai/oas3.json,
  CNPJ is upper-case in the spec).

issueDate/purchaseDate are date-time strings -> Date, matching the existing
`date`/`dueDate` mapping; issuerCNPJ is a string.
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.

1 participant