Coder Social home page Coder Social logo

edsey-omenda / service-api Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 42 KB

This is a RESTFUL microservice program that will perform database operation to create CUSTOMER and create customer ACCOUNT. update Customer ACCOUNT through amount withdrawals and topups.

Home Page: https://service-api.onrender.com/customers

Ruby 98.46% HTML 0.85% Shell 0.68%

service-api's Introduction

Microservice system

The system has two main models that form one to many relationship:

Customer

  • A customer has many accounts.
  • A customer has multiple credit/debit card numbers.
  • A customer can be created with specific attrubutes and related to an account that solely belongs to that customer.
  • Live link for customer route is: https://service-api.onrender.com/customers

Account.

  • An account belongs to a customer.
  • An account can be created and is related to a customer(new or existing one)
  • Account can be topped up and withrawal made via the amount attribute.(Operation managed by the update method in the account controller).
  • Live link for account routes is: https://service-api.onrender.com/accounts

API Reference

Get all /customers

GET /https://service-api.onrender.com/customers

Get customers/:id

GET /https://service-api.onrender.com/customers/${id} Parameter Type Description id integer Required. Id of item to fetch

Get all /accounts

GET /https://service-api.onrender.com/accounts

Get accounts/:id

GET /https://service-api.onrender.com/accounts/${id} Parameter Type Description id integer Required. Id of item to fetch

Post customers/

Creating a Customer

POST /https://service-api.onrender.com/customers/

Parameter Type Description
name String. Name of the customer.
account_type String. Type of customer account.
account_number. String. Customer account number.
email String. Customer email.
age integer. Customer age.
contact integer. Customer contact number.

Post accounts/

Creating an account for a specific customer.

POST /https://service-api.onrender.com/accounts/

Parameter Type Description
customer_id integer. Id of the customer relating toaccount.
account_name String. Name of customer account.
account_number. integer. Customer account number.
debit_Cnumber integer. Account debit card number.
credit_Cnumber integer. Account credit card number.
account_type integer. Type of customer account.
amount integer. Amount of money inside the account.

Updating accounts/

UPdating account

PATCH/PUT /https://service-api.onrender.com/accounts/${id}

Parameter Type Description
amount integer Amount of money inside the account.

Technologies used

  • Ruby on rails.
  • Postgresql.
  • Render

service-api's People

Contributors

edsey-omenda 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.