Files
sirpremiumv2/database/migrations/2025_10_23_130227_create_ranks_table.php
T
Juan Felipe Duarte a558e393f2 Add rank management feature with CRUD and UI
Introduces a new rank management system including the Rank model, migrations for the ranks table and user IP address, Livewire components for managing and displaying ranks, and related Blade views. Updates navigation and routes to include the new 'Gestión Rangos' section, and enhances the ShareCodeComponent with user data. Also adds a reusable input field component for forms.
2025-10-23 20:28:47 -05:00

40 lines
1.2 KiB
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up()
{
Schema::create('ranks', function (Blueprint $table) {
$table->id();
$table->string('nombre'); // Bronce, Plata, Oro, Diamante
$table->string('logo')->nullable();
$table->decimal('cashback', 5, 2)->default(0); // % de cashback personal
$table->decimal('bono_equipo', 5, 2)->default(0); // % de bono sobre ventas del equipo
$table->integer('tope_bono_equipo')->default(0); // límite máximo del bono
// Requisitos
$table->integer('compra_personal_min')->default(0);
$table->integer('directos_activos_min')->default(0);
$table->integer('niveles_min')->default(0);
$table->integer('volumen_equipo_min')->default(0);
// Valor mínimo por nivel (ej: cada nivel >= 300.000)
$table->integer('volumen_por_nivel_min')->default(0);
$table->timestamps();
});
}
public function down()
{
Schema::dropIfExists('ranks');
}
};