Overview
Platform Settings in TradeMaster Transactions allow administrators to configure system-wide parameters that affect all users and events. These settings include exchange rates, costs, payment types, and general platform configurations.Settings Architecture
Data Storage
Platform settings are stored in Firestore under thedata collection with different document types:
Redux State Management
Settings are loaded into Redux state for application-wide access:store/setup/SetupSlice.js
Exchange Rates
Exchange Rate Configuration
Manage currency conversion rates for international transactions:data/exchange_rates
Timestamp Conversion
Exchange rate timestamps are converted for display:Exchange Rate Features
Manual Updates
Administrators can manually set exchange rates when needed.
Auto-Update
Configure automatic updates from external exchange rate APIs.
Historical Rates
Maintain history of exchange rates for accurate historical reporting.
Multi-Currency
Support for multiple currency pairs and conversions.
Cost Configuration
Fixed Costs
Costs that remain constant regardless of transaction volume:data/fixed_costs
Variable Costs
Costs that vary with transaction volume:data/variable_costs
Cost Calculation Example
Payment Types
Payment Method Structure
Each payment method has detailed configuration:data/payment_types/payment_data/{payment_id}
Supported Payment Methods
- Digital Payments
- Bank Transfers
- Cash & In-Person
- Credit/Debit Cards (Visa, Mastercard, Amex)
- PayPal
- Digital Wallets (Zelle, Pago Móvil)
- Cryptocurrency (Bitcoin, USDT)
Adding New Payment Methods
General Settings
Platform Configuration
data/general_settings
Feature Flags
Control feature availability across the platform:Accessing Settings in Code
Using Redux Selector
Loading Setup on Authentication
Settings are automatically loaded when a user authenticates:guards/firebase/FirebaseContext.js
Settings Management UI
Current Implementation
The platform settings interface includes several tabs:- General
- Exchange Rates
- Fixed Costs
- Variable Costs
Currently displays “Trabajo en progreso” (Work in progress)Future features:
- Company information
- Contact details
- Default configurations
- Feature flags
Settings Component Structure
components/pages/platform-setting/GeneralTab.js
Updating Settings
Update Exchange Rates
Update Payment Method
Update General Settings
Maintenance Mode
Enabling Maintenance Mode
Checking Maintenance Mode
Security Considerations
Firestore Security Rules
Best Practices
Version Control
Keep a history of settings changes to allow rollback if needed.
Documentation
Document the purpose and impact of each setting.
Testing
Always test setting changes in a staging environment first.
Monitoring
Monitor the impact of setting changes on system performance.
Troubleshooting
Settings Not Loading
Settings Not Loading
- Check that user is authenticated
- Verify
fetchSetup()is called after authentication - Check Firestore permissions for
datacollection - Look for errors in browser console
- Verify Redux store is properly configured
Exchange Rates Not Updating
Exchange Rates Not Updating
- Verify administrator permissions
- Check for Firestore write errors
- Ensure timestamp conversion is working
- Verify API connection if using auto-update
Payment Methods Not Appearing
Payment Methods Not Appearing
- Check that payment_data subcollection exists
- Verify payment methods have
enabled: true - Ensure Redux state is updated after changes
- Check for currency/country restrictions
Next Steps
Authentication
Set up secure authentication for your platform
Permissions
Configure role-based access control