Commit graph

185 commits

Author SHA1 Message Date
Tiago Yamamoto
240ce9a7e5 feat: add quantity selector, fix offer display, swap filter/location layout
- 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
2025-12-26 22:16:48 -03:00
Tiago Yamamoto
41862b3d5c chore(backend): change swagger endpoint from /swagger to /docs 2025-12-26 22:00:10 -03:00
Tiago Yamamoto
803d371b59 Fix checkout summary rendering 2025-12-26 18:13:01 -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
fd305c00a8 fix(marketplace): ensure auth token is set before initial requests 2025-12-26 17:24:57 -03:00
Tiago Yamamoto
e64b3a4855 fix(tests): update mock repo to match interface 2025-12-26 17:09:09 -03:00
Tiago Yamamoto
51a8293a11 fix(auth): support login with email in addition to username 2025-12-26 17:05:12 -03:00
Tiago Yamamoto
73ad7296ca feat(web): redesign login page, fix search bug and enhance seeder 2025-12-23 18:34:46 -03:00
Tiago Yamamoto
baa60c0d9b feat: overhaul shipping module, add seeder, and improve order UI 2025-12-23 18:23:32 -03:00
Tiago Yamamoto
8a5ec57e9c feat: redesign Orders page with tabs for purchases/sales
- Add tabs: 'Pedidos Feitos' (compras) and 'Pedidos Recebidos' (vendas)
- Add stats bar with totals and pending count
- Add progress tracker for purchase orders
- Improved UI with icons and better styling
- Actions only visible on sales tab
2025-12-23 17:32:55 -03:00
Tiago Yamamoto
e39ed59264 fix: use ES module import for logo in Shell.tsx
- Import logoImg from assets instead of hardcoded path
- Fixes logo not displaying in production build
2025-12-23 17:25:00 -03:00
Tiago Yamamoto
607d942072 feat: implement 2-step product registration with new catalog fields
Backend:
- Add ean_code, manufacturer, category, subcategory, observations to Product model
- Create migration 0006_product_catalog_fields.sql
- Update repository queries (CreateProduct, ListProducts, ListRecords)

Frontend:
- Create ProductCreate.tsx with 2-step wizard form
- Add route /products/new
- Add 'Cadastrar Produto' button to Inventory page

Seeder:
- Update CREATE TABLE products with new columns
- Update generateProducts with EAN codes and manufacturers

Docs:
- Update database-schema.md with new fields
2025-12-23 17:09:38 -03:00
Tiago Yamamoto
091e8093c0 feat: apply logo, document database schema, update docs
- Move logo to marketplace/src/assets/
- Apply logo in Shell.tsx header
- Add favicon and meta tags to index.html
- Create docs/database-schema.md with ER diagram
- Update README.md with database section
- Update marketplace/README.md with assets section
- Update seeder-api/README.md with new fields
2025-12-23 17:01:16 -03:00
Tiago Yamamoto
15eb6d42e5 feat(seeder): add phone, operating_hours, is_24_hours to companies table
- Updated SeedLean and SeedFull CREATE TABLE statements
- Added new fields to INSERT statements
- Updated generateTenants to include phone (random), operating_hours, is_24_hours
- Fixes 404 on /api/v1/companies/me due to missing columns
2025-12-23 16:52:06 -03:00
Tiago Yamamoto
8d4731268e feat(marketplace): add company management and user editing features
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
2025-12-23 16:44:51 -03:00
Tiago Yamamoto
352ef86617 fix(marketplace): filter own products by company_id from JWT
- Add companyId field to AuthUser interface in AuthContext
- Extract company_id from JWT payload in Login.tsx
- Use user.companyId to filter products where seller_id matches
- This properly excludes own store products using UUID comparison
2025-12-23 16:31:46 -03:00
Tiago Yamamoto
2bbb715ebb fix(marketplace): filter out own store products by 0km distance
- For owners/sellers, exclude products at exactly 0km (own pharmacy)
- This correctly hides own products without needing company_id in JWT
2025-12-23 16:29:08 -03:00
Tiago Yamamoto
e7b02f24e7 fix(marketplace): fix modal z-index and button colors
- Change modal z-index from z-50 to z-[1000] to appear above Leaflet map
- Replace bg-primary with bg-blue-600 for visible button styling
- Fix 'Adicionar' button in ProductOffersModal
- Fix 'Ver ofertas' button in GroupedProductCard
2025-12-23 16:23:59 -03:00
Tiago Yamamoto
8ec820c383 feat(marketplace): add cart hover dropdown preview
- Add CartDropdownContent component showing cart items on hover
- Show 'carrinho vazio' message when empty
- Display up to 4 items with name, quantity, price
- Add remove button for each item in dropdown
- Show total and 'Ver carrinho completo' link
- Badge only shows when cart has items (already implemented)
2025-12-23 16:21:48 -03:00
Tiago Yamamoto
299001d8bc feat(marketplace): add functional sort dropdown to ProductSearch
- Add sortBy state with options: price, distance, expiry
- Replace static text with interactive select dropdown
- Implement sorting logic for each option in groupedProducts memo
2025-12-23 16:19:47 -03:00
Tiago Yamamoto
1600591f86 feat(marketplace): improve ProductSearch with grouping, modal, and filters
- Add Shell layout to restore header navigation
- Filter out products from logged-in user's own pharmacy
- Group medications by name (e.g., Losartana 50mg shows as 1 card with '3 offers')
- Create GroupedProductCard component with offer count badge
- Create ProductOffersModal with sorted offers and add-to-cart
- Implement advanced filters (price range, minimum expiry days)
- Add GroupedProduct interface to types
- Sort grouped products by lowest price
2025-12-23 16:13:19 -03:00
Tiago Yamamoto
3a618fa466 chore(marketplace): remove Checkout page and route
- Remove CheckoutPage import from App.tsx
- Remove /checkout route from routing configuration
2025-12-23 16:04:46 -03:00
Tiago Yamamoto
cad6010965 feat(marketplace): replace cart text with icon + badge counter
- Remove Checkout link from header navigation
- Replace 'Carrinho' text with cart SVG icon
- Add red badge showing cart item count (max 99+)
- Import and use cartStore for real-time count updates
2025-12-23 16:01:54 -03:00
Tiago Yamamoto
77d23dac7e feat(marketplace): enable ProductSearch page for pharmacy owners and employees
- Add ProductSearch route at /search with access for owner, seller, employee roles
- Add 'Comprar Medicamentos' button to SellerDashboard header
- Add 'Comprar Medicamentos' button and card to EmployeeDashboard
- Remove redirect that was blocking access to the product search page
2025-12-23 15:59:51 -03:00
Tiago Yamamoto
14eb6c61c8
Merge pull request #49 from rede5/codex/investigate-shipping-data-save-error
Improve shipping settings validation (backend + frontend)
2025-12-23 15:09:08 -03:00
Tiago Yamamoto
32f6fde529 Fix shipping settings validation 2025-12-23 15:08:46 -03:00
Tiago Yamamoto
af99035b8f
Merge pull request #48 from rede5/codex/create-internal-product-display-page
Add internal purchases page with product grouping and distance to customer
2025-12-23 14:46:35 -03:00
Tiago Yamamoto
949398b867 Add internal purchases products page 2025-12-23 14:46:18 -03:00
Tiago Yamamoto
69ec17cd91
Merge pull request #47 from rede5/codex/add-profile-editing-page
Add `/meu-perfil` page and update profile links/routes
2025-12-23 14:36:29 -03:00
Tiago Yamamoto
cc29efa8a0 Add meu-perfil page for profile editing 2025-12-23 14:36:09 -03:00
Tiago Yamamoto
9b5c600f98
Merge pull request #46 from rede5/codex/add-company-configuration-overview
Add company page tabs for overview, users and shipping settings
2025-12-23 14:31:11 -03:00
Tiago Yamamoto
36c0742735 Add company tabs for users and shipping settings 2025-12-23 14:30:55 -03:00
Tiago Yamamoto
f7b56db4dd
Merge pull request #45 from rede5/codex/create-404-and-500-error-pages
Add custom 404 and 500 pages with console logging
2025-12-23 14:17:42 -03:00
Tiago Yamamoto
d059f44d9e Add 404 and 500 error pages with logging 2025-12-23 14:17:20 -03:00
Tiago Yamamoto
e823f6f4a8
Merge pull request #44 from rede5/codex/refactor-empty-state-for-cart-page
Add elegant Empty State to Cart (Lucide icon) and hide checkout when cart is empty
2025-12-23 12:04:02 -03:00
Tiago Yamamoto
51b6165f09 Add cart empty state 2025-12-23 12:03:47 -03:00
Tiago Yamamoto
79e115784a
Merge pull request #43 from rede5/codex/add-unified-profile-dropdown-in-navbar
Unified profile dropdown in marketplace header
2025-12-23 11:49:13 -03:00
Tiago Yamamoto
6a66503b48 Update profile dropdown in marketplace shell 2025-12-23 11:48:54 -03:00
Tiago Yamamoto
f2cdadb73f
Merge pull request #42 from rede5/codex/add-empresa-and-perfil-options-to-dropdown
Show company and user info in header dropdown
2025-12-23 11:45:17 -03:00
Tiago Yamamoto
a705aadf37 Improve header dropdown company profile info 2025-12-23 11:44:37 -03:00
Tiago Yamamoto
16d5ef994c
Merge pull request #41 from rede5/codex/add-link-to-profile-without-break
Add owner "Meu Perfil" page and keep profile dropdown button on one line
2025-12-23 09:23:10 -03:00
Tiago Yamamoto
49d8878706 Add owner profile link and page 2025-12-23 09:21:38 -03:00
Tiago Yamamoto
051d4a015c
Merge pull request #40 from rede5/codex/fix-dropdown-disappearance-issue
Fix dropdown role loading from storage
2025-12-23 08:46:42 -03:00
Tiago Yamamoto
4d2db62a13 Fix dropdown role loading 2025-12-23 08:46:07 -03:00
Tiago Yamamoto
6b923e6661
Merge pull request #39 from rede5/codex/add-profile-dropdown-on-hover
Header: add "Meu perfil" entry and open profile dropdown on hover
2025-12-23 08:26:18 -03:00
Tiago Yamamoto
406d7b9949 Add profile link and hover dropdown 2025-12-23 08:25:50 -03:00
Tiago Yamamoto
58da0ebcf4
Merge pull request #38 from rede5/codex/criar-dropdown-solicitado
Add profile dropdown to marketplace header
2025-12-23 08:13:53 -03:00
Tiago Yamamoto
20980d8a80 Add profile dropdown to marketplace header 2025-12-23 08:12:54 -03:00
Tiago Yamamoto
a5f386b38e
Merge pull request #37 from rede5/codex/add-profile-dropdown-to-top-right
Add profile dropdown to marketplace header
2025-12-23 08:06:16 -03:00
Tiago Yamamoto
95913578e9 Add profile dropdown to marketplace header 2025-12-23 08:05:51 -03:00