Skip to content

Commit

Permalink
Merge pull request #266 from deanblackborough/v3.13.0
Browse files Browse the repository at this point in the history
v3.13.0
  • Loading branch information
deanblackborough authored Jun 29, 2023
2 parents 9fa4b67 + 2126c27 commit bcb0da3
Show file tree
Hide file tree
Showing 31 changed files with 3,084 additions and 1,468 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@

The complete changelog for the Costs to Expect REST API, our changelog follows the format defined at https://keepachangelog.com/en/1.0.0/

## [v3.13.0] - 2023-06-29
### Added
- Added resource tests, action and view, also add category view tests.
- Added the OPTIONS schema for the resource collection, categories collection, resource show and category show.
- Added two buttons to the landing page, one to access the API, one to view the docs.
- Added additional helper methods for testing.
### Changed
- Reviewed and updated the resource type tests, added tests for each 'item-type' and updated the tests to exclude pulling public resource types.
- Reduced throttle limit to 300 requests per minute.
- Removed throttle limit for tests.
### Fixed
- Added a message to the README to explain the 'exclude-public' URI parameter.
- Minor fixes to the budget-pro migrate job.
- Fix for data parameter validation.

## [v3.12.1] - 2023-06-24
### Fixed
- Clear resource cache after successful migration.
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ resource type.

Public resources types provide READ access to everyone, WRITE access is limited to the permitted users.

You can exclude public resource types by include exclude-public=true in the query string.

| HTTP Verb(s) | Route |
|:-------------|:-----------------------------------------------------------------------------------------------------------------------------------------------|
| GET/HEAD | v3/ |
Expand Down Expand Up @@ -292,7 +294,7 @@ our local test suite is as complete as the Postman request test suite.
| Controller | Action | View |
|:--------------------|:---------|:---------|
| Authentication | 35 Tests | 3 Tests |
| Category | 11 Tests | Non yet* |
| Category | 12 Tests | 19 Tests |
| Currency | Non yet* | Non yet* |
| ItemCategory | Non yet* | Non yet* |
| Item | 45 Tests | 39 Tests |
Expand All @@ -305,10 +307,10 @@ our local test suite is as complete as the Postman request test suite.
| PermittedUser | 4 Tests | 2 Tests |
| Queue | Non yet* | Non yet* |
| Request | Non yet* | Non yet* |
| Resource | 24 Tests | Non yet* |
| ResourceType | 23 Tests | 11 Tests |
| Resource | 24 Tests | 22 Tests |
| ResourceType | 23 Tests | 17 Tests |
| Subcategory | 12 Tests | Non yet* |
| **Total tests** | **154** | **62** |
| **Total tests** | **155** | **109** |

*Non yet does not mean there are no tests, it just means there are no PHPUnit tests. There are over 2000 tests in
a private Postman collection, I'm slowing transferring them locally and expanding the test suite.
4 changes: 4 additions & 0 deletions app/HttpRequest/Parameter/Filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ private static function validateDate($date): bool
DateTime::createFromFormat('Y-m-d', $date);
$errors = DateTime::getLastErrors();

if ($errors === false) {
return true;
}

return ($errors['warning_count'] === 0 && $errors['error_count'] === 0);
}

Expand Down
4 changes: 2 additions & 2 deletions app/Providers/RouteServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ public function boot()
*/
protected function configureRateLimiting()
{
RateLimiter::for('api', function (Request $request) {
return Limit::perMinute(500)->by(optional($request->user())->id ?: $request->ip());
RateLimiter::for('api', static function (Request $request) {
return Limit::perMinute(300)->by(optional($request->user())->id ?: $request->ip());
});
}
}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
},
"autoload-dev": {
"psr-4": {
"Tests\\": "Tests/"
"Tests\\": "tests/"
}
},
"scripts": {
Expand Down
Loading

0 comments on commit bcb0da3

Please sign in to comment.