Balance + Transaction Models
balance/models/balance_model.dart + transaction_model.dart
Overview
BalanceModel mirrors /vendor/stripe/balance (available + pending). TransactionModel mirrors a single row of /vendor/stripe/transactions; TransactionDetailModel is the expanded shape from /vendor/stripe/transactions/:id.
User Flow
- BalanceModel.fromJson normalizes the Stripe payload into typed currency amounts.
- TransactionModel.fromJson builds list rows; TransactionDetailModel inflates the per-row detail.
Cases & Edge Cases
- Stripe amounts are minor units (cents) — models hold them as int; UI divides by 100 for display.
- Some transaction types (refunds, fees) carry negative amounts — UI must color-code accordingly.
Code References
- lib/src/features/seller/balance/models/balance_model.dart
- lib/src/features/seller/balance/models/transaction_model.dart
API Calls
Empty — fill this in later. Open the manifest and add content here.
Notes
If we add multi-currency sellers, balance arrives as an array per currency — current models flatten to a single 'currency' field.