Skip to content

Commit

Permalink
Merge pull request #512 from LerianStudio/refactor/MIDAZ-510
Browse files Browse the repository at this point in the history
Refactor/MIDAZ-510
  • Loading branch information
MartinezAvellan authored Feb 11, 2025
2 parents a76d672 + d034c4e commit 3d1e622
Show file tree
Hide file tree
Showing 181 changed files with 1,150 additions and 673 deletions.
4 changes: 2 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

- [ ] Auth
- [ ] Infra
- [ ] Ledger
- [ ] Onboarding
- [ ] Mdz
- [ ] Transaction
- [ ] Audit
Expand All @@ -24,6 +24,6 @@ Please check each item after it's completed.
- [ ] I have updated the version appropriately (if applicable).
- [ ] I have confirmed this code is ready for review.

## Obs: Please, always remember to target your PR to develop branch instead of main.
## Additional Notes
[//]: # (Add any additional notes, context, or explanation that could be helpful for reviewers.)
## Obs: Please, always remember to target your PR to develop branch instead of main.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
strategy:
matrix:
app:
- name: "midaz-ledger"
working_dir: "components/ledger"
- name: "midaz-audit"
working_dir: "components/audit"
- name: "midaz-onboarding"
working_dir: "components/onboarding"
- name: "midaz-transaction"
working_dir: "components/transaction"

Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/midaz-update-repos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
git push origin main
update-swagger-on-pages:
name: Run Update swagger on ledger and transaction in LerianStudio.github.io
name: Run Update swagger on onboarding and transaction in LerianStudio.github.io
runs-on: ubuntu-24.04
steps:
- uses: actions/create-github-app-token@v1
Expand Down Expand Up @@ -92,7 +92,7 @@ jobs:
gh repo clone LerianStudio/LerianStudio.github.io
- name: Generate Swagger on Ledger and Transaction
- name: Generate Swagger on Onboarding and Transaction
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
Expand All @@ -115,8 +115,8 @@ jobs:
cp midaz/components/audit/api/swagger.json LerianStudio.github.io/audit/
cp midaz/components/audit/api/openapi.yaml LerianStudio.github.io/audit/
cp midaz/components/ledger/api/swagger.json LerianStudio.github.io/ledger/
cp midaz/components/ledger/api/openapi.yaml LerianStudio.github.io/ledger/
cp midaz/components/onboarding/api/swagger.json LerianStudio.github.io/onboarding/
cp midaz/components/onboarding/api/openapi.yaml LerianStudio.github.io/onboarding/
cp midaz/components/transaction/api/swagger.json LerianStudio.github.io/transaction/
cp midaz/components/transaction/api/openapi.yaml LerianStudio.github.io/transaction/
Expand All @@ -137,7 +137,7 @@ jobs:
git remote set-url origin https://${{ secrets.MANAGE_TOKEN }}@github.com/LerianStudio/LerianStudio.github.io.git
git add audit ledger transaction
git add audit onboarding transaction
git commit -S -m "Update openapi.yaml and swagger.json from Repositories"
git push origin main
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
name: Integration test
runs-on: ubuntu-24.04
env:
WORKING_DIR: components/ledger
WORKING_DIR: components/onboarding
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -42,7 +42,7 @@ jobs:
environment:
name: create_release
env:
WORKING_DIR: components/ledger
WORKING_DIR: components/onboarding
name: Create release to Midaz
steps:
- uses: actions/create-github-app-token@v1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/update-env-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
VERSION=$(grep '^VERSION=' ./components/ledger/.env.example | cut -d '=' -f2)
VERSION=$(grep '^VERSION=' ./components/onboarding/.env.example | cut -d '=' -f2)
echo "LEDGER version: $VERSION"
echo "::set-output name=version::$VERSION"
Expand All @@ -75,7 +75,7 @@ jobs:
- name: Update LEDGER Env
if: steps.latest_release.outputs.tag != steps.env_release.outputs.version
run: |
sed -i "s/^VERSION=.*/VERSION=${{ steps.latest_release.outputs.tag }}/" ./components/ledger/.env.example
sed -i "s/^VERSION=.*/VERSION=${{ steps.latest_release.outputs.tag }}/" ./components/onboarding/.env.example
- name: Update TRANSACTION Env
if: steps.latest_release.outputs.tag != steps.env_release.outputs.version
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ components/mdz/bin/mdz
.idea
*.iml
components/ledger/_docker-compose.yml
components/onboarding/_docker-compose.yml
coverage.out
dist/
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ builds:
- -X github.com/LerianStudio/midaz/components/mdz/pkg/environment.ClientID=9670e0ca55a29a466d31
- -X github.com/LerianStudio/midaz/components/mdz/pkg/environment.ClientSecret=dd03f916cacf4a98c6a413d9c38ba102dce436a9
- -X github.com/LerianStudio/midaz/components/mdz/pkg/environment.URLAPIAuth=http://127.0.0.1:8080
- -X github.com/LerianStudio/midaz/components/mdz/pkg/environment.URLAPILedger=http://127.0.0.1:3000
- -X github.com/LerianStudio/midaz/components/mdz/pkg/environment.URLAPIOnboarding=http://127.0.0.1:3000
- -X github.com/LerianStudio/midaz/components/mdz/pkg/environment.Version={{.Version}}

archives:
Expand Down
24 changes: 12 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ AUDIT_DIR := ./components/audit
AUTH_DIR := ./components/auth
INFRA_DIR := ./components/infra
MDZ_DIR := ./components/mdz
LEDGER_DIR := ./components/ledger
ONBOARDING_DIR := ./components/onboarding
TRANSACTION_DIR := ./components/transaction

BLUE := \033[36m
Expand Down Expand Up @@ -63,19 +63,19 @@ help:
@echo " make checkEnvs Check if github hooks are installed and secret env on files are not exposed."
@echo " make auth Run a command inside the auth app in the components directory to see available commands."
@echo " make infra Run a command inside the infra app in the components directory to see available commands."
@echo " make ledger Run a command inside the ledger app in the components directory to see available commands."
@echo " make onboarding Run a command inside the onboarding app in the components directory to see available commands."
@echo " make transaction Run a command inside the transaction app in the components directory to see available commands."
@echo " make audit Run a command inside the audit app in the components directory to see available commands."
@echo " make set-env Run a command to copy all .env.example to .env into respective folders."
@echo " make all-services Run a command to all services passing any individual container command."
@echo " make generate-docs-all Run a command to inside the ledger and transaction app to generate swagger docs."
@echo " make generate-docs-all Run a command to inside the onboarding and transaction app to generate swagger docs."
@echo ""
@echo ""
@echo "$(BOLD)Service Commands:$(NC)"
@echo " make up - Start all services with Docker Compose"
@echo " make auth COMMAND=<cmd> - Run command in auth service"
@echo " make infra COMMAND=<cmd> - Run command in infra service"
@echo " make ledger COMMAND=<cmd> - Run command in ledger service"
@echo " make onboarding COMMAND=<cmd> - Run command in onboarding service"
@echo " make transaction COMMAND=<cmd> - Run command in transaction service"
@echo " make audit COMMAND=<cmd> - Run command in audit service"
@echo " make all-services COMMAND=<cmd> - Run command across all services"
Expand Down Expand Up @@ -154,7 +154,7 @@ set-env:
@echo "$(BLUE)Setting up environment files...$(NC)"
cp -r $(AUTH_DIR)/.env.example $(AUTH_DIR)/.env
cp -r $(INFRA_DIR)/.env.example $(INFRA_DIR)/.env
cp -r $(LEDGER_DIR)/.env.example $(LEDGER_DIR)/.env
cp -r $(ONBOARDING_DIR)/.env.example $(ONBOARDING_DIR)/.env
cp -r $(TRANSACTION_DIR)/.env.example $(TRANSACTION_DIR)/.env
cp -r $(MDZ_DIR)/.env.example $(MDZ_DIR)/.env
cp -r $(AUDIT_DIR)/.env.example $(AUDIT_DIR)/.env
Expand All @@ -165,7 +165,7 @@ up:
@echo "$(BLUE)Starting all services...$(NC)"
@$(DOCKER_CMD) -f $(AUTH_DIR)/docker-compose.yml up --build -d
@$(DOCKER_CMD) -f $(INFRA_DIR)/docker-compose.yml up --build -d
@$(DOCKER_CMD) -f $(LEDGER_DIR)/docker-compose.yml up --build -d
@$(DOCKER_CMD) -f $(ONBOARDING_DIR)/docker-compose.yml up --build -d
@$(DOCKER_CMD) -f $(TRANSACTION_DIR)/docker-compose.yml up --build -d
@echo "$(BLUE)All services started successfully$(NC)"

Expand All @@ -179,10 +179,10 @@ infra:
@echo "$(BLUE)Executing command in infra service...$(NC)"
$(MAKE) -C $(INFRA_DIR) $(COMMAND)

.PHONY: ledger
ledger:
@echo "$(BLUE)Executing command in ledger service...$(NC)"
$(MAKE) -C $(LEDGER_DIR) $(COMMAND)
.PHONY: onboarding
onboarding:
@echo "$(BLUE)Executing command in onboarding service...$(NC)"
$(MAKE) -C $(ONBOARDING_DIR) $(COMMAND)

.PHONY: transaction
transaction:
Expand All @@ -199,7 +199,7 @@ all-services:
@echo "$(BLUE)Executing command across all services...$(NC)"
$(MAKE) -C $(AUTH_DIR) $(COMMAND) && \
$(MAKE) -C $(INFRA_DIR) $(COMMAND) && \
$(MAKE) -C $(LEDGER_DIR) $(COMMAND) && \
$(MAKE) -C $(ONBOARDING_DIR) $(COMMAND) && \
$(MAKE) -C $(TRANSACTION_DIR) $(COMMAND) && \
$(MAKE) -C $(AUDIT_DIR) $(COMMAND)

Expand All @@ -224,6 +224,6 @@ tidy:
.PHONY: generate-docs-all
generate-docs-all:
@echo "$(BLUE)Executing command to generate swagger...$(NC)"
$(MAKE) -C $(LEDGER_DIR) generate-docs && \
$(MAKE) -C $(ONBOARDING_DIR) generate-docs && \
$(MAKE) -C $(TRANSACTION_DIR) generate-docs && \
$(MAKE) -C $(AUDIT_DIR) generate-docs
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ Midaz is designed to address the limitations of traditional ledger systems and p

At Lerian, we view a core banking system as a comprehensive platform consisting of four main components:

1. **Ledger (Core)**: The central database that manages all transactions and accounts. This is where Midaz plays a crucial role, serving as the foundation of the core banking system.
1. **Onboarding (Core)**: The central database that manages all transactions and accounts. This is where Midaz plays a crucial role, serving as the foundation of the core banking system.

2. **Transactional Services**: These generate debits and credits in the ledger. Examples include instant payments (like PIX in Brazil), card transactions, and wire transfers.
2. **Transactional Services**: These generate debits and credits in the onboarding. Examples include instant payments (like PIX in Brazil), card transactions, and wire transfers.

3. **Governance**: This component includes integrations for onboarding, anti-fraud/AML measures, management reporting, regulatory compliance, and accounting.

Expand Down Expand Up @@ -69,7 +69,7 @@ First, make sure you have Docker and Docker Compose installed.
This will start all components using Docker Compose:
- Authentication Service
- Infrastructure Service
- Ledger Service
- Onboarding Service
- Transaction Service

### Additional Commands
Expand Down
Loading

0 comments on commit 3d1e622

Please sign in to comment.