using General_Ledger_Service.Infra; using General_Ledger_Service.Interfaces.Repositories; using General_Ledger_Service.Models; using Microsoft.EntityFrameworkCore; namespace General_Ledger_Service.Repositories { public class CurrencyRepository(AppDBContext context) : ICurrencyRepository { private readonly AppDBContext _context = context; public async Task> GetAllAsync() => await _context.Currencies .OrderBy(c => c.CurrencyCode) .ToListAsync(); public async Task GetBaseCurrencyCodeAsync() => (await _context.Currencies.FirstOrDefaultAsync(c => c.IsBaseCurrency))?.CurrencyCode ?? "LKR"; } }