#nullable enable
namespace Baya.Application.Contracts.Common;

/// <summary>
/// Seam for the استعلام شبا IBAN-owner ↔ national-id inquiry — the automated check that the bank account
/// an IBAN belongs to is registered to the same national id as the nurse. This replaces the forgeable
/// "an admin eyeballs the IBAN" step and is the money-mule-prevention gate for the first payout (b13).
/// The mock returns a deterministic fake match; the real implementation calls a Finnotech/banking-bridge
/// vendor. No money moves through this seam.
/// </summary>
public interface IBankAccountOwnershipVerifier
{
    /// <summary>Runs the ownership inquiry for the given IBAN against the nurse's national id.</summary>
    Task<OwnershipInquiryResult> VerifyOwnershipAsync(string iban, string? nurseNationalId, CancellationToken cancellationToken = default);
}

/// <summary>
/// Outcome of an <see cref="IBankAccountOwnershipVerifier"/> inquiry.
/// </summary>
/// <param name="MatchedNationalId">Whether the IBAN owner's national id matches the nurse's.</param>
/// <param name="AccountHolderFromBank">The account-holder name the bank returned (snapshot).</param>
/// <param name="VendorRef">The vendor transaction id, kept for audit.</param>
public readonly record struct OwnershipInquiryResult(bool MatchedNationalId, string AccountHolderFromBank, string VendorRef);
