Giter Site home page Giter Site logo

mikeheft / rails_engine Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 1.32 MB

The Rails Engine API allows you to query metadata and perform business analytics on merchants, invoices, invoice items, items, customers, and transactions. The return format for all endpoints is JSON.

Ruby 24.55% JavaScript 0.21% CSS 20.31% HTML 54.93%

rails_engine's Introduction

Rails Engine

The Rails Engine API allows you to query metadata and perform business analytics on merchants, invoices, invoice items, items, customers, and transactions. The return format for all endpoints is JSON.

Base URL

All URLs referenced in this documentation have the following base:

http://localhost:3000

Getting Started

This section will help you get started with our API.

Prerequisites

You're going to need:

  • Ruby, version 2.3.1 or newer
  • Bundler

Getting Set Up

  1. Fork this repository on Github.

  2. Clone your forked repository (not our original one) to your hard drive with

git clone https://github.com/mimilettd/rails_engine
  1. cd rails_engine

  2. Run bundle

  3. Create, migrate, and seed your database:

rake db:create
rake db:migrate
rake import
  1. Run rspec to confirm passing tests.

  2. Initialize server locally by running rails s

Request URLs

Merchant Record Endpoints

GET /api/v1/merchants.json
GET /api/v1/merchants/1.json
GET /api/v1/merchants/find_all
GET /api/v1/merchants/find?
GET /api/v1/merchants/random.json

Note: For find_all and find, you can use the following search params: id, name, created_at, updated_at.

Sample Response for /api/v1/merchants/find_all?name=Cummings-Thiel:

[{"id":4,"name":"Cummings-Thiel"}]

Merchant Relationship Endpoints

GET /api/v1/merchants/:id/items
GET /api/v1/merchants/:id/invoices

Merchant Business Intelligence Endpoints

GET /api/v1/merchants/most_revenue?quantity=x
GET /api/v1/merchants/most_items?quantity=x
GET /api/v1/merchants/revenue?date=x
GET /api/v1/merchants/:id/revenue
GET /api/v1/merchants/:id/revenue?date=x
GET /api/v1/merchants/:id/favorite_customer
GET /api/v1/merchants/:id/customers_with_pending_invoices

Transactions Record Endpoints

GET /api/v1/transactions.json
GET /api/v1/transactions/1.json
GET /api/v1/transactions/find_all?
GET /api/v1/transactions/find?
GET /api/v1/transactions/random.json

Note: For find_all and find, you can use the following search params: id, invoice_id, credit_card_number, result, created_at, updated_at.

Transactions Relationship Endpoints

GET /api/v1/transactions/:id/invoice

Customer Record Endpoints

GET /api/v1/customers.json
GET /api/v1/customers/1.json
GET /api/v1/customers/find_all
GET /api/v1/customers/find?
GET /api/v1/customers/random.json

Note: For find_all and find, you can use the following search params: id, first_name, last_name, created_at, updated_at.

Customer Relationship Endpoints

GET /api/v1/customers/:id/invoices
GET /api/v1/customers/:id/transactions

Customer Business Intelligence Endpoints

GET /api/v1/customers/:id/favorite_merchant

Invoice Record Endpoints

GET /api/v1/invoices.json
GET /api/v1/invoices/1.json
GET /api/v1/invoices/find_all
GET /api/v1/invoices/find?
GET /api/v1/invoices/random.json

Note: For find_all and find, you can use the following search params: id, customer_id, merchant_id, status, created_at, updated_at.

Invoice Relationship Endpoints

GET /api/v1/invoices/:id/transactions
GET /api/v1/invoices/:id/invoice_items
GET /api/v1/invoices/:id/items
GET /api/v1/invoices/:id/customer
GET /api/v1/invoices/:id/merchant

Transaction Record Endpoints

GET /api/v1/transactions.json
GET /api/v1/transactions/1.json
GET /api/v1/transactions/find_all
GET /api/v1/transactions/find?
GET /api/v1/transactions/random.json

Note: For find_all and find, you can use the following search params: id, invoice_id, credit_card_number, result, created_at, updated_at.

Transaction Relationship Endpoints

GET /api/v1/transactions/:id/invoice

Transaction Record Endpoints

GET /api/v1/transactions.json
GET /api/v1/transactions/1.json
GET /api/v1/transactions/find_all
GET /api/v1/transactions/find?
GET /api/v1/transactions/random.json

Customer Record Endpoints

GET /api/v1/customers.json
GET /api/v1/customers/1.json
GET /api/v1/customers/find_all
GET /api/v1/customers/find?
GET /api/v1/customers/random.json

Note: For find_all and find, you can use the following search params: id, first_name, last_name, created_at, updated_at.

Customer Relationship Endpoints

GET /api/v1/customers/:id/invoices
GET /api/v1/customers/:id/transactions

Customer Business Intelligence Endpoints

GET /api/v1/customers/:id/favorite_merchant

Additional Information

This is the first paired project of Module 3 at the Turing School. More information on this project can be found here.

rails_engine's People

Contributors

mimizotti avatar mikeheft 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.