Shop, invoices, inventory, workshops, AI, appointments, and newsletter
routes now return German error messages consistent with the rest of the
codebase.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fire-and-forget operations (notifications, Meilisearch indexing, view
count increments) now log errors instead of silently swallowing them.
This enables debugging of notification delivery failures and search
index sync issues in production.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add HTTP status validation before parsing JSON in 8 files. Without
these checks, non-2xx responses (502 gateway errors, 500s) could cause
silent failures or crash on non-JSON response bodies.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- StripeCheckout: add response.ok check before reading payment intent
JSON to prevent silent failures on 4xx/5xx responses
- HirnSidebar: replace silent catch blocks with logger.error calls
for better debugging of session/stats loading failures
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add section-level error boundaries for services, workshops, profil,
inventory, and blog routes. Each provides context-specific error
messages in Swiss German with retry and back navigation.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Delete unused lib/hirn/utils.ts (duplicate cn, zero importers)
- Remove formatDate wrappers in admin/content/pages and blog pages,
use formatDateNumeric from SSOT directly
- Replace HirnSidebar custom relative time with formatRelativeTime
from lib/utils.ts
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Converts remaining routes using raw NextResponse.json error responses to
use centralized apiSuccess/apiError/apiNotFound helpers for consistency.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- GET /api/repairers: Replace 100 per-request queries (2 per repairer)
with 2 batch queries using WHERE repairer_id = ANY($1)
- GET /api/repairers/[id]: Parallelize independent rating distribution
and review summary queries with Promise.all
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- ProductManagement: use MARKETPLACE_STATUS and PRODUCT_STATUS constants
- Blog submissions: use APPROVAL_STATUS for filter counts and status checks
- Repairer applications: use APPROVAL_STATUS for filters, cards, and docs
- Update Submission.status type to use ApprovalStatus from config
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add apiRateLimited() to lib/api/helpers with Retry-After and
X-RateLimit-* header support
- Update 7 routes (auth + newsletter + admin) to use the helper
- Remove unused NextResponse imports where possible
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add error boundaries for checkout, order detail, appointments,
marketplace listing detail, reviews, and admin task detail pages.
Follows existing codebase pattern with logger, retry button,
back link, and accessible markup.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Split monolithic marketing page into focused section components:
HeroSection, ProblemSection, WorkflowSection, AccessControlSection,
FeaturesSection, SuggestionTypesSection, ComparisonSection,
StatusSection, CTASection. Main page is now a clean composition.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace raw NextResponse.json() calls with apiSuccess/apiError/apiBadRequest
helpers across 8 API routes for consistent response format. Extract
analyzeProductDescription and calculateSustainabilityScore from import-csv
route to lib/inventory/csv-analysis.ts.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Extract RequestRow type + mapRequestListRow/mapRequestDetailRow to
lib/it-hilfe/request-mapper.ts (DRY: shared between list and detail)
- Extract sendRequestCreatedNotifications to lib/it-hilfe/notifications.ts
(requester confirmation, admin alert, matching helper emails)
- Fix type errors: cast through unknown for BlogSubmission, use string
for number input value, add Record<string, unknown> cast in edit-utils
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Invoice PDF: extract template + generation to lib/invoices/pdf-template.ts
(396 → 97 lines in route)
- Inventory: extract publish/unpublish/image logic to lib/admin/inventory-actions.ts
(472 → 220 lines in route)
- Reviews: extract validation/rating/notification to lib/reviews/review-service.ts
(421 → 225 lines in route)
Routes are now thin HTTP handlers delegating to domain modules.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace edit_history any[] with EditHistoryEntry[] in blog/workshop APIs
- Replace outcome as any with typed OutcomeData union in ResultsPanel
- Remove unused SECTION_COMPONENTS dead code from TeamProfileForm
- Remove index signature from BlogSubmission, cast internally instead
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Reduces type-safety holes by replacing `any` with `unknown`, specific
union types, and `Record<string, ...>` patterns. Covers admin edit
modals, edit history utils, validation messages, editable-fields config,
unified permissions, and team profile form.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Shop product page: extract useInventoryProduct hook + types to shared
lib, replace inline CONDITION_LABELS with existing getConditionLabel.
Build-your-computer: extract mock inventory data, use case options, and
recommendation logic to config/build-computer.ts.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extract ProblemDetailsSection, LocationSection, and SkillsSection from
the 578-line create page. Page retains state management, effects, and
handlers while rendering delegates to focused section components.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extract ImageUploadGrid, ListingFormFields, and ListingPreview from the
647-line monolithic sell page. Consolidate 13 individual useState hooks
into a single ListingFormData object for cleaner state management.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extract 4 form sections (BusinessInfo, ContactInfo, ServicesPricing,
Documents) + shared types/config from 681-line monolithic page.
Move service/specialization options to config for SSOT.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Static metadata for it-hilfe, repairers, marketplace, workshops, blog,
and auth (noindex). Dynamic generateMetadata for repairer/[id],
it-hilfe/[id], and marketplace/[id] with DB-driven titles and OG tags.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extract 3 components from 597-line search page + DRY consolidation:
- RepairerSearchBar: search/filter UI with advanced filters
- RepairerCard: result card using shared StarRating, getServiceIcon, formatPrice
- RepairerReviewsModal: reviews overlay using shared RepairerReview type
Eliminates duplicated renderStars, getServiceIcon, serviceOptions in favor
of shared helpers from batch 6. Page reduced from 597 to ~170 lines.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Cover browse requests (filters, pagination, search), request detail
(auth, ownership, email visibility), request updates (status transitions,
owner-only), offer submission (validation, duplicates, expiry), offer
listing (owner-only), and offer withdrawal (ownership, status checks).
Guard window-dependent mocks in jest.setup.js so API route tests can
use the node environment.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add error.tsx to 6 route groups (it-hilfe, shop, marketplace,
dashboard, admin, auth) and loading.tsx to 4 that were missing them
(it-hilfe, shop, marketplace, auth). Error pages log via logger,
show Swiss German copy, and include reset + back navigation.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The old seller flow (apply → admin approve → create products) is fully
replaced by the new P2P listing system at /marketplace/sell. This removes
all dead routes, pages, components, and config entries while updating
surviving references to point to the new paths.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Wire three high-impact features into the IT-Hilfe marketplace using existing
backend infrastructure: image uploads on create/detail pages, a "Nachricht
senden" button that opens the right conversation from the detail page, and a
full review flow (form, API validation, helper rating recalculation).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add DELETE endpoint for withdrawing pending offers
- Add withdraw button on request detail page and my-offers page
- Send email to requester when a new offer is received
- Block offer submissions on expired requests
- Show expiration banner on expired request detail pages
- Filter expired requests from public listing (already done, now enforced in offer API)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add email templates for offer accepted/rejected notifications
- Accept API now emails the winning helper and notifies rejected helpers
- PUT handler allows matched → completed and matched → cancelled transitions
- Request detail page shows "Mark complete" and "Cancel" buttons when matched
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Search bar: API now reads `search` param and does ILIKE across title,
description, device brand, and model (was silently ignored)
- Sort dropdown: API maps frontend values (newest/urgent/budget_high/offers)
to DB columns (was reading wrong param name with wrong values)
- Navigation: "Meine Anfragen" under IT-Hilfe now points to /it-hilfe/my
instead of /dashboard/repairer/bookings (wrong dashboard)
- Messaging: MessageButton and MessageSidebar now read data.data.conversations
and data.data.messages from apiSuccess wrapper (unread count was always 0,
sidebar never loaded conversations)
- HelperCard: Fix response path for conversation_id and replace navigation
to non-existent /messages/ page with success alert directing user to
the message sidebar
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The repository referenced non-existent columns on helper_profiles
(status, is_available, skills, remote_support) and was never imported
anywhere. All active IT-Hilfe code uses direct queries with correct
column names.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds select-all/individual checkboxes to both inventory and shop product
tables. Selected products can be bulk-deleted via the filter bar button
with a confirmation dialog. Also clarifies the checkout session handler
as a no-op pending payment provider decision.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sends in-app + email notification to the person who created a task request
when someone responds to it, closing the feedback loop in the request flow.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Wrap fetchProposal in useCallback to satisfy exhaustive-deps
- Replace useState+useEffect(setState) with lazy useState initializer
in cart page and ShopHeader to avoid cascading renders
- Move useRef above early return in ContentInputStep to fix
conditional hook call
- Use inline arrow functions in useCallback for useShopStore
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Connect notification service to email infrastructure — each notification
now sends an email when user has email_notifications enabled (default).
Replace hardcoded navigation in NotificationBell with SSOT config lookup.
Fix CHECK constraint to include decision_voting, decision_closed, and
protocol_finalized types that the codebase actually inserts.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace hardcoded zero badges with real data. Cart count comes from
Medusa via useCart hook, wishlist/compare use localStorage-backed
stores with useSyncExternalStore for cross-tab sync. Badges now
only render when count > 0.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ajv v6 ReDoS vulnerability (10 moderate findings) is unfixable —
eslint through v10 depends on ajv v6, and overriding to v8 breaks
eslint (incompatible API). Dev-only, not exploitable in our context.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Resolves Dependabot alerts #48 and #50 (DoS via DOCTYPE entity
expansion). The installed version was already 5.3.6 via the previous
^5.3.4 override; this makes the minimum explicit.
ajv alerts #49 and #51 dismissed — transitive devDependency of eslint
with no fix available (v6→v8 is breaking). Not a production risk.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>