diff --git a/.env.example b/.env.example deleted file mode 100644 index 7340d17..0000000 --- a/.env.example +++ /dev/null @@ -1,52 +0,0 @@ -APP_NAME=Laravel -APP_ENV=local -APP_KEY= -APP_DEBUG=true -APP_URL=http://localhost - -LOG_CHANNEL=stack -LOG_DEPRECATIONS_CHANNEL=null -LOG_LEVEL=debug - -DB_CONNECTION=mysql -DB_HOST=127.0.0.1 -DB_PORT=3306 -DB_DATABASE=prueba -DB_USERNAME=root -DB_PASSWORD= - -BROADCAST_DRIVER=log -CACHE_DRIVER=file -FILESYSTEM_DISK=local -QUEUE_CONNECTION=sync -SESSION_DRIVER=file -SESSION_LIFETIME=120 - -MEMCACHED_HOST=127.0.0.1 - -REDIS_HOST=127.0.0.1 -REDIS_PASSWORD=null -REDIS_PORT=6379 - -MAIL_MAILER=smtp -MAIL_HOST=mailhog -MAIL_PORT=1025 -MAIL_USERNAME=null -MAIL_PASSWORD=null -MAIL_ENCRYPTION=null -MAIL_FROM_ADDRESS="hello@example.com" -MAIL_FROM_NAME="${APP_NAME}" - -AWS_ACCESS_KEY_ID= -AWS_SECRET_ACCESS_KEY= -AWS_DEFAULT_REGION=us-east-1 -AWS_BUCKET= -AWS_USE_PATH_STYLE_ENDPOINT=false - -PUSHER_APP_ID= -PUSHER_APP_KEY= -PUSHER_APP_SECRET= -PUSHER_APP_CLUSTER=mt1 - -MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" -MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" diff --git a/.vs/PIS-proyect/FileContentIndex/c99f5113-1122-4638-b05d-1f66fd627d31.vsidx b/.vs/PIS-proyect/FileContentIndex/c99f5113-1122-4638-b05d-1f66fd627d31.vsidx deleted file mode 100644 index 18aba43..0000000 Binary files a/.vs/PIS-proyect/FileContentIndex/c99f5113-1122-4638-b05d-1f66fd627d31.vsidx and /dev/null differ diff --git a/.vs/PIS-proyect/FileContentIndex/read.lock b/.vs/PIS-proyect/FileContentIndex/read.lock deleted file mode 100644 index e69de29..0000000 diff --git a/.vs/PIS-proyect/config/applicationhost.config b/.vs/PIS-proyect/config/applicationhost.config deleted file mode 100644 index 0d88f0d..0000000 --- a/.vs/PIS-proyect/config/applicationhost.config +++ /dev/null @@ -1,1016 +0,0 @@ - - - - - - - -
-
-
-
-
-
-
-
- - - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
- -
-
-
-
-
-
- -
-
-
-
-
- -
-
-
- -
-
- -
-
- -
-
-
- - -
-
-
-
-
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/.vs/PIS-proyect/v17/.suo b/.vs/PIS-proyect/v17/.suo deleted file mode 100644 index 29dbfd4..0000000 Binary files a/.vs/PIS-proyect/v17/.suo and /dev/null differ diff --git a/.vs/ProjectSettings.json b/.vs/ProjectSettings.json deleted file mode 100644 index f8b4888..0000000 --- a/.vs/ProjectSettings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "CurrentProjectSetting": null -} \ No newline at end of file diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json deleted file mode 100644 index 38f11aa..0000000 --- a/.vs/VSWorkspaceState.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "ExpandedNodes": [ - "", - "\\app", - "\\app\\Models", - "\\app\\Providers" - ], - "SelectedNode": "\\app\\Providers\\AppServiceProvider.php", - "PreviewInSolutionExplorer": false -} \ No newline at end of file diff --git a/.vs/phptasks.json b/.vs/phptasks.json deleted file mode 100644 index e6e3456..0000000 --- a/.vs/phptasks.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "tasks": [] -} \ No newline at end of file diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite deleted file mode 100644 index ef3f236..0000000 Binary files a/.vs/slnx.sqlite and /dev/null differ diff --git a/app/Http/Controllers/Api/PlanController.php b/app/Http/Controllers/Api/PlanController.php new file mode 100644 index 0000000..307f867 --- /dev/null +++ b/app/Http/Controllers/Api/PlanController.php @@ -0,0 +1,206 @@ +validate([ + "estandar_id"=> "required|integer", + "nombre"=>"required|max:255", + "codigo"=> "required|max:11", + "fuentes"=>"required", + "fuentes.*.descripcion"=> "required", + "problemas_oportunidades"=>"required", + "problemas_oportunidades.*.descripcion"=> "required", + "causas_raices"=>"required", + "causas_raices.*.descripcion"=> "required", + "oportunidad_plan"=>"required|max:255", + "acciones_mejoras"=>"required", + "acciones_mejoras.*.descripcion"=> "required", + "semestre_ejecucion"=>"required|max:7", + "duracion"=> "required|integer", + "recursos"=>"required", + "recursos.*.descripcion"=> "required", + "metas"=>"required", + "metas.*.descripcion"=> "required", + "responsables"=>"required", + "responsables.*.nombre"=> "required", + "observaciones"=>"required", + "observaciones.*.descripcion"=> "required", + "estado"=> "required|max:30", + "evidencias_planes_mejoras"=>"required", + "evidencias_planes_mejoras.*.codigo"=> "required", + "evidencias_planes_mejoras.*.denominacion"=> "required", + "evidencias_planes_mejoras.*.encargado_id"=> "required", + "evidencias_planes_mejoras.*.adjunto"=> "required", + "evaluacion_eficacia"=> "required|boolean", + "avance"=> "required|integer", + ]); + + $id_user = auth()->user()->id; + $plan = new plan(); + + $plan->id_user = $id_user; + $plan->id_estandar = $request->estandar_id; //actualizar a estandar_id + + $plan->nombre = $request->nombre; + $plan->codigo = $request->codigo; + $plan->oportunidad_plan = $request->oportunidad_plan; + $plan->semestre_ejecucion = $request->semestre_ejecucion; + $plan->duracion = $request->duracion; + $plan->estado = $request->estado; + $plan->evaluacion_eficacia = $request->evaluacion_eficacia; + $plan->avance = $request->avance; + $plan->save(); + + $id_plan = $plan->id; + + foreach($request->fuentes as $fuente){ + $fuentes_aux = new Fuentes(); + $fuentes_aux->descripcion = $fuente["descripcion"]; + $fuentes_aux->id_plan = $id_plan; + $fuentes_aux->save(); + } + + foreach($request->problemas_oportunidades as $problema){ + $problemas_oportunidades_aux = new ProblemasOportunidades(); + $problemas_oportunidades_aux->descripcion = $problema["descripcion"]; + $problemas_oportunidades_aux->id_plan = $id_plan; + $problemas_oportunidades_aux->save(); + } + + foreach($request->causas_raices as $causa){ + $causas_raices_aux = new CausasRaices(); + $causas_raices_aux->descripcion = $causa["descripcion"]; + $causas_raices_aux->id_plan = $id_plan; + $causas_raices_aux->save(); + } + + foreach($request->acciones_mejoras as $accion){ + $acciones_mejoras_aux = new AccionesMejoras(); + $acciones_mejoras_aux->descripcion = $accion["descripcion"]; + $acciones_mejoras_aux->id_plan = $id_plan; + $acciones_mejoras_aux->save(); + } + + foreach($request->recursos as $recurso){ + $recursos_aux = new Recursos(); + $recursos_aux->descripcion = $recurso["descripcion"]; + $recursos_aux->id_plan = $id_plan; + $recursos_aux->save(); + } + + foreach($request->metas as $meta){ + $meta_aux = new Metas(); + $meta_aux->descripcion = $meta["descripcion"]; + $meta_aux->id_plan = $id_plan; + $meta_aux->save(); + } + + foreach($request->observaciones as $observacion){ + $observaciones_aux = new Observaciones(); + $observaciones_aux->descripcion = $observacion["descripcion"]; + $observaciones_aux->id_plan = $id_plan; + $observaciones_aux->save(); + } + + /* + $evidencias_planes_mejoras = new Evidencias(); Falta completar + $responsables = new Responsables(); Falta completar + */ + + return response([ + "status" => 1, + "message" => "!Plan de mejora creado exitosamente", + ]); + } + + public function listPlan(){ + $planAll = plan::select('plans.id', 'plans.codigo','plans.avance','plans.estado','estandars.name as estandar_name','users.name as user_name') + ->join('estandars', 'plans.id_estandar', '=', 'estandars.id') + ->join('users', 'plans.id_user', '=', 'users.id') + ->orderBy('id','asc') + ->get(); + + return response([ + "status" => 1, + "message" => "!Lista de planes de mejora", + "data" => $planAll, + ]); + } + + public function updatePlan(Request $request, $id){ + $id_user = auth()->user()->id; + if(plan::where(["id_user"=>$id_user,"id"=>$id])->exists()){ + $plan = plan::find($id); + $plan->name = isset($request->name) ? $request->name : $plan->title; + $plan->save(); + return response([ + "status" => 1, + "message" => "!Plan de mejora actualizado", + "data" => $plan, + ]); + } + else{ + return response([ + "status" => 0, + "message" => "!No se encontro el plan o no esta autorizado", + ],404); + } + + } + + public function deletePlan($id){ + $id_user = auth()->user()->id; + if(plan::where(["id"=>$id,"id_user"=>$id_user])->exists()){ + $plan = plan::where(["id"=>$id,"id_user"=>$id_user])->first(); + $plan->delete(); + return response([ + "status" => 1, + "message" => "!Plan de mejora eliminado", + ]); + } + else{ + return response([ + "status" => 0, + "message" => "!No se encontro el plan de mejora o no esta autorizado", + ],404); + } + } + + + public function showPlan($id){ + if(plan::where("id",$id)->exists()){ + $plan = plan::find($id); + return response([ + "status" => 1, + "message" => "!plan", + "data" => $plan, + ]); + } + else{ + return response([ + "status" => 0, + "message" => "!No se encontro el plan de mejora", + ],404); + } + + } +} diff --git a/app/Models/AccionesMejoras.php b/app/Models/AccionesMejoras.php new file mode 100644 index 0000000..046c4cc --- /dev/null +++ b/app/Models/AccionesMejoras.php @@ -0,0 +1,21 @@ +belongsTo(plan::class,'id_plan'); + } +} diff --git a/app/Models/CausasRaices.php b/app/Models/CausasRaices.php new file mode 100644 index 0000000..7b24f4a --- /dev/null +++ b/app/Models/CausasRaices.php @@ -0,0 +1,21 @@ +belongsTo(plan::class,'id_plan'); + } +} diff --git a/app/Models/Estandar.php b/app/Models/Estandar.php index 31bc854..784e6a7 100644 --- a/app/Models/Estandar.php +++ b/app/Models/Estandar.php @@ -10,7 +10,6 @@ class Estandar extends Model use HasFactory; public $timestamps = false; - protected $table ='estandars'; protected $fillable = [ 'name', @@ -21,9 +20,7 @@ class Estandar extends Model return $this->belongsTo(User::class,'id_user'); } public function plans(){ - return $this->hasMany(Plan::class,'id'); - } - public function evidencias(){ - return $this->hasMany(Evidencia::class,'id'); + return $this->hasMany(plan::class,'id'); } + } diff --git a/app/Models/evidencia.php b/app/Models/Evidencias.php similarity index 76% rename from app/Models/evidencia.php rename to app/Models/Evidencias.php index c53d8ae..8193535 100644 --- a/app/Models/evidencia.php +++ b/app/Models/Evidencias.php @@ -5,7 +5,7 @@ namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; -class evidencia extends Model +class Evidencias extends Model { use HasFactory; @@ -23,8 +23,8 @@ class evidencia extends Model public function users(){ return $this->belongsTo(User::class,'id_user'); } - public function estandars(){ - return $this->belongsTo(Estandar::class,'id_estandar'); + public function plans(){ + return $this->belongsTo(plan::class,'id_plan'); } } diff --git a/app/Models/Fuentes.php b/app/Models/Fuentes.php new file mode 100644 index 0000000..d255441 --- /dev/null +++ b/app/Models/Fuentes.php @@ -0,0 +1,21 @@ +belongsTo(plan::class,'id_plan'); + } +} diff --git a/app/Models/Metas.php b/app/Models/Metas.php new file mode 100644 index 0000000..5e3531c --- /dev/null +++ b/app/Models/Metas.php @@ -0,0 +1,21 @@ +belongsTo(plan::class,'id_plan'); + } +} diff --git a/app/Models/Observaciones.php b/app/Models/Observaciones.php new file mode 100644 index 0000000..4bdef09 --- /dev/null +++ b/app/Models/Observaciones.php @@ -0,0 +1,21 @@ +belongsTo(plan::class,'id_plan'); + } +} diff --git a/app/Models/ProblemasOportunidades.php b/app/Models/ProblemasOportunidades.php new file mode 100644 index 0000000..fb07ebc --- /dev/null +++ b/app/Models/ProblemasOportunidades.php @@ -0,0 +1,21 @@ +belongsTo(plan::class,'id_plan'); + } +} diff --git a/app/Models/Recursos.php b/app/Models/Recursos.php new file mode 100644 index 0000000..ecce106 --- /dev/null +++ b/app/Models/Recursos.php @@ -0,0 +1,21 @@ +belongsTo(plan::class,'id_plan'); + } +} diff --git a/app/Models/Responsables.php b/app/Models/Responsables.php new file mode 100644 index 0000000..b8462da --- /dev/null +++ b/app/Models/Responsables.php @@ -0,0 +1,22 @@ +hasmany(ResponsablesPlanesMejora::class,'id'); + } + +} diff --git a/app/Models/ResponsablesPlanesMejora.php b/app/Models/ResponsablesPlanesMejora.php new file mode 100644 index 0000000..975dc79 --- /dev/null +++ b/app/Models/ResponsablesPlanesMejora.php @@ -0,0 +1,20 @@ +belongsTo(Responsables::class,'id_responsable'); + } + public function plans(){ + return $this->belongsTo(plan::class,'id_plan'); + } +} diff --git a/app/Models/User.php b/app/Models/User.php index 736249b..c8eeade 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -33,5 +33,4 @@ class User extends Authenticatable public function evidencias(){ return $this->hasMany(Evidencia::class,'id'); } - } diff --git a/app/Models/plan.php b/app/Models/plan.php index 5beb005..93043a2 100644 --- a/app/Models/plan.php +++ b/app/Models/plan.php @@ -13,13 +13,13 @@ class plan extends Model protected $table ='plans'; protected $fillable = [ 'codigo', - 'name', - 'oportunidad', - 'semestre', + 'nombre', + 'oportunidad_plan', + 'semestre_ejecucion', 'duracion', 'estado', 'avance', - 'evaluacion', + 'evaluacion_eficacia', ]; @@ -30,5 +30,31 @@ class plan extends Model public function estandars(){ return $this->belongsTo(Estandar::class,'id_estandar'); } + public function fuentes(){ + return $this->hasMany(Fuentes::class,'id'); + } + public function metas(){ + return $this->hasMany(Metas::class,'id'); + } + public function recursos(){ + return $this->hasMany(Recursos::class,'id'); + } + public function observaciones(){ + return $this->hasMany(Observaciones::class,'id'); + } + public function problemasOportunidade(){ + return $this->hasMany(ProblemasOportunidades::class,'id'); + } + public function accionesMejoras(){ + return $this->hasMany(AccionesMejoras::class,'id'); + } + public function causasRaices(){ + return $this->hasMany(causasRaices::class,'id'); + } + public function responsablesplanesmejora(){ + return $this->hasMany(ResponsablesPlanesMejora::class,'id'); + } + // + } diff --git a/database/migrations/2022_06_14_000526_create_estandars_table.php b/database/migrations/2022_06_14_000526_create_estandars_table.php index 630002a..1f4dbaf 100644 --- a/database/migrations/2022_06_14_000526_create_estandars_table.php +++ b/database/migrations/2022_06_14_000526_create_estandars_table.php @@ -15,7 +15,7 @@ return new class extends Migration { Schema::create('estandars', function (Blueprint $table) { $table->id(); - $table->string('name'); + $table->string('name'); //cambiar el name por nombre //$table->foreign('id_user')->references('id')->on('users'); $table->foreignId('id_user') ->constrained('users'); diff --git a/database/migrations/2022_07_07_012118_create_plans_table.php b/database/migrations/2022_07_07_012118_create_plans_table.php index 1213777..80be237 100644 --- a/database/migrations/2022_07_07_012118_create_plans_table.php +++ b/database/migrations/2022_07_07_012118_create_plans_table.php @@ -16,16 +16,18 @@ return new class extends Migration Schema::create('plans', function (Blueprint $table) { $table->id(); $table->string('codigo', 11); - $table->string('name'); - $table->string('oportunidad'); - $table->string('semestre', 6); + $table->string('nombre'); + $table->string('oportunidad_plan'); + $table->string('semestre_ejecucion', 7); + $table->integer('avance'); $table->integer('duracion'); - $table->string('estado', 20); - $table->boolean('eficacia'); + $table->string('estado', 30); + $table->boolean('evaluacion_eficacia'); $table->foreignId('id_estandar') ->constrained('estandars'); $table->foreignId('id_user') ->constrained('users'); + }); } diff --git a/database/migrations/2022_07_08_220043_create_evidencias_table.php b/database/migrations/2022_07_08_220043_create_evidencias_table.php index d0d7b06..7d4b5e1 100644 --- a/database/migrations/2022_07_08_220043_create_evidencias_table.php +++ b/database/migrations/2022_07_08_220043_create_evidencias_table.php @@ -17,11 +17,12 @@ return new class extends Migration $table->id(); $table->string('codigo', 16); $table->string('denominacion'); - $table->string('oportunidad'); + $table->string('adjunto'); $table->foreignId('id_user') ->constrained('users'); - $table->foreignId('id_estandar') - ->constrained('estandars'); + $table->foreignId('id_plan') + ->constrained('plans') + ->onDelete('cascade'); }); } diff --git a/database/migrations/2022_07_10_224717_create_fuentes_table.php b/database/migrations/2022_07_10_224717_create_fuentes_table.php new file mode 100644 index 0000000..7be5c7d --- /dev/null +++ b/database/migrations/2022_07_10_224717_create_fuentes_table.php @@ -0,0 +1,35 @@ +id(); + $table->timestamps(); + $table->string('descripcion'); + $table->foreignId('id_plan') + ->constrained('plans') + ->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('fuentes'); + } +}; diff --git a/database/migrations/2022_07_10_231851_create_metas_table.php b/database/migrations/2022_07_10_231851_create_metas_table.php new file mode 100644 index 0000000..41aa462 --- /dev/null +++ b/database/migrations/2022_07_10_231851_create_metas_table.php @@ -0,0 +1,35 @@ +id(); + $table->timestamps(); + $table->string('descripcion'); + $table->foreignId('id_plan') + ->constrained('plans') + ->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('metas'); + } +}; diff --git a/database/migrations/2022_07_10_232224_create_recursos_table.php b/database/migrations/2022_07_10_232224_create_recursos_table.php new file mode 100644 index 0000000..8639c13 --- /dev/null +++ b/database/migrations/2022_07_10_232224_create_recursos_table.php @@ -0,0 +1,35 @@ +id(); + $table->timestamps(); + $table->string('descripcion'); + $table->foreignId('id_plan') + ->constrained('plans') + ->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('recursos'); + } +}; diff --git a/database/migrations/2022_07_10_232552_create_observaciones_table.php b/database/migrations/2022_07_10_232552_create_observaciones_table.php new file mode 100644 index 0000000..24638f1 --- /dev/null +++ b/database/migrations/2022_07_10_232552_create_observaciones_table.php @@ -0,0 +1,35 @@ +id(); + $table->timestamps(); + $table->string('descripcion'); + $table->foreignId('id_plan') + ->constrained('plans') + ->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('observaciones'); + } +}; diff --git a/database/migrations/2022_07_10_233504_create_problemas_oportunidades_table.php b/database/migrations/2022_07_10_233504_create_problemas_oportunidades_table.php new file mode 100644 index 0000000..15460b5 --- /dev/null +++ b/database/migrations/2022_07_10_233504_create_problemas_oportunidades_table.php @@ -0,0 +1,35 @@ +id(); + $table->timestamps(); + $table->string('descripcion'); + $table->foreignId('id_plan') + ->constrained('plans') + ->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('problemas_oportunidades'); + } +}; diff --git a/database/migrations/2022_07_10_233829_create_acciones_mejoras_table.php b/database/migrations/2022_07_10_233829_create_acciones_mejoras_table.php new file mode 100644 index 0000000..b05f1af --- /dev/null +++ b/database/migrations/2022_07_10_233829_create_acciones_mejoras_table.php @@ -0,0 +1,35 @@ +id(); + $table->timestamps(); + $table->string('descripcion'); + $table->foreignId('id_plan') + ->constrained('plans') + ->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('acciones_mejoras'); + } +}; diff --git a/database/migrations/2022_07_10_234105_create_causas_raices_table.php b/database/migrations/2022_07_10_234105_create_causas_raices_table.php new file mode 100644 index 0000000..47c0328 --- /dev/null +++ b/database/migrations/2022_07_10_234105_create_causas_raices_table.php @@ -0,0 +1,35 @@ +id(); + $table->timestamps(); + $table->string('descripcion'); + $table->foreignId('id_plan') + ->constrained('plans') + ->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('causas_raices'); + } +}; diff --git a/database/migrations/2022_07_10_234320_create_responsables_table.php b/database/migrations/2022_07_10_234320_create_responsables_table.php new file mode 100644 index 0000000..9734fb1 --- /dev/null +++ b/database/migrations/2022_07_10_234320_create_responsables_table.php @@ -0,0 +1,32 @@ +id(); + $table->timestamps(); + $table->string('nombre'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('responsables'); + } +}; diff --git a/database/migrations/2022_07_10_234419_create_responsables_planes_mejoras_table.php b/database/migrations/2022_07_10_234419_create_responsables_planes_mejoras_table.php new file mode 100644 index 0000000..d28d540 --- /dev/null +++ b/database/migrations/2022_07_10_234419_create_responsables_planes_mejoras_table.php @@ -0,0 +1,36 @@ +id(); + $table->timestamps(); + $table->foreignId('id_plan') + ->constrained('plans') + ->onDelete('cascade'); + $table->foreignId('id_responsable') + ->constrained('responsables'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('responsables_planes_mejoras'); + } +}; diff --git a/routes/api.php b/routes/api.php index 76c740c..2e65d0e 100644 --- a/routes/api.php +++ b/routes/api.php @@ -4,6 +4,7 @@ use Illuminate\Http\Request; use Illuminate\Support\Facades\Route; use App\Http\Controllers\Api\UserController; use App\Http\Controllers\Api\EstandarController; +use App\Http\Controllers\Api\PlanController; Route::post('register', [UserController::class, 'register']); Route::post('login', [UserController::class, 'login']); @@ -20,13 +21,13 @@ Route::middleware("auth:sanctum")->group (function(){ Route::put('estandar/{id}', [EstandarController::class,'updateEstandar']); Route::delete('estandar/{id}', [EstandarController::class,'deleteEstandar']); - /*Route::controller(EstandarController::class)->group(function(){ - Route::post('estandar/create', 'createEstandar'); - Route::get('estandar/list', 'listEstandar'); - Route::get('estandar/{id}', 'showEstandar'); - Route::put('estandar/update/{id}', 'updateEstandar'); - Route::delete('estandar/delete/{id}', 'deleteEstandar'); - });*/ + //rutas plan + Route::post('plan',[PlanController::class,'createPlan']); + Route::get('plan',[PlanController::class,'listPlan']); + Route::get('plan/{id}',[PlanController::class,'showPlan']); + Route::delete('plan/{id}',[PlanController::class,'deletePlan']); + #Route::put('plan/{id}',[PlanController::class,'updatePlan']); + }); Route::middleware('auth:sanctum')->get('/user', function (Request $request) { diff --git a/routes/web.php b/routes/web.php index b130397..e825498 100644 --- a/routes/web.php +++ b/routes/web.php @@ -12,7 +12,6 @@ use Illuminate\Support\Facades\Route; | contains the "web" middleware group. Now create something great! | */ - Route::get('/', function () { - return view('welcome'); -}); + return ['APP' => 'Sistema Gestor de Calidad de la Escuela de Relaciones Industriales']; +}); \ No newline at end of file