Second commit toward killing IN_DISCUSSION (after e5a92e94 stopped
creating new ones). Pure data update — status column is VARCHAR(30)
with no CHECK constraint, so this is a one-line UPDATE with no schema
change.
After this migration runs, the next code commit can simplify all
`status === OPEN || status === IN_DISCUSSION` filter checks in
requests/[id]/route.ts, offers/route.ts, accept/route.ts, and
admin/it-hilfe/stats/route.ts to just `OPEN`, then drop IN_DISCUSSION
from config/it-hilfe.ts's REQUEST_STATUS / VALID_REQUEST_TRANSITIONS
/ REQUEST_STATUSES / isRequestAcceptingOffers.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds MEMBERSHIP_APPROVED, WORKSHOP_PROPOSAL_APPROVED, LISTING_SOLD,
SERVICE_APPOINTMENT_ASSIGNED, SERVICE_APPOINTMENT_COMPLETED to NOTIFICATION_TYPES.
Adds WORKSHOP, WORKSHOP_PROPOSAL, MEMBERSHIP, LISTING to RELATED_TYPES and hrefs.
Migrations 068/069 add workshops.proposal_id FK and extend the notifications CHECK constraint
to cover all new and previously-missing IT-Hilfe/decision-deadline types.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- npm run compliance:ssot / compliance:i18n — new audit scripts that detect
SSOT and i18n violations in CI or local runs
- scripts/baselines/ — snapshot files for the audits
- ship.sh simplified to a minimal quality gate (lint, typecheck, test)
- services/data.ts: badgeKey replaces hardcoded badge string so the 'soon'
label is driven by translations (messages/*.json services.badges.soon)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ALTER TABLE ... DROP CONSTRAINT is required when the unique index
backs a named constraint; DROP INDEX fails with a hint in that case.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Allow decisions to be shared publicly via link; anyone can vote with
email-only identity (no account required) when allow_public_voting=true
- decision_votes.user_id is now nullable; voter_email added for anonymous
identity; DB-level check ensures at least one is present
- Partial unique indexes replace the old unique constraint to deduplicate
registered votes by (decision_id, user_id) and anonymous by
(decision_id, voter_email) independently
- POST /api/vote/[id] accepts {email, voteData} without auth; validates
the email is on the invited list unless allow_public_voting is enabled
- Admin form: AdvancedSettings gains "Öffentliche Abstimmung" toggle;
DecisionDetailClient shows allow_public_voting badge and shareable link
- After submitting a vote, anonymous visitors see a registration gate CTA
with register + login links pointing back to the vote page
- Migration: 066_anonymous_public_voting.sql (apply to Neon DB)
- Translation keys added in all 7 locales (de/en/fr/es/it/ja/ko)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Migration 065: ADD COLUMN background to decisions (was in Drizzle only,
never applied to Neon — caused 'Fehler beim Erstellen der Entscheidung')
- decisions-crud.ts: add null guard on INSERT result row
- DecisionDetailClient: 'Link teilen' button copies /vote/<id> to clipboard
when decision is in discussion or voting phase
- GET /api/vote/[id]: public endpoint returning decision data (no auth)
- POST /api/vote/[id]: submit vote by email lookup — resolves to DB user ID
then delegates to existing submitVote() with full eligibility checks
- /vote/[id]: public page (no auth required) — shows decision context,
collapsible background, options, and reuses existing ballot components
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Migration 064 adds the missing `canton` column to `repairer_profiles` (omitted
in 061 when helper_profiles was merged in), backfills from helper_profiles, and
rebuilds helper_profiles_v to expose the real column instead of NULL.
The canton filter in /api/technicians was silently ignored since 061 — any
frontend filter by Swiss canton returned all results. Now wired up.
Legacy routes /api/repairers and /api/it-hilfe/helpers reduced from 150-230
lines of duplicated query logic each to 30-line thin proxies that delegate to
/api/technicians and remap the response shape for backwards compatibility.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add next-intl v4.9.1 with App Router [locale] directory pattern
- German is SSOT; other locales fall back to German for missing keys
- All public pages moved to src/app/[locale]/ for locale-aware routing
- Non-locale routes (admin, auth, dashboard, profil) use AppShell for providers
- Root layout stripped to html/body shell; locale layout owns providers
- Middleware merges next-intl locale routing with existing CSRF/auth logic
- LocaleSwitcher added to desktop header; MobileMenu updated
- CommunityStats, NewsletterSignup, Header, MobileMenu use useTranslations
- 57 partial message files merged into de/fr/en locale JSONs
- Fix react-hooks/immutability in DecisionFormClient (setInitialStatus)
- TypeScript: 0 errors — ESLint: 0 errors
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Architecture:
- User ≠ Member: users are accounts, members are users with is_member=true
- Migration 062: adds is_member/member_since/member_type/member_paid_until
to users + creates membership_applications table
- Fixed misleading "Mitglieder" stat label (now "Nutzer:innen")
New membership flow:
- /mitglied-werden now has a real form (not mailto: link)
- Works both for logged-in and anonymous users
- Logged-in: pre-fills name/email, links application to user_id
- Anonymous: accepts application, admin manually links later
- Shows 3 states: form, pending application, already a member
- Member type selection: Regular CHF 50 / Reduced CHF 20
API:
- POST /api/membership/apply — validated, rate-limited
- Prevents duplicate pending applications from same user
- Stores in membership_applications with pending status
FAQ updated to clarify:
- Difference between user account and Verein membership
- How application process works
- How to pay annual dues
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Phase 1 — Database:
- Migration 061: adds community columns to repairer_profiles
(accepts_gratis, accepts_kulturlegi, max_travel_km, service_delivery_types,
profile_tier), migrates helper_profiles data, creates compat view
- Schema updated in services.ts and itHilfe.ts
Phase 2 — Unified API:
- New GET /api/technicians — unified list with tier/skills/gratis filters
- New GET /api/technicians/[id] — unified detail with skills + services
- Updated PUT /api/user/technician-profile to write to repairer_profiles
with profile_tier='community'
- Old endpoints marked as legacy proxies
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Decision categories:
- 6 Verein categories: Vorstandsbeschluss, Mitgliederbeschluss,
Ratifizierung, Statutenänderung, Budget, Operative Entscheidung
- Category dropdown in creation form + displayed in detail header
Deadlines:
- Discussion + voting deadline date pickers in creation form
- Countdown timer in voting UI (red <24h, amber <3 days)
- Helper text about auto-close behavior
Participant selector:
- Team member picker with search in creation form
- "Abstimmungsberechtigt" section with checkboxes
- Empty = all staff can vote, selected = restricted
Quorum enforcement:
- Blocks closing decisions that don't meet quorum threshold
- Shows quorum progress with green/red indicator
- Warning message when quorum not yet met
Email notifications:
- New templates: decisionVotingOpened, decisionDeadlineReminder
- Email sent when voting opens (with deadline info)
- 24h deadline reminder via daily cron job
- Migration 057 adds category column
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Task assignment:
- Add assigned_to column to tasks table (migration 056)
- Team member dropdown in create/edit forms ("Zuweisen an")
- Show assignee in task list + detail page
- Notification sent to assignee on create/reassign
Protocol attendees:
- Search input in attendee picker ("Teilnehmer suchen...")
- Attendees column in protocol list (name badges, +N overflow)
- Edit attendees in review phase (checkbox picker + save)
- Attendee filter dropdown in protocol list
- Resolve attendee UUIDs to names in list + detail sidebar
- Attendee section open by default in creation form
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Migration 054 adds due_date column to tasks table
- Schema updated with dueDate field
- Task create/edit forms include date picker
- Task detail shows due date with overdue highlighting
- Task list shows Fällig column with red overdue indicator
- API accepts due_date in POST/PATCH
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The locations Drizzle schema defined 8 columns (accessibility_info,
approval_status, approved_by, approved_at, rejection_reason,
usage_count, last_used_at, created_by) that didn't exist in the DB,
causing db.select().from(locations) to 500.
Migration 053 adds all missing columns and backfills approval_status
from the existing is_approved boolean.
Also fixed the admin locations page which used snake_case property
names (created_at, approval_status, etc.) but the Drizzle API returns
camelCase (createdAt, approvalStatus). Added null guard on date
formatting to prevent toLocaleDateString crash.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add migration 052 to update marketplace_orders CHECK constraint:
'pending' → 'pending_payment' (matches ORDER_STATUS config)
- Fix Payrexx webhook setting invalid 'paid' status on service
appointments — use APPOINTMENT_STATUS.CONFIRMED instead
- Fix appointment pay route referencing non-existent 'approved' status
and setting invalid 'paid' — use APPOINTMENT_STATUS.COMPLETED
- Use APPOINTMENT_STATUS constants instead of PAYMENT_STATUS for
appointment status updates (type safety)
These mismatches would cause CHECK constraint violations at runtime
when creating marketplace orders or processing payment webhooks.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Phase 1 — IT-Hilfe ↔ Repairer unification:
- Add repairer_profile_id to it_hilfe_offers (soft FK to repairer_profiles)
- New API: GET /api/repairers/[id]/matching-requests (skill-based matching)
- New MatchingRequestsTab component on repairer detail pages
- IT-Hilfe offers now display repairer profile info (verified badge, rating)
- Repairers can see and respond to matching IT-Hilfe requests
Phase 2 — Erfassung vs Intake audit:
- docs/ERFASSUNG_INTAKE_AUDIT.md: full overlap analysis and consolidation plan
- Erfassung = AI-powered capture, Intake = checklist pipeline
- Recommended: merge into single pipeline with AI as optional first step
Apply Zod validation imports and status config imports across
remaining page components (admin approvals, decisions, locations,
protocols, workshops, blog, dashboard, IT-Hilfe, marketplace).
Delete unused MarketplaceCheckoutForm. Update audit report with
current findings and scores.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Marketplace payments now use Payrexx reservation-based escrow instead of
Stripe manual capture. Checkout redirects to Payrexx hosted payment page
rather than rendering inline Stripe Elements. Dev mock mode enables full
E2E testing without Payrexx credentials.
Navigation reorganized: merged standalone Shop into "Marktplatz" mega-menu
alongside Marketplace and IT-Hilfe (7→6 nav items). Homepage hero CTA now
points to /marketplace. Removed 10 unused TABLE_NAMES constants.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Messages dashboard: split-panel conversation list + thread view with
mobile-responsive layout, deep-linking via ?conversation= param
- Share listing: Web Share API with clipboard fallback + "Kopiert!" toast
- Report listing: modal with reason radio buttons, DB migration, API route
- Duplicate listing: copy fields + specs as draft, redirect to edit
- JSON-LD Product schema on listing detail pages (Schema.org structured data)
- Dynamic sitemap for active marketplace listings (/marketplace/sitemap.xml)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implement all 6 Phase 1 features for the marketplace competitive roadmap:
1.1 Seller type toggle (RevampIT Geräte / Community Inserate) on browse page
1.2 RevampIT verified badge with admin verify endpoint and verification details
1.3 Categories migrated to KATEGORIEN SSOT (numeric IDs) + structured tech specs
(listing_specs table, spec filters on browse, spec tags on cards, spec table on detail)
1.4 Category-specific condition criteria checklists in sell form and detail page
1.5 Gratis listings (price=0) with badge + zero commission (COMMISSION_RATE=0)
1.6 AI spec extraction — enhanced marketplace AI prompt to extract specs from text
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove all Medusa-specific documentation (MEDUSA_*.md, SETUP_*.md,
README_MEDUSA.md, AI_AGENT_QUICK_REFERENCE.md, REVAMPIT_SHOP_*.md).
Update remaining docs, README, AGENTS.md, CLAUDE.md, env examples,
sitemap, and agent config files to reflect the simplified architecture
without Medusa dependency. Replace Medusa.js with WooCommerce in
service offerings documentation.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove the entire Medusa integration that was replaced by native database
queries for product management. This includes the medusa-backend directory,
all Medusa API routes (cart, orders, products, regions, health), Medusa
client library and React hooks, StripeCheckout component, publish service,
Docker services (medusa, medusa_db, medusa_redis), CI/CD workflow, and
all Medusa references from config files, scripts, and docker-compose.
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>
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>
Migration 038 adds 12 columns to workshops and 2 to workshop_instances so
the proposal approve route no longer crashes with 500. Approvals page now
only shows workshop proposals and blog posts (products/services are
admin-only), and surfaces permission requests for super admins. Removed
dead Medusa product-publish logic from the approval API route.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Previously inventory products showed "Anfrage senden" because they had
no Medusa variant ID, and the order service used hardcoded placeholder
data. This wires up the full end-to-end flow:
- Add medusa_variant_id column to inventory_items (migration 037)
- Extract Medusa publish logic into medusa-publish-service.ts
- Auto-publish to Medusa on product publish (fire-and-forget)
- Return Medusa IDs from inventory detail API
- Enable "In den Warenkorb" when variant ID exists on product page
- Rewrite order service to fetch real cart data from Medusa
- Make paymentIntentId optional (payments deferred)
- Update order-service tests for new Medusa cart integration
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace RAG-based document retrieval with a rich system prompt containing
all organizational knowledge derived from SSOT sources. The Llama 3.3 70B
model (128k context) handles it easily without needing vector search.
- Create system-prompt.ts deriving all numbers from org-numbers.defaults
- Remove RAG retrieval (searchSimilar, formatContext, contextUsed)
- Remove chunks UI (sources panel, similarity scores) from HirnChat
- Add input validation for temperature/maxTokens at API boundary
- Scope history queries by user_id for defense in depth
- Update welcome text to reflect baked-in knowledge
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
All organizational numbers now flow from a single `org_numbers` table
in the shared Neon database, resolving contradictions across 6+ files
(e.g. internship success 40% vs 90%, devices 150 vs 1000, CO₂ 300kg
vs 350kg). Numbers reconciled against audited revamp-info registry.
Key corrections: CO₂ production 300→350kg (Fraunhofer IZM 2023),
refurbishment 15→65kg, annual CO₂ saved ~43t (not 285t), internship
success ~40% (not 90%), people helped 100+ (not 347), team ~20 (not 23).
Also fixes German language consistency in services.ts (Linux & Web
pricing/features were in English).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add EditHistoryEntry type and edit tracking fields to WorkshopProposal
- Add reviewer_name and editor_name to WorkshopProposalWithProposer
- Fix type assertions in API routes (currentProposal as WorkshopProposal)
- Fix optional property access in EditProposalModal and EditSubmissionModal
- Fix Heading import (default vs named export)
- Add null checks in test file
- All typechecks now pass
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add database migration (034) for edit tracking columns
- Implement edit history with JSONB audit trail
- Create workshop proposal detail page with edit modal
- Add blog submission edit functionality
- Display edit history with timestamps and field changes
- Show 'Von Admin bearbeitet' badges in list views
- Full API endpoints for edit operations
Co-Authored-By: Claude Sonnet 4.5 <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>
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>