using GB5Shared.DTO.Framework.Login;
namespace GoodBooks.PAY.PAYBLL.Integration
{
///
/// Cross-module HTTP client for Sales coupon validation and usage recording.
/// HTTP-only — never shares Sales assembly.
///
public interface ISalesCouponService
{
///
/// Validates a coupon code for the given order amount.
/// Returns null if invalid/expired.
///
Task ValidateCouponAsync(
string couponCode, int customerId, decimal orderAmt, LoginDTO login, CancellationToken ct);
///
/// Marks a coupon as used after payment success.
/// Fire-and-forget safe — non-fatal if this fails.
///
Task RecordCouponUsageAsync(
string couponCode, int customerId, int payOrderId, LoginDTO login, CancellationToken ct);
}
public record CouponValidationResult(
bool IsValid,
string CouponCode,
decimal DiscountAmt,
string? ErrorMessage
);
}