Skip to content

Commit

Permalink
feat(api)!: remove student modality endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanlegranbizarro committed Oct 3, 2024
1 parent 93cd4a3 commit ccb47ab
Show file tree
Hide file tree
Showing 12 changed files with 47 additions and 293 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace App\Annotations\OpenApi\Controllers\StudentResume;

class StudentDetailAnnotation
Expand Down Expand Up @@ -45,6 +46,14 @@ class StudentDetailAnnotation
* type="object",
* @OA\Property(property="subtitle", type="string", example="Full Stack developer en PHP"),
* @OA\Property(
* property="modality",
* type="array",
* @OA\Items(
* type="string",
* example="Remote"
* )
* ),
* @OA\Property(
* property="social_media",
* type="object",
* @OA\Property(property="github", type="string", example="https://github.com/bettie52"),
Expand Down
34 changes: 0 additions & 34 deletions app/Http/Controllers/api/Student/StudentModalityController.php

This file was deleted.

1 change: 1 addition & 0 deletions app/Http/Resources/ResumeResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class ResumeResource extends JsonResource
public function toArray(Request $request): array
{
return [
'modality' => $this->modality,
'subtitle' => $this->subtitle,
'social_media' => [
'github' => $this->github_url,
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Resume.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ public function projects(): BelongsToMany

public function additionalTrainings(): BelongsToMany
{
return $this->belongsToMany(AdditionalTraining::class);
return $this->belongsToMany(AdditionalTraining::class);
}
}
36 changes: 0 additions & 36 deletions app/Service/Student/StudentModalityService.php

This file was deleted.

2 changes: 1 addition & 1 deletion database/factories/ResumeFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function definition(): array
),
'development' => $development,
'about' => $this->faker->paragraph,
'modality' => $this->faker->randomElements(['Presencial', 'Híbrid', 'Remot'], rand(1, 3)),
'modality' => $this->faker->randomElement(['Presencial', 'Híbrid', 'Remot']),
'collaborations_ids' => json_encode($collaborationsIds),
];
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

declare(strict_types=1);

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('resumes', function (Blueprint $table) {
$table->dropColumn('modality');

$table->enum('modality', ['Presencial', 'Remot', 'Híbrid'])->default('Presencial')->after('specialization');
});
}

/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('resumes', function (Blueprint $table) {
$table->dropColumn('modality');

$table->json('modality')->after('specialization')->nullable();
});
}
};
16 changes: 0 additions & 16 deletions routes/api/v1.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
DeleteStudentResumeLanguageController,
GetStudentImageController,
StudentAdditionalTrainingListController,
StudentModalityController,
StudentBootcampDetailController,
StudentCollaborationDetailController,
StudentDetailController,
Expand Down Expand Up @@ -56,7 +55,6 @@
Route::get('additionaltraining', StudentAdditionalTrainingListController::class)->name('student.additionaltraining');
Route::get('languages', StudentLanguagesDetailController::class)->name('student.languages');
Route::put('languages', UpdateStudentLanguagesController::class)->name('student.languages.update');
Route::get('modality', StudentModalityController::class)->name('student.modality');
Route::get('photo', GetStudentImageController::class)->middleware('auth:api', EnsureStudentOwner::class)->name('student.photo.get');
Route::put('projects/{projectId}', UpdateStudentProjectController::class)->middleware('auth:api', EnsureStudentOwner::class)->name('student.updateProject');
//Route::put('skills', UpdateStudentSkillsController::class)->middleware('auth:api')->name('student.skills');
Expand All @@ -74,17 +72,3 @@
Route::get('/{tagId}', TagDetailController::class)->name('tag.detail');
Route::put('/{tagId}', TagUpdateController::class)->name('tag.update');
});
// ! OLD ROUTES BLOCK
Route::get('/student/list/for-home', StudentListController::class)->name('profiles.home');
Route::get('/student/{id}/detail/for-home', StudentDetailController::class)->name('student.detail');
Route::get('/students/{student}/projects', StudentProjectsDetailController::class)->name('projects.list');
Route::get('/students/{student}/collaborations', StudentCollaborationDetailController::class)->name('collaborations.list');
Route::get('/students/{id}/bootcamp', StudentBootcampDetailController::class)->name('bootcamp.list');
Route::get('/students/{student}/additionaltraining', StudentAdditionalTrainingListController::class)->name('additionaltraining.list');
Route::get('/students/{id}/languages', StudentLanguagesDetailController::class)->name('languages.list');
Route::get('/modality/{studentId}', StudentModalityController::class)->name('modality');
// Fake endpoint development
Route::get('/development/list', DevelopmentListController::class)->name('development.list');
// Specialization List Endpoint
Route::get('/specialization/list', SpecializationListController::class)->name('roles.list');
// ! OLD ROUTES BLOCK
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public function testStudentDetailsJsonFormat(): void
];
})->toArray(),
'resume' => [
'modality' => $this->resume->modality,
'subtitle' => $this->resume->subtitle,
'social_media' => [
'github' => $this->resume->github_url,
Expand Down
63 changes: 0 additions & 63 deletions tests/Feature/Controller/Student/StudentModalityControllerTest.php

This file was deleted.

Loading

0 comments on commit ccb47ab

Please sign in to comment.