diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ed430a7..63babf3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,31 @@ The complete changelog for the Costs to Expect REST API, our changelog follows the format defined at https://keepachangelog.com/en/1.0.0/ +## [v2.25.0] - 2022-06-20 +## Added +- We allow the `collection` parameter for `simple-item` item-type collections. +- We have added tests for subcategory management, found another bug, whoopee! +- We have added tests for item type responses. +- We have added an option response tests for the resource types collection and a resource type. +- We have added additional resource type tests and created/updated the json-schema files as necessary. +- We have added a catch-all route for non-matching routes. + +## Changed +- We have renamed the tests directory and corrected the namespaces. +- We are continuing to update out routes to named routes. +- We have moved additional responses to the response class. +- We have updated more response, if a collection is included in a response a `uri` field will contain the relative URI to the relevant collection. +- We have adjusted the layout of the test section in the README and added a note explaining the meaning of 'Non yet'. +- We have updated the response when attempting to delete an item with category assignments, rather than return a generic foreign key error, we specifically mention that there are category assignments that need to be removed first. +- We have cleaned up the response description lang file. + +## Fixed +- Removed an output in a test. +- Updated the route middleware, invalid decodes should return a 403 for the route. +- Added a unique validation rule for emails, don't leave the check to the database. +- Corrected the descriptions in the OPTIONS requests for `item` summaries. +- The allowed values for `winner_id` should be a category assigned to the item, not all the categories assigned to the resource type. + ## [v2.24.0] - 2022-06-13 ## Added - We have added our first schema files for OPTIONS responses and started working on the tests. diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index e5d1c1d9..d99e8ac0 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -9,6 +9,7 @@ use App\HttpRequest\Hash; use App\HttpRequest\Validate\Boolean; use Illuminate\Routing\Controller as BaseController; +use JetBrains\PhpStorm\ArrayShape; class Controller extends BaseController { @@ -127,6 +128,7 @@ protected function hasViewAccessToResourceType(int $resource_type_id): bool return in_array($resource_type_id, $this->viewable_resource_types, true) === true; } + #[ArrayShape(['view' => "bool", 'manage' => "bool"])] protected function permissions(int $resource_type_id): array { return [ diff --git a/config/api/app/version.php b/config/api/app/version.php index 2149b412..d2aaf1bd 100644 --- a/config/api/app/version.php +++ b/config/api/app/version.php @@ -3,9 +3,9 @@ declare(strict_types=1); return [ - 'version'=> 'v2.24.0', + 'version'=> 'v2.25.0', 'prefix' => 'v2', - 'release_date' => '2022-06-13', + 'release_date' => '2022-06-20', 'changelog' => [ 'api' => '/v2/changelog', 'markdown' => 'https://github.com/costs-to-expect/api/blob/master/CHANGELOG.md' diff --git a/resources/views/welcome.blade.php b/resources/views/welcome.blade.php index 0ab15b7a..fb35665c 100644 --- a/resources/views/welcome.blade.php +++ b/resources/views/welcome.blade.php @@ -214,7 +214,7 @@ function gtag(){dataLayer.push(arguments);}
-

Latest release {{ $version }}

+

{{ $version }}

The latest release of the Costs to Expect API is {{ $version }}; we released it on the {{ date('jS M Y', strtotime($date)) }}.

@@ -225,34 +225,34 @@ function gtag(){dataLayer.push(arguments);}

Added

Changed

Fixed

Removed