Skip to content

Latest commit

 

History

History
100 lines (72 loc) · 1.89 KB

File metadata and controls

100 lines (72 loc) · 1.89 KB

Status da Instalação ✅

Go 1.22.0 foi instalado com sucesso em C:\go

Verificar Instalação

go version
# Output: go version go1.22.0 windows/amd64

Projeto Compilado ✅

C:\Users\MambaPê\Desktop\payment-event-processor\bin\payment-processor.exe
Tamanho: ~15 MB

Testes Executados ✅

TestEventTypeValidation               ✓
TestInvoiceStatusTransitions          ✓
TestSubscriptionStatusTransitions     ✓
TestHealthEndpoint                    ✓
TestSignatureGeneration               ✓
TestWebhookPayloadParsing             ✓
TestContextCancellation               ✓
TestJSONResponse                      ✓

Total: 21 testes - TODOS PASSARAM

Próximos Passos

1. Iniciar Infraestrutura (PostgreSQL + Redis)

# Ir para o diretório do projeto
cd "c:\Users\MambaPê\Desktop\payment-event-processor"

# Iniciar containers
docker compose up -d postgres redis

2. Rodar Aplicação

# Opção A: Executar binário compilado
.\bin\payment-processor.exe

# Opção B: Rodar direto via Go
go run ./cmd/server

3. Testar Endpoints

# Health check
curl http://localhost:8080/health

# Métricas
curl http://localhost:8080/metrics

# Enviar webhook de teste
.\scripts\test-webhook.ps1 -EventType "payment_succeeded"

Variáveis de Ambiente

Criar arquivo .env baseado em .env.example:

PORT=8080
ENV=development
DATABASE_URL=postgres://payments:payments123@localhost:5432/payments?sslmode=disable
REDIS_URL=redis://localhost:6379/0
WEBHOOK_SECRET=whsec_test_secret_key_for_development
RATE_LIMIT_REQUESTS=100
WORKER_CONCURRENCY=5
WORKER_MAX_RETRIES=3

Verificação Final

# Build
go build -o bin/payment-processor.exe ./cmd/server

# Testes
go test -v ./...

# Formato/Lint
go fmt ./...

# Dependências
go mod tidy

Sistema pronto para desenvolvimento!