hoeyi / Ozym

A web-application for tracking personal finances. Built using Blazor, ASP.NET Core, and Entity Framework Core.
3 stars 0 forks source link

Add reference data endpoints to API #219

Closed hoeyi closed 1 year ago

hoeyi commented 1 year ago

Summary

Some model fields are constrained to values defined elsewhere in the data store, e.g., a foreign key reference. Add a reference endpoint to controllers that emulates POST to [endpoint]/search, then returns key-value pairs for use in lookup fields by the client app,

Given that some referenced objects are not included in the CRUD endpoints, it may be necessary to create reference endpoints, similar to the way Web.Controllers.Abstractions.QueryController is currently written.

Acceptance Criteria

hoeyi commented 1 year ago

Would it be possible to combine requests so that fewer calls are needed?

For example, what if I need to a get a list of securities that are tradable and a separate list of securities that accept deposits?

hoeyi commented 1 year ago

Removing requirement for <int, string> and <string, string> key pair lookup. With pagination and well-defined DTOs, the amount of data returned is not an issue. This also allows the client code to be cleaner, as a lot of references to Key and Value member names will be removed.