Commit Graph

24 Commits

Author SHA1 Message Date
Maxime Delporte
e93375d441 Returning pagination metadata.
All checks were successful
Deploy Greenlight API / deploy (push) Successful in 2m48s
2025-11-15 16:51:13 +01:00
Maxime Delporte
1b71a1a8ad Creating GetAll MovieModel method to retrieve all movies. Updating the listMovieHandler to use the new GetAll MovieModel's method.
All checks were successful
Deploy Greenlight API / deploy (push) Successful in 59s
2025-11-13 15:25:00 +01:00
Maxime Delporte
95d9de60b4 Adding ValidateFilters method in filters.go and use it in our listMoviesHandler 2025-11-12 11:09:57 +01:00
Maxime Delporte
bf7c53e565 Creating Filters struct and using it inside our listMoviesHandler 2025-11-11 10:47:25 +01:00
Maxime Delporte
041d302a79 Creating listMoviesHandler and adding /v1/movies GET endpoint to use it. 2025-11-11 10:43:34 +01:00
Maxime Delporte
fd3bca1226 Adding a check on the X-Expected-Version header field.
All checks were successful
Deploy Greenlight API / deploy (push) Successful in 1m0s
2025-11-10 10:21:14 +01:00
Maxime Delporte
f8f78c3eec Adding concurrency control in our updateMovieHandler and documenting it.
All checks were successful
Deploy Greenlight API / deploy (push) Successful in 57s
2025-11-08 10:41:44 +01:00
Maxime Delporte
b76496e096 Updating updateMovieHandler to be able to update only some fields (patch instead of put). Update routes with the correct verb.
All checks were successful
Deploy Greenlight API / deploy (push) Successful in 1m20s
2025-11-07 11:57:04 +01:00
Maxime Delporte
1270a3bda6 Updating MovieModel's Delete method from internal/data/movies.go file. Create the deleteMovieHandler function inside cmd/api/movies.go. Adding the route into routes.go to delete a movie. 2025-11-07 11:37:19 +01:00
Maxime Delporte
69651c58b7 Updating MovieModel's method from internal/data/movies.go file. Create the updateMovieHandler function inside cmd/api/movies.go. Adding the route into routes.go to update a movie. 2025-11-07 11:27:45 +01:00
Maxime Delporte
0824a127b9 Updating internal/data/movies.go to Get a movie from the database. Updating cmd/api/movies.go showMovieHandler method to fetch a movie from a request (using the MovieModel's Get method). 2025-11-07 10:58:58 +01:00
Maxime Delporte
19a844ea2e Updating Insert MovieModel's method inserting a new record in the movies table. Updating createMovieHandler to use Insert MovieModel's method.
All checks were successful
Deploy Greenlight API / deploy (push) Successful in 1m0s
2025-11-06 17:10:33 +01:00
Maxime Delporte
6ef731573b Exporting the validation from cmd/api/movies.go to internal/data/movies.go by creating the ValidateMovie method. Updating createMovieHandler to use our new ValidateMovie method.
All checks were successful
Deploy Greenlight API / deploy (push) Successful in 55s
2025-10-28 12:07:04 +01:00
Maxime Delporte
e5ddfa120f Creating validator.go allowing us to validate received data from our endpoints. Updating errors.go adding failedValidationResponse method allowing us to deliver a StatusUnprocessableEntity error. Updating createMovieHandler with the use of our new validator package.
All checks were successful
Deploy Greenlight API / deploy (push) Successful in 53s
2025-10-28 11:04:18 +01:00
Maxime Delporte
040ace30ad Updating createMovieHandler accepting data.Runtime for the Runtime field. Updating internal/data/runtime.go with the json.Unmarshaler interface to transform our client's runtime string field '%d mins' into a Runtime type format.
All checks were successful
Deploy Greenlight API / deploy (push) Successful in 58s
2025-10-27 20:03:52 +01:00
Maxime Delporte
906bd868f9 Creating badRequestResponse helper method inside errors.go and use in in the createMovieHandler.
All checks were successful
Deploy Greenlight API / deploy (push) Successful in 53s
2025-10-24 18:55:05 +02:00
Maxime Delporte
12e1c7a523 Updating createMovieHandler using helper's readJSON method.
All checks were successful
Deploy Greenlight API / deploy (push) Successful in 52s
2025-10-24 14:47:20 +02:00
Maxime Delporte
d650691b08 Updating createMovieHandler decoding received data from client.
All checks were successful
Deploy Greenlight API / deploy (push) Successful in 58s
2025-10-24 14:02:36 +02:00
Maxime Delporte
2124f2f882 Using the new error's helper methods inside our current API endpoint and with our httprouter Handlers NotFound and MethodNotAllowed (will override the default responses with our helper's methods)
All checks were successful
Deploy Greenlight API / deploy (push) Successful in 52s
2025-10-21 19:02:42 +02:00
Maxime Delporte
1927c64047 Creating an envelope struct type inside our helpers file to update our writeJSON data type method's parameter. Updating healthcheckHandler and showMovieHandler with this new type to update our responses. 2025-10-19 11:47:25 +02:00
Maxime Delporte
9a0cb4db10 Creating Movie struct inside internal/data/movies.go to be used in cmd/api/movies.go. Updating the showMovieHandler with the Movie struct. 2025-10-19 11:03:04 +02:00
Maxime Delporte
5b6f33c3f0 Creating helpers.go file : allowing us to extract readIDParam method for further use. Updating showMovieHandler with the new method. 2025-10-10 20:50:32 +02:00
Maxime Delporte
faa27b11d5 Fixing typo. 2025-10-10 20:43:14 +02:00
Maxime Delporte
e0931223e4 Adding httprouter dependency to manage endpoints. Adding our routes to routes.go file facilitating endpoints management and adding POST /v1/movies and GET /v1/movies/:id endpoints. Updating main.go file removing ServeMux and add httprouter instead in app structure. Creating movies.go file to manage create and show movie endpoint. 2025-10-10 16:15:30 +02:00