Skip to content

feat: pass app language to receipt PDF endpoint#733

Draft
TaprootFreak wants to merge 1 commit into
stagingfrom
feat/receipt-language-param
Draft

feat: pass app language to receipt PDF endpoint#733
TaprootFreak wants to merge 1 commit into
stagingfrom
feat/receipt-language-param

Conversation

@TaprootFreak

Copy link
Copy Markdown
Contributor

Summary

  • Forward the current UI language from SettingsBloc through DTOs, service, and cubits to the receipt PDF API endpoint
  • The API uses this language override to generate receipts in the user's chosen app language instead of falling back to the user profile language
  • Companion to DFXswiss/api#3865 which adds the backend support for the language parameter and the enhanced RealUnit receipt layout

Changes

  • SingleReceiptDto / MultiReceiptDto: added optional Language? language field, serialized as uppercase code
  • RealUnitPdfService: both getTransactionReceipt and getTransactionsReceipt accept and forward language
  • TransactionHistoryReceiptCubit / TransactionHistoryMultiReceiptCubit: accept language in generateReceipt
  • TransactionHistoryRow / TransactionHistoryDownloadButton: read language from SettingsBloc state and pass it to the cubit

Test plan

  • All 47 existing transaction history tests pass
  • Manual test: set app to German → download receipt → verify PDF is in German
  • Manual test: set app to English → download receipt → verify PDF is in English
  • Verify with API PR #3865 deployed

Forward the current UI language from SettingsBloc through DTOs,
service, and cubits so the API generates receipts in the user's
chosen language instead of falling back to the profile language.
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