Implement multi-currency support with timestamps and user activation defaults#6
Draft
Implement multi-currency support with timestamps and user activation defaults#6
Conversation
Co-authored-by: rafnixg <10915285+rafnixg@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Agrega que se pueda obtener otros tipos de cambio, como (euro, yuan, lira, rublo), tiene la mista estructura un div con ID igual a la moneda, cambia el modelo Rate para que integre este cambio (el campo dollar deberia llamarse rate) debe tener la moned...
Implement multi-currency support with timestamps and user activation defaults
Aug 27, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements comprehensive multi-currency exchange rate support for the BCV API, addressing the need to handle multiple currencies beyond USD (euro, yuan, lira, rublo) and adding proper data management features.
Overview
The BCV website provides exchange rates for multiple currencies in separate divs with IDs matching the currency names. This implementation extends the API to scrape and store rates for all supported currencies while maintaining backward compatibility.
Key Changes
Database Schema Updates
dollarfield toratefor generic currency support and addedcurrencyfield to distinguish between different exchange ratescreate_dateandupdate_datefields to bothUserandRatemodels for proper audit trackingUser.is_activedefault fromTruetoFalseto ensure new users are deactivated by defaultMulti-Currency Support
The scraper now supports five currencies that correspond to BCV website div IDs:
API Enhancements
All rate endpoints now accept a
currencyquery parameter:Response Format Updates
API responses now include the currency information:
{ "rate": 40.2, "currency": "EUR", "date": "2025-08-27" }Technical Implementation
BCV Scraper Enhancement
The scraper function is now generic and accepts currency parameters that map to the corresponding div IDs on the BCV website:
Database Services
Updated all database operations to handle currency-specific queries while maintaining efficient indexing on both date and currency fields.
Backward Compatibility
Existing API calls continue to work as before, defaulting to USD when no currency is specified.
Validation
- ✅ All currency rates can be scraped from BCV website structure
- ✅ Database schema migrates cleanly with new fields
- ✅ API endpoints respond correctly with currency-specific data
- ✅ User creation defaults to inactive status with proper timestamps
- ✅ Multi-currency operations work simultaneously without conflicts
The implementation maintains the same efficient architecture while extending functionality to meet the multi-currency requirements specified in the issue.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.