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
- - We have added our first schema files for OPTIONS responses and started working on the tests.
- - We have added tests for category management, found one bug when creating the tests.
+ - 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 updated our response class for OPTIONS responses, we now allow parameters to be defined for POST requests. One example of where we need this is the create password POST request, `password` and `password_confirmation` are required fields, however, `token` and `email` are required parameters. Before this update, you had to parse the returned error of read the OPTIONS request description.
- - We have started splitting config files, a config file should be for one purpose.
- - We have spent quite a bit of time reviewing the API structure and refactoring. We have removed unnecessary complexity, renamed classes and methods to describe intent more clearly and removed pointless base classes.
- - We have reworked how allowed values are generated for the different item types, allowed values for fields and parameters have been split, and we have removed all abstraction.
- - We have removed some route validation files which didn't do anything useful after all the item type work.
- - We have reworked the responses class, removed exception parameters when not necessary, pass in an exception if thrown and now delegated responsibility to the responses class to decide if the exception should be returned in the response.
- - We have upgraded the API to Laravel 9 and PHP 8.1.
+ - 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
- - Options request incorrect for the `auth.register` endpoint (Test added).
- - Options requests returning response twice.
- - Type corrected in OPTIONS response, authentication status/requirements now a boolean, not a string.
- - Minor correction to the description of two POST endpoints.
- - Corrected a type in the OPTIONS response for the month parameter.
- - Corrected the `partial-transfer` JSON schema file.
- - Allowed values not showing for `category` on GET endpoints.
- - Inconsistent usage of the responses helper.
- - Category validator allowed duplicate names due to incorrect params, caught by model.
+ - 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.
Removed