Commit graph

66 commits

Author SHA1 Message Date
Tiago Yamamoto
9740ba2e9b chore(marketplace): configure env vars for API and Map 2025-12-22 01:15:37 -03:00
Tiago Yamamoto
c0903f06ab debug(marketplace): add console.log to authService 2025-12-22 01:09:26 -03:00
Tiago Yamamoto
77c93346e5 debug(marketplace): add console.log to login for debugging 2025-12-22 01:05:31 -03:00
Tiago Yamamoto
a2f305be3f fix(marketplace): exclude test files from production build 2025-12-22 00:35:28 -03:00
Tiago Yamamoto
c9a08c8621 test: add automated tests for admin login
Backend:
- TestAdminLogin_Success: verify admin login with username
- TestAdminLogin_WrongPassword: verify 401 for wrong password

Frontend (Marketplace):
- auth.test.ts: mocked tests for login/logout (5 tests)
- auth.integration.test.ts: real API tests (3 tests, skipped in CI)
2025-12-22 00:31:26 -03:00
Tiago Yamamoto
f0b9d27cee Fix login token guard 2025-12-22 00:06:06 -03:00
Tiago Yamamoto
c11652d386 Block marketplace search route 2025-12-22 00:00:27 -03:00
Tiago Yamamoto
a87459455d Guard against missing marketplace arrays 2025-12-21 23:55:06 -03:00
Tiago Yamamoto
b710383733 Implement marketplace auth login integration 2025-12-21 23:40:34 -03:00
Tiago Yamamoto
e73d423b16 refactor: move seeder to api, improve coverage and security 2025-12-20 11:13:53 -03:00
Tiago Yamamoto
25cee3911c chore: refactor backend config, unignore .env, update config loading 2025-12-20 10:10:55 -03:00
Tiago Yamamoto
45d34f36c8 feat(pagination): add pagination to all list endpoints
Added pagination support to:
- ListCompanies: filter by role, search
- ListProducts: filter by seller, search
- ListOrders: filter by buyer, seller, status
- ListInventory: filter by expiring date, seller

New domain types:
- ProductFilter, ProductPage
- CompanyFilter, CompanyPage
- OrderFilter, OrderPage
- InventoryPage

All endpoints now return paginated responses with:
- items array
- total count
- current page
- page size

Updated MockRepository in both test files to match new signatures
2025-12-20 08:37:59 -03:00
Tiago Yamamoto
e40517aac4 refactor(handler): extract company handlers + update READMEs
Backend:
- Extract 8 company handlers to company_handler.go (228 lines)
- handler.go reduced from 1254 to ~1026 lines
- Total refactoring: ~35% of original handler.go

READMEs updated:
- Backend: new architecture, test coverage table
- Marketplace: new pages (Orders, Inventory, Company, SellerDashboard), Vitest info
2025-12-20 07:58:37 -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
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