Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions app/Http/Controllers/ApplicationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ public function __construct(
* tags={"Applications"},
* summary="Get all applications for a user",
* operationId="getAllForUser",
* security={},
* deprecated=true,
* @OA\Parameter(
* name="userId",
* in="query",
Expand Down Expand Up @@ -121,6 +123,8 @@ public function getAllForUser(Request $request)
* tags={"Applications"},
* summary="Get an application by ID",
* operationId="getApplicationById",
* security={},
* deprecated=true,
* @OA\Parameter(
* name="id",
* in="path",
Expand Down Expand Up @@ -177,6 +181,8 @@ public function getById($id)
* tags={"Applications"},
* summary="Create a new application",
* operationId="createApplication",
* security={},
* deprecated=true,
* @OA\RequestBody(
* required=true,
* @OA\JsonContent(
Expand Down Expand Up @@ -236,6 +242,8 @@ public function create(Request $request)
* tags={"Applications"},
* summary="Update an application by ID",
* operationId="updateApplication",
* security={},
* deprecated=true,
* @OA\Parameter(
* name="id",
* in="path",
Expand Down Expand Up @@ -294,6 +302,8 @@ public function update(Request $request, $id)
* tags={"Applications"},
* summary="Delete an application by ID",
* operationId="deleteApplication",
* security={},
* deprecated=true,
* @OA\Parameter(
* name="id",
* in="path",
Expand Down
2 changes: 2 additions & 0 deletions app/Http/Controllers/FileUploadController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class FileUploadController extends Controller
* tags={"Whatnow"},
* summary="Upload a file",
* operationId="uploadFile",
* security={},
* deprecated=true,
* @OA\RequestBody(
* required=true,
* @OA\MediaType(
Expand Down
6 changes: 4 additions & 2 deletions app/Http/Controllers/OrganisationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function __construct(
/**
* @OA\Get(
* path="/org",
* summary="Get all organisations",
* summary="Get all organisations (public)",
* security={{"ApiKeyAuth": {}}},
* tags={"Organisation"},
* @OA\Response(
Expand Down Expand Up @@ -99,7 +99,7 @@ public function getAll(Request $request)
/**
* @OA\Get(
* path="/org/{code}",
* summary="Get organisation by country code",
* summary="Get organisation by country code (public)",
* tags={"Organisation"},
* security={{"ApiKeyAuth": {}}},
* @OA\Parameter(
Expand Down Expand Up @@ -152,6 +152,8 @@ public function getById($code, Request $request)
* path="/org/{code}",
* tags={"Organisation"},
* summary="Update an organisation by its country code",
* security={},
* deprecated=true,
* description="Updates the details of an organisation based on the provided country code.",
* operationId="OrganisationController@putById",
* @OA\Parameter(
Expand Down
12 changes: 12 additions & 0 deletions app/Http/Controllers/RegionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ public function __construct(
* tags={"Regions"},
* summary="Create a new region",
* operationId="createRegion",
* security={},
* deprecated=true,
* @OA\RequestBody(
* required=true,
* @OA\JsonContent(
Expand Down Expand Up @@ -132,6 +134,8 @@ public function createRegion(Request $request)
* tags={"Regions"},
* summary="Update an existing region",
* operationId="updateRegion",
* security={},
* deprecated=true,
* @OA\Parameter(
* name="regionId",
* in="path",
Expand Down Expand Up @@ -219,6 +223,8 @@ public function updateRegion(Request $request, $regionId)
* path="/regions/{country_code}",
* summary="Get all regions for a specific organisation by country code",
* tags={"Regions"},
* security={},
* deprecated=true,
* @OA\Parameter(
* name="country_code",
* in="path",
Expand Down Expand Up @@ -273,6 +279,8 @@ public function getAllForOrganisation($country_code)
* path="/regions/{country_code}/{code}",
* summary="Get regions for a specific organisation by country code and language code",
* tags={"Regions"},
* security={},
* deprecated=true,
* @OA\Parameter(
* name="country_code",
* in="path",
Expand Down Expand Up @@ -333,6 +341,8 @@ public function getForCountryCode($country_code, $code)
* tags={"Regions"},
* summary="Delete a region",
* operationId="deleteRegion",
* security={},
* deprecated=true,
* @OA\Parameter(
* name="regionId",
* in="path",
Expand Down Expand Up @@ -372,6 +382,8 @@ public function deleteRegion($regionId)
* tags={"Regions"},
* summary="Delete a region translation",
* operationId="deleteTranslation",
* security={},
* deprecated=true,
* @OA\Parameter(
* name="translationId",
* in="path",
Expand Down
8 changes: 8 additions & 0 deletions app/Http/Controllers/UsageLogController.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ public function __construct(ApplicationRepositoryInterface $applicationRepo, Usa
* tags={"UsageLogs"},
* summary="Get application usage logs",
* operationId="getApplicationLogs",
* security={},
* deprecated=true,
* @OA\Parameter(
* name="fromDate",
* in="query",
Expand Down Expand Up @@ -126,6 +128,8 @@ public function getApplicationLogs(Request $request)
* tags={"UsageLogs"},
* summary="Get endpoint usage logs",
* operationId="getEndpointLogs",
* security={},
* deprecated=true,
* @OA\Parameter(
* name="fromDate",
* in="query",
Expand Down Expand Up @@ -198,6 +202,8 @@ public function getEndpointLogs(Request $request)
* tags={"UsageLogs"},
* summary="Export usage logs as CSV",
* operationId="exportUsageLogs",
* security={},
* deprecated=true,
* @OA\Parameter(
* name="fromDate",
* in="query",
Expand Down Expand Up @@ -306,6 +312,8 @@ public function getForApplication(int $applicationId)
* tags={"UsageLogs"},
* summary="Get usage log totals",
* operationId="getTotals",
* security={},
* deprecated=true,
* @OA\Parameter(
* name="society",
* in="query",
Expand Down
54 changes: 36 additions & 18 deletions app/Http/Controllers/WhatNowController.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function __construct(
* @OA\Get(
* path="/whatnow/{id}",
* tags={"Whatnow"},
* summary="Obtiene un recurso publicado por ID",
* summary="Obtiene un recurso publicado por ID (public)",
* description="Retorna los detalles de un recurso publicado basado en el ID proporcionado.",
* operationId="getPublishedById",
* security={{"ApiKeyAuth": {}}},
Expand Down Expand Up @@ -159,6 +159,8 @@ public function getPublishedById($id)
* tags={"Whatnow"},
* summary="Get the latest revision of a WhatNow entity by ID",
* operationId="getLatestById",
* security={},
* deprecated=true,
* @OA\Parameter(
* name="id",
* in="path",
Expand Down Expand Up @@ -214,6 +216,8 @@ public function getLatestById($id)
* tags={"Whatnow"},
* summary="Delete a WhatNow entity by ID",
* operationId="deleteById",
* security={},
* deprecated=true,
* @OA\Parameter(
* name="id",
* in="path",
Expand Down Expand Up @@ -260,7 +264,7 @@ public function deleteById($id)
* @OA\Get(
* path="/org/{code}/whatnow",
* tags={"Whatnow"},
* summary="Get a feed of WhatNow entities for a specific organisation",
* summary="Get a feed of WhatNow entities for a specific organisation (public)",
* operationId="getFeed",
* security={{"ApiKeyAuth": {}}},
* @OA\Parameter(
Expand Down Expand Up @@ -364,6 +368,8 @@ protected function changeLogStatus($status){
* tags={"Whatnow"},
* summary="Get the latest revisions for a country code",
* operationId="getLatestForCountryCode",
* security={},
* deprecated=true,
* @OA\Parameter(
* name="code",
* in="path",
Expand Down Expand Up @@ -416,6 +422,8 @@ public function getLatestForCountryCode($code)
* tags={"Whatnow"},
* summary="Get the latest revisions for a specific region",
* operationId="getLatestForRegion",
* security={},
* deprecated=true,
* @OA\Parameter(
* name="code",
* in="path",
Expand Down Expand Up @@ -501,6 +509,8 @@ public function getAllRevisions()
* tags={"Whatnow"},
* summary="Create a new WhatNow entity",
* operationId="createWhatNowEntity",
* security={},
* deprecated=true,
* @OA\RequestBody(
* required=true,
* @OA\JsonContent(
Expand Down Expand Up @@ -629,6 +639,8 @@ public function post()
* tags={"Whatnow"},
* summary="Update a WhatNow entity by ID",
* operationId="putById",
* deprecated=true,
* security={},
* @OA\Parameter(
* name="id",
* in="path",
Expand Down Expand Up @@ -678,22 +690,22 @@ public function putById($id)
]);
}

try {
$this->validate($this->request, [
'countryCode' => 'alpha|size:3',
'eventType' => 'string|max:50',
'regionName' => 'nullable|string',
'translations' => 'array',
'translations.*.webUrl' => 'nullable|string',
'translations.*.lang' => 'alpha|size:2',
'translations.*.title' => 'string',
'translations.*.description' => 'string',
]);
} catch (ValidationException $e) {
Log::info($e->getMessage());

return $e->getResponse();
}
try {
$this->validate($this->request, [
'countryCode' => 'alpha|size:3',
'eventType' => 'string|max:50',
'regionName' => 'nullable|string',
'translations' => 'array',
'translations.*.webUrl' => 'nullable|string',
'translations.*.lang' => 'alpha|size:2',
'translations.*.title' => 'string',
'translations.*.description' => 'string',
]);
} catch (ValidationException $e) {
Log::info($e->getMessage());

return $e->getResponse();
}

try {
$org = $this->orgRepo->findByCountryCode($this->request->input('countryCode'));
Expand Down Expand Up @@ -755,6 +767,8 @@ public function putById($id)
* tags={"Whatnow"},
* summary="Create a new translation for a WhatNow entity",
* operationId="createNewTranslation",
* deprecated=true,
* security={},
* @OA\Parameter(
* name="id",
* in="path",
Expand Down Expand Up @@ -844,6 +858,8 @@ public function createNewTranslation($id)
* tags={"Whatnow"},
* summary="Update the published status of a translation",
* operationId="patchTranslation",
* deprecated=true,
* security={},
* @OA\Parameter(
* name="id",
* in="path",
Expand Down Expand Up @@ -927,6 +943,8 @@ public function patchTranslation($id, $translationId)
* tags={"Whatnow"},
* summary="Publish translations by IDs",
* operationId="publishTranslationsByIds",
* deprecated=true,
* security={},
* @OA\RequestBody(
* required=true,
* @OA\JsonContent(
Expand Down
Loading
Loading