Backend (order_handler.go):
- Log URL, method, pagination
- Log requester role and company ID
- Log role query param and filter values
- Log service call results and errors
Frontend (Orders.tsx):
- Styled console logs with colors
- Log tab, endpoint, response data
- Detailed error logging with response data
Previously only 'Seller' role was filtered, but Owner/Colaborador/Entregador roles
were not filtered, causing global admin to appear in pharmacy user lists.
- shipping_handler: Remove auth restriction on GetShippingSettings (buyers need to see sellers' shipping options)
- order_handler: Add role query param parsing (buyer/seller) to filter orders by requester's company ID
Fixes 500 errors on:
- GET /api/v1/shipping/settings/{vendor_id}
- GET /api/v1/orders?role=buyer
- GET /api/v1/orders?role=seller
- 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
Backend:
- Add phone, operating_hours, is_24_hours fields to Tenant model
- Create migration 0005_tenants_operating_hours.sql for new columns
- Update postgres repository queries for new fields
Frontend Company.tsx:
- Expand company edit form with phone, city, state
- Add operating hours section with 24h toggle
- Add user edit/delete buttons with Actions column
- Add user edit modal with name, email, role fields
- Add handleDeleteUser and handleSaveUser functions
- 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
Updates .env.example with missing variables. Adds missing security headers in middleware. Fixes repository tests including timezone issues and sqlmock expectations.
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
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
- 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
- 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