<?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(): void
    {
        Schema::create('tax_rates', function (Blueprint $table) {
            $table->id();
            $table->string('province_code', 2)->unique();
            $table->string('province_name');
            $table->decimal('gst_rate', 5, 3)->default(0);
            $table->decimal('pst_rate', 5, 3)->default(0);
            $table->decimal('hst_rate', 5, 3)->default(0);
            $table->decimal('total_rate', 5, 3);
            $table->date('effective_date');
            $table->string('stripe_tax_code')->nullable();
            $table->timestamps();
        });
    }

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