Skip to content

luizeduardotesta/cashback

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cashback

Uma api RESTfull.

Proposal Problem

Fazer cashback para os cliente. Sistema usado apenas pelo admin. Conforme o trello: https://trello.com/b/ORB80QSL/cashback

Deps for Linux

  • sudo apt update
  • sudo apt upgrade
  • sudo apt install -y build-essential libssl-dev zlib1g-dev automake autoconf libncurses5-dev

In loco Setup

  • Instalar as deps mix deps.get
  • Criar o banco mix ecto.setup
  • Start Phoenix mix phx.server
  • Rodar os testes mix test

Database

PostgreSQL

username: postgres
password: postgres

Using

Você pode usar postman/insomnia ou algo similar pra fazer os request de endpoin abaixo:

Endpoint

  • Cadastrar regras (post api/rules)
{
  "rule": { 
    "description": "cashback simples", 
    "bonus": 10
  }
}
  • Listagem de regras (get api/rules)

  • Cadastrar compra do usuario (post api/purchases)

{
  "purchase": { 
    "rule_id": 1,
    "user_cpf": "466.745.098-20",
    "price": 2000
  }
}
  • Listagem de compras (get api/purchases)

  • Gerar codigó de cashback por compra (post api/cashback_code/:id)

Made by

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages