Git Product home page Git Product logo

billing-laravel's Introduction

Billing

This system aims to control billings and manage payments of these billings.


Functionalities


Sequence Receive File


Technologies

  • PHP 8.3 with Laminas
  • MySQL 8.0.32
  • RabbitMQ 3.10.1

Instructions for run this app:

First time

Clone project in your projects folder.

$ git clone [email protected]:fatorx/app-billing.git && cd app-billing

Copy .env.dist to .env and adjust values in the .env file to your preferences.

cp .env.dist .env 

Configure environment to local application.

cp api/config/autoload/local.php.dist api/config/autoload/local.php 

Add permissions to folder data (MySQL and RabbitMQ) and api/data (logs, storage files), this is where the persistence files will be kept.

chmod 755 data
chmod 755 api/data

Mount the environment based in docker-compose.yml.

docker-compose up -d --build

Access database to create tables (the name app-billing-database is based in the parameter config APP in .env).

docker exec -it app-billing-database mysql -u root -p -D billings

After access the docker with above command, at the MySQL prompt type:

source /tmp/dump.sql

Working routine

docker-compose up -d

Access to environment

Test to send a file:

curl --location '0.0.0.0:8009/v1/billing/send-file' \
--form 'file=@"/home/yourpath/projects/app-billing/temp/test_length_ok.csv"'

Test to send a request to webhook (file size limited in 1MB):

curl --location '0.0.0.0:8009/v1/billing/webhook' \
     --header 'Content-Type: application/json' \
     --data '{
        "debtId": "123",
        "paidAt": "2022-06-09 10:00:00",
        "paidAmount": 1001.10,
        "paidBy": "John Doe"
     }'

Tests Inside Docker

docker exec -it app-billing-php-fpm bash

And then do this

vendor/bin/phpunit --testdox --testsuite "Game Test Suite"

or

vendor/bin/phpunit --testdox --testsuite "Game Test Suite" --group games

Tests Outside Docker

docker exec -it app-billing-php-fpm vendor/bin/phpunit --testdox --testsuite "Game Test Suite"

Coverage

docker exec -it app-billing-php-fpm bash 
XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-html data/report --group billing

Licence

MIT

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.