From e85df8a45f53db939f6a9abefff7ff00b6b9c517 Mon Sep 17 00:00:00 2001 From: Rodrigo Patote <47055922+patote85@users.noreply.github.com> Date: Mon, 21 Sep 2026 12:41:10 -0300 Subject: [PATCH 1/4] docs: ARCHITECTURE alinhado ao ADR-001 (monorepo) --- ARCHITECTURE.md | 53 ++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 41 insertions(+), 12 deletions(-) diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index d8fae05..fb6f967 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -1,15 +1,44 @@ -# Arquitetura Detalhada +# Arquitetura — exclusão Pix (canônico) -## Visão Geral -Ver README.md para diagrama simplificado. +**Fonte da verdade:** [ADR-001](docs/adr/ADR-001-unificar-exclusao-pix.md) (Accepted) + [README](README.md). +Este arquivo **não** substitui o ADR; só resume o desenho atual pra agents/humanos. -## Componentes -- API Gateway -- Lambda -- DynamoDB -- Futuro: Step Functions + SNS/SQS para processamento assíncrono +## Bounded context -## Decisões de Arquitetura -- Serverless first -- Idempotência no nível da aplicação -- Separação entre código e infraestrutura (dois repositórios) \ No newline at end of file +Um repo, um stack deployável: `patote85/aws-lambda-api-gateway-python`. + +| Pasta | Papel | +|-------|--------| +| `lambda/` | Handler Powertools (HTTP API) | +| `cdk/` | Cognito + DynamoDB + Lambda + HttpApi (JWT) | +| `tests/` | pytest + moto (sem AWS) | +| `docs/adr/` | Decisões versionadas | + +`aws-api-gateway-cdk` está **arquivado** (banner no README dele) — não usar pra deploy. + +## Componentes (hoje) + +- **HTTP API** — throttle 100 rps / burst 200; CORS lab localhost (sem `*`) +- **Lambda** Python 3.12 — `app.lambda_handler` +- **DynamoDB** — PK `cliente_id` / SK `request_id`, pointer `LATEST` +- **Cognito User Pool** — JWT nas rotas mutáveis/status; `GET /health` público + +## Access pattern Dynamo (obrigatório) + +1. Histórico: `SK = ` +2. Ponteiro: `SK = LATEST` (espelho do estado corrente) +3. Status/dedup leem só `LATEST` +4. Confirmação de pagamento atualiza uuid **e** `LATEST` + +## Verificação agent-friendly + +```bash +make check # ruff + mypy(tests) + pytest + cdk synth +``` + +## Não-objetivos (ainda) + +- Step Functions / SNS/SQS (event-driven) — ADR futuro +- WAF / ACM / domínio custom +- Pix real (stub de lab) +- Unificar com `aws-crud-api-lambda-dynamodb` (outro BC) From d91a375466cdbb0fe798427a448cae86c870b2ed Mon Sep 17 00:00:00 2001 From: Rodrigo Patote <47055922+patote85@users.noreply.github.com> Date: Mon, 21 Sep 2026 12:41:33 -0300 Subject: [PATCH 2/4] docs: API.md aponta README (sem stub mentiroso) --- API.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/API.md b/API.md index dfe083e..8e26f47 100644 --- a/API.md +++ b/API.md @@ -1,5 +1,10 @@ -# API Specification +# API -## Endpoints -- POST /solicitar-exclusao-cliente -- ... \ No newline at end of file +Especificação viva está no [README](README.md) (rotas, Cognito, curl de lab). + +Endpoints: + +- `POST /solicitar-exclusao-cliente` (JWT) +- `GET /status-exclusao/{cliente_id}` (JWT) +- `POST /confirmar-pagamento` (JWT) +- `GET /health` (público) From f000dc46ccfb20ed1037b7b57e95b501021334fe Mon Sep 17 00:00:00 2001 From: Rodrigo Patote <47055922+patote85@users.noreply.github.com> Date: Mon, 21 Sep 2026 12:41:39 -0300 Subject: [PATCH 3/4] docs: DEPLOYMENT.md aponta README + CAB --- DEPLOYMENT.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/DEPLOYMENT.md b/DEPLOYMENT.md index 46a63bb..5d2f103 100644 --- a/DEPLOYMENT.md +++ b/DEPLOYMENT.md @@ -1,6 +1,10 @@ # Deployment -1. Deploy Lambda -2. Deploy CDK +Passos e comandos vivem no [README](README.md) (seção CDK / Deploy + Cognito lab). -Ver README principal. \ No newline at end of file +Resumo: + +1. `make check` (lint + types + pytest + `cdk synth`) — sem AWS +2. `npx aws-cdk@2 deploy` **só** com CAB aprovado / conta lab + +Não há deploy em dois repos: o canônico é este (ADR-001). From 6500330950e3d0ad55f5171c68a5bc1a9a604232 Mon Sep 17 00:00:00 2001 From: Rodrigo Patote <47055922+patote85@users.noreply.github.com> Date: Mon, 21 Sep 2026 12:42:01 -0300 Subject: [PATCH 4/4] =?UTF-8?q?docs:=20CHANGELOG=20sem=20stub=20Grok=20Cap?= =?UTF-8?q?it=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ba0463..63f30f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # Changelog -## [Unreleased] -- Adição de arquivos de documentação completa. +Histórico útil: merges na `main` + ADRs em `docs/adr/`. -Gerado por Grok Capitão. \ No newline at end of file +## Unreleased + +- Agent-friendly: `make check`, CI `lint`/`test`/`synth` (ruff + mypy + pytest + cdk synth) +- ADR-001 Accepted — canônico unificado; Cognito JWT; pointer LATEST