Commit graph

221 commits

Author SHA1 Message Date
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
Tiago Yamamoto
6719ec6298
Merge pull request #36 from rede5/codex/fix-errors-in-background.js
Gate marketplace logs behind logger utility
2025-12-22 17:52:31 -03:00
Tiago Yamamoto
54d0de2844 Gate marketplace logs behind logger 2025-12-22 17:52:05 -03:00
Tiago Yamamoto
64f72db26f
Merge pull request #35 from rede5/codex/add-user-and-company-profile-dropdown
Header: add notification bell, move cart left and profile/company links; add anchors in Profile page
2025-12-22 17:39:55 -03:00
Tiago Yamamoto
bd63f39d88 Atualiza header com perfil e notificações 2025-12-22 17:39:42 -03:00
Tiago Yamamoto
6517839c9b
Merge pull request #34 from rede5/codex/fix-405-method-not-allowed-error
Use PATCH for company update to match API route
2025-12-22 17:32:32 -03:00
Tiago Yamamoto
31df281cde Fix company edit request method 2025-12-22 17:32:18 -03:00
Tiago Yamamoto
6477eeb756 fix(marketplace): handle paginated API response in Orders and Inventory pages 2025-12-22 16:39:30 -03:00
Tiago Yamamoto
965cedca05 fix(marketplace): add centralized formatCurrency/formatCents utilities to prevent toFixed errors 2025-12-22 16:31:39 -03:00
Tiago Yamamoto
b7ed676153
Merge pull request #33 from rede5/codex/fix-typeerror-in-api-response-handling
Fix dashboard data guards and numeric parsing
2025-12-22 16:06:56 -03:00
Tiago Yamamoto
79bc2e2275 Fix dashboard data guards 2025-12-22 16:06:40 -03:00
Tiago Yamamoto
a873d29160
Merge pull request #32 from rede5/codex/fix-typeerror-in-login-flow
Fix catalog price formatting
2025-12-22 16:01:10 -03:00
Tiago Yamamoto
adaf2fb49c Fix catalog price formatting 2025-12-22 16:00:52 -03:00
Tiago Yamamoto
abf636ab65 fix(backend): handle NULL shipping fields in orders queries with COALESCE 2025-12-22 15:50:02 -03:00
Tiago Yamamoto
5c004422f2 feat(marketplace): fix R$ NaN and add owner navigation links 2025-12-22 15:42:58 -03:00