From f54ca8e341e5eb6c731cc802fcf6cae521e9d4b9 Mon Sep 17 00:00:00 2001 From: Arturo Corro Date: Mon, 27 Jan 2025 13:00:36 -0600 Subject: [PATCH] Test install component --- src/BaseServiceProvider.php | 8 +- .../0001_01_01_000000_create_users_table.php | 96 ------ .../0001_01_01_000001_create_cache_table.php | 35 -- .../0001_01_01_000002_create_jobs_table.php | 57 ---- ...12_14_035487_create_user_logins_table.php} | 1 + ..._104331_create_cfdi_sat_catalog_tables.php | 305 ------------------ 6 files changed, 8 insertions(+), 494 deletions(-) delete mode 100644 src/Database/migrations/0001_01_01_000000_create_users_table.php delete mode 100644 src/Database/migrations/0001_01_01_000001_create_cache_table.php delete mode 100644 src/Database/migrations/0001_01_01_000002_create_jobs_table.php rename src/Database/migrations/{2024_12_14_040004_create_user_logins_table.php => 2024_12_14_035487_create_user_logins_table.php} (95%) delete mode 100644 src/Database/migrations/2024_12_14_104331_create_cfdi_sat_catalog_tables.php diff --git a/src/BaseServiceProvider.php b/src/BaseServiceProvider.php index e7c7b15..4d87e35 100644 --- a/src/BaseServiceProvider.php +++ b/src/BaseServiceProvider.php @@ -56,7 +56,6 @@ class BaseServiceProvider extends ServiceProvider $this->app->register(VuexyAdminProvider::class); } - public function boot() { // Registrar alias del middleware @@ -108,5 +107,12 @@ class BaseServiceProvider extends ServiceProvider // Enable auditing User::observe(AuditableObserver::class); + + // Publicar activos del módulo + $this->publishes([ + __DIR__ . '/../Resources/assets/vuexy-admin/vendor' => public_path('vendor/laravel-vuexy-admin-module'), + __DIR__ . '/../Resources/Resources/assets/vuexy-admin/js' => resource_path('js/modules/admin'), + __DIR__ . '/../Resources/Resources/assets/vuexy-admin/css' => resource_path('css/modules/admin'), + ], 'vuexy-assets'); } } diff --git a/src/Database/migrations/0001_01_01_000000_create_users_table.php b/src/Database/migrations/0001_01_01_000000_create_users_table.php deleted file mode 100644 index 8fcad6e..0000000 --- a/src/Database/migrations/0001_01_01_000000_create_users_table.php +++ /dev/null @@ -1,96 +0,0 @@ -mediumIncrements('id'); - - $table->string('contact_code', 50)->unique()->nullable()->comment('Código único del contacto'); - - $table->string('name', 100)->comment('Nombre')->index(); - $table->string('last_name', 100)->comment('Apellidos')->nullable()->index(); - - $table->string('email')->unique()->index(); - $table->timestamp('email_verified_at')->nullable(); - $table->string('password')->nullable(); - $table->rememberToken(); - $table->string('profile_photo_path', 2048)->nullable(); - - $table->string('company', 100)->nullable()->comment('Nombre de la empresa')->index(); - - $table->date('birth_date')->nullable()->comment('Fecha de nacimiento'); - $table->date('hire_date')->nullable()->comment('Fecha de contratación'); - - $table->string('curp', 50)->nullable()->comment('Clave Única de Registro de Población (CURP)')->index(); - $table->string('nss', 11)->nullable()->comment('Número de seguridad social')->index(); - - $table->string('job_title', 100)->nullable()->comment('Cargo del contacto en la empresa'); - - $table->json('face_vector')->nullable()->comment('Vector de características faciales'); - - $table->string('rfc', 13)->unique()->nullable()->index(); - $table->string('nombre_fiscal')->nullable()->index(); - - $table->unsignedTinyInteger('tipo_persona')->nullable()->index(); - - $table->unsignedSmallInteger('c_regimen_fiscal')->nullable()->index(); // sat_regimen_fiscal.c_regimen_fiscal - - $table->unsignedMediumInteger('domicilio_fiscal')->nullable()->index(); // sat_codigo_postal.c_codigo_postal - - $table->char('c_uso_cfdi', 4)->charset('ascii')->collation('ascii_general_ci')->nullable()->index(); // sat_uso_cfdi.c_uso_cfdi - - $table->unsignedTinyInteger('is_partner')->nullable()->index(); - $table->unsignedTinyInteger('is_employee')->nullable()->index(); - $table->unsignedTinyInteger('is_prospect')->nullable()->index(); - $table->unsignedTinyInteger('is_customer')->nullable()->index(); - $table->unsignedTinyInteger('is_provider')->nullable()->index(); - $table->unsignedTinyInteger('is_user')->nullable()->index(); - - $table->unsignedTinyInteger('status')->nullable()->index(); - - // Auditoría - $table->dateTime('last_login_at')->nullable(); - $table->ipAddress('last_login_ip')->nullable(); - - $table->unsignedMediumInteger('created_by')->nullable()->index(); // users.id - $table->timestamps(); - - // Relaciones - $table->foreign('created_by')->references('id')->on('users')->onUpdate('restrict')->onDelete('restrict'); - }); - - Schema::create('password_reset_tokens', function (Blueprint $table) { - $table->string('email')->primary(); - $table->string('token'); - $table->timestamp('created_at')->nullable(); - }); - - Schema::create('sessions', function (Blueprint $table) { - $table->string('id')->primary(); - $table->foreignId('user_id')->nullable()->index(); - $table->string('ip_address', 45)->nullable(); - $table->text('user_agent')->nullable(); - $table->longText('payload'); - $table->integer('last_activity')->index(); - }); - } - - /** - * Reverse the migrations. - */ - public function down(): void - { - Schema::dropIfExists('users'); - Schema::dropIfExists('password_reset_tokens'); - Schema::dropIfExists('sessions'); - } -}; diff --git a/src/Database/migrations/0001_01_01_000001_create_cache_table.php b/src/Database/migrations/0001_01_01_000001_create_cache_table.php deleted file mode 100644 index b9c106b..0000000 --- a/src/Database/migrations/0001_01_01_000001_create_cache_table.php +++ /dev/null @@ -1,35 +0,0 @@ -string('key')->primary(); - $table->mediumText('value'); - $table->integer('expiration'); - }); - - Schema::create('cache_locks', function (Blueprint $table) { - $table->string('key')->primary(); - $table->string('owner'); - $table->integer('expiration'); - }); - } - - /** - * Reverse the migrations. - */ - public function down(): void - { - Schema::dropIfExists('cache'); - Schema::dropIfExists('cache_locks'); - } -}; diff --git a/src/Database/migrations/0001_01_01_000002_create_jobs_table.php b/src/Database/migrations/0001_01_01_000002_create_jobs_table.php deleted file mode 100644 index 425e705..0000000 --- a/src/Database/migrations/0001_01_01_000002_create_jobs_table.php +++ /dev/null @@ -1,57 +0,0 @@ -id(); - $table->string('queue')->index(); - $table->longText('payload'); - $table->unsignedTinyInteger('attempts'); - $table->unsignedInteger('reserved_at')->nullable(); - $table->unsignedInteger('available_at'); - $table->unsignedInteger('created_at'); - }); - - Schema::create('job_batches', function (Blueprint $table) { - $table->string('id')->primary(); - $table->string('name'); - $table->integer('total_jobs'); - $table->integer('pending_jobs'); - $table->integer('failed_jobs'); - $table->longText('failed_job_ids'); - $table->mediumText('options')->nullable(); - $table->integer('cancelled_at')->nullable(); - $table->integer('created_at'); - $table->integer('finished_at')->nullable(); - }); - - Schema::create('failed_jobs', function (Blueprint $table) { - $table->id(); - $table->string('uuid')->unique(); - $table->text('connection'); - $table->text('queue'); - $table->longText('payload'); - $table->longText('exception'); - $table->timestamp('failed_at')->useCurrent(); - }); - } - - /** - * Reverse the migrations. - */ - public function down(): void - { - Schema::dropIfExists('jobs'); - Schema::dropIfExists('job_batches'); - Schema::dropIfExists('failed_jobs'); - } -}; diff --git a/src/Database/migrations/2024_12_14_040004_create_user_logins_table.php b/src/Database/migrations/2024_12_14_035487_create_user_logins_table.php similarity index 95% rename from src/Database/migrations/2024_12_14_040004_create_user_logins_table.php rename to src/Database/migrations/2024_12_14_035487_create_user_logins_table.php index f1b064b..84f5ba3 100644 --- a/src/Database/migrations/2024_12_14_040004_create_user_logins_table.php +++ b/src/Database/migrations/2024_12_14_035487_create_user_logins_table.php @@ -30,6 +30,7 @@ return new class extends Migration */ public function down(): void { + // Elimina tablas solo si existen Schema::dropIfExists('user_logins'); } }; diff --git a/src/Database/migrations/2024_12_14_104331_create_cfdi_sat_catalog_tables.php b/src/Database/migrations/2024_12_14_104331_create_cfdi_sat_catalog_tables.php deleted file mode 100644 index 82cdf38..0000000 --- a/src/Database/migrations/2024_12_14_104331_create_cfdi_sat_catalog_tables.php +++ /dev/null @@ -1,305 +0,0 @@ -smallIncrements('id'); - - $table->unsignedSmallInteger('c_banco')->index(); - $table->string('descripcion'); - $table->string('razon_social')->nullable(); - $table->string('rfc', 13)->nullable(); - - $table->unsignedTinyInteger('status'); - - $table->timestamps(); - }); - - Schema::create('sat_clave_prod_serv', function (Blueprint $table) { - $table->mediumIncrements('id'); - - $table->unsignedInteger('c_clave_prod_serv'); - $table->string('descripcion')->nullable()->fulltext(); - $table->string('incluir_iva_trasladado')->nullable(); - $table->string('incluir_ieps_trasladado')->nullable(); - $table->string('complemento_que_debe_incluir')->nullable(); - $table->date('fecha_inicio_vigencia')->nullable(); - $table->date('fecha_fin_vigencia')->nullable(); - $table->unsignedTinyInteger('estimulo_franja_fronteriza')->nullable(); - $table->string('palabras_similares', 1024)->nullable(); - - $table->timestamps(); - - // Indices - $table->unique('c_clave_prod_serv'); - }); - - Schema::create('sat_clave_unidad', function (Blueprint $table) { - $table->smallIncrements('id'); - - $table->string('c_clave_unidad', 3)->unique(); - $table->string('nombre')->fulltext(); - $table->string('descripcion', 1024)->nullable(); - $table->string('categoria', 1024)->nullable(); - $table->string('nota', 1024)->nullable(); - $table->date('fecha_de_inicio_de_vigencia')->nullable(); - $table->date('fecha_de_fin_de_vigencia')->nullable(); - $table->string('simbolo')->nullable(); - $table->boolean('is_base')->nullable(); - - $table->timestamps(); - }); - - Schema::create('sat_forma_pago', function (Blueprint $table) { - $table->smallIncrements('id'); - - $table->unsignedTinyInteger('c_forma_pago'); - $table->string('descripcion'); - $table->string('bancarizado')->nullable(); - $table->string('numero_de_operacion')->nullable(); - $table->string('rfc_del_emisor_de_la_cuenta_ordenante')->nullable(); - $table->string('cuenta_ordenante')->nullable(); - $table->string('patron_para_cuenta_ordenante')->nullable(); - $table->string('rfc_del_emisor_cuenta_de_beneficiario')->nullable(); - $table->string('cuenta_de_benenficiario')->nullable(); - $table->string('patron_para_cuenta_beneficiaria')->nullable(); - $table->string('tipo_cadena_pago')->nullable(); - $table->string('banco_emisor_de_la_cuenta_ordenante')->nullable(); - $table->date('fecha_inicio_de_vigencia')->nullable(); - $table->date('fecha_fin_de_vigencia')->nullable(); - - $table->timestamps(); - - // Indices - $table->unique('c_forma_pago'); - }); - - Schema::create('sat_moneda', function (Blueprint $table) { - $table->smallIncrements('id'); - - $table->char('c_moneda', 3)->charset('ascii')->collation('ascii_general_ci'); - $table->string('descripcion'); - $table->string('decimales')->nullable(); - $table->string('porcentaje_variacion')->nullable(); - $table->date('fecha_inicio_de_vigencia')->nullable(); - $table->date('fecha_fin_de_vigencia')->nullable(); - - $table->timestamps(); - - // Indices - $table->unique('c_moneda'); - }); - - Schema::create('sat_codigo_postal', function (Blueprint $table) { - $table->mediumIncrements('id'); - - $table->unsignedMediumInteger('c_codigo_postal'); - $table->string('c_estado', 3)->charset('ascii')->collation('ascii_general_ci'); - $table->unsignedSmallInteger('c_municipio')->nullable(); - $table->unsignedTinyInteger('c_localidad')->nullable(); - $table->string('estimulo_franja_fronteriza')->nullable(); - $table->date('fecha_inicio_de_vigencia')->nullable(); - $table->date('fecha_fin_de_vigencia')->nullable(); - - $table->timestamps(); - - // Indices - $table->index('c_codigo_postal'); - $table->index('c_estado'); - $table->index('c_municipio'); - $table->index('c_localidad'); - - $table->unique('c_codigo_postal'); - }); - - Schema::create('sat_regimen_fiscal', function (Blueprint $table) { - $table->smallIncrements('id'); - - $table->unsignedSmallInteger('c_regimen_fiscal'); - $table->string('descripcion'); - $table->char('fisica', 2)->nullable(); - $table->char('moral', 2)->nullable(); - $table->date('fecha_de_inicio_de_vigencia')->nullable(); - $table->date('fecha_de_fin_de_vigencia')->nullable(); - - $table->timestamps(); - - // Indices - $table->unique('c_regimen_fiscal'); - }); - - Schema::create('sat_pais', function (Blueprint $table) { - $table->smallIncrements('id'); - - $table->char('c_pais', 3)->charset('ascii')->collation('ascii_general_ci'); - $table->string('descripcion'); - $table->string('formato_de_codigo_postal')->nullable(); - $table->string('formato_de_registro_de_identidad_tributaria')->nullable(); - $table->string('validacion_del_registro_de_identidad_tributaria')->nullable(); - $table->string('agrupaciones')->nullable(); - - $table->timestamps(); - - // Indices - $table->unique('c_pais'); - }); - - Schema::create('sat_uso_cfdi', function (Blueprint $table) { - $table->smallIncrements('id'); - - $table->char('c_uso_cfdi', 4)->charset('ascii')->collation('ascii_general_ci'); - $table->string('descripcion'); - $table->char('aplica_para_tipo_persona_fisica', 2)->nullable(); - $table->char('aplica_para_tipo_persona_moral', 2)->nullable(); - $table->date('fecha_inicio_de_vigencia')->nullable(); - $table->date('fecha_fin_de_vigencia')->nullable(); - $table->string('regimen_fiscal_receptor')->nullable(); - - $table->timestamps(); - - // Indices - $table->unique('c_uso_cfdi'); - }); - - Schema::create('sat_colonia', function (Blueprint $table) { - $table->mediumIncrements('id'); - - $table->unsignedMediumInteger('c_colonia'); - $table->unsignedMediumInteger('c_codigo_postal'); - $table->string('nombre_del_asentamiento')->nullable(); - - $table->timestamps(); - - // Indices - $table->index('c_colonia'); - $table->index('c_codigo_postal'); - - $table->unique(['c_colonia', 'c_codigo_postal']); - }); - - Schema::create('sat_estado', function (Blueprint $table) { - $table->smallIncrements('id'); - - $table->string('c_estado', 3)->charset('ascii')->collation('ascii_general_ci'); - $table->char('c_pais', 3)->charset('ascii')->collation('ascii_general_ci'); - $table->string('nombre_del_estado'); - $table->date('fecha_inicio_de_vigencia')->nullable(); - $table->date('fecha_fin_de_vigencia')->nullable(); - - $table->timestamps(); - - // Indices - $table->index('c_estado'); - $table->index('c_pais'); - - $table->unique(['c_estado', 'c_pais']); - }); - - Schema::create('sat_localidad', function (Blueprint $table) { - $table->smallIncrements('id'); - - $table->unsignedTinyInteger('c_localidad'); - $table->string('c_estado', 3)->charset('ascii')->collation('ascii_general_ci'); - $table->string('descripcion'); - $table->date('fecha_de_inicio_de_vigencia')->nullable(); - $table->date('fecha_de_fin_de_vigencia')->nullable(); - - $table->timestamps(); - - // Indices - $table->index('c_localidad'); - $table->index('c_estado'); - - $table->unique(['c_localidad', 'c_estado']); - }); - - Schema::create('sat_municipio', function (Blueprint $table) { - $table->smallIncrements('id'); - - $table->unsignedSmallInteger('c_municipio'); - $table->string('c_estado', 3)->charset('ascii')->collation('ascii_general_ci'); - $table->string('descripcion'); - $table->date('fecha_de_inicio_de_vigencia')->nullable(); - $table->date('fecha_de_fin_de_vigencia')->nullable(); - - $table->timestamps(); - - // Indices - $table->index('c_municipio'); - $table->index('c_estado'); - - $table->unique(['c_municipio', 'c_estado']); - }); - - Schema::create('sat_deduccion', function (Blueprint $table) { - $table->tinyIncrements('id'); - - $table->unsignedTinyInteger('c_deduccion')->index(); - $table->string('descripcion'); - $table->date('fecha_inicio_de_vigencia')->nullable(); - $table->date('fecha_fin_de_vigencia')->nullable(); - - $table->timestamps(); - }); - - Schema::create('sat_percepcion', function (Blueprint $table) { - $table->smallIncrements('id'); - - $table->unsignedTinyInteger('c_percepcion')->index(); - $table->string('descripcion'); - $table->date('fecha_inicio_de_vigencia')->nullable(); - $table->date('fecha_fin_de_vigencia')->nullable(); - - $table->timestamps(); - }); - - - Schema::table('users', function (Blueprint $table) { - // Indices - $table->foreign('c_regimen_fiscal') - ->references('c_regimen_fiscal') - ->on('sat_regimen_fiscal') - ->onUpdate('restrict') - ->onDelete('restrict'); - - $table->foreign('domicilio_fiscal') - ->references('c_codigo_postal') - ->on('sat_codigo_postal') - ->onUpdate('restrict') - ->onDelete('restrict'); - - $table->foreign('c_uso_cfdi') - ->references('c_uso_cfdi') - ->on('sat_uso_cfdi') - ->onUpdate('restrict') - ->onDelete('restrict'); - }); - - } - - /** - * Reverse the migrations. - */ - public function down(): void - { - Schema::dropIfExists('sat_forma_pago'); - Schema::dropIfExists('sat_moneda'); - Schema::dropIfExists('sat_codigo_postal'); - Schema::dropIfExists('sat_regimen_fiscal'); - Schema::dropIfExists('sat_pais'); - Schema::dropIfExists('sat_uso_cfdi'); - Schema::dropIfExists('sat_colonia'); - Schema::dropIfExists('sat_estado'); - Schema::dropIfExists('sat_localidad'); - Schema::dropIfExists('sat_municipio'); - } -};