namespace MoneyMap.Models.Import { /// /// Result of resolving a payment method (card or account) for a transaction. /// public class PaymentResolutionResult { public bool IsSuccess { get; init; } public int? CardId { get; init; } public int? AccountId { get; init; } public string? Last4 { get; init; } public string? ErrorMessage { get; init; } /// /// Creates a successful result when a card is used. /// public static PaymentResolutionResult SuccessCard(int cardId, int accountId, string last4) => new() { IsSuccess = true, CardId = cardId, AccountId = accountId, Last4 = last4 }; /// /// Creates a successful result when a direct account transaction (no card). /// public static PaymentResolutionResult SuccessAccount(int accountId, string last4) => new() { IsSuccess = true, AccountId = accountId, Last4 = last4 }; /// /// Creates a failure result with error message. /// public static PaymentResolutionResult Failure(string error) => new() { IsSuccess = false, ErrorMessage = error }; } }