Tiago Yamamoto
c48666bf60
Add backend and frontend test coverage
2026-01-01 15:06:55 -03:00
Tiago Yamamoto
36d6fa4ae0
feat: Implement Phase 4 features
...
Backend (Go):
- FCM Push Notifications (fcm.go, push_handler.go)
- Credit Lines (credit_line.go, credit_handler.go)
- Payment Config (admin_handler.go, seller_payment_handler.go)
- Team Management (team_handler.go)
Backoffice (NestJS):
- Dashboard module (KPIs, revenue charts)
- Audit module (tracking changes)
- Disputes module (CRUD, resolution)
- Reports module (CSV export)
- Performance module (seller scores)
- Fraud module (detection, alerts)
Frontend (Marketplace):
- ThemeContext for Dark Mode
- HelpCenter page with FAQ
- OrderDetails with timeline
- Team management page
- Persistent cart (Zustand)
2025-12-27 10:07:05 -03:00
Tiago Yamamoto
bbe6ec447e
feat(backend): implement financial features (KYC, ledger, withdrawals)
2025-12-27 01:34:29 -03:00
Tiago Yamamoto
6de471ce3e
feat(backend): implement notification system (logger mock)
2025-12-27 01:24:43 -03:00
Tiago Yamamoto
132fef816c
feat(backend): implement order state machine with validation
2025-12-27 01:18:00 -03:00
Tiago Yamamoto
ed4349a938
feat: Implement Payment Methods, Shipping Improvements, Swagger Audit, and UUIDv7 Migration
...
- Payment Methods: Added Pix/Credit/Debit selection in checkout, updated backend models and handlers.
- Shipping: Updated Checkout UI, added shipping_settings table and seed data.
- Swagger: Updated API docs, regenerated swagger.yaml.
- UUIDv7: Migrated seeder and backend tests to use uuid.NewV7().
2025-12-26 17:48:50 -03:00
Tiago Yamamoto
e64b3a4855
fix(tests): update mock repo to match interface
2025-12-26 17:09:09 -03:00
Tiago Yamamoto
9997aed18a
fix(backend): fix build errors, update tests, and improve documentation
...
- Add GetUserByEmail to Repository interface for password reset flow
- Add username to UpdateUser query
- Fix config_test.go: remove references to deleted DB pool fields
- Fix handler_test.go: add GetUserByUsername to MockRepository
- Fix usecase_test.go: add GetUserByUsername and update auth tests
- Update backend README with auth and admin seeding info
- Create seeder-api README with usage and warnings
2025-12-21 23:11:33 -03:00
Tiago Yamamoto
4ad6a0aae5
Add marketplace record search and audit trigger
2025-12-21 17:36:17 -03:00
Tiago Yamamoto
e73d423b16
refactor: move seeder to api, improve coverage and security
2025-12-20 11:13:53 -03:00
Tiago Yamamoto
fd60888706
Add shipping settings and calculation
2025-12-20 10:47:37 -03:00
Tiago Yamamoto
4bb848788f
feat: tenant model, seeder, and product search with distance
...
Tenant Model:
- Renamed Company→Tenant (Company alias for compatibility)
- Added: lat/lng, city, state, category
- Updated: postgres, handlers, DTOs, schema SQL
Seeder (cmd/seeder):
- Generates 400 pharmacies in Anápolis/GO
- 20-500 products per tenant
- Haversine distance variation ±5km from center
Product Search:
- GET /products/search with advanced filters
- Filters: price (min/max), expiration, distance
- Haversine distance calculation (approx km)
- Anonymous seller (only city/state shown until checkout)
- Ordered by expiration date (nearest first)
New domain types:
- ProductWithDistance, ProductSearchFilter, ProductSearchPage
- HaversineDistance function
Updated tests for Category instead of Role
2025-12-20 09:03:13 -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
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