Commit Graph

9 Commits (c3c3814d777c48d8263396edf1743516ccbf84a3)

Author SHA1 Message Date
Joey Hines c6ec8467c1
report_out_of_stock command + new query system
continuous-integration/woodpecker the build was successful Details
+ report_out_of_stock can be used by a when an item is not in stock in a shop
+ Added new query system
  + Impl for both LocationDB and Player for now
  + Goal is to increase code re-use without a million functions for different queries
  + Should be expanded to more models
  + I Should really just rip out the DB and make it a generic thing
+ Clippy + fmt
2021-12-30 21:48:33 -06:00
Joey Hines 48be50dd67
Added link command
continuous-integration/woodpecker the build was successful Details
+ Link provides a link code that a user can use to link other accounts
+ This places the main auth source into MC and the plugin
+ Refactored register to accept a link code
+ Clippy + fmt
2021-12-18 11:13:18 -07:00
Joey Hines 199516f3cc
Added set_portal to the API
+ Bumped DB version to 3
+ Renamed "tunnel" to "portal" on the location models
+ Added a new migration
+ Cargo + Clippy
2021-12-07 20:33:25 -07:00
Joey Hines 12218d0b62
Updated models + migration infra
+ Model migration is handled in the DB modules
+ It involves writing an up and a down case
  + Both load and interact with the JSON directly
  + Done so it can be decoupled from models
2021-12-05 16:51:13 -07:00
Joey Hines e1b362aa1c
Implemented sorting an ordering for selling
+ Added parameter validation as well
+ Currently, Restock and Price are the two sorting methods available
2021-11-14 16:28:55 -07:00
Joey Hines 8e8798f509
First pass on shop/item handling
+ The `add_item` command adds items to a location of type `Shop`
+ `selling` allows items to be queried
  + Items are not sorted yet
  + The user will be able to apply optional sorting params
+ Allowed the `insert` function of the DB to be used to update a model already in the DB
+ Clippy + Fmt
2021-11-07 14:23:18 -07:00
Joey Hines 22ffe75422
Added API token handling
+ Tokens can be added by the add_token command or via the CLI
+ Tokens are checked for authorization before a command is run
+ Added an error message field to the GeoffreyApiResponse
+ Made tokens strings instead of u64s
  + Tokens are randomly generated 64 char long alphanumeric strings
+ Clippy + Fmt
2021-10-31 11:00:07 -06:00
Joey Hines c2bc16f3d8
Added better error handling for API+Database
+ GeoffreyDatabaseError implements Into<GeoffreyApiError>
+ The database Option and Result were combined into just Result to reduce complexity
2021-10-17 12:21:01 -06:00
Joey Hines b92308da67
First pass of an API
+ Implemented register, find, and add_location
+ Bunch of changes to the DB and the Models to make this work
+ API models are defined in GeoffreyModels so things that call the API don't need to define their own types
+ Still needs a lot of work, and need to design the api a bit more
+ Clippy + fmt
2021-10-03 14:03:32 -06:00