Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/renanbastos93/transaction-routine
This project is a challenge to analyze my code skills at moment.
https://github.com/renanbastos93/transaction-routine
Last synced: 18 days ago
JSON representation
This project is a challenge to analyze my code skills at moment.
- Host: GitHub
- URL: https://github.com/renanbastos93/transaction-routine
- Owner: renanbastos93
- License: mit
- Created: 2023-10-06T20:05:09.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-11T19:44:38.000Z (about 1 year ago)
- Last Synced: 2024-10-06T16:41:12.388Z (about 1 month ago)
- Language: Go
- Size: 59.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# transaction-routine
This project is a challenge to analyze my code skills at the moment.## About
This project was developed to solve a job interview problem. In summary, it is a ledger where we have records of transactions made, just like a bank statement. Some tools were used to assist in the development, thus allowing us to focus on the business rule itself. Further down, we'll be able to see a sequence diagram to better understand these rules and also how to execute and run this application.## How to run it
```bash
# Install dependecies
$ go install github.com/golang-migrate/migrate/v4/cmd/migrate@latest
$ go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest
$ go install github.com/ServiceWeaver/weaver/cmd/weaver@latest
$ go install github.com/renanbastos93/boneless/cmd/boneless@latest# Up database
$ docker-compose up# Run migrations
$ boneless migrate app up# Run server
$ boneless run# For execute unit tests
$ make test
# output in last line:
# total: (statements) 64.7%
```## Driagram
```mermaid
sequenceDiagram
title Transaction Routine
actor User
alt register user
User-->>Service:createAccount(documentNumber);
Service-->>Database: saveUser(data);
Database-->>User: created;
end
alt purchase
User-->>Service:buy(accountID, operationTypeID, amout);
Service-->>Service: validateOperationsTypes();
Service-->>Service: normalizeValues();
Service-->>Database: saveTransaction();
Database-->>User: saved your transaction;
end
alt get user
User-->>Service:getUserByAccountID(id);
Service-->>Database: getUser(accountID);
Database-->>User: user data;
end
```