Commit Graph

9 Commits (caf7212cca2a5041b43e944b793e9d5fbe0881dd)

Author SHA1 Message Date
Joey Hines caf7212cca
Added string length validation (#4)
continuous-integration/woodpecker the build failed Details
+ Added a length check to string fields on add_item and add_location
+ Only doing length validation for now
+ Clippy + Fmt
2021-12-22 19:00:40 -07:00
Joey Hines 3711e7011c
Refactored parameter handling + added delete command
+ CommandRequest is now a struct that contains a generic parameter for the type
+ This streamlines adding new command parameters and reduces duplicate code
+ Added delete commands
2021-12-17 20:03:15 -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 b79db6029e
Fmt + Clippy 2021-10-24 13:21:30 -06:00
Joey Hines 8e6b652d5e
Added user_id checking to commands
+ Refactored to make CommandRequest a trait that all the parameter structs implment
+ Created handle_command to handle all the preprocessing needed before running the command
2021-10-24 13:20:15 -06:00
Joey Hines b3c0e2dcb0
Fmt + Clippy 2021-10-23 13:13:28 -06:00
Joey Hines d8de648395
Refactoring to get the find command working
+ Decoupled Database Types from API Return Types
  + Allows response to be more content rich
+ Added helper methods to load all the information related ot a model
 + This also helps us move a bit closer to what we would have to do for something like Diesel
 + Might be good to add more functions like this to decouple db operations from the API layer
2021-10-23 13:11:23 -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