awalsh3 / books

Mentor Challenge Project - API powered by Rails. An API that serves data about Books.
0 stars 0 forks source link

Learn Rails 14. A create endpoint. #31

Open patrickquigley102 opened 11 months ago

patrickquigley102 commented 11 months ago

A create books endpoint.

This ticket is light on implementation details on purpose. I want you to bring together all we've been learning and apply it here.

If you get stuck, I'm always an email/call etc away to help.

Requirements are:

  1. A create books endpoint, JSON API compliant.
  2. Unit tests for all classes written by yourself, following the black box testing approach.
  3. Request level specs for the endpoint too.

We're going to also use this ticket to discuss planning of work, so. I want you to do the following please.

  1. Take the requirements above and write down a plan. This plan should include enough detail to make sense to us both but, still be light overall. You don't need to write an essay. The plan should include a plan for the PRs you'll submit for review.
  2. Share the plan with me on this ticket.
  3. We'll discuss together in a call.
  4. Then you action that plan!

Sample Plan

This is a sample for another bit of work, to indicate what I'm looking for.

The sample work: build a author model

Plan would be:

  1. PR 1. Tests for (TDD) and a basic author model with simple assumptions of what the data structure and validations are.
  2. PR 2. Tests for and a refactor of book to associate with author correctly. Including updates to seeds and existing tests. Also updates to the book#index endpoint, to remove any data no longer part of the book model. Such as author_name.
awalsh3 commented 4 months ago

[DRAFT] Build a JSON API-compliant create books endpoint. Plan:

  1. PR 1 - Tests for TDD - a basic book create endpoint (Unit and Request Level)
  2. PR 2 - Request. Add books create action route. Request. Add controller with create action and book_params method. Response. Serialize the response in the format we've established for books Response. Make sure the headers compliant with JSON spec. Use curl to interact with HTTP requests