- 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.
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>
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>
- 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
- 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>
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>
- 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>
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>
- 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>
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>
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>
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>
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>
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>
- 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>
- 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>
- 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>
- 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>
- 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>
- 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>
- 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>
- 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>
- 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>
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>
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>