Giter Site home page Giter Site logo

homepanda-task's Introduction

Homepanda Task

Description

This project allows you to view the list of transactions carried out by a specific customer. The value of the transactions is converted into euros

The project was implemented using:

  • docker and docker-compose
  • php 8.1
  • symfony
  • postgresql

Installation

Clone the repository:

git clone [email protected]:fpiccolo/homepanda-task.git

To initialize the project with the Make file:

make init

This command do:

  • builds the docker images
  • pulls up the containers
  • initializes the database
  • runs the migrations
  • runs the fixtures

To turn off the environment:

make down

To turn on the environment:

make up

To go inside the php container:

make sh

To run the tests:

make test

To destroy the environment:

make destroy

This command downs the environment and deletes the volumes

List of transactions

With command line

To see a customer's transactions run this command passing a customer's id as a parameter.

In the database there are only customers with id 1 and 2

make customer-transactions customer=1

Example result:

alt text

Example error with wrong customer id:

alt text

With HTTP request

You can view the list of transactions by making an HTTP call to the following url: http://127.0.0.1:8080/customer/{customerId}/transactions

Example call with curl:

curl --location --request GET 'http://127.0.0.1:8080/customer/1/transactions'

Example result:

[
    {
        "date": "2015-04-01",
        "currency": "EUR",
        "value": 57.18
    },
    {
        "date": "2015-04-02",
        "currency": "EUR",
        "value": 12.63
    },
    {
        "date": "2015-04-02",
        "currency": "EUR",
        "value": 1
    },
    {
        "date": "2015-04-03",
        "currency": "EUR",
        "value": 23.12
    }
]

Example error response:

{
    "message": "Customer with id [3] not found",
    "code": 404
}

homepanda-task's People

Contributors

fpiccolo 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.