<?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('payments', function (Blueprint $table) {
    $table->id();
    $table->foreignId('member_id')->constrained()->onDelete('cascade');
    $table->string('fingerprint_id')->nullable();
    $table->string('membership_type');
    $table->string('package_type');

    $table->integer('amount');
    $table->integer('membership_fee')->default(0);
    $table->integer('admission_fee')->default(0);

    $table->date('payment_date');
    $table->string('payment_type');
    $table->date('expiry_date');
    $table->date('next_payment_date')->nullable();
    $table->timestamps();
});

    }

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

