File size: 748 Bytes
ee79726
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
using LibraryManagement.Shared.Models;

namespace Backend.Features.Wallet
{
    public interface IWalletService
    {
        Task<decimal> GetBalanceAsync(Guid userId);
        Task<IEnumerable<WalletTransactionDto>> GetHistoryAsync(Guid userId);
        Task<bool> TopUpAsync(Guid userId, decimal amount, Guid librarianId, string? description = null);
        Task<bool> DeductAsync(Guid userId, decimal amount, string description, Guid? referenceId = null);
    }

    public class WalletTransactionDto
    {
        public Guid Id { get; set; }
        public decimal Amount { get; set; }
        public string Type { get; set; } = null!;
        public string? Description { get; set; }
        public DateTime CreatedAt { get; set; }
    }
}