<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    public function up(): void
    {
        Schema::create('wisebee_transcripts', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('wisebee_id')->unique();
            $table->unsignedBigInteger('wisebee_consultation_id')->index();
            $table->string('status');
            $table->longText('transcript_text')->nullable();
            $table->longText('transcript_edited')->nullable();
            $table->dateTime('completed_at')->nullable();
            $table->dateTime('edited_at')->nullable();
            $table->unsignedBigInteger('edited_by')->nullable();
            $table->dateTime('approved_at')->nullable();
            $table->unsignedBigInteger('approved_by')->nullable();
            $table->dateTime('wisebee_created_at')->nullable();
            $table->timestamps();
        });
    }

    public function down(): void
    {
        Schema::dropIfExists('wisebee_transcripts');
    }
};
