Commit graph

11 commits

Author SHA1 Message Date
8821f604be feat: consolidate Stall types and create reusable CartButton component
## Type Consolidation
- Add StallApiResponse interface matching LNbits backend structure
- Update domain Stall interface with cleaner, app-friendly properties
- Create mapApiResponseToStall() mapper function for API-to-domain conversion
- Remove duplicate Stall type definition from nostrmarketAPI.ts
- Update CheckoutPage to use standardized shipping property
- Verify types against LNbits reference implementation

## UI Components
- Create reusable CartButton.vue component with proper separation of concerns
- Remove duplicate cart button code from MarketPage and StallView
- Add consistent cart functionality across all market pages
- Fix missing cart button in StallView
- Improve code maintainability with DRY principles

## Bug Fixes
- Fix ProductDetailDialog add-to-cart functionality by using correct cart system
- Resolve cart system mismatch between legacy addToCart and stall-based totalCartItems
- Update ProductCard to emit events properly instead of direct store call
- Ensure consistent event flow: ProductCard → ProductGrid → MarketPage → Store

## Technical Improvements
- Follow established Product type consolidation pattern for consistency
- Maintain type safety between API responses and domain models
- Enable easier API evolution without breaking domain logic
- Optimize bundle splitting with component extraction
2025-09-27 01:31:52 +02:00
c284ad5778 Remove legacy compatibility layer and enforce modular architecture
- Delete src/stores/market.ts compatibility re-export file
- Update 15 files to import from proper module path @/modules/market/stores/market
- Add necessary type exports to market store for external consumers
- Remove empty src/stores/ directory completely
- Enforce clean modular architecture without global store shortcuts

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-07 02:30:37 +02:00
4feb5459cc Refactor authentication architecture to eliminate dual auth complexity
This major refactor consolidates the authentication system to use a single
source of truth, eliminating timing issues and architectural complexity
that was causing chat and payment functionality problems.

Key Changes:
• Remove old global useAuth composable and replace with useAuthService wrapper
• Update all 25+ files to use consistent auth pattern via dependency injection
• Eliminate dual auth detection workarounds from services (ChatService, PaymentService, etc.)
• Fix TypeScript errors and add proper Uint8Array conversion for Nostr private keys
• Consolidate auth state management to AuthService as single source of truth

Benefits:
• Resolves chat peer loading and message subscription timing issues
• Fixes wallet detection problems for Lightning payments
• Eliminates race conditions between global and injected auth
• Maintains API compatibility while improving architecture
• Reduces code complexity and improves maintainability

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-07 00:47:02 +02:00
8a019db34a Enhance Chat and Market Services with improved error handling and logging
Chat Service:
- Added detailed logging for API calls and responses, including warnings for missing authentication tokens and invalid response formats.
- Implemented a retry mechanism for message subscription setup on connection errors.
- Merged peers instead of clearing existing ones when loading from the API.

Market Service:
- Updated authentication checks to prioritize global auth state, improving user experience during order placement.
- Enhanced error messages for missing Nostr keys to guide users in configuring their profiles.

These changes improve the robustness and user-friendliness of the chat and market functionalities.
2025-09-06 20:12:41 +02:00
813cc86b3d Fix checkout success page UX flow
- Reorder template conditional logic to show success page instead of error after order placement
- Move orderPlaced state check before checkoutCart validation in CheckoutPage.vue
- Resolves issue where users saw "Cart not found" error instead of success confirmation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-06 16:52:07 +02:00
92c33aa0a3 Remove legacy Nostr keypair authentication and fix auth service integration
- Remove obsolete LogoutDialog component that displayed private keys
  - Replace nostrStore.account references with authService.user in market module
  - Fix property access paths to use authService.user.value instead of currentUser
  - Update connection state checks to use relayHub instead of nostrStore
  - Clean up TODOs and remove unused nostrStore imports
2025-09-06 10:45:44 +02:00
c7fcd51990 Enhance CheckoutPage with Nostr integration for order placement
- Import and utilize the Nostr store to retrieve the user's public key for order placement.
- Implement debug logging to track authentication state and public key availability.
- Ensure that the order placement process checks for a valid Nostr public key, improving user feedback and error handling during the checkout process.
2025-09-05 06:08:16 +02:00
861c032300 Refactor imports and enhance type handling across components
- Update import paths for useTicketPurchase in PurchaseTicketDialog.vue to reflect new module structure.
- Adjust type handling in Navbar.vue and various market components to use 'any' for improved compatibility with existing data structures.
- Enhance useLightningPayment composable to include shipping zone details, ensuring better order management.
- Remove unused pages (events.vue, MyTickets.vue, OrderHistory.vue) to streamline the codebase and improve maintainability.
2025-09-05 05:42:44 +02:00
fec577ba39 Integrate authentication checks and order placement logic in CheckoutPage
- Inject AuthService to verify user authentication before placing orders.
- Enhance order creation process by ensuring required data is present, including checkout cart and stall information.
- Update order data structure to include detailed buyer and seller information, contact details, and shipping zone data.
- Implement error handling for order placement failures, improving user feedback during the checkout process.
2025-09-05 03:52:58 +02:00
143c8afcc3 Enhance shipping zone functionality in CheckoutPage and market types
- Add 'shipping_zones' property to the Stall interface to support LNbits format.
- Update ShippingZone interface to include optional 'countries' property for better zone coverage representation.
- Modify CheckoutPage.vue to display shipping zone details, including a message for zones that do not require physical shipping.
- Improve user feedback by updating messages related to shipping address requirements based on selected shipping zone.
- Refactor logic to auto-select shipping zones and handle cases where no shipping zones are available, enhancing user experience during checkout.
2025-09-05 03:45:40 +02:00
dc6a9ed283 Add new routes for shopping cart and checkout pages in market module
- Introduce routes for the Shopping Cart and Checkout pages, enhancing user navigation within the market module.
- Implement a redirect for the Market Dashboard to improve user flow.
- Add an alias for clearCheckout for consistency in the market store functions.
2025-09-05 03:36:36 +02:00