Skip to content

[WIP] UX changes for multi-wallet support#132

Open
shubham3121 wants to merge 8 commits intofeat/xendit-integration-v2from
shubham/feat/multi-wallet-fr
Open

[WIP] UX changes for multi-wallet support#132
shubham3121 wants to merge 8 commits intofeat/xendit-integration-v2from
shubham/feat/multi-wallet-fr

Conversation

@shubham3121
Copy link
Copy Markdown
Member

This pull request introduces several enhancements and refactors to the frontend codebase, primarily focusing on policy creation logic, wallet handling, and API integrations. The most significant changes include improved handling of wallet selection for payment policies, support for multiple pricing policy types, and the addition of new API endpoints for payments and policy types. Additionally, the AppNavbar component has been simplified by removing the balance dropdown and related UI logic.

Policy Creation & Wallet Handling Improvements:

  • Refactored the usePolicyCreation composable to dynamically select the correct active wallet (either mpp or xendit) when creating payment-related policies, instead of relying on a user store property. This ensures the appropriate wallet is attached based on the policy type. (Fd7215b3L70R70, [1] [2] [3]
  • Updated the transformPolicyRules function to support asynchronous wallet lookups and to handle both "bundle" and "micro-payment" pricing types, mapping them to the correct backend policy types (xendit for bundles, mpp_accounting for micro-payments). [1] [2] [3]
  • Changed the policy config typing to allow for more flexible configuration objects.

API Enhancements:

  • Added new API endpoints for retrieving invoices and bundle usage (paymentsApi), as well as for listing and retrieving policy types (policyTypesApi). [1] [2]
  • Added an endpoint to update Xendit wallet configuration in walletsApi.

UI & Component Simplification:

  • Removed the balance dropdown, wallet setup dialog, transaction dialog, and related logic from AppNavbar.vue, significantly simplifying the component and its dependencies. [1] [2] [3]

Policy Creation Flow Adjustments:

  • Updated the data and model endpoint creation composables to await the asynchronous transformPolicyRules function, ensuring policy creation flows work with the new async logic. [1] [2]

Policy and Wallet Handling:

  • Refactored policy creation to dynamically select the correct active wallet for payment-related policies (mpp or xendit), and updated the transformation logic to support both bundle and micro-payment pricing types, mapping them to the appropriate backend policy types. (Fd7215b3L70R70, [1] [2] [3] [4] [5] [6]
  • Updated data/model endpoint creation flows to support asynchronous policy transformation. [1] [2]

API Integrations:

  • Added paymentsApi for invoices and bundle usage, policyTypesApi for policy type metadata, and an Xendit wallet update endpoint in walletsApi. [1] [2] [3]

UI Simplification:

  • Removed the balance dropdown, wallet setup, and transaction dialogs from AppNavbar.vue, streamlining the navigation bar and related logic. [1] [2] [3]

- Add paymentsApi with getInvoicesByEndpoint and getBundleUsages
- Add policyTypesApi with list and get for fetching policy type schemas
- Add walletsApi.updateXendit for updating Xendit wallet credentials
- Payment type selection: Bundle Payments (Xendit) or Micro-payments (MPP)
- Micro-payments wizard: Wallet setup → Set price (with unit type from API) → Apply
- Bundle payments wizard: Connect Xendit (creates wallet via API) → Define bundles → Apply
- Auto-detects existing wallets and skips to next step
- Locked type support: once a payment type is chosen, subsequent rules use same type
- Copy buttons for wallet address and webhook URL
- Fetches unit type options from policy type schema API
- Replace PolicyFormDialog with AddPricingRuleDialog for pricing rules
- Handle both micro (mpp_accounting) and bundle (xendit) policy types
- Store bundle_tiers, currency, country in pricing rule config
- Update transformPolicyRules to map bundle → xendit policy type
- Fix wallet_id lookup: fetch by wallet type instead of userStore.walletId
- Widen PolicyConfig type to support complex values (arrays/objects)
- Show all wallets (MPP + Xendit) in a unified list with type icons
- Add generic "Add Wallet" dialog with type selection (MPP or Xendit)
- MPP: create new or import existing wallet
- Xendit: connect with API key + callback token, shows webhook URL
- Manage button for both types (MPP address update, Xendit credential update)
- Delete wallet with confirmation
- Copy button for Xendit webhook URL
- Add Transactions tab with MPP transactions and Gateway invoices
- Email filter for both transaction types
- Lazy fetch on tab selection with refresh button
- Fix pricing policy display for Xendit (bundle tiers summary)
- Hide free access banner when pricing rules exist
- Remove Wallet Settings button from endpoint detail
- Remove balance dropdown from navbar (moved to Settings page)
@shubham3121 shubham3121 requested a review from itstauq April 8, 2026 16:35
Fetch wallet list once and reuse via cached closure instead of
calling walletsApi.list() inside the loop for each payment policy.
@shubham3121 shubham3121 changed the title UX changes for multi-wallet support [WIP] UX changes for multi-wallet support Apr 8, 2026
…blish payload

- Update payment API types: bundle_name, remaining_balance, total_deposited
- Redesign bundle wizard: price-per-request + currency/country grid layout
  instead of defining bundle tiers with units
- Update transformPolicyRules to emit price_per_request for xendit config
- Update endpoint pages to display new field names
- Move payment_url and credits_url into policy config during publish
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