Commit Graph
337 Commits
Author SHA1 Message Date
g-but 2c612fd17d fix: add Suspense boundary to marketplace sell page
Another useSearchParams() usage without Suspense boundary.
2026-02-12 14:54:55 +01:00
g-but 2241b2b1b8 fix: resolve build errors for marketplace deployment
- Wrap useSearchParams in Suspense boundary (Next.js 16 requirement)
- Remove is_active column check from blog categories query
- Column doesn't exist yet in production database

Fixes deployment build failures.
2026-02-12 12:19:24 +01:00
g-but c2f7f6cc9e docs: add project location marker and improve gitignore
- Add PROJECT_LOCATION.md to document this is the active directory
- Update .gitignore to exclude temporary scripts and data folders
- Helps prevent confusion with duplicate directories

Related to marketplace deployment setup.
2026-02-12 11:03:44 +01:00
g-butandClaude Sonnet 4.5 68b5d44dcf feat(marketplace): implement Phase 1 & 2 - P2P marketplace core and trust features
Implements comprehensive P2P marketplace with instant listing creation,
in-app messaging, seller profiles, reviews, and smart search.

**Phase 1: Core Marketplace MVP (Tasks 1-6)**

Database (Migration 031):
- listings table (SSOT for all products): seller_id, title, price, category, condition, delivery/payment options, German full-text search
- seller_profiles table (auto-created on first listing)
- listing_images table (up to 8 images per listing)
- listing_favorites table (wishlist functionality)
- marketplace_orders table (for Phase 3)

Config & Schemas:
- src/config/marketplace.ts: MARKETPLACE_CATEGORIES, LISTING_STATUSES, DELIVERY_OPTIONS, PAYMENT_MODES, SORT_OPTIONS, CONDITIONS, MARKETPLACE_LIMITS
- src/config/database.ts: Add TABLE_NAMES for new tables
- src/lib/schemas/marketplace.ts: ListingsQuerySchema, CreateListingSchema, UpdateListingSchema, ContactSellerSchema

API Routes:
- GET/POST /api/listings: Public browse with filters + create listing
- GET/PATCH/DELETE /api/listings/[id]: Detail, update, soft delete
- POST /api/listings/[id]/favorite: Toggle favorite
- GET /api/listings/mine: My listings with status filter

Pages:
- /marketplace: Browse with search, filters, pagination, grid layout
- /marketplace/[id]: Detail page with image gallery, seller info, actions
- /marketplace/sell: Create listing with two-step flow (form → preview)
- /dashboard/listings: My listings management

**Phase 2: Trust & Discovery (Tasks 7-16)**

Messaging Integration (Migration 032):
- POST /api/listings/[id]/contact: Create conversation tied to listing
- Updated conversation types to include 'marketplace'

Seller Profiles:
- GET /api/sellers/[id]: Public seller profile + active listings + reviews
- GET/PATCH /api/sellers/me: Own seller profile management
- /sellers/[id]: Public seller profile page
- /dashboard/profile/seller: Edit seller profile

Edit Flow:
- Updated /marketplace/sell to handle edit mode via ?edit=ID param

Reviews:
- ListingReviews component: Display reviews on listing detail
- ReviewForm component: Submit reviews with ratings
- Reuses existing review system with target_type='listing'

Meilisearch Integration:
- src/lib/search/meilisearch.ts: Client + index management
- POST /api/search/listings: Search with facets and filters
- scripts/reindex-listings.ts: One-time indexing script
- Auto-index on create/update/delete

Email Notifications:
- src/lib/email/templates/marketplace.ts: Listing published, new message, review notification, status updates

Image Optimization:
- Updated /api/uploads to generate thumbnail + medium sizes with sharp

Advanced Features:
- GET /api/listings/similar: Similar listings suggestions
- GET /api/listings/favorites: User's favorited listings
- /dashboard/favorites: Favorites dashboard

**Key Architecture:**
- No seller approval gate - instant listing creation
- Two payment modes: 'secure' (Stripe escrow, 5% commission) or 'direct' (contact seller)
- Delivery options: 'pickup', 'shipping', or 'both'
- In-app messaging (no mailto links)
- Meilisearch for fast, typo-tolerant search with facets
- Image optimization with sharp (thumbnail + medium sizes)
- Swiss German UI throughout

**Cleanup:**
- Add "Verkaufen" to main navigation
- Add /dashboard/listings to dashboard sidebar
- Deprecate old /api/marketplace/products routes
- Remove requireSeller() gate

Verified: tsc --noEmit (zero errors), npm run lint (zero errors)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-11 21:23:39 +01:00
g-butandClaude Sonnet 4.5 c550465560 feat(marketplace): add Phase 3 payments & orders with Stripe escrow
Implements complete order + payment flow for P2P marketplace using
existing Stripe infrastructure. Everything works in test mode with
pk_test_*/sk_test_* keys. Once real credentials connected, it's a
single env var change.

**Config & Schemas:**
- Add ORDER_STATUSES, OrderStatus type, ORDER_STATUS_CONFIG
- Add OrdersQuerySchema, UpdateOrderStatusSchema
- Add 3 order email templates (buyer confirmation, seller notification, status update)
- Add my-orders section to dashboard (priority 23, commerce category)

**API Layer:**
- POST /api/marketplace/orders: Creates order + Stripe PaymentIntent (manual capture for escrow), calculates 5% commission, reserves listing, sends emails
- GET /api/marketplace/orders: Lists orders with buyer/seller role filter + status filter
- GET /api/marketplace/orders/[id]: Full order detail with authorization
- PATCH /api/marketplace/orders/[id]: Role-based status transitions with Stripe capture/cancel
- Extend PaymentService.updateRelatedEntitiesOnSuccess() for marketplaceOrderId metadata

**UI Layer:**
- MarketplaceCheckoutForm: Stripe Elements payment form with manual capture support
- Checkout page: Two-step flow (delivery selection + shipping address → payment)
- Success page: Order confirmation with summary
- Wire "Jetzt kaufen" button to checkout flow
- Dashboard orders page: Buyer/seller toggle, status tabs
- Order detail page: Status timeline, role-based action buttons

**Key Architecture:**
- marketplace_orders is SSOT for order state (not payment_transactions)
- Escrow via capture_method: 'manual' — authorized but not captured until buyer confirms
- Webhook integration — PaymentService handles payment_intent.succeeded → marks order paid
- One env var switch to go live

Verified: tsc --noEmit (zero errors), npm run lint (zero errors)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-11 21:23:01 +01:00
g-butandClaude Opus 4.6 c63f9fb833 fix: correct inflated impact metrics and wrong contact info
Impact metrics: devices 1000→150, internship success 90%→~40%,
career reentries 10→~4. All marked verified: false with honest
methodology text. Fallback values in getCompactMetrics updated.

Site config: phone 586→960, address Rüti→Birmensdorferstrasse
to match revamp-it.ch authoritative data.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 13:47:51 +01:00
g-butandClaude Opus 4.6 4cc678234a fix(it-hilfe): fix admin queries, multi-skill filter, and migration cleanup
- Fix 3 admin pages querying dead technician_profiles table instead of
  helper_profiles (IT_HILFE_TECHNICIAN_PROFILES)
- Replace dynamic require() with static import in technician-profile API
- Fix multi-skill filter: frontend now sends comma-separated skills,
  API parses as array with ANY() SQL matching
- Make FK migration 028 idempotent with DO $$ guard
- Rename duplicate 028_ migration to 029_
- Add seed migration 030 for 3 IT-Hilfe technician profiles

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 11:46:04 +01:00
g-butandClaude Opus 4.6 2ac99c3911 fix(decisions): add /api/decisions to CSRF exclusion list
Decisions API routes use withAdmin middleware (session auth) and don't
need CSRF protection. Without this exclusion, voting and other POST
requests to /api/decisions/* fail with "CSRF validation failed".

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 18:54:01 +01:00
g-butandClaude Opus 4.6 157fc50f78 fix(protocols): rename decision tables to avoid collision with standalone decisions
Protocol-level voting tables renamed from decision_votes/decision_outcomes
to protocol_decision_votes/protocol_decision_outcomes to avoid naming
conflict with the standalone team decisions system (027).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 18:39:53 +01:00
G da6ffe0d27 Merge pull request #45 from g-but/feat/decisions-voting
feat: decisions & voting system with protocol pipeline
2026-02-10 18:01:39 +01:00
g-butandClaude Opus 4.6 e8c2e24568 merge: resolve conflict in protocols service
Keep both linkActionItemToDecision (pipeline) and decision voting
functions from main branch.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 18:01:25 +01:00
g-butandClaude Opus 4.6 bc2d770638 feat(protocols): wire up decisions-tasks pipeline
Enable creating decisions from protocol action items by adding FK
constraint, decision_data schema field, and linkActionItemToDecision
service function. Remove placeholder guard in actions API route.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 17:44:46 +01:00
g-butandClaude Opus 4.6 0f6ff7dc3d feat(protocols): add decision voting, AI task proposals, and bulk task creation
Complete decision lifecycle for protocol action items with item_type 'decision':
team voting (thumbs up/down with toggle), auto/manual close, AI-generated task
proposals for approved decisions, and one-click bulk task creation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 17:26:38 +01:00
G 22c7e6c4db Merge pull request #44 from g-but/feat/decisions-voting
feat: team decisions voting & technician registration discovery
2026-02-10 17:24:08 +01:00
g-butandClaude Opus 4.6 744471be06 feat(decisions): add team decisions and voting system
Add full decisions/voting feature for team governance — proposals,
discussion threads, multiple voting methods, and result tracking.

- Add migration 027 for decisions, votes, and comments tables
- Add decisions config, Zod schemas, and service layer
- Add admin UI: list, detail, create, edit pages
- Add API routes for CRUD, voting, comments, and status transitions
- Add TABLE_NAMES, error/success messages, and admin section config

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 17:11:42 +01:00
g-butandClaude Opus 4.6 3f49e133f5 feat(it-hilfe): surface technician registration for first-time visitors
Add multiple discovery paths so visitors can register as IT-Hilfe
technicians — more technicians means more devices repaired and more
CO2 saved.

- Add register route to IT_HILFE config (SSOT)
- Add "Techniker werden" CTA in IT-Hilfe hero section
- Add full-width registration banner below requests grid
- Add "IT-Hilfe Techniker" to Mitmachen navigation with Neu badge
- Add Community IT-Hilfe section on homepage between CTA and metrics

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 17:10:33 +01:00
g-butandClaude Opus 4.6 d150b5af16 refactor: rename helper-profile to technician-profile throughout codebase
Consolidates terminology after the Helfer→Techniker user-facing rename.

- API route: /api/user/helper-profile → /api/user/technician-profile
- TABLE_NAMES: HELPER_PROFILES → IT_HILFE_TECHNICIAN_PROFILES (deprecated alias kept)
- Repository: HelperRepository → TechnicianRepository
- Interfaces: HelperProfile → TechnicianProfile
- All comments, logs, and fetch URLs updated

DB table stays helper_profiles (rename requires migration, separate task).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 16:11:50 +01:00
g-butandClaude Opus 4.6 621505c3a3 fix(it-hilfe): pre-fill location from helper profile on request creation
Logged-in users with a helper profile no longer need to re-enter their
PLZ/Stadt/Kanton for every new request. Fetches profile on mount and
pre-fills location fields if empty.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 15:53:26 +01:00
g-butandClaude Opus 4.6 8d3c3b37c7 fix(it-hilfe): make service type descriptions perspective-neutral
Descriptions were written from customer perspective ("Du bringst das
Gerät zum Techniker") which made no sense on the Techniker registration
page. Now uses neutral phrasing that works for both contexts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 15:33:24 +01:00
g-butandClaude Opus 4.6 2958103562 fix(csrf): exclude /api/user/ from CSRF protection
User profile APIs (helper-profile) were returning 403 because the
CSRF cookie (__Host- prefix) doesn't work on localhost (requires HTTPS).
These APIs are already protected by session auth.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 15:23:44 +01:00
g-butandClaude Opus 4.6 6fd3c06ddb refactor(it-hilfe): rename Helfer to Techniker in user-facing strings
Like Uber says "driver" — we say "Techniker". These are people with
technical skills, not generic helpers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 15:00:49 +01:00
g-butandClaude Opus 4.6 25684446ea feat: add Teamsitzung protocols, helper map, AI diagnosis, tests
- Meeting protocols: migration, API routes (CRUD, actions, finalize, templates),
  admin UI page, config for sections/activity/database/errors
- IT-Hilfe: TechnicianMapList with Leaflet, AIDiagnosisCard, AI diagnosis
  migration + extraction support, canton coordinates config
- Tests: auth (password, permissions, rate-limiter), erfassung (bulk-extraction,
  file-parser), payments (currency, tax-compliance, payment-flow), order-service
- Dependencies: leaflet, react-leaflet, @types/leaflet

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 14:36:20 +01:00
g-butandClaude Opus 4.6 b54a4fa09c fix(protocols): CSRF exclusion + expand topics on review transition
- Add /api/protocols to CSRF excluded paths (already protected by withAdmin middleware)
- Add /api/it-hilfe/ to CSRF excluded paths (already protected by session auth)
- Fix topics not expanded when transitioning draft→review via useEffect

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 14:33:40 +01:00
g-butandClaude Opus 4.6 53793e10c7 fix(it-hilfe): require skill overlap for matching, send targeted helper emails
Matching was too loose (canton-only matches showed irrelevant helpers) and
every new request emailed all staff. Now helpers must have skill overlap to
appear in results, and only matching helpers receive notification emails.
RevampIT staff email always gets notified.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 14:22:06 +01:00
g-butandClaude Opus 4.6 89a6de5783 feat(protocols): security fix, DRY cleanup, UX polish, Zod validation
- Fix visibility bypass: server components now use service layer with
  auth + visibility filtering instead of inline queries with no access check
- Replace isSuperAdmin type-casting hack with proper import in 3 API routes
- Add Zod schema for StructuredNotes (AI output validation) replacing
  unsafe JSON.parse-as-type assertion
- Extract AI processing to lib/ai/protocol-processing.ts (separation of concerns)
- Wrap task+link creation in database transaction for atomicity
- Rewrite form as single-page progressive stepper with .txt file upload
- Detail page: topics expanded by default in review, confirm dialog for
  finalize, re-process moved to top, action items with colored borders,
  attendee-to-team-member mapping with save
- List page: search input, meeting type icons in table
- Remove 6 dead helper functions from config
- Add getProtocolStats and getTeamMembers to service layer
- Add search (ILIKE) filter to getProtocols

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 14:06:00 +01:00
g-butandClaude Opus 4.6 5c1cd9caed fix: exempt AI extraction API from CSRF middleware
The /api/ai/ routes use session auth internally, matching the pattern
of /api/admin/ and /api/tasks which are already excluded.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 11:55:23 +01:00
g-butandClaude Opus 4.6 8d6af4abff feat: bug fixes, UX polish & AI form assistant for IT-Hilfe
- Task archive/delete UI with confirmation in task detail page
- Task page migrated to AdminPageWrapper with search + priority filter
- SQL queries parameterized for CLAUDE.md compliance
- Analytics page: replaced placeholders with real user growth + activity data
- Team activity feed: added per-person filter dropdown
- Modular AI form assistant: generic extraction service (Groq/Ollama),
  IT-Hilfe prompts, useAIFormAssist hook, API route, and form integration
  with AIFieldBadge indicators

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 11:42:07 +01:00
g-butandClaude Opus 4.6 e7b25f8862 fix: add exceljs dependency for file-parser migration
The previous commit migrated file-parser.ts from xlsx to exceljs
but missed including the package.json dependency change.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 10:23:15 +01:00
g-butandClaude Opus 4.6 99c67fa601 feat: UX/UI & code quality improvements (colors, wrapper, a11y, headings, Zod)
Consolidate 32 hardcoded hex colors into src/config/ui-colors.ts (SSOT),
create AdminPageWrapper to eliminate header boilerplate across 7 admin pages,
add ARIA accessibility attributes to 32 form files (WCAG AA), create shared
Heading component with responsive typography and migrate 7 public pages,
and extend Zod validation to ~15 additional API routes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 08:40:55 +01:00
g-butandClaude Opus 4.6 2a71f61d2f feat(validation): add Zod schemas to ~25 API routes with tests
Add comprehensive input validation across all high-priority API routes:
- Create 12 domain-specific schema files (payments, appointments, reviews,
  workshops, messages, user, repairer, seller, blog, ai, inventory, common)
- Add validateBody/validateQuery helpers with structured German error responses
- Wire validation into 20+ route files replacing manual field-presence checks
- Add discriminated union schema for appointment PATCH actions
- Standardize payment route error messages to German
- Fix lint errors in CategoryForm and RegistrationWizard (setState in useEffect)
- Extract thick route handlers to service layer (seller, inventory, orders)
- Add loading states to admin and dashboard pages
- Add 67 unit tests covering all schemas with valid/invalid/default cases

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 06:21:58 +01:00
g-butandClaude Opus 4.6 d1a63c7f55 fix: replace ASCII umlaut "enthaelt" with proper "enthält"
- Fix "enthaelt" → "enthält" in bulk-upload error message
- Add 16 new patterns to lint-umlauts.sh (enthält, erhält, verfügbar,
  überprüf, fällt, lässt, nächst, gewählt, etc.)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 18:11:18 +01:00
g-but 86c0d40e3a Auto-deploy: Updates from 2026-02-09 17:26:25 2026-02-09 17:26:25 +01:00
g-butandClaude Opus 4.6 8f27c3adab feat(erfassung): add Excel (.xlsx) bulk upload support
- Add xlsx (SheetJS) dependency for parsing Excel files
- Add parseExcel() in file-parser.ts that converts xlsx → CSV → existing pipeline
- Accept .xlsx/.xls in bulk-upload route with ArrayBuffer handling
- Update DataEntryTabs UI: accept attribute, labels, unmapped columns warning
- Fix verkaufspreis/auf_lager string→number coercion in bulk-save route
- Add normalizeConditionValue() to resolve condition aliases (very_good→like_new, etc.)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 17:14:15 +01:00
g-butandClaude Opus 4.6 0663c12e8c refactor(tasks): fix CLAUDE.md compliance — DRY, SSOT, responsive
Critical:
- Extract getDbUserId() and getActiveTask() to shared task-helpers.ts,
  eliminating 4x duplicated user lookup and 3x task verification
- Move status/priority color maps to config/tasks.ts (was duplicated
  in list + detail pages)
- Centralize 6 task interfaces in lib/schemas/tasks.ts, replacing 4
  separate inline definitions across page files

Important:
- Replace magic strings in SQL with config constants (TASK_STATUSES,
  TASK_PRIORITIES, REQUEST_STATUSES)
- Fix responsive grids: grid-cols-2 md:grid-cols-4 (list),
  grid-cols-1 lg:grid-cols-3 (detail)
- Add logger.error() to all catch blocks that silently swallowed errors
- Extract client-safe getErrorMessage() to lib/utils/error.ts to fix
  client/server boundary (client components cannot import server modules)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 15:34:50 +01:00
g-butandClaude Opus 4.6 e7be46d5f2 refactor: replace inline date formatting with centralized helpers
Replace ~35 instances of inline `new Date().toLocaleDateString('de-CH')`
and `toLocaleString('de-CH')` with shared formatters from lib/date-formats.ts.
Eliminates SSOT violation where locale and format options were scattered
across components.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 15:34:33 +01:00
g-butandClaude Opus 4.6 6d58a2c843 refactor(p2): deduplicate formatCHF and use approval-status SSOT
- Replace 4 local formatCHF() definitions with import from @/lib/hirn/format
- Simplify KPICard formatDefaultValue to use formatCHF/formatPercent/formatNumber
- Replace hardcoded approval status labels in repairer-applications with SSOT

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 13:40:33 +01:00
g-butandClaude Opus 4.6 63afbb3c81 refactor(config): add booking status config (SSOT)
- Create /src/config/booking-status.ts with all booking lifecycle statuses
- Extract booking status labels/colors from dashboard/bookings and repairer/bookings
- Add urgency level badges (urgent, high, normal) to SSOT
- Include dark mode support in all badge colors

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 13:29:11 +01:00
g-butandClaude Opus 4.6 90ab0b5ef1 refactor(p2): centralize date formatting, fix SSOT violations
- Create /src/lib/date-formats.ts as SSOT for date formatting (de-CH locale)
- Replace 12 local formatDate definitions with shared imports
- Fix blog-utils.ts de-DE → de-CH locale via re-export
- Derive PRODUCT_CONDITIONS from ZUSTAND_OPTIONS SSOT
- Derive PRODUCT_CATEGORIES from KATEGORIEN SSOT
- Fix English metadata on about page → German

17 files changed, -106 lines net

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 13:15:44 +01:00
g-butandClaude Opus 4.6 7d3c7aeeae refactor(config): add shared approval status config (SSOT)
- Create /src/config/approval-status.ts with labels, badges, and helpers
- Replace hardcoded status labels in content submissions page
- Replace inline ternary status labels in blog submissions page
- Supports pending, approved, rejected, requires_changes, published

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 12:55:56 +01:00
g-butandClaude Opus 4.6 29995ebcd2 fix(admin): replace all browser prompt() calls and deduplicate condition labels
- Replace 12 prompt() calls in repairer-applications with unified action dialog
- Replace prompt() in reviews page with inline moderation form
- Replace prompt() in PermissionRequestsManager with inline rejection form
- Add getConditionBadge() to conditions SSOT with legacy value aliases
- Replace hardcoded condition labels in marketplace, inventory, and admin pages
- Zero prompt() calls remaining in codebase

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 12:47:42 +01:00
g-butandClaude Opus 4.6 c4fa343b5b fix(admin): resolve P1 issues - hardcoded table names, missing anchor, prompt() UX
- Add id="register" anchor to workshop detail registration form
- Add TECHNICIAN_PROFILES to TABLE_NAMES config constant
- Replace 6 hardcoded table names with TABLE_NAMES constants in admin pages
- Remove dummy workshop instance creation, return error when none scheduled
- Replace browser prompt() with inline rejection form in workshop approval

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 12:30:46 +01:00
g-butandClaude Opus 4.6 a786b4115c fix(security): resolve P0 issues from second audit pass
- Fix appointment cancel button sending empty PATCH body (now sends action: 'cancel')
- Fix appointment edit sending wrong payload (add 'update' action to API)
- Fix workshop cancel button sending empty PATCH body
- Fix PasswordChangeSection showing wrong complexity requirements (match AUTH_CONFIG)
- Add rate limiting to forgot-password and reset-password APIs
- Fix service booking field mismatch (API now resolves serviceSlug to service_type_id)
- Route marketplace product submissions through approval flow instead of publishing directly
- Admin approval now publishes to MedusaJS when approving product submissions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 11:52:20 +01:00
g-butandClaude Opus 4.6 dea70dbd90 fix(lint): resolve all lint errors in SuggestionButton and ProductListingForm
- Move ref updates into useEffect to avoid writes during render
- Track textarea value with state instead of reading ref during render
- Replace <a> with <Link> for client-side navigation to /marketplace

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 11:24:50 +01:00
g-butandClaude Opus 4.6 08859abc02 fix(typecheck): add type parameter to appointment insert query
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 11:15:52 +01:00
g-butandClaude Opus 4.6 263e057a20 fix(security): resolve P0 security and blocking issues across platform
- Fix password change to verify current password before allowing update
- Unify password policy to AUTH_CONFIG SSOT (8 chars, no complexity) across
  registration, reset-password, and server validation
- Add POST handler to /api/appointments for service booking flow
- Fix workshop registration links (dead /register → working #register anchor)
- Fix workshop propose CTA to link to /workshops/propose
- Create marketplace product detail page at /marketplace/[productId]
- Make admin approvals buttons functional with API route and client component
- Replace hardcoded table names with TABLE_NAMES constants in approvals page
- Add USER_CONTENT_SUBMISSIONS to TABLE_NAMES config

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 10:57:13 +01:00
g-butandClaude Opus 4.6 ca6e2b2b10 refactor: decompose god files into focused modules
Extract hooks, sub-components, config, and data arrays from 5 oversized
files to improve maintainability and separation of concerns:

- SuggestionButton.tsx (780 → 331 lines): extract 3 hooks, 3 sub-components,
  config, and CSS into dedicated files under features/floating-ui/
- ProfilePage.tsx (899 → 227 lines): extract 4 hooks, 6 section components,
  and swiss-cantons config
- enterprise-ai-solutions (843 → 492 lines): extract 9 data arrays to data.ts
- web-design-development (759 → 555 lines): extract 5 declarations to data.ts

Pure structural refactoring — no behavioral changes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 19:39:22 +01:00
g-butandClaude Opus 4.6 595ba77bf1 fix(security): resolve 3 Dependabot high-severity alerts
- fast-xml-parser 5.2.5 → 5.3.4 (RangeError DoS, alerts #35 #37)
- @isaacs/brace-expansion 5.0.0 → 5.0.1 (resource consumption, alert #40)

Both fixed via npm overrides on transitive dependencies from
@aws-sdk and @medusajs/cli.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 19:01:25 +01:00
g-butandClaude Opus 4.6 83f62b12ae fix(erfassung): use correct brand capitalization in fallback parser
Brands like HP and ASUS were incorrectly capitalized (Hp, Asus) because
the naive charAt(0).toUpperCase() approach doesn't handle acronyms.
Replaced with explicit brandMap for proper casing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 17:51:21 +01:00
g-butandClaude Opus 4.6 92107b2837 fix(erfassung): improve bulk table row click and fallback parser
Row click: Move onClick handler to <tr> element so clicking anywhere
on a row opens the detail panel. Editable cells and checkboxes use
stopPropagation to preserve their specific behavior.

Fallback parser: Extract price from the last number on the line
instead of the first (avoids picking up model numbers like T480).
Detect conditions using CONDITION_ALIASES sorted by length to match
"wie neu" before "neu". Auto-detect categories from product model
patterns. Clean product names by stripping brand, price, and
condition words.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 16:56:46 +01:00
g-butandClaude Opus 4.6 aefe1fac1d feat(erfassung): add bulk product erfassung and fix umlaut violations
Implement bulk product entry system (Phases 1-7):
- Shared product creation logic (create-product.ts) and form component (ProductForm.tsx)
- Multi-product AI extraction from text input (bulk-extraction.ts)
- Bulk review table, detail panel, action bar, and success screen
- CSV file upload with auto-column detection (file-parser.ts)
- AI enrichment API for CSV data (bulk-enrich)
- Bulk save API with per-product transaction isolation
- Future-proof tabs for speech/image bulk input

Fix ASCII umlaut violations across entire codebase:
- Replace "fuer" → "für", "koennen" → "können", "Ungueltig" → "Ungültig",
  "Waehlen" → "Wählen", "Laenge" → "Länge", "Hoehe" → "Höhe", etc.
- Affected: erfassung, schemas, donations, services, auth routes
- Add npm run lint:umlauts script to catch future violations

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 15:13:54 +01:00