Skip to content

Commit

Permalink
Merge pull request #223 from deanblackborough/v2.23.0
Browse files Browse the repository at this point in the history
v2.23.0
  • Loading branch information
deanblackborough authored Apr 12, 2022
2 parents e6d032c + e3dfbf0 commit 287935b
Show file tree
Hide file tree
Showing 100 changed files with 2,529 additions and 1,800 deletions.
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,33 @@

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.23.0] - 2022-04-12
## Added
- We have updated the `/auth/user` route, the route will now show any active created tokens.
- We have added `device_name` as an optional field on sign-in, if set, the generated token will be prefixed with the device name.
- We have added an `include-permitted-users` parameter when requesting a resource type, you will be able to see all the permitted users without having to go down the tree.
- If an API response includes a related object, the first field should be the URI to the relevant collection or resource, we have started updating responses.
- We have added a `auth/user/tokens` route to show the active tokens, you can view an individual token as well as delete a token.
- We have added a notification for failed jobs, if the `ClearCache` job fails we will get an email, luckily, it doesn't ever fail :)
- We have added the ability to assign permitted users, if you have access to a resource type you can assign a known user to the resource type.
- We have added a view permitted user endpoint.
- We have added the ability to delete a permitted user, you can delete any permitted user with access to the resource type, including yourself.
- We have added initial tests for the permitted user routes.

## Changed
- We have updated sign-in to clear tokens that have not been used for a year.
- We have added additional validation to `/auth/login` to match the create password routes.
- We have removed additional references to our `item-type` entity class, keep code in the individual item type namespaces.
- We have converted out `Mailables` to `Notifications` and they get send via the queue.
- We have updated the `partial-transfers` route to use methods per item types, this way we can correctly return a 405 when an item doesn't support partial transfers.
- We have updated the `transfers` route to use methods per item types, this was we can correctly return a 405 when an item doesn't support transfers.
- We have localised all response messages in the Authentication controller to match the rest of the API.

## Fixed
- We have fixed our Authentication tests, we no longer overwrite the initial user, additionally, we have updated three tests to return success on a 422, not a 401.
- We have corrected a couple of parameter conversions, two parameters not correctly being converted to Booleans.
- Unable to delete an `allocated-expense`, need to clear the partial transfers table.

## [v2.22.0] - 2022-01-26
After being away from the code for a while I've made some changes. I've reduced the complexity around different items types because things had started to get a little complex and I know what is coming next so want to clear out as much unnecessary code as possible. This is just a first pass, I'm sure there will be more but I have many other planned tickets to get on with.

Expand Down
21 changes: 15 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,17 @@ Docker services, `api` and `mysql`, we will need to exec into the `api` service
set up our app.

Firstly, we need to check we are trying to access the right location,
execute `docker compose exec api ls`. You should see a list of the files and
execute `docker compose exec costs.api.app ls`. You should see a list of the files and
directories at the project root.

Next, we need to configure the API by setting out local .ENV file our .env,
installing all dependencies and running our migrations.

* Copy the `.env.example` file and name the copy `.env`. Set all the empty values, all
drivers have been set to our defaults, sessions, cache, and the queue default to the database driver.
* `docker compose exec api php artisan key:generate`
* `docker compose exec api php artisan migrate`
* `docker compose exec api php artisan queue:work`
* `docker compose exec costs.api.app php artisan key:generate`
* `docker compose exec costs.api.app php artisan migrate`
* `docker compose exec costs.api.app php artisan queue:work`
* Run an OPTIONS request on `http://[your.domail.local:8080]/v2/resource_types`, you will see an OPTIONS response,
alternatively a GET request to `http://[your.domail.local:8080]/v1` will show all the defined routes.
* You can create a user by POSTing to `http://[your.domail.local:8080]/v2/auth/register`.
Expand All @@ -73,7 +73,7 @@ you will also need to set `MAIL_FROM_ADDRESS` and `MAIL_TO_ADDRESS`. You may nee

* Collections will return an array and a 200.
* Items will return a single object and a 200.
* Successful POST requests will return a single object and a 201.
* Successful POST requests will return a single object and a 201, there are minor exceptions where we may return a 204.
* Successful PATCH requests will return 204.
* Successful DELETE requests will return a 204.
* Non 2xx results will return an object with a message field and optionally a fields array. When we
Expand Down Expand Up @@ -133,6 +133,11 @@ additionally, the same is true if you are assigned as a permitted user to a reso
| POST | v2/auth/update-profile |
| GET/HEAD | v2/auth/user |
| OPTIONS | v2/auth/user |
| GET/HEAD | v2/auth/user/tokens |
| OPTIONS | v2/auth/user/tokens |
| DELETE | v2/auth/user/tokens/{token_id} |
| GET/HEAD | v2/auth/user/tokens/{token_id} |
| OPTIONS | v2/auth/user/tokens/{token_id} |
| GET/HEAD | v2/changelog |
| OPTIONS | v2/changelog |
| GET/HEAD | v2/currencies |
Expand Down Expand Up @@ -175,8 +180,12 @@ additionally, the same is true if you are assigned as a permitted user to a reso
| GET/HEAD | v2/resource-types/{resource_type_id}/partial-transfers/{item_partial_transfer_id} |
| OPTIONS | v2/resource-types/{resource_type_id}/partial-transfers/{item_partial_transfer_id} |
| DELETE | v2/resource-types/{resource_type_id}/partial-transfers/{item_partial_transfer_id} |
| POST | v2/resource-types/{resource_type_id}/permitted-users |
| GET/HEAD | v2/resource-types/{resource_type_id}/permitted-users |
| OPTIONS | v2/resource-types/{resource_type_id}/permitted-users |
| GET/HEAD | v2/resource-types/{resource_type_id}/permitted-users/{permitted_user_id} |
| OPTIONS | v2/resource-types/{resource_type_id}/permitted-users/{permitted_user_id} |
| DELETE | v2/resource-types/{resource_type_id}/permitted-users/{permitted_user_id} |
| GET/HEAD | v2/resource-types/{resource_type_id}/resources |
| OPTIONS | v2/resource-types/{resource_type_id}/resources |
| POST | v2/resource-types/{resource_type_id}/resources |
Expand Down Expand Up @@ -222,7 +231,7 @@ additionally, the same is true if you are assigned as a permitted user to a reso

Eventually, there will be a summary route for every API collection GET endpoint. Until
that point, the summary routes that exists are detailed below. Some allow GET
parameters to breakdown the data, one example being
parameters to break down the data, one example being
`v2/summary/resource-types/{resource_type_id}/items`.

Review the OPTIONS request for each summary route to see the supported parameters, these should
Expand Down
240 changes: 0 additions & 240 deletions app/AllowedValue/ResourceItem.php

This file was deleted.

Loading

0 comments on commit 287935b

Please sign in to comment.