Skip to content

Commit

Permalink
Merge pull request #101 from IT-Academy-BCN/feature/#81-fake-endpoint…
Browse files Browse the repository at this point in the history
…-that-can-list-colaboration-for-frontend-student-detail-view

Feature/#81 fake endpoint that can list collaboration for frontend student detail view
  • Loading branch information
leidyz authored Mar 13, 2024
2 parents 21c8399 + ccd175a commit c35e691
Show file tree
Hide file tree
Showing 9 changed files with 237 additions and 2,471 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pull_request_phpunit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
run: php artisan key:generate

- name: Ejecutar migraciones y seeds
run: php artisan migrate:fresh --seed
run: php artisan migrate --seed

- name: Ejecutar pruebas unitarias
run: php artisan test
Original file line number Diff line number Diff line change
Expand Up @@ -7,56 +7,57 @@

class AnnotationsStudentBootcampDetail
{
/**
* @OA\Get(
* path="/api/v1/students/{uuid}/bootcamp",
* operationId="getStudentBootcamp",
* tags={"Bootcamp"},
* summary="Get a detailed list of a student bootcamp",
* description="Returns detail for a specific student bootcamp. (Note: This endpoint returns hardcoded bootcamp details)",
* @OA\Parameter(
* name="uuid",
* description="Student UUID",
* required=true,
* in="path",
* @OA\Schema(
* type="string",
* format="uuid"
* )
* ),
* @OA\Response(
* response=200,
* description="Successful operation",
* @OA\JsonContent(
* type="array",
* @OA\Items(
* type="object",
* @OA\Property(
* property="bootcamp_id",
* type="string",
* description="Bootcamp ID"
* ),
* @OA\Property(
* property="bootcamp_name",
* type="string",
* description="Bootcamp Name"
/**
* @OA\Get(
* path="/api/v1/students/{id}/bootcamp",
* operationId="getStudentBootcamp",
* tags={"Bootcamp"},
* summary="Get a detailed list of a student bootcamp",
* description="Returns detail for a specific student bootcamp. (Note: This endpoint returns hardcoded bootcamp details)",
* @OA\Parameter(
* name="uuid",
* description="Student UUID",
* required=true,
* in="path",
* @OA\Schema(
* type="string",
* format="uuid"
* )
* ),
* @OA\Response(
* response=200,
* description="Successful operation",
* @OA\JsonContent(
* type="array",
* @OA\Items(
* type="object",
* @OA\Property(
* property="bootcamp_id",
* type="string",
* description="Bootcamp ID"
* ),
* @OA\Property(
* property="bootcamp_name",
* type="string",
* description="Bootcamp Name"
* ),
* @OA\Property(
* property="bootcamp_end_date",
* type="array",
* @OA\Items(type="string"),
* description="Bootcamp end date"
* )
* )
* )
* ),
* @OA\Response(
* response=404,
* description="Student not found"
* )
* )
*/

* ),
* @OA\Property(
* property="bootcamp_end_date",
* type="array",
* @OA\Items(type="string"),
* description="Bootcamp end date"
* )
* )
* )
* ),
* @OA\Response(
* response=404,
* description="Student not found"
* )
* )
*/

public function __invoke() {}
public function __invoke()
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php

namespace App\Annotations\OpenApi\controllersAnnotations\studentCollaborationAnnotations;

use OpenApi\Annotations as OA;

class AnnotationsStudentCollaboration
{
/**
* @OA\Get(
* path="/api/v1/studentCollaborations",
* operationId="getStudentCollaborations",
* tags={"Collaborations"},
* summary="Get collaborations for a student",
* description="Returns a list of collaborations for a specific student. (Note: This endpoint returns hardcoded student collaborations)",
*
* @OA\Response(
* response=200,
* description="Successful operation",
* @OA\JsonContent(
* type="array",
* @OA\Items(
* type="object",
*
* @OA\Property(
* property="collaborations",
* type="array",
* @OA\Items(
* type="object",
* @OA\Property(property="id", type="integer", example=1, description="Collaboration ID"),
* @OA\Property(property="name", type="string", example="ita wiki", description="Collaboration name"),
* @OA\Property(property="description", type="string", example="Recursos subidos", description="Collaboration description"),
* @OA\Property(property="quantity", type="integer", example=9, description="Quantity"),
* ),
*
* ),
*
* )
* )
* ),
* @OA\Response(
* response=404,
* description="Student not found"
* )
* )
*/
public function __invoke()
{
}
}

22 changes: 22 additions & 0 deletions app/Http/Controllers/api/StudentCollaborationController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

namespace App\Http\Controllers\api;

use App\Http\Controllers\Controller;

//use Illuminate\Http\Request;

class StudentCollaborationController extends Controller
{
public function __invoke()
{

$data = file_get_contents(base_path('database/data/studentCollaborations.json'));

$decodedData = json_decode($data, true);

return response()->json($decodedData);


}
}
Loading

0 comments on commit c35e691

Please sign in to comment.