<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up()
    {
        Schema::create('payment_profiles', function (Blueprint $table) {
            $table->id();
            $table->foreignId('company_id')->constrained()->onDelete('cascade');
            $table->string('provider')->default('stripe'); // e.g. stripe, ach, paypal
            $table->string('provider_customer_id');        // e.g. Stripe Customer ID
            $table->string('provider_account_id')->nullable(); // e.g. for Connect Accounts
            $table->json('metadata')->nullable();          // optional extra info (like ACH tokens, bank names)
            $table->timestamps();
        });
    }


    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('payment_profiles');
    }
};
