Releases: costs-to-expect/api
Releases · costs-to-expect/api
Skip cache, public cache and pagination fixes
Added
- We have added support for an
X-Skip-Cache
request header; If you include the header with your request we will skip response caching and fetch live values, please use this with care.
Changed
- We have added separate links for the documentation and example page and the postman collection.
- We have simplified our
\Model\Transformer
classes and made it possible to alter the returned data format. - We have added
public
as a sorting option for resource types. - We have reworked our pagination class; we have moved it to a new workspace and also improved how it works.
- We have moved our
Hash
class; theHash
class now lives in theRequest
namespace. - We have moved our
ModelUtility
class: theModelUtility
class now lives in theModels
namespace. - We have updated the indexes in our
Hash
request class; the indexes are consistent with the rest of the app.
Fixed
- We have updated our pagination helper to include any defined filtering parameters.
- We have corrected pagination calls in all our controllers; we now include all possible request parameters.
- We have corrected calls to clear public caches; we were comparing different types.
Docs and examples
Added
- We have added a documentation page; the documentation page links to the API documentation and includes a couple of examples.
Changed
- We have updated the example ENV file.
- We have renamed a couple of our helper conversion/validation classes and moved them to a new namespace.
- We have made a minor content tweak on the landing page; the documentation button is in another section.
- We have updated and relocated our validation classes; the validation classes are now part of the
App\Request\Validate
namespace. - We have reworked our summary controllers; we have removed some code duplication and added additional error checking.
Fixed
- Incorrectly assuming the result will be an array with at least one value.
- We have fixed an error in the changelog; we jump a couple of minor versions.
Additional caching and Redis
Changed
- We have added caching to summaries.
- We have switched to Redis for caching.
- We have made minor tweaks to our caching to tweak performance.
Application caching tweaks
Changed
- We have split calls to clear public and private cache keys.
- We only clear public cache keys when modifying a public resource type.
- We have updated the web.config; the web.config file was referring to PHP7.3.
- Added removed class type hints now that we are running PHP7.4.
Application caching
Added
- We have added an application cache for collections; we include the ETag header however we are not yet returning a 304.
Changed
- We have moved our route validators; the route validators sit inside the
App\Request
namespace. - We have moved our
Header
utility class; theHeader
class sits inside theApp\Response
namespace. - We have moved our
RoutePermission
utility class; thePermission
class sits inside theApp\Request
namespace. - We have moved and simplified our
Parameter
classes; theParameter
classes sit inside theApp\Request
namespace. - We have moved and renamed the
RequestUtility
class; theBodyValidation
class sits in theApp\Request
namespace.
Search and filtering
Added
- We have added search to the categories summary endpoint.
- We have added search to the subcategories summary endpoint.
- We have added search to the resources summary endpoint.
- We have added search to the resource-types summary endpoint.
- We have updated the transfers collection; you can filter the results by an
item
ID. - We have updated the partial transfers collection; you can filter the results by an
item
ID. - We have added additional filtering options for collections. We have added
total
andactualised_total
range filtering for theallocated-expense
item type andtotal
range filtering for thesimple-expense
item type.
Changed
- We have added the documentation URI to the README and API; the documentation for the API is work in progress; it is almost complete.
- We have added a version query parameter to the CSS include.
- We have removed a unique index on the
item_transfer
table; the index was limiting the ability to transfer an item multiple times. - We have altered the format of the category and subcategory object for item relationships; the returned object is now a closer match to a category object.
- We have updated the URIs for item category and subcategory assignments; the URI was singular for a collection.
- We have updated the item delete endpoint; we did not return a conflict error before removing relationships.
- We have tweaked the
type
for expense fields; we highlight that the supplied value should be a decimal string.
Fixed
- The
name
field now displays as a required field in the items collection OPTIONS request. - The
filterable
array shows in the OPTIONS response for resource type items. - We have updated the namespace in a model.
- We have corrected the case of a model name.
- We have added the migrations for the original item-types, missing from the import.
- We have added a database migration to update the
friendly_name
andexamples
data foritem-types
. - We have updated the delete item request; we delete the transfer log entries for the item.
- We have updated two
item-type
summary endpoints to show they are sortable byname
.
Fix session clearing
Fixed
- We have adjusted the lottery value to reduce session clears.
- We have updated to v3.5.1 of Jquery, v3.5.0 was bugged.
Delete resource type fix
Fixed
- We have updated the delete resource type action; we have added additional checks before we attempt to delete, it was possible to remove relationship values which made the resource type inaccessible.
Tweaks and fixes
Changed
- We have updated all item endpoints to return
updated
; this is the date and time an item was updated, not its category assignments. - We have updated item collection and show endpoints; we are going to allow the possibility of items not having categories and subcategories. When you add the
include-categories
andinclude-subcategories
parameters to a request, we will not exclude items without category assignments. - We have updated the API to the latest release of Laravel 7.
- We have updated the front end dependencies for the welcome page.
- We have updated the
item-types
route to show additional information on each tracking method. - We have updated all decimal fields to 13,2 rather than 10,2.
- We have updated all description fields; we have switched all the description fields from varchar(255) to text.
Fixed
- We have corrected a bad link on the landing page.
- We have corrected a typo on the landing page.
- We have switched the table we look at to return created at for an item; we should be using the sub table, not the base item table.
- We have corrected the
/resource-types/
OPTIONS request;public
is not a required field.
Partial transfers
Added
- We have added a new route,
/resource_types/[id]/resources/[id]/items/[id]/partial-transfer
; A partial transfer allows you to transfer a percentage of thetotal
for an item from one resource to another. - We have added an
item_transfer
table; the table will log which items were transferred and by whom. - We have added a partial transfers collection; the route is
/resource_types/[id]/partial-transfers
. - We have added a partial transfers item view; the route is
/resource_types/[id]/partial-transfers/[id]
. - We have added a transfers collection; the route is
/resource_types/[id]/transfers
. - We have added a transfers item view; the route is
/resource_types/[id]/transfers/[id]
. - We have added a delete endpoint for partial transfers.
Changed
- We have reformatted the validation rules in the configuration files; easier to read and simpler to add additional rules.
- We have switched the HTTP status code for a "Constraint error" from 500 to 409.
- We have tweaked the description for the resource field in the
/resource_types/[id]/resources/[id]/items/[id]/transfer
OPTIONS request. - We have renamed the third parameter of the route validation methods; we changed the name from
$manage
to$write
. - We have renamed a response helper method; it was not clear from the name that the method is used for updates and delete.
Fixed
- It is possible to set the quantity for a
simple-item
item as zero. - It is possible to clear optional values in a PATCH request.