Commit Graph

36 Commits

Author SHA1 Message Date
e0bba0254c Add buy_merchandise endpoint
Temporary for now, eventually this should actually create a transaction record.

All it does now is update the merchandise quantity.
2020-10-26 00:51:01 -04:00
58583a553a Add update by shop id handlers 2020-10-25 03:16:46 -04:00
df48b64ffd one interior_ref_list and merchandise_list per shop
still some bugs with routing I need to figure out
2020-10-24 03:01:38 -04:00
3f124ce439 Move filters into main.rs for SPEED
Using a macro from the warp github to balance the OR filter tree which sped up compile times by 10x.
2020-10-20 21:50:01 -04:00
0dc4247224 Add latest_interior_ref_list_by_shop_id endpoint
Not sure if this is correct yet, still waiting for rustc to compile...
2020-10-20 01:13:40 -04:00
97a2ac52dc Add update shop & owner endpoints 2020-10-18 02:31:17 -04:00
441bc979f2 Update related projects in README 2020-10-12 21:40:25 -04:00
2b1db3e438 Add related projects to README 2020-10-12 21:06:09 -04:00
db8ccb3ca4 Rename the project and add more README docs 2020-10-12 20:54:34 -04:00
7fa6fe2b04 Update README with Windows setup and db seeding 2020-10-11 03:03:09 -04:00
fc057e86dd Add merchandise_lists endpoint 2020-10-11 01:20:55 -04:00
8d5fe7f75d Update schema, add status endpoint 2020-09-07 16:51:01 -04:00
170a3a8b02 Remove bytes dependency 2020-08-01 02:24:39 -04:00
d1c933e1ea Add authentication to more handlers 2020-08-01 02:18:31 -04:00
eb7706974e Fix readme 2020-08-01 00:44:05 -04:00
519fcb4c5a Add caching with LRU cache under mutex
Caches responses of each GET handler in a separate capacity-limited cache (as a
custom clone-able `CachedResponse` struct). Subsequent requests will build a
`Response` from the cached bytes instead of re-querying the database and
re-serializing the JSON. This greatly speeds up the list endpoints and
`get_interior_ref_list`.

Also caches the api-key-to-id mapping for `Owner`s in order to speed up frequent
authentications.

Each create handler clears the entire list response cache. Each delete handler
also clears the entire list response cache and deletes the cached response for
that key. Deleting an owner also deletes their entry in the
`owner_ids_by_api_key` cache.
2020-08-01 00:25:04 -04:00
68b04b4f4c Add auth to delete endpoints 2020-07-30 01:09:29 -04:00
79b45551fd Add delete endpoints and clean up filters 2020-07-29 00:02:48 -04:00
17cd3f12d2 Improve model query performance tracing 2020-07-28 22:01:57 -04:00
b16ba3e3f7 Swap out old log for shiny tracing 2020-07-27 22:36:48 -04:00
fb99afdc26 Encode/decode InteriorRef struct from jsonb column 2020-07-27 00:09:45 -04:00
29eadabc8a interior_refs -> interior_ref_lists, finish insert 2020-07-23 00:13:31 -04:00
0275143559 Update setup instructions 2020-07-23 00:12:56 -04:00
a84694042f Add test JSON payloads to repo 2020-07-22 23:30:20 -04:00
6eb58935e3 Move interior refs list to interior_refs table
Still WIP, need to actually save the data to the table.
2020-07-22 22:42:17 -04:00
65e6ba1f8a WIP adding interior_refs endpoints
Ran into some limitations of sqlx while trying to bulk create interior_refs. I
also discovered how slow creating hundreds of rows in postgres is and I'm
planning on saving interior_refs data in a jsonb column instead which seems to
be much faster.
2020-07-19 03:01:20 -04:00
9985f123c9 Remove refinery.toml from source control 2020-07-19 03:00:54 -04:00
9ea3e35359 Allow no ORDER BY clause by default in list method 2020-07-18 18:10:45 -04:00
359096e0bf Gitignore Session.vim 2020-07-18 18:02:43 -04:00
9ec7fc1518 Modularize, Model trait, list_owners 2020-07-18 17:46:33 -04:00
6b1f31f246 Add list_shops endpoint 2020-07-17 01:05:58 -04:00
28d6e50a5a Clean up filter chain a bit 2020-07-16 00:56:51 -04:00
3df7af7032 Easier to read handler reply style 2020-07-16 00:48:41 -04:00
aebcaf7d21 Working shops and owners create/get endpoints 2020-07-16 00:42:04 -04:00
25641ed8da Remove .env file 2020-07-16 00:41:03 -04:00
91ff001c53 Initial commit. WIP shops endpoint
Pretty comfortable with the choice of crates now so it's time to start
committing.

Currently the API only returns errors, but throwing good errors is important.
2020-07-13 01:55:36 -04:00