Commit graph

49 commits

Author SHA1 Message Date
Tiago Yamamoto
23df78d9c3 refactor(handler): extract DTOs and helpers to dto.go
- Move 18 request/response structs to dto.go
- Move utility functions (writeJSON, decodeJSON, parseUUID, etc)
- Reduce handler.go from 1471 to 1254 lines (~15% reduction)
- All tests passing
2025-12-20 07:54:35 -03:00
Tiago Yamamoto
b8973739ab feat(backend): add comprehensive test suite for 80% coverage
- Add config_test.go (5 tests for env parsing)
- Add middleware_test.go (16 tests for CORS, Auth, Gzip, Logger)
- Add usecase_test.go (30+ tests for business logic)
- Add payments_test.go (6 tests for MercadoPago gateway)

Coverage: config 100%, middleware 95.9%, payments 100%, usecase 64.7%

feat(marketplace): add test framework and new pages

- Setup Vitest with jsdom environment
- Add cartStore.test.ts (15 tests for Zustand store)
- Add usePersistentFilters.test.ts (5 tests for hook)
- Add apiClient.test.ts (7 tests for axios client)
- Add Orders page with status transitions
- Add Inventory page with stock adjustments
- Add Company page with edit functionality
- Add SellerDashboard page with KPIs

Total marketplace tests: 27 passing
2025-12-20 07:43:56 -03:00
Tiago Yamamoto
c83079e4c9 chore(marketplace): update package-lock.json 2025-12-20 07:27:37 -03:00
Tiago Yamamoto
8ffd35741d fix: resolve swagger duplicates and add backend tests 2025-12-19 20:28:39 -03:00
Tiago Yamamoto
fdf256d436
Merge pull request #18 from rede5/codex/corrigir-erro-contia
Remove duplicate /api/v1/products/{id} path from Swagger docs
2025-12-19 19:32:31 -03:00
Tiago Yamamoto
e5103db905 Fix duplicate product path in swagger docs 2025-12-19 19:32:16 -03:00
Tiago Yamamoto
cee817cd60
Merge pull request #17 from rede5/codex/implementar-rotas-para-sistema-de-auth
Add missing auth endpoints in BFF
2025-12-19 19:22:57 -03:00
Tiago Yamamoto
edf7cb78ac Add missing auth endpoints 2025-12-19 19:22:20 -03:00
Tiago Yamamoto
952e158aae
Merge pull request #16 from rede5/codex/add-swagger-route-/docs
Expose Swagger UI at /docs and update links
2025-12-19 19:01:13 -03:00
Tiago Yamamoto
632b35f6bb Update swagger route to /docs 2025-12-19 19:00:58 -03:00
Tiago Yamamoto
60078dd6aa
Merge pull request #15 from rede5/codex/fix-route-conflict-for-post-/api/v1/companies
Fix duplicate API route registrations
2025-12-19 18:53:02 -03:00
Tiago Yamamoto
65add1fa8e Fix duplicate API route registrations 2025-12-19 18:52:47 -03:00
Tiago Yamamoto
2bca2d4576
Merge pull request #14 from rede5/codex/add-v1-to-all-rptas
Prefix API routes with /api/v1 and update OpenAPI docs
2025-12-19 18:43:26 -03:00
Tiago Yamamoto
69af774d30 Add v1 prefix to API routes 2025-12-19 18:42:38 -03:00
Tiago Yamamoto
21d98da9c1
Merge pull request #13 from rede5/codex/mapear-backend-e-atualizar-rotas-no-swagger
Add v1 API routes and Swagger entries
2025-12-19 18:31:25 -03:00
Tiago Yamamoto
6cc02a7a8c Add v1 routes to API and Swagger 2025-12-19 18:30:27 -03:00
Tiago Yamamoto
1309a120cb
Merge pull request #12 from rede5/codex/implementar-crud-nas-rotas-e-documentar
Add CRUD endpoints for companies, products and orders; update repo/service/handlers and regenerate Swagger
2025-12-19 18:10:27 -03:00
Tiago Yamamoto
aaa4955fd9 Add full CRUD coverage to core API routes 2025-12-19 18:09:25 -03:00
Tiago Yamamoto
8f8d128ee8
Merge pull request #11 from rede5/codex/implementar-autenticacao-e-crud-de-usuarios
Add auth docs, user CRUD endpoints and password peppering
2025-12-19 17:55:38 -03:00
Tiago Yamamoto
4680035e02 Add auth docs, user CRUD, and password pepper 2025-12-19 17:54:16 -03:00
Tiago Yamamoto
916225f19e feat(backend): add configurable CORS and optimize Dockerfile
- 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
2025-12-19 17:34:30 -03:00
Tiago Yamamoto
851dd4f265 chore: optimize Dockerfiles with multi-stage builds and caching
- Backend (Go): Use scratch image (~5MB), add build cache for modules
- Backoffice (NestJS): Add pnpm cache, alpine image, fix Prisma client copy
- BFF (Python): Add multi-stage with virtualenv, pip cache, optimized env vars
- All: Add non-root users for security
2025-12-18 17:28:52 -03:00
Tiago Yamamoto
a1a65ab831
Merge pull request #10 from rede5/codex/create-b2b-reputation-system
Add rating and dashboard endpoints
2025-12-18 13:19:44 -03:00
Tiago Yamamoto
cd376339b9 Add rating and dashboard endpoints 2025-12-18 13:19:21 -03:00
Tiago Yamamoto
989f465613
Merge pull request #9 from rede5/codex/implement-delivery-management-routes
Add shipment endpoints and payment webhook split handling
2025-12-18 12:58:25 -03:00
Tiago Yamamoto
ce825fd1d5 Add shipment endpoints and payment webhook split handling 2025-12-18 12:58:05 -03:00
Tiago Yamamoto
94c27ec7dc
Merge pull request #8 from rede5/codex/implement-inventory-control-routes
Add inventory and cart endpoints
2025-12-18 12:47:23 -03:00
Tiago Yamamoto
e96ba8a49b Add inventory and cart endpoints 2025-12-18 12:43:51 -03:00
Tiago Yamamoto
a674eb8169
Merge pull request #7 from rede5/codex/implementar-modulo-de-autenticacao-em-go
Add JWT authentication and company verification
2025-12-18 12:31:06 -03:00
Tiago Yamamoto
e57445847b Implement JWT auth and company verification 2025-12-18 12:29:51 -03:00
Tiago Yamamoto
b4fd89f4a8
Merge pull request #6 from rede5/codex/implementar-crud-completo-de-usuarios
Add user CRUD endpoints with seller scoping
2025-12-18 11:42:48 -03:00
Tiago Yamamoto
b461ff5201 Implement user CRUD endpoints 2025-12-18 11:42:23 -03:00
Tiago Yamamoto
ee6a0a5375
Merge pull request #5 from rede5/codex/prepare-database-migration-sql-for-users-and-inventory
Add Gemini prompt guide for migrations and auth
2025-12-18 11:24:53 -03:00
Tiago Yamamoto
6995c17c55 Add Gemini prompt guide for migrations and auth 2025-12-18 11:24:30 -03:00
Tiago Yamamoto
521c7f1377 fix(backend): update default port to 8214 and fix env loading 2025-12-18 10:39:42 -03:00
Tiago Yamamoto
4037ab6876 feat(backend): add root endpoint and 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
2025-12-18 10:37:46 -03:00
Tiago Yamamoto
029fce39ce fix: update db tests with proper env loading 2025-12-18 08:20:19 -03:00
Tiago Yamamoto
0e5c93ec6c feat: add automated db tests and update env examples 2025-12-18 08:13:19 -03:00
Tiago Yamamoto
fc4e3df02d feat: implement CORS and externalize payments config 2025-12-18 08:07:45 -03:00
Tiago Yamamoto
42f72f5f43 docs: adiciona documentação completa do projeto SaveInMed
- Cria README.md na raiz com visão global e diagrama de arquitetura
- Adiciona/atualiza README.md em todos os componentes:
  - backend (API Go)
  - backoffice (NestJS)
  - marketplace (React/Vite)
  - saveinmed-bff (Python/FastAPI)
  - saveinmed-frontend (Next.js)
  - website (Fresh/Deno)
- Atualiza .gitignore em todos os componentes com regras abrangentes
- Cria .gitignore na raiz do projeto
- Renomeia pastas para melhor organização:
  - backend-go → backend
  - backend-nest → backoffice
  - marketplace-front → marketplace
- Documenta arquitetura, tecnologias, setup e fluxo de desenvolvimento
2025-12-17 17:07:30 -03:00
Tiago Yamamoto
1130fb662a
Merge pull request #4 from rede5/codex/develop-frontend-for-b2b-pharmaceutical-marketplace
Add B2B marketplace frontend with virtualized catalog
2025-12-17 15:57:49 -03:00
Tiago Yamamoto
424fbdba1d Add B2B marketplace frontend with virtualized catalog 2025-12-17 15:56:07 -03:00
Tiago Yamamoto
b0507e29a4
Merge pull request #3 from rede5/codex/restructure-/website-content-for-b2b-portal
Build marketplace landing page with lead capture islands
2025-12-17 15:40:56 -03:00
Tiago Yamamoto
d2105c5130 Revamp marketplace website with lead capture 2025-12-17 15:40:23 -03:00
Tiago Yamamoto
56275036e0
Merge pull request #2 from rede5/codex/create-nestjs-project-with-fastify-setup
Add NestJS Fastify backend scaffold
2025-12-17 14:52:35 -03:00
Tiago Yamamoto
d1ff1eaa1c feat: add nestjs fastify backend scaffold 2025-12-17 14:50:19 -03:00
Tiago Yamamoto
470f8463b1
Merge pull request #1 from rede5/codex/implement-b2b-marketplace-backend-in-go
Add Go performance core backend and refresh landing page
2025-12-17 14:26:26 -03:00
Tiago Yamamoto
5b0c86899c Add Go performance core backend and refresh landing page 2025-12-17 14:25:47 -03:00
Tiago Yamamoto
b39caf0fd0 first commit 2025-12-17 13:58:26 -03:00