caden-jarrett / whats_the_tea

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

About the Repo

Whts The Tea is a project that allows developers to create subscriptions for customers, and different teas. All endpoints are active through local host.

Built With

RoR pgsql

Gems

rspec shoulda capybara simplecov spring faker faraday

Set Up

  • Clone this repo
  • bundle install
  • rails s

Database Creation

  • `rails db:{create,migrate}``

Database Structure

Database

Testing Instructions

  • Clone this repo
  • in terminal (apple or integrated)
    • bundle install
    • bundle exec rspec

End Points

Create Subscription

        params = {
            customer_id: 1,
            tea_id: 1,
            title: 'The High Life',
            frequency: 'Twice a week',
            price: 25.50
            }

request:

post https://localhost:3000/create_subscriptions, params:params

response:

        {
            data: {
                customer_id: 1,
                tea_id: 1,
                status: 'active',
                title: 'The High Life'
                price: 25.50,
                frequency: 'Twice a week'
            }
        }

Cancel Subscription

        params = {
            subscription_id: 1
            }

request:

post https://localhost:3000/customer_subscriptions_cancel, params:params

response:

        {
            data: {
                customer_id: 1,
                tea_id: 1,
                status: 'cancelled',
                title: 'The High Life'
                price: 25.50,
                frequency: 'Twice a week'
            }
        }

View all of a customers subscriptions

        params = {
            customer_id: 1
            }

request:

post https://localhost:3000/customer_subscriptions, params:params

response:

        {
            data: {
                customer_id: 1,
                subscriptions: {
                    active:                         
                            [{
                                title: 'The High Life'
                                price: 25.50,
                                status: 'active',
                                frequency: 'Twice a week',
                                tea_id: 1
                            }],
                    cancelled:                         
                            [{
                                title: 'Sea Breeze'
                                price: 45.50,
                                status: 'cancelled',
                                frequency: 'Once a month',
                                tea_id: 2
                            }]
                    }

            }
        }

About


Languages

Language:HTML 79.2%Language:Ruby 20.8%