using MediatR;

namespace StorageService.API.Application.Commands.MultipartUpload;

/// <summary>
/// EN: Command to complete a multipart upload.
/// VI: Command để hoàn thành multipart upload.
/// </summary>
public record CompleteMultipartUploadCommand(
    Guid UploadId,
    string UserId
) : IRequest<CompleteMultipartUploadResult>;

/// <summary>
/// EN: Result of multipart upload completion.
/// VI: Kết quả hoàn thành multipart upload.
/// </summary>
public record CompleteMultipartUploadResult(
    bool Success,
    Guid? FileId,
    string? ObjectKey,
    string? Error
)
{
    public static CompleteMultipartUploadResult Ok(Guid fileId, string objectKey) => 
        new(true, fileId, objectKey, null);
    public static CompleteMultipartUploadResult Fail(string error) => 
        new(false, null, null, error);
}
