namespace WalletService.Domain.AggregatesModel.PaymentAggregate;

using WalletService.Domain.SeedWork;

/// <summary>
/// EN: Repository interface for Payment aggregate.
/// VI: Interface repository cho aggregate Payment.
/// </summary>
public interface IPaymentRepository : IRepository<Payment>
{
    /// <summary>
    /// EN: Get payment by ID.
    /// VI: Lay thanh toan theo ID.
    /// </summary>
    Task<Payment?> GetByIdAsync(Guid paymentId);

    /// <summary>
    /// EN: Get payment by order ID.
    /// VI: Lay thanh toan theo ma don hang.
    /// </summary>
    Task<Payment?> GetByOrderIdAsync(Guid orderId);

    /// <summary>
    /// EN: Get payment by gateway transaction ID.
    /// VI: Lay thanh toan theo ma giao dich cong thanh toan.
    /// </summary>
    Task<Payment?> GetByTransactionIdAsync(string transactionId);

    /// <summary>
    /// EN: Get payments by order ID (an order may have multiple payment attempts).
    /// VI: Lay cac thanh toan theo ma don hang (mot don hang co the co nhieu lan thanh toan).
    /// </summary>
    Task<IEnumerable<Payment>> GetPaymentsByOrderIdAsync(Guid orderId);

    /// <summary>
    /// EN: Add a new payment.
    /// VI: Them thanh toan moi.
    /// </summary>
    Payment Add(Payment payment);

    /// <summary>
    /// EN: Update an existing payment.
    /// VI: Cap nhat thanh toan hien co.
    /// </summary>
    void Update(Payment payment);
}
