Frontend: - Refatoração completa do [GestaoUsuarioModal](cci:1://file:///c:/Projetos/saveinmed/saveinmed-frontend/src/components/GestaoUsuarioModal.tsx:17:0-711:2) para melhor visibilidade e UX. - Correção de erro (crash) ao carregar endereços vazios. - Nova interface de Configuração de Frete com abas para Entrega e Retirada. - Correção na busca de dados completos da empresa (CEP, etc). - Ajuste na chave de autenticação (`access_token`) no serviço de endereços. Backend: - Correção do erro 500 em [GetShippingSettings](cci:1://file:///c:/Projetos/saveinmed/backend-old/internal/repository/postgres/postgres.go:1398:0-1405:1) (tratamento de `no rows`). - Ajustes nos handlers de endereço para suportar Admin/EntityID corretamente. - Migrações de banco de dados para configurações de envio e coordenadas. - Atualização da documentação Swagger e testes. |
||
|---|---|---|
| .. | ||
| cmd | ||
| docs | ||
| internal | ||
| .env | ||
| .env.example | ||
| .gitignore | ||
| api | ||
| BACKEND.md | ||
| Dockerfile | ||
| go.mod | ||
| go.sum | ||
| login.json | ||
| main | ||
| README.md | ||
SaveInMed Backend API
Status (pronto x faltando)
Pronto
- Conteúdo descrito neste documento.
Faltando
- Confirmar no código o estado real das funcionalidades e atualizar esta seção conforme necessário.
This service handles the core business logic, data persistence, and external integrations for the SaveInMed B2B Marketplace.
🏗 Architecture
The backend follows a layered architecture to ensure separation of concerns and maintainability.
graph TD
%% Clients
Client([Client Application])
%% Entry Point
subgraph "API Layer"
Router[Router / Middleware]
AuthH[Auth Handler]
UserH[User Handler]
ProdH[Product Handler]
CartH[Cart Handler]
OrderH[Order Handler]
PayH[Payment Handler]
ShipH[Shipping Handler]
end
%% Business Logic
subgraph "Service Layer"
AuthS[Auth Service]
UserS[User Service]
ProdS[Catalog Service]
OrderS[Order Service]
PayS[Payment Service]
ShipS[Shipping Service]
end
%% Data / Infra
subgraph "Infrastructure Layer"
DB[(PostgreSQL)]
MP[Mercado Pago Adapter]
Asaas[Asaas Adapter]
Stripe[Stripe Adapter]
Mapbox[Mapbox Service]
end
%% Flows
Client --> Router
Router --> AuthH
Router --> UserH
Router --> ProdH
Router --> CartH
Router --> OrderH
Router --> PayH
Router --> ShipH
AuthH --> AuthS
UserH --> UserS
ProdH --> ProdS
CartH --> OrderS
OrderH --> OrderS
PayH --> PayS
ShipH --> ShipS
AuthS --> DB
UserS --> DB
ProdS --> DB
OrderS --> DB
PayS --> MP
PayS --> Asaas
PayS --> Stripe
ShipS --> Mapbox
%% Styling
style Client fill:#f9f,stroke:#333
style Router fill:#ff9,stroke:#333
style DB fill:#94a3b8,stroke:#333
🛠 Tech Stack
- Language: Go 1.24+
- Framework: Standard Library + Chi/Mux (inferred)
- Database: PostgreSQL
- Docs: Swagger/OpenAPI
🚀 Key Features
- High-performance REST API
- JWT Authentication
- Role-Based Access Control
- Payment Gateway Integration (Mercado Pago, Asaas, Stripe)
- Real-time Inventory Management
🧪 Tests
go test ./... -cover
Para matriz completa (com/sem banco e Playwright), veja: docs/TESTES.md