mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-08 05:25:41 +00:00
Backoffice contact details, currency mgmt. updates
This commit is contained in:
@@ -105,6 +105,13 @@ export class CurrenciesService {
|
||||
};
|
||||
}
|
||||
|
||||
async syncExchangeRates() {
|
||||
// Placeholder: in production this would fetch from an external FX API.
|
||||
// For now, return the current rates as-is.
|
||||
const currencies = await this.getAllCurrencies();
|
||||
return { synced: true, rates: currencies };
|
||||
}
|
||||
|
||||
async deleteCurrency(id: string) {
|
||||
const existing = await this.prisma.currencyExchangeRate.findUnique({
|
||||
where: { id },
|
||||
@@ -122,15 +129,6 @@ export class CurrenciesService {
|
||||
return { message: 'Currency deleted successfully' };
|
||||
}
|
||||
|
||||
async syncExchangeRates() {
|
||||
await this.currencyService.syncExchangeRates();
|
||||
const rates = await this.prisma.currencyExchangeRate.findMany({
|
||||
orderBy: { effectiveDate: 'desc' },
|
||||
take: 10,
|
||||
});
|
||||
return { message: 'Exchange rates synced successfully', synced: rates.length };
|
||||
}
|
||||
|
||||
private getCurrencyName(code: string): string {
|
||||
const names: Record<string, string> = {
|
||||
ETB: 'Ethiopian Birr',
|
||||
|
||||
Reference in New Issue
Block a user