Skip to content

Add BRCode resource#9

Open
lucasmiranda-stark wants to merge 1 commit into
masterfrom
feature/brcode-preview
Open

Add BRCode resource#9
lucasmiranda-stark wants to merge 1 commit into
masterfrom
feature/brcode-preview

Conversation

@lucasmiranda-stark

@lucasmiranda-stark lucasmiranda-stark commented May 19, 2026

Copy link
Copy Markdown

Summary

  • Adds StarkInfra.BrcodePreview — single batch create/2 operation against POST /brcode-preview, returning previewed BR Code payloads with all 23 server-populated fields.
  • Adds embedded StarkInfra.BrcodePreview.Subscription sub-resource (18 output-only fields) parsed into the parent's :subscription field when the previewed BR Code carries Pix-recurring-debit metadata.
  • Patches StarkInfra.Utils.Check.datetime/1, date/1, and date_or_datetime/1 to normalize empty strings ("") returned by the server to nil, matching the parent contract's M5 normalization (also unblocks future resources that hit the same edge case).
  • Adds :ssl and :public_key to extra_applications in mix.exs so the test suite can boot SSL/TLS on Erlang/OTP 28 (:httpc.ssl_verify_host_options/1 eagerly calls :public_key before the runtime ensure_all_started(:ssl) finishes). No production behaviour change — client apps already start :ssl from their own supervision tree.
  • Adds test/utils/static_brcode.exs test helper that mints a fresh sandbox StaticBrcode via Request.fetch(:post, "/static-brcode", ...), used by the new test/brcode_preview_test.exs so the e2e tests self-bootstrap their own input BR Code (mirrors the Python SDK pattern).

Test plan

  • mix test --only brcode_preview — 2 tests, 0 failures on the Infra sandbox.
  • mix test --only pix_balance — smoke test still green (no regression from the mix.exs change).
  • Reviewer: confirm the Check.datetime("") head is the right place for the empty-string normalization (vs. inline at each call-site).
  • Reviewer: confirm extra_applications: [:inets, :ssl, :public_key] is acceptable, or whether you'd prefer a mod: {StarkInfra.Application, []} start-up hook.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@lucasmiranda-stark lucasmiranda-stark requested a review from a team May 19, 2026 16:47
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