Backoffice contact details, currency mgmt. updates

This commit is contained in:
Stephanos A
2026-07-11 12:16:05 +03:00
parent 3c3924b33f
commit 50ebe8ddda
14 changed files with 323 additions and 355 deletions

View File

@@ -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',