Skip to content

nelsonlpco/transactions

Repository files navigation

transactionsapi

A REST API to register debit and credit transactions from customers accounts.


transactions-api

startup options

flag description
-d create database
-s seed operation types table

Configurations

var example value description
SERVER_PORT 5566 defines the port for the accessing server
SQL_DRIVER mysql / sqlite3 defines the database drive
CONNECTION_STRING file:/teste.db defines the connection string to database
CONNECTION_TIMEOUT 5 defines timeout to wait connection in seconds
LOG_LEVEL 1 - 6 (logrus levels) defines logrus level to log
TTL 3 Defines time to leave of io operations by context in seconds
SCHEMAS_PATH ./v1_schema.sql Path to SQL schema to configure database.

makefile commands

command description
clean clean resources
test run all tests
coverage run all tests and generate coverage report
updatemocks update all mocks generated by mockgen
build compile program
buildimage build docker production image
rundev run program with dev configuration .env-dev
runtest run program with test configuration .env-test

docker

docker and docker-compose configurations

docker-compose -f ./docker/docker-compose.yaml up -d

Resources


DOC

  • swagger file
  • collections

Architecture

Concepts of clean architecture and DDD

Layers


Domain

Represents all business rules, no external dependencies.

  • Entiy

    • Represents a business unity, important concepts.
    • One point of validation
    • Closed to modifications
    • Isolated Business rules
  • Repository

    • Adapter to receive and dispatch data
    • Only interfaces
  • UseCases

    • Represents a single business use case
    • Single responsibility
    • No dependencies.

Infrastructure

Implementation of adapters to input and output data

  • datasources

    • Abstraction to access data sources, with apis, databases e etc.
  • Repository

    • Implementation of domain repository interfaces
  • inframodel

    • Data model, represents external data models.

application

Facade to execute business rules with useCases

  • services

    • Services by context

shared

cross cutting layer, share common contents

  • commonerrors

    • custom errors by context

api

Application entry points

  • adapter

    • entry point adapters
      • rest
        • controller
          • request controllers
        • model
          • input output data models
        • responses
          • wrapper rest output responses
        • middlewares
          • adapters to rest clint
        • core
          • bootstrap file and dependency container
        • server
          • Server application

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published