When the platform company (CNPJ 00000000000000) already exists in the DB,
RegisterAccount was failing with a unique constraint error before creating
the admin user. Now the bootstrap checks for the existing company first
and binds the new admin user directly to it.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Corrige algoritmo de validacao CNPJ (pesos completos 12/13 digitos)
- Auto-login apos cadastro de usuario redirecionando para /seller
- Registro: role padrao Seller quando campo vazio, mapeamento company_name/cnpj
- Adiciona role Seller ao middleware productManagers (fix 403 em criacao de produto)
- Inventario: usa campos corretos da API (nome, ean_code, sale_price_cents, stock_quantity)
- Marketplace: raio padrao nacional (5000km), empresas sem coordenadas sempre visiveis
- dto.go: adiciona CompanyName e CNPJ ao registerAuthRequest
- remove backend-old (Medusa), saveinmed-frontend (Next.js/Appwrite) and marketplace dirs
- split Go usecases by domain and move notifications/payments to infrastructure
- reorganize frontend pages into auth, dashboard and marketplace modules
- add Makefile, docker-compose.yml and architecture docs
- implementa busca automática de CEP e coordenadas
- adiciona upload e visualização de licença sanitária
- corrige listagem de pedidos vinculados à empresa
- ajusta interceptador Axios para envio correto de multipart/form-data
- Remove backend Medusa.js (TypeScript) e substitui pelo backend Go (saveinmed-performance-core)
- Corrige testes auth.test.ts: alinha paths de API (v1/ sem barra inicial) e campo access_token
- Corrige GroupedProductCard.test.tsx: ajusta distância formatada (toFixed) e troca userEvent por fireEvent com fakeTimers
- Corrige AuthContext.test.tsx: usa vi.hoisted() para mocks e corrige parênteses no waitFor
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- ProductOffersModal: Add quantity input for each offer when purchasing
- ProductOffersModal: Display offer info in single line with flex-wrap
- GroupedProductCard: Add whitespace-nowrap to prevent 'oferta' badge wrapping
- ProductSearch: Swap Filters and Location components (Filters now first)
- Backend: Refactored admin routes to use role-based access control
- review_handler: New handler with role-based filtering
- shipping_handler: Added ListShipments with role-based filtering
- domain/models: Added SellerID to ReviewFilter and ShipmentFilter
- postgres.go: Updated ListReviews and ListShipments for SellerID filtering
- server.go: Removed /api/v1/admin routes, updated handlers
- Add CORS_ORIGINS env var for multiple domains support
- Update config.go with CORSOrigins field and getEnvStringSlice helper
- Rewrite CORS middleware with CORSWithConfig for dynamic origins
- Update server.go to use configurable CORS
- Update .env.example with all configuration variables
- Optimize Dockerfile: switch to distroless image, update port to 8214
- Add GET / endpoint with SaveInMed API info
- Update PORT from 8080 to 8214 in .env.example
- Add start.sh interactive development script
- Script auto-installs dependencies when needed