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
This commit is contained in:
padreug 2025-09-27 01:31:52 +02:00
parent da5c4d6de1
commit 8821f604be
3 changed files with 38 additions and 39 deletions

View file

@ -349,8 +349,8 @@ const orderTotal = computed(() => {
const availableShippingZones = computed(() => {
if (!currentStall.value) return []
// Check if stall has shipping_zones (LNbits format) or shipping (nostr-market-app format)
const zones = currentStall.value.shipping_zones || currentStall.value.shipping || []
// Use standardized shipping property from domain model
const zones = currentStall.value.shipping || []
// Ensure zones have required properties and determine shipping requirements
return zones.map(zone => {