#nullable enable
using Baya.Application.Models.Common;
using Baya.Application.Models.Messaging;
using Mediator;

namespace Baya.Application.Features.Messaging.Commands.OpenTicket;

/// <summary>
/// Opens a ticket, mints a stable unique <c>reference_code</c>, attaches the optional (both nullable)
/// <see cref="BookingId"/>/<see cref="RefundId"/> links, and adds the opener as the first participant. Used by
/// the customer/nurse "contact support" flow, the b11 refund flow (which anchors <c>refunds.ticket_id</c> here),
/// and <c>LogEmergencyTicket</c>. A booking link requires the opener to be a party to the booking (staff bypass);
/// a refund link is staff-only.
/// </summary>
public record OpenTicketCommand(
    string Category,
    string? Subject,
    string? Body,
    long? BookingId,
    long? RefundId) : IRequest<OperationResult<OpenTicketResult>>;
