using GB5Shared.DTO.Framework.Login;
namespace GoodBooks.PAY.PAYBLL.Webhook
{
public interface IPayWebhookBLL
{
///
/// Processes an inbound webhook event end-to-end.
/// NEVER throws — any exception is caught, logged, and the webhook row updated.
/// Caller (ReceiveWebhook endpoint) must always return HTTP 200.
///
Task ProcessWebhookAsync(
string gatewayCode,
int tenantId,
string rawPayload,
string sigHeader,
LoginDTO systemLogin,
CancellationToken ct);
///
/// Builds a minimal system-level LoginDTO for webhook processing.
/// ClientId = tenantId, UserId = -1 (system account).
/// DatabaseName defaults to "GoodBooks_Main" — gateways do not carry a DB hint.
///
Task BuildSystemLoginAsync(int tenantId, string gatewayCode, CancellationToken ct);
///
/// Returns a paged list of webhook events for admin review.
///
Task GetWebhookEventList(int pageOffset, int pageSize, LoginDTO login, CancellationToken ct);
}
}