philmarcu / tea_service

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tea Service API

Table of Contents

  1. Overview
  2. Database Design
  3. Endpoints
  4. Gems & Resources

Built With



Overview

🍵 Tea Service is a subscription app designed to let a customer subscribe to regular shipments of tea for a period of their choosing - monthly, quarterly or annually. A customer can suscribe, cancel a subscription, and view all of their previous subscriptions whether they are active, pending or cancelled. A customer can also view all teas currently stored in the database. Future feature may involve consuming Tea API for data.

Database Design

Database was designed with intention of using the Subscription model as a join table between the customer and a specified tea that the customer intends to subscribe to. This was designed with the intention of making the customer primarily make differne subscriptions to different teas as each tea would have an individual frequency plan. Future potential refactors could include making it possible to subscribe to multiple teas with one subscription, like creating a Bulk Subscription model possibly or just changing the current Subscription model.

tea_service_db

Endpoints

The current endpoints in tea service are:

Find All Teas

GET /teas

Find a Customer's Subscriptions

GET /customers/:customer_id/subscriptions

Create a Subscription

POST /subscriptions

Cancel a Subscription

GET /subscriptions/:subscription_id/cancel

Delete a Subscription

DELETE /subscriptions/:id

Gems & Resources

Gems used in the creation of this project:

jsonapi-serializer
Faker
Factory Bot

About


Languages

Language:Ruby 99.4%Language:HTML 0.6%