Carga inicial

This commit is contained in:
IvanAS94
2025-12-26 17:21:11 -08:00
parent 45d9afc951
commit 51880798ca
359 changed files with 42159 additions and 1 deletions

1
database/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
*.sqlite

View File

@@ -0,0 +1,25 @@
<?php
/*
|--------------------------------------------------------------------------
| Model Factories
|--------------------------------------------------------------------------
|
| Here you may define all of your model factories. Model factories give
| you a convenient way to create models for testing and seeding your
| database. Just tell the factory how a default model should look.
|
*/
/** @var \Illuminate\Database\Eloquent\Factory $factory */
$factory->define(App\User::class, function (Faker\Generator $faker) {
static $password;
return [
'name' => $faker->name,
'email' => $faker->unique()->safeEmail,
'password' => $password ?: $password = bcrypt('secret'),
'remember_token' => str_random(10),
];
});

View File

@@ -0,0 +1,33 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableTiposEmpleados extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('tipos_empleados', function (Blueprint $table) {
$table->increments('id');
$table->string('nombre');
$table->boolean('login');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('tipos_empleados');
}
}

View File

@@ -0,0 +1,41 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableSucursales extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('sucursales', function (Blueprint $table) {
$table->increments('id');
$table->string('nombre')->unique();
$table->string('calle');
$table->string('num_ext');
$table->string('num_int')->nullable();
$table->string('colonia');
$table->string('cp');
$table->string('telefono');
$table->string('gerente');
$table->string('encargado');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('sucursales');
}
}

View File

@@ -0,0 +1,140 @@
<?php
/**
* Part of the Sentinel package.
*
* NOTICE OF LICENSE
*
* Licensed under the 3-clause BSD License.
*
* This source file is subject to the 3-clause BSD License that is
* bundled with this package in the LICENSE file.
*
* @package Sentinel
* @version 2.0.17
* @author Cartalyst LLC
* @license BSD License (3-clause)
* @copyright (c) 2011-2017, Cartalyst LLC
* @link http://cartalyst.com
*/
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class MigrationCartalystSentinel extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('activations', function (Blueprint $table) {
$table->increments('id');
$table->integer('user_id')->unsigned();
$table->string('code');
$table->boolean('completed')->default(0);
$table->timestamp('completed_at')->nullable();
$table->timestamps();
$table->engine = 'InnoDB';
});
Schema::create('persistences', function (Blueprint $table) {
$table->increments('id');
$table->integer('user_id')->unsigned();
$table->string('code');
$table->timestamps();
$table->engine = 'InnoDB';
$table->unique('code');
});
Schema::create('reminders', function (Blueprint $table) {
$table->increments('id');
$table->integer('user_id')->unsigned();
$table->string('code');
$table->boolean('completed')->default(0);
$table->timestamp('completed_at')->nullable();
$table->timestamps();
$table->engine = 'InnoDB';
});
Schema::create('roles', function (Blueprint $table) {
$table->increments('id');
$table->string('slug');
$table->string('name');
$table->text('permissions')->nullable();
$table->timestamps();
$table->engine = 'InnoDB';
$table->unique('slug');
});
Schema::create('role_users', function (Blueprint $table) {
$table->integer('user_id')->unsigned();
$table->integer('role_id')->unsigned();
$table->nullableTimestamps();
$table->engine = 'InnoDB';
$table->primary(['user_id', 'role_id']);
});
Schema::create('throttle', function (Blueprint $table) {
$table->increments('id');
$table->integer('user_id')->unsigned()->nullable();
$table->string('type');
$table->string('ip')->nullable();
$table->timestamps();
$table->engine = 'InnoDB';
$table->index('user_id');
});
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('email');
$table->string('password');
$table->string('nombre');
$table->string('apellido_paterno');
$table->string('apellido_materno');
$table->string('telefono')->nullable();
$table->integer('sucursal_id')->unsigned();
$table->boolean('solicitar')->default(0);
$table->integer('tipo_empleado_id')->unsigned();
$table->text('permissions')->nullable();
$table->timestamp('last_login')->nullable();
$table->rememberToken();
$table->timestamps();
$table->engine = 'InnoDB';
$table->unique('email');
$table->foreign('tipo_empleado_id')
->references('id')
->on('tipos_empleados');
$table->foreign('sucursal_id')
->references('id')
->on('sucursales');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('activations');
Schema::drop('persistences');
Schema::drop('reminders');
Schema::drop('roles');
Schema::drop('role_users');
Schema::drop('throttle');
Schema::drop('users');
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreatePasswordResetsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('password_resets', function (Blueprint $table) {
$table->string('email')->index();
$table->string('token');
$table->timestamp('created_at')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('password_resets');
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableUsersAddSoftdeletes extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function (Blueprint $table) {
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('deleted_at');
});
}
}

View File

@@ -0,0 +1,33 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableEstatusServicios extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('cat_estatus_servicios', function (Blueprint $table) {
$table->increments('id');
$table->string('nombre');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('cat_estatus_servicios');
}
}

View File

@@ -0,0 +1,33 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableCatServicios extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('cat_servicios', function (Blueprint $table) {
$table->increments('id');
$table->string('nombre');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('cat_servicios');
}
}

View File

@@ -0,0 +1,33 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableCatFormaPago extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('cat_formas_pagos', function (Blueprint $table) {
$table->increments('id');
$table->string('nombre');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('cat_formas_pagos');
}
}

View File

@@ -0,0 +1,33 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableCatTipoServicio extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('cat_tipos_servicios', function (Blueprint $table) {
$table->increments('id');
$table->string('nombre');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('cat_tipos_servicios');
}
}

View File

@@ -0,0 +1,33 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableRolesAddMovilWeb extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('roles', function (Blueprint $table) {
$table->boolean('movil')->after('permissions')->default(0);
$table->boolean('web')->after('movil')->default(0);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('roles', function (Blueprint $table) {
$table->dropColumn(['movil','web']);
});
}
}

View File

@@ -0,0 +1,33 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableVehiculos extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('cat_vehiculos', function (Blueprint $table) {
$table->increments('id');
$table->string('num_economico')->unique();
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('cat_vehiculos');
}
}

View File

@@ -0,0 +1,41 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableVehiculosSucursales extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('vehiculos_sucursales', function (Blueprint $table) {
$table->integer('vehiculo_id')->unsigned();
$table->integer('sucursal_id')->unsigned();
$table->unique(['vehiculo_id', 'sucursal_id']);
$table->foreign('vehiculo_id')
->references('id')
->on('cat_vehiculos');
$table->foreign('sucursal_id')
->references('id')
->on('sucursales');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('vehiculos_sucursales');
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableFacturaUsoCfdi extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('facturas_uso_cfdi', function (Blueprint $table) {
$table->increments('id');
$table->char('clave', 9);
$table->string('descripcion', 765);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('facturas_uso_cfdi');
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableFacturaFormasPago extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('facturas_formas_pago', function (Blueprint $table) {
$table->increments('id');
$table->char('clave', 6);
$table->string('descripcion', 765);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('facturas_formas_pago');
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableFacturaMetodosPago extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('facturas_metodos_pago', function (Blueprint $table) {
$table->increments('id');
$table->char('clave', 9);
$table->string('descripcion', 765);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('facturas_metodos_pago');
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableFacturaTipoComprobante extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('facturas_tipo_comprobante', function (Blueprint $table) {
$table->increments('id');
$table->char('clave', 3);
$table->string('descripcion', 765);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('facturas_tipo_comprobante');
}
}

View File

@@ -0,0 +1,44 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableClientes extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('clientes', function (Blueprint $table) {
$table->increments('id');
$table->string('denominacion');
$table->integer('asesor_id')->unsigned();
$table->integer('sucursal_id')->unsigned();
$table->boolean('requiere_factura');
$table->timestamps();
$table->softDeletes();
$table->foreign('asesor_id')
->references('id')
->on('users');
$table->foreign('sucursal_id')
->references('id')
->on('sucursales');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('clientes');
}
}

View File

@@ -0,0 +1,45 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableClientesDomicilios extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('clientes_domicilios', function (Blueprint $table) {
$table->increments('id');
$table->integer('cliente_id')->unsigned();
$table->string('calle');
$table->string('num_ext');
$table->string('num_int')->nullable();
$table->string('colonia');
$table->string('cp');
$table->string('telefono')->nullable();
$table->double('lat')->nullable();
$table->double('lng')->nullable();
$table->timestamps();
$table->softDeletes();
$table->foreign('cliente_id')
->references('id')
->on('clientes');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('clientes_domicilios');
}
}

View File

@@ -0,0 +1,71 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableClientesDatosFiscales extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('clientes_datos_fiscales', function (Blueprint $table) {
$table->increments('id');
$table->integer('cliente_id')->unsigned()->unique();
$table->string('razon_social');
$table->string('rfc');
$table->string('email');
$table->string('calle');
$table->string('num_ext');
$table->string('num_int')->nullable();
$table->string('colonia');
$table->string('localidad');
$table->string('municipio');
$table->string('estado');
$table->string('pais');
$table->string('cp');
$table->integer('factura_uso_cfdi_id')->unsigned();
$table->integer('factura_tipo_comprobante_id')->unsigned();
$table->integer('factura_metodos_pago_id')->unsigned();
$table->integer('factura_formas_pago_id')->unsigned();
$table->string('condicion_pago');
$table->boolean('retencion_iva');
$table->string('observacion',250)->nullable();
$table->timestamps();
$table->foreign('cliente_id')
->references('id')
->on('clientes');
$table->foreign('factura_uso_cfdi_id')
->references('id')
->on('facturas_uso_cfdi');
$table->foreign('factura_tipo_comprobante_id')
->references('id')
->on('facturas_tipo_comprobante');
$table->foreign('factura_metodos_pago_id')
->references('id')
->on('facturas_metodos_pago');
$table->foreign('factura_formas_pago_id')
->references('id')
->on('facturas_formas_pago');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('clientes_datos_fiscales');
}
}

View File

@@ -0,0 +1,81 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableServicios extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('servicios', function (Blueprint $table) {
$table->increments('id');
$table->integer('servicio_id')->unsigned();
$table->integer('estatus_servicio_id')->unsigned();
$table->integer('forma_pago_id')->unsigned();
$table->integer('tipo_servicio_id')->unsigned();
$table->dateTime('fecha_agenda');
$table->dateTime('fecha_solicitud');
$table->integer('usuario_agenda_id')->unsigned();
$table->time('duracion');
$table->boolean('definido_cliente');
$table->integer('cliente_id')->unsigned();
$table->integer('cliente_domicilio_id')->unsigned();
$table->integer('operador_id')->unsigned();
$table->integer('vehiculo_id')->unsigned();
$table->timestamps();
$table->softDeletes();
$table->foreign('servicio_id')
->references('id')
->on('cat_servicios');
$table->foreign('estatus_servicio_id')
->references('id')
->on('cat_estatus_servicios');
$table->foreign('forma_pago_id')
->references('id')
->on('cat_formas_pagos');
$table->foreign('tipo_servicio_id')
->references('id')
->on('cat_tipos_servicios');
$table->foreign('usuario_agenda_id')
->references('id')
->on('users');
$table->foreign('cliente_id')
->references('id')
->on('clientes');
$table->foreign('cliente_domicilio_id')
->references('id')
->on('clientes_domicilios');
$table->foreign('operador_id')
->references('id')
->on('users');
$table->foreign('vehiculo_id')
->references('id')
->on('cat_vehiculos');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('servicios');
}
}

View File

@@ -0,0 +1,49 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableBitacoraLaboral extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('bitacora_laboral', function (Blueprint $table) {
$table->increments('id');
$table->integer('usuario_id')->unsigned();
$table->integer('vehiculo_id')->nullable()->unsigned();
$table->dateTime('fecha_hora_ini');
$table->dateTime('fecha_hora_fin')->nullable();
$table->integer('kilometraje_inicial');
$table->integer('kilometraje_final')->nullable();
$table->double('lat_ini');
$table->double('lng_ini');
$table->double('lat_fin')->nullable();
$table->double('lng_fin')->nullable();
$table->timestamps();
$table->foreign('usuario_id')
->references('id')
->on('users');
$table->foreign('vehiculo_id')
->references('id')
->on('cat_vehiculos');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('bitacora_laboral');
}
}

View File

@@ -0,0 +1,46 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableUsuariosDesplazamientos extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('usuarios_desplazamientos', function (Blueprint $table) {
$table->bigIncrements('id');
$table->integer('bitacora_laboral_id')->unsigned();
$table->integer('usuario_id')->unsigned();
$table->dateTime('fecha');
$table->string('modelo_celular');
$table->integer('bateria');
$table->double('lat');
$table->double('lng');
$table->timestamps();
$table->foreign('usuario_id')
->references('id')
->on('users');
$table->foreign('bitacora_laboral_id')
->references('id')
->on('bitacora_laboral');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('usuarios_desplazamientos');
}
}

View File

@@ -0,0 +1,31 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableParametros extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('parametros', function (Blueprint $table) {
$table->string('llave');
$table->string('valor');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('parametros');
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableUsersAddTokenFirebase extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function (Blueprint $table) {
$table->string('token_firebase',255)->nullable()->after('permissions');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn(['token_firebase']);
});
}
}

View File

@@ -0,0 +1,37 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableClientesDomiciliosAddNombreSucursal extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('clientes_domicilios', function (Blueprint $table) {
$table->string('nombre_sucursal')->after('cliente_id');
$table->integer('numero_sucursal')->after('nombre_sucursal');
$table->string('nombre_responsable_sucursal')->after('numero_sucursal');
$table->string('entre_calles')->nullable()->after('calle');
$table->string('ciudad')->after('colonia');
$table->string('celular_responsable')->after('telefono');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('clientes_domicilios', function (Blueprint $table) {
$table->dropColumn(['nombre_sucursal', 'numero_sucursal', 'nombre_responsable_sucursal', 'entre_calles', 'ciudad', 'celular_responsable']);
});
}
}

View File

@@ -0,0 +1,33 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableCatTiposVehiculos extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('cat_tipos_vehiculos', function (Blueprint $table) {
$table->increments('id');
$table->string('nombre');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('cat_tipos_vehiculos');
}
}

View File

@@ -0,0 +1,38 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableCatVehiculosAddTipoVehiculoId extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('cat_vehiculos', function (Blueprint $table) {
$table->integer('tipo_vehiculo_id')->after('num_economico')->unsigned();
$table->foreign('tipo_vehiculo_id')
->references('id')
->on('cat_tipos_vehiculos');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('cat_vehiculos', function (Blueprint $table) {
$table->dropForeign(['tipo_vehiculo_id']);
$table->dropColumn(['tipo_vehiculo_id']);
});
}
}

View File

@@ -0,0 +1,42 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableServiciosAddAux1Aux2 extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('servicios', function (Blueprint $table) {
$table->integer('auxiliar_1')->nullable()->unsigned()->after('vehiculo_id');
$table->integer('auxiliar_2')->nullable()->unsigned()->after('auxiliar_1');
$table->foreign('auxiliar_1')
->references('id')
->on('users');
$table->foreign('auxiliar_2')
->references('id')
->on('users');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('servicios', function (Blueprint $table) {
$table->dropForeign(['auxiliar_1', 'auxiliar_2']);
$table->dropColumn(['auxiliar_1', 'auxiliar_2']);
});
}
}

View File

@@ -0,0 +1,33 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableCatEstatusServiciosAddColores extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('cat_estatus_servicios', function (Blueprint $table) {
$table->string('color_1',10)->nullable()->after('nombre');
$table->string('color_2',10)->nullable()->after('color_1');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('cat_estatus_servicios', function (Blueprint $table) {
$table->dropColumn(['color_1', 'color_2']);
});
}
}

View File

@@ -0,0 +1,61 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableServiciosEnc extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::dropIfExists('servicios');
Schema::create('servicios_enc', function (Blueprint $table) {
$table->increments('id');
$table->integer('forma_pago_id')->unsigned();
$table->dateTime('fecha_agenda');
$table->integer('usuario_agenda_id')->unsigned();
$table->integer('cliente_id')->unsigned();
$table->integer('cliente_domicilio_id')->unsigned();
$table->integer('sucursal_id')->unsigned();
$table->timestamps();
$table->softDeletes();
$table->foreign('forma_pago_id')
->references('id')
->on('cat_formas_pagos');
$table->foreign('usuario_agenda_id')
->references('id')
->on('users');
$table->foreign('cliente_id')
->references('id')
->on('clientes');
$table->foreign('cliente_domicilio_id')
->references('id')
->on('clientes_domicilios');
$table->foreign('sucursal_id')
->references('id')
->on('sucursales');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('servicios_enc');
}
}

View File

@@ -0,0 +1,75 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableServiciosDet extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('servicios_det', function (Blueprint $table) {
$table->increments('id');
$table->integer('servicio_enc_id')->unsigned();
$table->integer('servicio_id')->unsigned();
$table->integer('estatus_servicio_id')->unsigned();
$table->integer('tipo_servicio_id')->unsigned();
$table->dateTime('fecha_solicitud');
$table->time('duracion');
$table->boolean('definido_cliente');
$table->decimal('costo_servicio',14,2);
$table->integer('operador_id')->nullable()->unsigned();
$table->integer('vehiculo_id')->nullable()->unsigned();
$table->integer('auxiliar_1')->nullable()->unsigned();
$table->integer('auxiliar_2')->nullable()->unsigned();
$table->timestamps();
$table->foreign('servicio_enc_id')
->references('id')
->on('servicios_enc');
$table->foreign('auxiliar_1')
->references('id')
->on('users');
$table->foreign('auxiliar_2')
->references('id')
->on('users');
$table->foreign('servicio_id')
->references('id')
->on('cat_servicios');
$table->foreign('estatus_servicio_id')
->references('id')
->on('cat_estatus_servicios');
$table->foreign('tipo_servicio_id')
->references('id')
->on('cat_tipos_servicios');
$table->foreign('operador_id')
->references('id')
->on('users');
$table->foreign('vehiculo_id')
->references('id')
->on('cat_vehiculos');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('servicios_det');
}
}

View File

@@ -0,0 +1,33 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableServiciosDetAddAceptado extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('servicios_det', function (Blueprint $table) {
$table->boolean('aceptado')->nullable()->after('auxiliar_2');
$table->string('observacion',255)->nullable()->after('aceptado');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('servicios_det', function (Blueprint $table) {
$table->dropColumn(['aceptado', 'observacion']);
});
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableServiciosDetAddObservacion extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('servicios_det', function (Blueprint $table) {
$table->string('observacion_atencion_cliente',255)->nullable()->after('observacion');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('servicios_det', function (Blueprint $table) {
$table->dropColumn(['observacion_atencion_cliente']);
});
}
}

View File

@@ -0,0 +1,53 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableServiciosProgreso extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('servicios_progreso', function (Blueprint $table) {
$table->increments('id');
$table->integer('servicio_enc_id')->unsigned();
$table->integer('servicio_det_id')->unsigned();
$table->dateTime('fecha_ini_servidor');
$table->dateTime('fecha_fin_servidor')->nullable();
$table->dateTime('fecha_ini_celular');
$table->dateTime('fecha_fin_celular')->nullable();
$table->time('duracion')->nullable();
$table->double('lat_ini');
$table->double('lng_ini');
$table->double('lat_fin')->nullable();
$table->double('lng_fin')->nullable();
$table->string('comentarios', 255)->nullable();
$table->timestamps();
$table->foreign('servicio_enc_id')
->references('id')
->on('servicios_enc');
$table->foreign('servicio_det_id')
->references('id')
->on('servicios_det');
$table->unique(['servicio_enc_id', 'servicio_det_id']);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('servicios_progreso');
}
}

View File

@@ -0,0 +1,41 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableServiciosEvidencias extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('servicios_evidencias', function (Blueprint $table) {
$table->increments('id');
$table->integer('servicio_progreso_id')->unsigned();
$table->string('imagen', 255)->nullable();
$table->string('uuid', 255);
$table->enum('etapa', ['Inicio', 'Proceso', 'Final']);
$table->double('lat');
$table->double('lng');
$table->timestamps();
$table->foreign('servicio_progreso_id')
->references('id')
->on('servicios_progreso');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('servicios_evidencias');
}
}

View File

@@ -0,0 +1,33 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableServiciosProgresoAddFirma extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('servicios_progreso', function (Blueprint $table) {
$table->string('firma',255)->nullable()->after('comentarios');
$table->string('pdf',255)->nullable()->after('firma');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('servicios_progreso', function (Blueprint $table) {
$table->dropColumn(['firma', 'pdf']);
});
}
}

View File

@@ -0,0 +1,33 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableCatOrigenes extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('cat_origenes', function (Blueprint $table) {
$table->increments('id');
$table->string('nombre');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('cat_origenes');
}
}

View File

@@ -0,0 +1,37 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableServiciosEncAddOrigenId extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('servicios_enc', function (Blueprint $table) {
$table->integer('origen_id')->unsigned()->after('sucursal_id');
$table->foreign('origen_id')
->references('id')
->on('cat_origenes');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('servicios_enc', function (Blueprint $table) {
$table->dropForeign(['origen_id']);
$table->dropColumn(['origen_id']);
});
}
}

View File

@@ -0,0 +1,35 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTablePreguntasEmpresarial extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('preguntas_empresarial', function (Blueprint $table) {
$table->increments('id');
$table->string('nombre');
$table->integer('orden');
$table->boolean('mostrar_numero');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('preguntas_empresarial');
}
}

View File

@@ -0,0 +1,40 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableRespuestasEmpresarial extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('respuestas_empresarial', function (Blueprint $table) {
$table->increments('id');
$table->integer('pregunta_id')->unsigned();
$table->string('nombre');
$table->integer('orden');
$table->enum('tipo_campo', ['Texto', 'Email', 'Fecha', 'Checkbox']);
$table->timestamps();
$table->softDeletes();
$table->foreign('pregunta_id')
->references('id')
->on('preguntas_empresarial');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('respuestas_empresarial');
}
}

View File

@@ -0,0 +1,35 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTablePreguntasDomestico extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('preguntas_domestico', function (Blueprint $table) {
$table->increments('id');
$table->string('nombre');
$table->integer('orden');
$table->boolean('mostrar_numero');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('preguntas_domestico');
}
}

View File

@@ -0,0 +1,40 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableRespuestasDomestico extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('respuestas_domestico', function (Blueprint $table) {
$table->increments('id');
$table->integer('pregunta_id')->unsigned();
$table->string('nombre');
$table->integer('orden');
$table->enum('tipo_campo', ['Texto', 'Email', 'Fecha', 'Checkbox']);
$table->timestamps();
$table->softDeletes();
$table->foreign('pregunta_id')
->references('id')
->on('preguntas_domestico');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('respuestas_domestico');
}
}

View File

@@ -0,0 +1,48 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableServiciosEncuestasDomestico extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('servicios_encuestas_domestico', function (Blueprint $table) {
$table->increments('id');
$table->integer('servicio_det_id')->unsigned();
$table->integer('pregunta_id')->unsigned();
$table->integer('respuesta_id')->nullable()->unsigned();
$table->string('respuesta')->nullable();
$table->timestamps();
$table->softDeletes();
$table->foreign('servicio_det_id')
->references('id')
->on('servicios_det');
$table->foreign('pregunta_id')
->references('id')
->on('preguntas_domestico');
$table->foreign('respuesta_id')
->references('id')
->on('respuestas_domestico');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('servicios_encuestas_domestico');
}
}

View File

@@ -0,0 +1,48 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableServiciosEncuestasEmpresarial extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('servicios_encuestas_empresarial', function (Blueprint $table) {
$table->increments('id');
$table->integer('servicio_det_id')->unsigned();
$table->integer('pregunta_id')->unsigned();
$table->integer('respuesta_id')->nullable()->unsigned();
$table->string('respuesta')->nullable();
$table->timestamps();
$table->softDeletes();
$table->foreign('servicio_det_id')
->references('id')
->on('servicios_det');
$table->foreign('pregunta_id')
->references('id')
->on('preguntas_empresarial');
$table->foreign('respuesta_id')
->references('id')
->on('respuestas_empresarial');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('servicios_encuestas_empresarial');
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableServiciosDetAddRequiereEncuesta extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('servicios_det', function (Blueprint $table) {
$table->boolean('requiere_encuesta')->after('observacion_atencion_cliente');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('servicios_det', function (Blueprint $table) {
$table->dropColumn(['requiere_encuesta']);
});
}
}

View File

@@ -0,0 +1,42 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableBitacoraLaboralNullable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('bitacora_laboral', function (Blueprint $table) {
$table->dropColumn('fecha_hora_ini');
$table->dropColumn('kilometraje_inicial');
$table->dropColumn('lat_ini');
$table->dropColumn('lng_ini');
});
Schema::table('bitacora_laboral', function (Blueprint $table) {
$table->dateTime('fecha_hora_ini')->nullable()->after('vehiculo_id');
$table->integer('kilometraje_inicial')->nullable()->after('fecha_hora_fin');
$table->double('lat_ini')->nullable()->after('kilometraje_final');
$table->double('lng_ini')->nullable()->after('lat_ini');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}

View File

@@ -0,0 +1,42 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableRespuestasDomesticoAddEnum extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('respuestas_domestico', function (Blueprint $table) {
$table->dropColumn('tipo_campo');
});
Schema::table('respuestas_empresarial', function (Blueprint $table) {
$table->dropColumn('tipo_campo');
});
Schema::table('respuestas_domestico', function (Blueprint $table) {
$table->enum('tipo_campo', ['Texto', 'Email', 'Fecha', 'Checkbox', 'Numero', 'Moneda'])->after('orden');
});
Schema::table('respuestas_empresarial', function (Blueprint $table) {
$table->enum('tipo_campo', ['Texto', 'Email', 'Fecha', 'Checkbox', 'Numero', 'Moneda'])->after('orden');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}

View File

@@ -0,0 +1,40 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableRespuestasDomesticoRespuestasEmpresarialAddPuntuacion extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('respuestas_domestico', function (Blueprint $table) {
$table->integer('puntuacion')->nullable()->after('tipo_campo');
});
Schema::table('respuestas_empresarial', function (Blueprint $table) {
$table->integer('puntuacion')->nullable()->after('tipo_campo');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('respuestas_domestico', function (Blueprint $table) {
$table->dropColumn('puntuacion');
});
Schema::table('respuestas_empresarial', function (Blueprint $table) {
$table->dropColumn('puntuacion');
});
}
}

View File

@@ -0,0 +1,30 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableClientesDomiciliosChangeCpNull extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('clientes_domicilios', function (Blueprint $table) {
$table->string('cp')->nullable()->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
}
}

View File

@@ -0,0 +1,40 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableClientesClientesDomiciliosAddEmail extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('clientes', function (Blueprint $table) {
$table->string('email')->nullable()->after('requiere_factura');
});
Schema::table('clientes_domicilios', function (Blueprint $table) {
$table->string('email')->nullable()->after('lng');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('clientes', function (Blueprint $table) {
$table->dropColumn(['email']);
});
Schema::table('clientes_domicilios', function (Blueprint $table) {
$table->dropColumn(['email']);
});
}
}

View File

@@ -0,0 +1,40 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTablePreguntasEmpresarialPreguntasDomesticoAddObligatorio extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('preguntas_domestico', function (Blueprint $table) {
$table->boolean('obligatorio')->default(1)->after('mostrar_numero');
});
Schema::table('preguntas_empresarial', function (Blueprint $table) {
$table->boolean('obligatorio')->default(1)->after('mostrar_numero');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('preguntas_domestico', function (Blueprint $table) {
$table->dropColumn('obligatorio');
});
Schema::table('preguntas_empresarial', function (Blueprint $table) {
$table->dropColumn('obligatorio');
});
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableServiciosProgresoAddAplicaGarantia extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('servicios_progreso', function (Blueprint $table) {
$table->boolean('aplica_garantia')->default(false)->after('pdf');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('servicios_progreso', function (Blueprint $table) {
$table->dropColumn(['aplica_garantia']);
});
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableCatTiposVehiculosAddObjetivoMensual extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('cat_tipos_vehiculos', function (Blueprint $table) {
$table->integer('objetivo_mensual')->default(0)->after('nombre');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('cat_tipos_vehiculos', function (Blueprint $table) {
$table->dropColumn(['objetivo_mensual']);
});
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableCatVehiculosAddDescripcion extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('cat_vehiculos', function (Blueprint $table) {
$table->string('descripcion', 100)->nullable()->after('num_economico');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('cat_vehiculos', function (Blueprint $table) {
$table->dropColumn(['descripcion']);
});
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableCatFormasPagosAddPermitezero extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('cat_formas_pagos', function (Blueprint $table) {
$table->char('zeros', 1)->default('0')->nullable()->after('nombre');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('cat_formas_pagos', function (Blueprint $table) {
$table->dropColumn(['zeros']);
});
}
}

View File

@@ -0,0 +1,47 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableRespuestasOperador extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('respuestas_operador', function (Blueprint $table)
{
$table->increments('id');
$table->integer('user_id')->unsigned();
$table->string('nombre');
$table->enum('tipo', ['REVISION', 'MATERIAL','HERRAMIENTAS']);
$table->boolean('tipo_checkbox');
$table->boolean('tipo_text');
$table->boolean('tipo_radio_btn');
$table->boolean('respuesta_checkbox');
$table->string('respuesta_text');
$table->string('respuesta_radio_btn');
$table->date('fecha');
$table->timestamps();
$table->foreign('user_id')
->references('id')
->on('users');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('respuestas_operador');
}
}

View File

@@ -0,0 +1,61 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableRespuestasOperadorReestructuracion extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::dropIfExists('respuestas_operador');
Schema::create('respuestas_operador_enc', function (Blueprint $table)
{
$table->increments('id');
$table->integer('user_id')->unsigned();
$table->date('fecha');
$table->timestamps();
$table->foreign('user_id')
->references('id')
->on('users');
});
Schema::create('respuestas_operador_det', function (Blueprint $table)
{
$table->increments('id');
$table->integer('respuestas_operador_enc_id')->unsigned();
$table->string('nombre');
$table->enum('tipo', ['REVISION', 'MATERIAL','HERRAMIENTA']);
$table->boolean('tipo_checkbox');
$table->boolean('tipo_text');
$table->boolean('tipo_radio_btn');
$table->boolean('respuesta_checkbox')->nullable();
$table->string('respuesta_text')->nullable();
$table->string('respuesta_radio_btn')->nullable();
$table->timestamps();
$table->foreign('respuestas_operador_enc_id')
->references('id')
->on('respuestas_operador_enc');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('respuestas_operador_det');
Schema::dropIfExists('respuestas_operador_enc');
}
}

View File

@@ -0,0 +1,40 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableServiciosEncuestasDomesticoServiciosEncuestasEmpresarialChangeLenght extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('servicios_encuestas_domestico', function (Blueprint $table) {
$table->string('respuesta', 255)->nullable()->change();
});
Schema::table('servicios_encuestas_empresarial', function (Blueprint $table) {
$table->string('respuesta', 255)->nullable()->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('servicios_encuestas_domestico', function (Blueprint $table) {
$table->string('respuesta', 255)->nullable()->change();
});
Schema::table('servicios_encuestas_empresarial', function (Blueprint $table) {
$table->string('respuesta', 255)->nullable()->change();
});
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableUsersAddPermisosEspeciales extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function (Blueprint $table) {
$table->boolean('permiso_especial')->default(0)->after('permissions');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn(['permiso_especial']);
});
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableServiciosProgresoAddLitraje extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('servicios_progreso', function (Blueprint $table) {
$table->integer('litraje')->nullable()->after('aplica_garantia');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('servicios_progreso', function (Blueprint $table) {
$table->dropColumn(['litraje']);
});
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableServiciosDetAddFacturado extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('servicios_det', function (Blueprint $table) {
$table->boolean('facturado')->default(0)->after('requiere_encuesta');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('servicios_det', function (Blueprint $table) {
$table->dropColumn(['facturado']);
});
}
}

View File

@@ -0,0 +1,33 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableCatMotivosEstatusNegativo extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('cat_motivos_estatus', function (Blueprint $table) {
$table->increments('id');
$table->string('nombre');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('cat_motivos_estatus');
}
}

View File

@@ -0,0 +1,37 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableServiciosDetAddIdCatMotivosEstatus extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('servicios_det', function (Blueprint $table) {
$table->integer('cat_motivos_estatus_id')->unsigned()->nullable()->after('estatus_servicio_id');
$table->foreign('cat_motivos_estatus_id')
->references('id')
->on('cat_motivos_estatus');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('servicios_det', function (Blueprint $table) {
$table->dropForeign(['cat_motivos_estatus_id']);
$table->dropColumn(['cat_motivos_estatus_id']);
});
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableServiciosProgresoAddTypeText extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('servicios_progreso', function (Blueprint $table) {
$table->text('comentarios')->nullable()->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('servicios_progreso', function (Blueprint $table) {
$table->text('comentarios')->nullable()->change();
});
}
}

View File

@@ -0,0 +1,33 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddDispositivoIdToUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function (Blueprint $table) {
$table->text('dispositivo_id')->nullable()->after('token_firebase');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn(['dispositivo_id']);
});
}
}

View File

@@ -0,0 +1,44 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableVehiculosIncidencias extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('vehiculos_incidencias', function (Blueprint $table) {
$table->increments('id');
$table->integer('vehiculo_id')->unsigned();
$table->integer('user_id')->unsigned();
$table->string('descripcion');
$table->boolean('resuelta')->default(false);
$table->timestamps();
$table->softDeletes();
$table->foreign('vehiculo_id')
->references('id')
->on('cat_vehiculos');
$table->foreign('user_id')
->references('id')
->on('users');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('vehiculos_incidencias');
}
}

View File

@@ -0,0 +1,33 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableServiciosProgresoAddEncuestaContestada extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('servicios_progreso', function (Blueprint $table) {
$table->boolean('encuesta_contestada')->default(false)->after('servicio_negativo');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('servicios_progreso', function (Blueprint $table) {
$table->dropColumn(['encuesta_contestada']);
});
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableServiciosDetChangeObservacionAtencionCliente extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('servicios_det', function (Blueprint $table) {
$table->text('observacion_atencion_cliente')->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('servicios_det', function (Blueprint $table) {
$table->string('observacion_atencion_cliente')->change();
});
}
}

View File

@@ -0,0 +1,40 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateUsersLoginsLogsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users_logins_logs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->unsignedInteger('user_id');
$table->string('device_info')->nullable();
$table->string('browser_info')->nullable();
$table->string('ip')->nullable();
$table->string('request_uri')->nullable();
$table->timestamps();
$table->foreign('user_id')
->references('id')
->on('users');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('users_logins_logs');
}
}

View File

@@ -0,0 +1,37 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableCorreosSucursales extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('correos_sucursales', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('email');
$table->unsignedInteger('sucursal_id');
$table->timestamps();
$table->foreign('sucursal_id')
->references('id')
->on('sucursales');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('correos_sucursales');
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableSucursalesAddCostoNegativo extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('sucursales', function (Blueprint $table) {
$table->decimal('costo_negativo', 14,2)->after('encargado')->default('350');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('sucursales', function (Blueprint $table) {
$table->dropColumn('costo_negativo');
});
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableClientesDomiciliosAddNombreCroquis extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('clientes_domicilios', function (Blueprint $table) {
$table->string('nombre_croquis')->after('email')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('clientes_domicilios', function (Blueprint $table) {
$table->dropColumn('nombre_croquis');
});
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableCatEstatusServiciosAddColorWeb extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('cat_estatus_servicios', function (Blueprint $table) {
$table->string('color_web', 10)->after('color_2')->default("#D1E8FF");
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('cat_estatus_servicios', function (Blueprint $table) {
$table->dropColumn('color_web');
});
}
}

View File

@@ -0,0 +1,82 @@
<?php
use Illuminate\Database\Seeder;
class CatFacturacion extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('facturas_formas_pago')->insert([
[
'clave' => '01',
'descripcion' => 'Efectivo',
],
[
'clave' => '02',
'descripcion' => 'Cheque nominativo',
],
[
'clave' => '03',
'descripcion' => 'Transferencia electrónica de fondos',
],
[
'clave' => '04',
'descripcion' => 'Tarjeta de crédito',
],
[
'clave' => '14',
'descripcion' => 'Pago por consignación',
],
[
'clave' => '28',
'descripcion' => 'Tarjeta de débito',
],
[
'clave' => '30',
'descripcion' => 'Aplicación de anticipos',
],
[
'clave' => '99',
'descripcion' => 'Por definir',
],
]);
DB::table('facturas_metodos_pago')->insert([
[
'clave' => 'PUE',
'descripcion' => 'Pago en una sola exhibición',
],
[
'clave' => 'PPD',
'descripcion' => 'Pago en parcialidades o diferido',
],
]);
DB::table('facturas_tipo_comprobante')->insert([
[
'clave' => 'I',
'descripcion' => 'Ingreso',
],
]);
DB::table('facturas_uso_cfdi')->insert([
[
'clave' => 'G01',
'descripcion' => 'Adquisición de mercancias',
],
[
'clave' => 'G03',
'descripcion' => 'Gastos en general',
],
[
'clave' => 'P01',
'descripcion' => 'Por definir',
],
]);
}
}

View File

@@ -0,0 +1,38 @@
<?php
use Carbon\Carbon;
use Illuminate\Database\Seeder;
class CatMotivosEstatusSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('cat_motivos_estatus')->insert([
[
'nombre' => 'Nivel en calle / Pozos de visita llenos',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString()
],
[
'nombre' => 'Tubería dañada',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString()
],
[
'nombre' => 'Registros ocultos',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString()
],
[
'nombre' => 'Registro sellado',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString()
]
]);
}
}

View File

@@ -0,0 +1,58 @@
<?php
use Illuminate\Database\Seeder;
use Carbon\Carbon;
class CatMotivosEstatusUpdateSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('cat_motivos_estatus')->insert([
[
'nombre' => 'Cliente canceló',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString()
],
[
'nombre' => 'Cliente no se encuentra',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString()
],
[
'nombre' => 'Cliente resolvió',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString()
],
[
'nombre' => 'Negocio cerrado',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString()
],
[
'nombre' => 'Cliente reprogramó',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString()
],
[
'nombre' => 'Tubería con raíces',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString()
],
[
'nombre' => 'Requiere succión',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString()
],
[
'nombre' => 'Domicilio no localizado',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString()
]
]);
}
}

View File

@@ -0,0 +1,69 @@
<?php
use Carbon\Carbon;
use Illuminate\Database\Seeder;
class CatOrigenesTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('cat_origenes')->insert([
[
'nombre' => 'Llamada Telefónica',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Correo electrónico',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Punto de venta',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Recomendación',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Internet',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Sección amarilla',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Publicidad visual',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Plomero',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Sitio web',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'JAPAC',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
]
]);
}
}

View File

@@ -0,0 +1,73 @@
<?php
use Illuminate\Database\Seeder;
class ClientesTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run(Faker\Generator $faker)
{
for ($i = 1; $i <= 50; $i++){
$data_cliente = [
'denominacion' => $faker->company,
'asesor_id' => $faker->numberBetween(4,5),
'requiere_factura' => 1,
'sucursal_id' => $faker->numberBetween(1,2)
];
$cliente = \App\Models\Cliente::create($data_cliente);
$data_cliente_domicilio = [
'cliente_id' => $cliente->id,
'nombre_sucursal' => $faker->company,
'numero_sucursal' => $faker->numberBetween(1,100),
'nombre_responsable_sucursal' => $faker->firstNameFemale.' '.$faker->lastName,
'calle' => $faker->streetName,
'entre_calles' => $faker->streetName.' and '.$faker->streetName,
'num_ext' => $faker->numberBetween(1000,5000),
'num_int' => $faker->numberBetween(1000,5000),
'colonia' => $faker->cityPrefix,
'ciudad' => $faker->city,
'cp' => $faker->postcode,
'telefono' => $faker->bothify('667#######'),
'celular_responsable' => $faker->bothify('667#######'),
'lat' => $faker->latitude($min = 21, $max = 26),
'lng' => $faker->longitude($min = -101, $max = -106)
];
\App\Models\ClienteDomicilio::create($data_cliente_domicilio);
$data_cliente_datos_fiscales = [
'cliente_id' => $cliente->id,
'razon_social' => $faker->catchPhrase,
'rfc' => $faker->isbn13,
'email' => $faker->freeEmail,
'calle' => $faker->streetName,
'num_ext' => $faker->numberBetween(1000,5000),
'num_int' => $faker->numberBetween(1000,5000),
'colonia' => $faker->cityPrefix,
'localidad' => $faker->cityPrefix,
'municipio' => $faker->country,
'estado' => $faker->state,
'pais' => $faker->city,
'cp' => $faker->postcode,
'factura_uso_cfdi_id' => $faker->numberBetween(1,3),
'factura_tipo_comprobante_id' => 1,
'factura_metodos_pago_id' => $faker->numberBetween(1,2),
'factura_formas_pago_id' => $faker->numberBetween(1,8),
'condicion_pago' => $faker->sentence($nbWords = 2, $variableNbWords = true),
'retencion_iva' => $faker->numberBetween(0,1),
'observacion' => $faker->sentence($nbWords = 10, $variableNbWords = true),
];
\App\Models\ClienteDatoFiscal::create($data_cliente_datos_fiscales);
}
}
}

View File

@@ -0,0 +1,31 @@
<?php
use Illuminate\Database\Seeder;
class ColoresWebEstatusServicio extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$estatus = \App\Models\CatEstatuServicio::all();
foreach ($estatus as $e){
\App\Models\CatEstatuServicio::where('id', $e->id)->update(['color_web' => $this->colores()[$e->id]]);
}
}
function colores(){
return [
1 => "#5BB55B",
2 => "#FFBF80",
3 => "#B55B5B",
4 => "#FDF1BA",
5 => "#FC7E7E",
6 => "#8080FF",
7 => "#A3A3A3",
];
}
}

View File

@@ -0,0 +1,54 @@
<?php
use Illuminate\Database\Seeder;
use Carbon\Carbon;
class CorreosSucursalesTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('correos_sucursales')->insert([
[
'email' => 'guillermo@drenax.com.mx',
'sucursal_id' => 1,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'email' => 'bladimir@drenax.com.mx',
'sucursal_id' => 1,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'email' => 'supervisorcln@drenax.com.mx',
'sucursal_id' => 1,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'email' => 'sergio@drenax.com.mx',
'sucursal_id' => 2,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'email' => 'gerencialosmochis@drenax.com.mx',
'sucursal_id' => 2,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'email' => 'marcela@drenax.com.mx',
'sucursal_id' => 3,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
]
]);
}
}

View File

@@ -0,0 +1,40 @@
<?php
use Illuminate\Database\Seeder;
class DatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$this->call(TiposServiciosTableSeeder::class);
$this->call(ServiciosTableSeeder::class);
$this->call(FormasPagosTableSeeder::class);
$this->call(EstatusServiciosTableSeeder::class);
$this->call(TiposVehiculosTableSeeder::class);
$this->call(VehiculosTableSeeder::class);
$this->call(TiposEmpleadosTableSeeder::class);
$this->call(SucursalesTableSeeder::class);
$this->call(RolesTableSeeder::class);
$this->call(UsersTableSeeder::class);
$this->call(CatFacturacion::class);
//$this->call(ClientesTableSeeder::class);
//$this->call(SolicitudesServicioTableSeeder::class);
$this->call(ParametrosTableSeeder::class);
$this->call(VehiculosSucursalesTableSeeder::class);
$this->call(CatOrigenesTableSeeder::class);
$this->call(PreguntasEmpresarialTableSeeder::class);
$this->call(RespuestasEmpresarialTableSeeder::class);
$this->call(PreguntasDomesticoTableSeeder::class);
$this->call(RespuestasDomesticoTableSeeder::class);
$this->call(PreguntasRespuestasNuevasTableSeeder::class);
$this->call(ColoresWebEstatusServicio::class);
}
}

View File

@@ -0,0 +1,68 @@
<?php
use Carbon\Carbon;
use Illuminate\Database\Seeder;
class EstatusServiciosTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('cat_estatus_servicios')->insert([
[
'nombre' => 'Realizado',
'color_1' => '#04B404',
'color_2' => NULL,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Reprogramado',
'color_1' => '#FF8000',
'color_2' => NULL,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Cancelado',
'color_1' => '#B40404',
'color_2' => NULL,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Pendiente',
'color_1' => '#FFFF00',
'color_2' => '#000000',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Negativo',
'color_1' => '#FE2E2E',
'color_2' => '#FFFFFF',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Pagado',
'color_1' => '#0000FF',
'color_2' => NULL,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Visita/asesoría',
'color_1' => '#A4A4A4',
'color_2' => NULL,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
]);
}
}

View File

@@ -0,0 +1,49 @@
<?php
use Carbon\Carbon;
use Illuminate\Database\Seeder;
class FormasPagosTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('cat_formas_pagos')->insert([
[
'nombre' => 'Efectivo',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Garantía',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Terminal',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Cotización',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Transferencia',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Cheque',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
]);
}
}

View File

@@ -0,0 +1,29 @@
<?php
use Illuminate\Database\Seeder;
class ParametrosTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('parametros')->insert([
[
'llave' => 'INTERVALO_GEOLOCALIZACION_OPERADOR_MINUTOS',
'valor' => '3',
],
[
'llave' => 'ANCLAJE_SERVICIO_HORAS',
'valor' => '3',
],
[
'llave' => 'CURRENT_VERSION_APPLICATION',
'valor' => '0.40',
]
]);
}
}

View File

@@ -0,0 +1,95 @@
<?php
use Carbon\Carbon;
use Illuminate\Database\Seeder;
class PreguntasDomesticoTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('preguntas_domestico')->insert([
[
'nombre' => '¿El personal se presentó y mostró la orden de trabajo previo a la realización de su servicio?',
'orden' => 1,
'mostrar_numero' => 1,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => '¿Cómo califica la puntualidad de nuestro personal?',
'orden' => 2,
'mostrar_numero' => 1,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => '¿Cómo califica la imagen de nuestro personal?',
'orden' => 3,
'mostrar_numero' => 1,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => '¿El asesor usó los instrumentos de seguridad e higiene para la correcta ejecución del servicio?',
'orden' => 4,
'mostrar_numero' => 1,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => '¿Cómo califica la atención y asesoría brindada por los asesores?',
'orden' => 5,
'mostrar_numero' => 1,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => '¿El servicio fue efectivo quedando conforme con lo que contrató?',
'orden' => 6,
'mostrar_numero' => 1,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => '¿Cómo califica la atención y asesoría telefónica?',
'orden' => 7,
'mostrar_numero' => 1,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'De acuerdo al servicio recibido, ¿usted nos recomendaría?',
'orden' => 8,
'mostrar_numero' => 1,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => '¿Cuánto pagó por su servicio?',
'orden' => 9,
'mostrar_numero' => 1,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Correo:',
'orden' => 10,
'mostrar_numero' => 0,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Fecha de nacimiento:',
'orden' => 11,
'mostrar_numero' => 0,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
]);
}
}

View File

@@ -0,0 +1,102 @@
<?php
use Carbon\Carbon;
use Illuminate\Database\Seeder;
class PreguntasEmpresarialTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('preguntas_empresarial')->insert([
[
'nombre' => '¿Su servicio fue programado en tiempo y forma?',
'orden' => 1,
'mostrar_numero' => 1,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => '¿El asesor de operaciones realiza recibo de servicio, y es llenado correctamente hora de inicio y hora final?',
'orden' => 2,
'mostrar_numero' => 1,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => '¿Cómo califica la imagen del personal?',
'orden' => 3,
'mostrar_numero' => 1,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => '¿El asesor usó los instrumentos de seguridad e higiene para la correcta ejecución del servicio?',
'orden' => 4,
'mostrar_numero' => 1,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => '¿Cómo califica la atención y asesoría brindada por los asesores de operaciones?',
'orden' => 5,
'mostrar_numero' => 1,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => '¿Cómo califica la calidad del servicio contratado?',
'orden' => 6,
'mostrar_numero' => 1,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => '¿Cómo califica la atención y asesoría telefónica?',
'orden' => 7,
'mostrar_numero' => 1,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => '¿Recibió su factura del mes en tiempo y forma?',
'orden' => 8,
'mostrar_numero' => 1,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => '¿Cómo califica nuestra área de cobranza?',
'orden' => 9,
'mostrar_numero' => 1,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => '¿Cómo califica en general a la empresa DRENAX?',
'orden' => 10,
'mostrar_numero' => 1,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Correo:',
'orden' => 11,
'mostrar_numero' => 0,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Fecha de nacimiento:',
'orden' => 12,
'mostrar_numero' => 0,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
]);
}
}

View File

@@ -0,0 +1,69 @@
<?php
use Carbon\Carbon;
use Illuminate\Database\Seeder;
class PreguntasRespuestasNuevasTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('preguntas_domestico')->insert([
[
'nombre' => 'Comentarios:',
'orden' => 12,
'mostrar_numero' => 0,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
]
]);
DB::table('preguntas_empresarial')->insert([
[
'nombre' => 'Comentarios:',
'orden' => 13,
'mostrar_numero' => 0,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
]
]);
DB::table('respuestas_domestico')->insert([
//Respuesta 12
[
'nombre' => '',
'pregunta_id' => 12,
'orden' => 1,
'tipo_campo' => 'Texto',
'puntuacion' => null,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
]);
DB::table('respuestas_empresarial')->insert([
//Respuesta 13
[
'nombre' => '',
'pregunta_id' => 13,
'orden' => 1,
'tipo_campo' => 'Texto',
'puntuacion' => null,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
]);
\App\Models\RespuestaDomestico::where('pregunta_id',1)->delete();
\App\Models\PreguntaDomestico::where('id',1)->delete();
\App\Models\RespuestaEmpresarial::where('pregunta_id',2)->delete();
\App\Models\PreguntaEmpresarial::where('id',2)->delete();
}
}

View File

@@ -0,0 +1,319 @@
<?php
use Carbon\Carbon;
use Illuminate\Database\Seeder;
class RespuestasDomesticoTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('respuestas_domestico')->insert([
//Respuesta 1
[
'nombre' => 'Si',
'pregunta_id' => 1,
'orden' => 1,
'tipo_campo' => 'Checkbox',
'puntuacion' => 100,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'No',
'pregunta_id' => 1,
'orden' => 2,
'tipo_campo' => 'Checkbox',
'puntuacion' => 50,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
//Respuesta 2
[
'nombre' => 'Excelente',
'pregunta_id' => 2,
'orden' => 1,
'tipo_campo' => 'Checkbox',
'puntuacion' => 100,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Bueno',
'pregunta_id' => 2,
'orden' => 2,
'tipo_campo' => 'Checkbox',
'puntuacion' => 80,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Regular',
'pregunta_id' => 2,
'orden' => 3,
'tipo_campo' => 'Checkbox',
'puntuacion' => 60,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Malo',
'pregunta_id' => 2,
'orden' => 4,
'tipo_campo' => 'Checkbox',
'puntuacion' => 40,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Pésimo',
'pregunta_id' => 2,
'orden' => 5,
'tipo_campo' => 'Checkbox',
'puntuacion' => 20,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
//Respuesta 3
[
'nombre' => 'Excelente',
'pregunta_id' => 3,
'orden' => 1,
'tipo_campo' => 'Checkbox',
'puntuacion' => 100,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Bueno',
'pregunta_id' => 3,
'orden' => 2,
'tipo_campo' => 'Checkbox',
'puntuacion' => 80,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Regular',
'pregunta_id' => 3,
'orden' => 3,
'tipo_campo' => 'Checkbox',
'puntuacion' => 60,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Malo',
'pregunta_id' => 3,
'orden' => 4,
'tipo_campo' => 'Checkbox',
'puntuacion' => 40,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Pésimo',
'pregunta_id' => 3,
'orden' => 5,
'tipo_campo' => 'Checkbox',
'puntuacion' => 20,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
//Respuesta 4
[
'nombre' => 'Si',
'pregunta_id' => 4,
'orden' => 1,
'tipo_campo' => 'Checkbox',
'puntuacion' => 100,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'No',
'pregunta_id' => 4,
'orden' => 2,
'tipo_campo' => 'Checkbox',
'puntuacion' => 50,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
//Respuesta 5
[
'nombre' => 'Excelente',
'pregunta_id' => 5,
'orden' => 1,
'tipo_campo' => 'Checkbox',
'puntuacion' => 100,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Bueno',
'pregunta_id' => 5,
'orden' => 2,
'tipo_campo' => 'Checkbox',
'puntuacion' => 80,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Regular',
'pregunta_id' => 5,
'orden' => 3,
'tipo_campo' => 'Checkbox',
'puntuacion' => 60,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Malo',
'pregunta_id' => 5,
'orden' => 4,
'tipo_campo' => 'Checkbox',
'puntuacion' => 40,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Pésimo',
'pregunta_id' => 5,
'orden' => 5,
'tipo_campo' => 'Checkbox',
'puntuacion' => 20,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
//Respuesta 6
[
'nombre' => 'Si',
'pregunta_id' => 6,
'orden' => 1,
'tipo_campo' => 'Checkbox',
'puntuacion' => 100,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'No',
'pregunta_id' => 6,
'orden' => 2,
'tipo_campo' => 'Checkbox',
'puntuacion' => 50,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
//Respuesta 7
[
'nombre' => 'Excelente',
'pregunta_id' => 7,
'orden' => 1,
'tipo_campo' => 'Checkbox',
'puntuacion' => 100,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Bueno',
'pregunta_id' => 7,
'orden' => 2,
'tipo_campo' => 'Checkbox',
'puntuacion' => 80,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Regular',
'pregunta_id' => 7,
'orden' => 3,
'tipo_campo' => 'Checkbox',
'puntuacion' => 60,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Malo',
'pregunta_id' => 7,
'orden' => 4,
'tipo_campo' => 'Checkbox',
'puntuacion' => 40,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Pésimo',
'pregunta_id' => 7,
'orden' => 5,
'tipo_campo' => 'Checkbox',
'puntuacion' => 20,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
//Respuesta 8
[
'nombre' => 'Si',
'pregunta_id' => 8,
'orden' => 1,
'tipo_campo' => 'Checkbox',
'puntuacion' => 100,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'No',
'pregunta_id' => 8,
'orden' => 2,
'tipo_campo' => 'Checkbox',
'puntuacion' => 50,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
//Respuesta 9
[
'nombre' => '',
'pregunta_id' => 9,
'orden' => 1,
'tipo_campo' => 'Moneda',
'puntuacion' => null,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
//Respuesta 10
[
'nombre' => '',
'pregunta_id' => 10,
'orden' => 1,
'tipo_campo' => 'Email',
'puntuacion' => null,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
//Respuesta 11
[
'nombre' => '',
'pregunta_id' => 11,
'orden' => 1,
'tipo_campo' => 'Fecha',
'puntuacion' => null,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
]);
}
}

View File

@@ -0,0 +1,402 @@
<?php
use Carbon\Carbon;
use Illuminate\Database\Seeder;
class RespuestasEmpresarialTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('respuestas_empresarial')->insert([
//Respuesta 1
[
'nombre' => 'Si',
'pregunta_id' => 1,
'orden' => 1,
'tipo_campo' => 'Checkbox',
'puntuacion' => 100,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'No',
'pregunta_id' => 1,
'orden' => 2,
'tipo_campo' => 'Checkbox',
'puntuacion' => 50,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
//Respuesta 2
[
'nombre' => 'Si',
'pregunta_id' => 2,
'orden' => 1,
'tipo_campo' => 'Checkbox',
'puntuacion' => 100,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'No',
'pregunta_id' => 2,
'orden' => 2,
'tipo_campo' => 'Checkbox',
'puntuacion' => 50,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
//Respuesta 3
[
'nombre' => 'Excelente',
'pregunta_id' => 3,
'orden' => 1,
'tipo_campo' => 'Checkbox',
'puntuacion' => 100,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Bueno',
'pregunta_id' => 3,
'orden' => 2,
'tipo_campo' => 'Checkbox',
'puntuacion' => 80,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Regular',
'pregunta_id' => 3,
'orden' => 3,
'tipo_campo' => 'Checkbox',
'puntuacion' => 60,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Malo',
'pregunta_id' => 3,
'orden' => 4,
'tipo_campo' => 'Checkbox',
'puntuacion' => 40,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Pésimo',
'pregunta_id' => 3,
'orden' => 5,
'tipo_campo' => 'Checkbox',
'puntuacion' => 20,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
//Respuesta 4
[
'nombre' => 'Si',
'pregunta_id' => 4,
'orden' => 1,
'tipo_campo' => 'Checkbox',
'puntuacion' => 100,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'No',
'pregunta_id' => 4,
'orden' => 2,
'tipo_campo' => 'Checkbox',
'puntuacion' => 50,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
//Respuesta 5
[
'nombre' => 'Excelente',
'pregunta_id' => 5,
'orden' => 1,
'tipo_campo' => 'Checkbox',
'puntuacion' => 100,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Bueno',
'pregunta_id' => 5,
'orden' => 2,
'tipo_campo' => 'Checkbox',
'puntuacion' => 80,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Regular',
'pregunta_id' => 5,
'orden' => 3,
'tipo_campo' => 'Checkbox',
'puntuacion' => 60,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Malo',
'pregunta_id' => 5,
'orden' => 4,
'tipo_campo' => 'Checkbox',
'puntuacion' => 40,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Pésimo',
'pregunta_id' => 5,
'orden' => 5,
'tipo_campo' => 'Checkbox',
'puntuacion' => 20,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
//Respuesta 6
[
'nombre' => 'Excelente',
'pregunta_id' => 6,
'orden' => 1,
'tipo_campo' => 'Checkbox',
'puntuacion' => 100,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Bueno',
'pregunta_id' => 6,
'orden' => 2,
'tipo_campo' => 'Checkbox',
'puntuacion' => 80,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Regular',
'pregunta_id' => 6,
'orden' => 3,
'tipo_campo' => 'Checkbox',
'puntuacion' => 60,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Malo',
'pregunta_id' => 6,
'orden' => 4,
'tipo_campo' => 'Checkbox',
'puntuacion' => 40,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Pésimo',
'pregunta_id' => 6,
'orden' => 5,
'tipo_campo' => 'Checkbox',
'puntuacion' => 20,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
//Respuesta 7
[
'nombre' => 'Excelente',
'pregunta_id' => 7,
'orden' => 1,
'tipo_campo' => 'Checkbox',
'puntuacion' => 100,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Bueno',
'pregunta_id' => 7,
'orden' => 2,
'tipo_campo' => 'Checkbox',
'puntuacion' => 80,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Regular',
'pregunta_id' => 7,
'orden' => 3,
'tipo_campo' => 'Checkbox',
'puntuacion' => 60,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Malo',
'pregunta_id' => 7,
'orden' => 4,
'tipo_campo' => 'Checkbox',
'puntuacion' => 40,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Pésimo',
'pregunta_id' => 7,
'orden' => 5,
'tipo_campo' => 'Checkbox',
'puntuacion' => 20,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
//Respuesta 8
[
'nombre' => 'Si',
'pregunta_id' => 8,
'orden' => 1,
'tipo_campo' => 'Checkbox',
'puntuacion' => 100,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'No',
'pregunta_id' => 8,
'orden' => 2,
'tipo_campo' => 'Checkbox',
'puntuacion' => 50,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
//Respuesta 9
[
'nombre' => 'Excelente',
'pregunta_id' => 9,
'orden' => 1,
'tipo_campo' => 'Checkbox',
'puntuacion' => 100,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Bueno',
'pregunta_id' => 9,
'orden' => 2,
'tipo_campo' => 'Checkbox',
'puntuacion' => 80,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Regular',
'pregunta_id' => 9,
'orden' => 3,
'tipo_campo' => 'Checkbox',
'puntuacion' => 60,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Malo',
'pregunta_id' => 9,
'orden' => 4,
'tipo_campo' => 'Checkbox',
'puntuacion' => 40,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Pésimo',
'pregunta_id' => 9,
'orden' => 5,
'tipo_campo' => 'Checkbox',
'puntuacion' => 20,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
//Respuesta 10
[
'nombre' => '10-9',
'pregunta_id' => 10,
'orden' => 1,
'tipo_campo' => 'Checkbox',
'puntuacion' => 100,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => '8-7',
'pregunta_id' => 10,
'orden' => 2,
'tipo_campo' => 'Checkbox',
'puntuacion' => 80,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => '6-5',
'pregunta_id' => 10,
'orden' => 3,
'tipo_campo' => 'Checkbox',
'puntuacion' => 60,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => '4-3',
'pregunta_id' => 10,
'orden' => 4,
'tipo_campo' => 'Checkbox',
'puntuacion' => 40,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => '2-1',
'pregunta_id' => 10,
'orden' => 5,
'tipo_campo' => 'Checkbox',
'puntuacion' => 20,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
//Respuesta 11
[
'nombre' => '',
'pregunta_id' => 11,
'orden' => 1,
'tipo_campo' => 'Email',
'puntuacion' => null,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
//Respuesta 12
[
'nombre' => '',
'pregunta_id' => 12,
'orden' => 1,
'tipo_campo' => 'Fecha',
'puntuacion' => null,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
]);
}
}

View File

@@ -0,0 +1,76 @@
<?php
use Carbon\Carbon;
use Illuminate\Database\Seeder;
class RolesTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('roles')->insert([
[
'slug' => 'Atención a cliente',
'name' => 'Atención a cliente',
'movil' => 0,
'web' => 1,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'slug' => 'Administradores',
'name' => 'Administradores',
'movil' => 0,
'web' => 1,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'slug' => 'Supervisor de operadores',
'name' => 'Supervisor de operadores',
'movil' => 1,
'web' => 1,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'slug' => 'Asesor de operaciones',
'name' => 'Asesor de operaciones',
'movil' => 1,
'web' => 0,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'slug' => 'Gerencial',
'name' => 'Gerencial',
'movil' => 0,
'web' => 1,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'slug' => 'Auxiliar de operaciones',
'name' => 'Auxiliar de operaciones',
'movil' => 0,
'web' => 0,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
]);
}
}

View File

@@ -0,0 +1,158 @@
<?php
use Carbon\Carbon;
use Illuminate\Database\Seeder;
class ServiciosTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('cat_servicios')->insert([
[
'nombre' => 'Barrido Mecanizado',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Desazolve De Fosa Séptica',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Destape',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Detección De Fuga De Agua',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Des-Incrustación De Chicle',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Lavado A Presión De Agua',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Lavado A Vapor',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Limpieza De Aljibe',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Limpieza De Biodigestor',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Limpieza De Cárcamo',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Limpieza De Drenaje',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Limpieza De Drenaje Sanitaria Y Pluvial',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Limpieza De Drenaje Pluvial',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Limpieza De Drenaje Y Trampas De Grasa',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Limpieza De Drenaje Y Trampa De Lodo',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Limpieza De Drenaje Y Video Inspección',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Limpieza Y Desazolve De Noria',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Limpieza De Drenaje Y Pozos De Visita',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Limpieza De Tanque De Grasa',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Limpieza De Trampa De Grasa',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Limpieza De Trampa De Lodo',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Limpieza De Pozo Tormenta',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Localización De Registros',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Retiro De Líquidos Lixiviados',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Restregado De Pisos',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Succión',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Sanitización',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Video Inspección De Tubería De Drenaje',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
]);
}
}

View File

@@ -0,0 +1,111 @@
<?php
use Illuminate\Database\Seeder;
use Carbon\Carbon;
class SolicitudesServicioTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run(Faker\Generator $faker)
{
for ($i = 1; $i <= 50; $i++){
$cliente_id = $faker->numberBetween(1,50);
$domicilio = \App\Models\ClienteDomicilio::where('cliente_id', $cliente_id)->first();
$operador = \App\Models\User::where('tipo_empleado_id', 2)->inRandomOrder()->first();
$fecha_actual = Carbon::now();
$y = $fecha_actual->format('Y');
$m = $fecha_actual->format('m');
$d = $faker->numberBetween(1,30);
$hora = $faker->time($format = 'H:i:s');
$fecha = "$y-$m-$d $hora";
$data_solicitud_enc = [
'forma_pago_id' => $faker->numberBetween(1,6),
'fecha_agenda' => $fecha,
'usuario_agenda_id' => 1,
'cliente_id' => $cliente_id,
'cliente_domicilio_id' => $domicilio->id,
'sucursal_id' => $operador->sucursal_id
];
$solicitud = \App\Models\ServicioEnc::create($data_solicitud_enc);
$data_solicitud_det = [
'servicio_enc_id' => $solicitud->id,
'servicio_id' => $faker->numberBetween(1,28),
'estatus_servicio_id' => $faker->numberBetween(1,7),
'tipo_servicio_id' => $faker->numberBetween(1,2),
'fecha_solicitud' => $fecha,
'duracion' => '02:30:00',
'definido_cliente' => $faker->numberBetween(0,1),
'costo_servicio' => $faker->numberBetween(1000,5000).'.'.$faker->numberBetween(10,99),
'operador_id' => $operador->id,
'vehiculo_id' => 1,
'auxiliar_1' => $faker->numberBetween(6,7),
'auxiliar_2' => $faker->numberBetween(8,9)
];
$solicitud_det = \App\Models\ServicioDet::create($data_solicitud_det);
$now = Carbon::now()->toDateTimeString();
$data_solicitud_progreso = [
'servicio_enc_id' => $solicitud->id,
'servicio_det_id' => $solicitud_det->id,
'fecha_ini_servidor' => $now,
'fecha_fin_servidor' => $now,
'fecha_ini_celular' => $now,
'fecha_fin_celular' => $now,
'duracion' => '02:30:00',
'lat_ini' => $faker->latitude($min = 21, $max = 26),
'lng_ini' => $faker->longitude($min = -101, $max = -106),
'lat_fin' => $faker->latitude($min = 21, $max = 26),
'lng_fin' => $faker->longitude($min = -101, $max = -106),
'comentarios' => 'Todo bien.'
];
$solicitud_progreso = \App\Models\ServicioProgreso::create($data_solicitud_progreso);
for($j=1; $j<=3; $j++){
if($j == 1){
$etapa = 'Inicio';
}
if($j == 2){
$etapa = 'Proceso';
}
if($j == 2){
$etapa = 'Final';
}
$soli = $solicitud->id;
$servi = $solicitud_det->id;
$data_solicitud_evidencia = [
'servicio_progreso_id' => $solicitud_progreso->id,
'uuid' => $faker->sha256,
'etapa' => $etapa,
'lat' => $faker->latitude($min = 21, $max = 26),
'lng' => $faker->longitude($min = -101, $max = -106)
];
$evidencia = \App\Models\ServicioEvidencia::create($data_solicitud_evidencia);
$evi = $evidencia->id;
$evidencia->update(['imagen' => "solicitud_".$soli."_servicio_".$servi."_evidencia_id_".$evi.".jpeg"]);
}
}
}
}

View File

@@ -0,0 +1,30 @@
<?php
use Carbon\Carbon;
use Illuminate\Database\Seeder;
class SucursalesTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('sucursales')->insert([
[
'nombre' => 'Culiacán',
'calle' => 'Pascual Orozco',
'num_ext' => '1949',
'colonia' => 'Nuevo Culiacán',
'cp' => '80170',
'telefono' => '6677139250',
'gerente' => 'Gabriel Salazar',
'encargado' => 'Brenda Tamayo',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
]
]);
}
}

View File

@@ -0,0 +1,60 @@
<?php
use Carbon\Carbon;
use Illuminate\Database\Seeder;
class TiposEmpleadosTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('tipos_empleados')->insert([
[
'nombre' => 'Administradores',
'login' => 1,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Asesor de Operaciones',
'login' => 1,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Auxiliar de Operaciones 1',
'login' => 0,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Auxiliar de Operaciones 2',
'login' => 0,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Atención a cliente',
'login' => 1,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Supervisor de operadores',
'login' => 1,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Gerencial',
'login' => 1,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
]);
}
}

View File

@@ -0,0 +1,29 @@
<?php
use Carbon\Carbon;
use Illuminate\Database\Seeder;
class TiposServiciosTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('cat_tipos_servicios')->insert([
[
'nombre' => 'Domestico',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'Empresarial',
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
]);
}
}

View File

@@ -0,0 +1,87 @@
<?php
use Carbon\Carbon;
use Illuminate\Database\Seeder;
class TiposVehiculosTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('cat_tipos_vehiculos')->insert([
[
'nombre' => 'EDUCTOR',
'objetivo_mensual' => 840,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'VACTOR',
'objetivo_mensual' => 360,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'BARREDORA TENNAT',
'objetivo_mensual' => 0,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'HIDROLAVADORA',
'objetivo_mensual' => 0,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'RESTREGADORA TENNAN M.T20 ',
'objetivo_mensual' => 0,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'CAMIÓN HINO',
'objetivo_mensual' => 360,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],[
'nombre' => 'CALDERA',
'objetivo_mensual' => 0,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],[
'nombre' => 'QUITA-CHICLES',
'objetivo_mensual' => 0,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],[
'nombre' => 'BARREDORA ELGIN',
'objetivo_mensual' => 0,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'BARREDORA TENNAN M.6400-5696 ',
'objetivo_mensual' => 0,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'CAMIÓN VACTOR',
'objetivo_mensual' => 0,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
],
[
'nombre' => 'BARREDORA TENNAN 6540 ',
'objetivo_mensual' => 0,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
]
]);
}
}

View File

@@ -0,0 +1,247 @@
<?php
use Carbon\Carbon;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
class UsersTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
/*$atencion =
[
'email' => 'atencionclientes@mail.com',
'password' => bcrypt('secret'),
'nombre' => 'Atención',
'apellido_materno' => 'Clientes',
'apellido_paterno'=> 'Clientes',
'telefono' => '6677889900',
'tipo_empleado_id' => 5,
'sucursal_id' => 1,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
];
$user_atencion = \App\Models\User::create($atencion);
\App\Models\RolUser::create([
'user_id' => $user_atencion->id,
'role_id' => 1,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
]);*/
$admin =
[
'email' => 'administrador@mail.com',
'password' => bcrypt('secret'),
'nombre' => 'Administrador',
'apellido_materno' => 'Administrador',
'apellido_paterno'=> 'Administrador',
'telefono' => '6677889900',
'tipo_empleado_id' => 1,
'sucursal_id' => 1,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
];
$user_admin = \App\Models\User::create($admin);
\App\Models\RolUser::create([
'user_id' => $user_admin->id,
'role_id' => 2,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
]);
/*$supervisor =
[
'email' => 'supervisor@mail.com',
'password' => bcrypt('secret'),
'nombre' => 'Supervisor',
'apellido_materno' => 'Operadores',
'apellido_paterno'=> 'Operadores',
'telefono' => '6677889900',
'tipo_empleado_id' => 1,
'sucursal_id' => 1,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
];
$user_super = \App\Models\User::create($supervisor);
\App\Models\RolUser::create([
'user_id' => $user_super->id,
'role_id' => 3,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
]);
$operador =
[
'email' => 'operador@mail.com',
'password' => bcrypt('secret'),
'nombre' => 'Operador',
'apellido_materno' => 'Operador',
'apellido_paterno'=> 'Operador',
'telefono' => '6677889900',
'tipo_empleado_id' => 2,
'sucursal_id' => 1,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
];
$user_operador = \App\Models\User::create($operador);
\App\Models\RolUser::create([
'user_id' => $user_operador->id,
'role_id' => 4,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
]);
$gerente =
[
'email' => 'gerente@mail.com',
'password' => bcrypt('secret'),
'nombre' => 'Gerente',
'apellido_materno' => 'Gerente',
'apellido_paterno'=> 'Gerente',
'telefono' => '6677889900',
'tipo_empleado_id' => 1,
'sucursal_id' => 1,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
];
$user_gerente = \App\Models\User::create($gerente);
\App\Models\RolUser::create([
'user_id' => $user_gerente->id,
'role_id' => 5,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
]);
$auxiliar1 =
[
'email' => 'auxiliar1@mail.com',
'password' => bcrypt('secret'),
'nombre' => 'Auxiliar 1',
'apellido_materno' => 'Auxiliar',
'apellido_paterno'=> 'Auxiliar',
'telefono' => '6677889900',
'tipo_empleado_id' => 3,
'sucursal_id' => 1,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
];
$user_auxiliar_1 = \App\Models\User::create($auxiliar1);
\App\Models\RolUser::create([
'user_id' => $user_auxiliar_1->id,
'role_id' => 6,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
]);
$auxiliar2 =
[
'email' => 'auxiliar2@mail.com',
'password' => bcrypt('secret'),
'nombre' => 'Auxiliar 2',
'apellido_materno' => 'Auxiliar',
'apellido_paterno'=> 'Auxiliar',
'telefono' => '6677889900',
'tipo_empleado_id' => 4,
'sucursal_id' => 1,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
];
$user_auxiliar_2 = \App\Models\User::create($auxiliar2);
\App\Models\RolUser::create([
'user_id' => $user_auxiliar_2->id,
'role_id' => 6,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
]);
$auxiliar3 =
[
'email' => 'auxiliar3@mail.com',
'password' => bcrypt('secret'),
'nombre' => 'Auxiliar 3',
'apellido_materno' => 'Auxiliar',
'apellido_paterno'=> 'Auxiliar',
'telefono' => '6677889900',
'tipo_empleado_id' => 3,
'sucursal_id' => 1,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
];
$user_auxiliar_3 = \App\Models\User::create($auxiliar3);
\App\Models\RolUser::create([
'user_id' => $user_auxiliar_3->id,
'role_id' => 6,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
]);
$auxiliar4 =
[
'email' => 'auxiliar4@mail.com',
'password' => bcrypt('secret'),
'nombre' => 'Auxiliar 4',
'apellido_materno' => 'Auxiliar',
'apellido_paterno'=> 'Auxiliar',
'telefono' => '6677889900',
'tipo_empleado_id' => 4,
'sucursal_id' => 1,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
];
$user_auxiliar_4 = \App\Models\User::create($auxiliar4);
\App\Models\RolUser::create([
'user_id' => $user_auxiliar_4->id,
'role_id' => 6,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
]);
$operador =
[
'email' => 'operador2@mail.com',
'password' => bcrypt('secret'),
'nombre' => 'Operador2',
'apellido_materno' => 'Operador2',
'apellido_paterno'=> 'Operador2',
'telefono' => '6677889900',
'tipo_empleado_id' => 2,
'sucursal_id' => 2,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
];
$user_operador = \App\Models\User::create($operador);
\App\Models\RolUser::create([
'user_id' => $user_operador->id,
'role_id' => 4,
'created_at' => Carbon::now()->toDateTimeString(),
'updated_at' => Carbon::now()->toDateTimeString(),
]);*/
}
}

View File

@@ -0,0 +1,20 @@
<?php
use Illuminate\Database\Seeder;
class VehiculosSucursalesTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$vehiculos = \App\Models\Vehiculo::get();
foreach ($vehiculos as $v){
\App\Models\VehiculoSucursal::create(['vehiculo_id' => $v->id, 'sucursal_id' => 1]);
}
}
}

Some files were not shown because too many files have changed in this diff Show More