Git Product home page Git Product logo

tea_subscription's Introduction

Contributors Forks Stargazers Issues GitHub last commit


Screen Shot 2021-12-15 at 9 56 38 AM

Tea Subscription

Take-Home Back End Prompt Tea Subscription Service You will create a Rails API for a Tea Subscription Service.

https://mod4.turing.edu/projects/take_home/

About The Project

Requirements: At a minimum, you must create:

An endpoint to subscribe a customer to a tea subscription An endpoint to cancel a customer’s tea subscription An endpoint to see all of a customer’s subscriptions (active and cancelled) Beyond the base requirements, include any additional endpoints you’d like, but be mindful of your time. You don’t need to go overboard, consider what might be necessary to achieve MVP so that this API is easy to understand and consume by a Frontend Developer.

Things we’ll be looking for: A strong understanding of Rails Ability to create restful routes Demonstration of well-organized code, following OOP Test Driven Development Clear documentation Try to limit your total time to approximately 8 hours on this project. Prioritize what is important to completing MVP and demonstrating your capabilities as a developer. If you are looking for a stretch option, you can consume this API for tea information: Tea API

(back to top)

Built With

Framework

Languages

Tools

Gems

Development Principles

(back to top)

Getting Started

Installation

Follow the instructions listed below to get the application up and running.

  1. Clone the repo
    git clone [email protected]:ozzman84/tea_subscription.git
  2. Run bundle
    bundle install
  3. Run migrations
    rails db:{create,migrate}

(back to top)

Query/Response

POST http://localhost:3000/api/v1/customer/subscriptions

QUERIES

All Customers

  • All Customers Query

    {
      customer_id: 2
    }
  • JSON Return Payload

    {
      "data": {
        "id": 1,
        "type": "subscription",
        "attributes": {
          "title": "Eary Grey",
          "price": 5.99,
          "status": "active",
          "frequency": "weekly"
        },
        "relationships": {
          "id": "1",
          "type": "customer",
          "attributes": {
            "name": "Customer A"
          },
          "id": "1",
          "id": "tea",
          "attributes": {
            "name": "Earl Grey"
          }
        },
        "id": 2,
        "type": "subscription",
        "attributes": {
          "title": "Eary Grey",
          "price": 5.99,
          "status": "active",
          "frequency": "weekly"
        },
        "relationships": {
          "id": "1",
          "type": "customer",
          "attributes": {
            "name": "Customer A"
          },
          "id": "1",
          "id": "tea",
          "attributes": {
            "name": "Earl Grey"
          }
        }  
      }
    }

CREATE

  • Create Customer Mutation
{
  customer_id: 2,
  tea_id: 1,
  title: 'Test Name of Tea',
  price: 5.99,
  status: 'active',
  frequency: 'weekly'
}
  • JSON Return Payload
{
  "data": {
    "id": 2,
    "type": "subscription",
    "attributes": {
      "title": "Eary Grey",
      "price": 5.99,
      "status": "active",
      "frequency": "weekly"
    },
    "relationships": {
      "id": "1",
      "type": "customer",
      "attributes": {
        "name": "Customer A"
      },
      "id": "1",
      "id": "tea",
      "attributes": {
        "name": "Earl Grey"
      }
    }  
  }
}

UPDATE

  • Update Location Query
{
  subscription_id: 1,
  status: "cancelled"
}
  • JSON Return Payload
{
  "data": {
    "id": 2,
    "type": "subscription",
    "attributes": {
      "title": "Eary Grey",
      "price": 5.99,
      "status": "active",
      "frequency": "weekly"
    },
    "relationships": {
      "id": "1",
      "type": "customer",
      "attributes": {
        "name": "Customer A"
      },
      "id": "1",
      "id": "tea",
      "attributes": {
        "name": "Earl Grey"
      }
    }  
  }
}

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

Contact

Back-end Team
Ozzie Osmonson link link

(back to top)

tea_subscription's People

Contributors

ozzman84 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.