Commit Graph
68 Commits
Author SHA1 Message Date
g-but 2823e25dca feat: connect IT-Hilfe and Repairers, audit Erfassung/Intake
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
2026-03-23 14:09:46 +01:00
g-but 19e6be6d19 debug: test all listings route imports individually 2026-03-23 13:12:59 +01:00
g-butandClaude Opus 4.6 15f30bda2e feat(it-hilfe): comprehensive IT-Hilfe product improvements
- Fix offer_count never incrementing on new offers (critical bug)
- Add VALID_REQUEST_TRANSITIONS config + deriveBudgetType() helper (SSOT)
- Add IT-Hilfe notification types to config
- Add decline offer endpoint with email + in-app notifications
- Add in-app notifications for offer accept/reject/complete lifecycle
- Add helper profile detail page at /it-hilfe/helfer/[id]
- Add helpers directory pagination (20 per page)
- Store budgetTier on request creation + use in matching
- Add request edit page at /it-hilfe/[id]/edit
- Add decline button UI in OffersList
- Replace alert() with inline success states in HelperCard + detail page
- Add expiry badges to RequestCard + countdown in RequestSidebar
- Add admin status transition validation
- Update tests for new functionality

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 14:22:56 +01:00
g-butandClaude Opus 4.6 f893115ad7 feat: complete all remaining audit items (12 items across 9 batches)
Accessibility:
- Add skip-to-content link in root layout
- Fix 125 gray-400 contrast violations across 92 files (→ gray-500)
- Fix 13 undersized admin touch targets (p-1 → p-2, w-8 → w-10)

Performance:
- Fix workshops N+1 waterfall: single ?include=instances API call
  replaces O(W×I) client-side fetch loops

Architecture:
- Remove legacy admin-auth.ts dual auth system
- Migrate 4 routes from CMS JWT to Auth.js/withAdmin

Responsive:
- Add mobile-first breakpoints to 5 components (sell page,
  bookings, decisions, product tables, filter bars)

Mission features:
- Public financial transparency page at /about/finances
- Per-listing CO2 impact badge on marketplace (Fraunhofer IZM 2023)
- Subscription exchange design spec + draft migration

0 TypeScript errors, 0 ESLint errors, 362/362 tests passing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 16:30:01 +01:00
g-butandClaude Opus 4.6 25723a7d75 refactor: apply Zod validation to remaining routes, update audit report
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>
2026-03-08 15:16:46 +01:00
g-butandClaude Opus 4.6 45bd7832fe feat: unified intake system, marketplace admin, IT-Hilfe, sidebar cleanup
Major features:
- Unified Device Intake system with AI text/voice extraction, checklist-gated
  publishing, tier change with checklist reset, and audit timeline
- Marketplace admin panel with stats, listing moderation, reports, orders
- IT-Hilfe admin for managing community tech help requests
- Marketplace sell form: AI-assisted listing creation with image upload

Fixes:
- Marketplace image URL validation: accept relative /uploads/ paths (was
  rejecting valid uploads with z.string().url())
- Admin marketplace stats/orders: fix column name mismatch (amount_chf
  not total_cents)
- Metadata title dedup: skip brand prefix when title already contains it
- Remove "Produkte" from admin sidebar (replaced by Geräte-Eingang +
  Marketplace flow)
- Dashboard quick action: "Neues Produkt" → "Neues Gerät" → /admin/intake

Cleanup:
- Delete unused modules: labels.ts, newsletter-status.ts, sensitive-areas.ts,
  role-checks.ts, unified-permissions.ts, mappers.ts, number-sources.ts,
  admin-access.ts, auth middleware, unused hooks
- SSOT consolidation across API routes and config

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 18:56:42 +01:00
g-butandClaude Opus 4.6 5ed9e62e38 feat: replace Stripe with Payrexx for marketplace escrow, reorganize navigation
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>
2026-02-26 15:02:41 +01:00
g-butandClaude Opus 4.6 c720d2ad93 feat: marketplace Phase 2 — messaging UI, share, report, duplicate, SEO
- 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>
2026-02-25 15:32:38 +01:00
g-butandClaude Opus 4.6 cb734980f1 feat: marketplace Phase 1 — specs, verification, gratis, seller toggle, condition criteria
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>
2026-02-25 14:18:22 +01:00
g-butandClaude Opus 4.6 3419caaa69 docs: update all documentation and configuration for post-Medusa architecture
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>
2026-02-25 11:44:25 +01:00
g-butandClaude Opus 4.6 b21a680a4b refactor: remove Medusa e-commerce backend and all related infrastructure
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>
2026-02-25 11:43:11 +01:00
g-butandClaude Opus 4.6 44c9e374df fix: security hardening, newsletter DB migration, and search reliability
- CSV import: add 5MB schema limit, 1000 row cap, rate limiting (5/hr)
- Newsletter: migrate from file I/O to newsletter_subscriptions table
  (eliminates race condition on concurrent writes)
- Database: add 9 performance indexes for marketplace queries
- Marketplace: add OG images to listing detail metadata
- Meilisearch: add retry logic (2 retries with backoff) for write ops

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 08:51:12 +01:00
g-butandClaude Opus 4.6 deff58b6a1 feat(tasks): notify requester when task request is accepted or declined
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>
2026-02-19 08:41:19 +01:00
g-butandClaude Opus 4.6 0d24599db9 feat(notifications): add email delivery, config-driven navigation, and fix DB type constraint
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>
2026-02-18 22:08:42 +01:00
g-butandClaude Opus 4.6 a9c5db02b2 fix(workshops,approvals): add missing DB columns and scope approvals to workshops/posts/access
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>
2026-02-18 14:53:31 +01:00
g-butandClaude Opus 4.6 de97b600c2 feat(shop): connect inventory products to Medusa cart and order flow
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>
2026-02-18 10:05:45 +01:00
g-but a0e6d383d6 fix(ai): harden provider config path and restore admin key persistence
- make AI runtime config deterministic from DB (dedupe-safe ordering)\n- respect provider enabled flags in fallback runtime\n- improve protocol NO_PROVIDER UX copy with clear admin hint\n- extend admin hirn providers PATCH for apiKey persistence + enable toggle + guarded default switch\n- add DB migration 036 to dedupe/uniqueness-hardening for system providers\n- update hirn init insert conflict handling
2026-02-17 22:38:36 +01:00
g-butandClaude Sonnet 4.5 1f30c8efa2 feat(hirn): bake org knowledge into system prompt, remove RAG UI
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>
2026-02-16 21:38:45 +01:00
g-butandClaude Opus 4.6 2db4fd4e9d feat(data): consolidate org numbers into shared SSOT via Neon DB
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>
2026-02-16 17:33:26 +01:00
g-butandClaude Sonnet 4.5 64fb3126dc fix(types): resolve all TypeScript errors in admin edit system
- 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>
2026-02-13 13:41:39 +01:00
g-butandClaude Sonnet 4.5 bc7ad02094 feat(admin): Add edit-before-approve system for workshop proposals and blog submissions
- 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>
2026-02-13 12:42:03 +01:00
g-butandClaude Sonnet 4.5 17108b846c feat(navigation): restructure for Community positioning
BREAKING CHANGE: Navigation structure updated to separate B2C and C2C offerings

Changes:
- Restructured main navigation (7 items):
  1. Über uns (includes Projekte)
  2. Dienstleistungen (professional services only)
  3. Shop (revamp-it's B2C shop)
  4. Community 🆕 (Marketplace + IT-Hilfe P2P platforms)
  5. Lernen (workshops, blog)
  6. Mitmachen (get involved)
  7. Kontakt (CTA)

- Homepage updates:
  * Added prominent Community section after hero
  * Features both Marketplace and IT-Hilfe with clear CTAs
  * Removed duplicate IT-Hilfe section
  * Added icons: Store, ShoppingBag, DollarSign, Users

- Strategic framing:
  * "Community" language resonates with team
  * Clearly separates B2C (Shop) from C2C (Community)
  * Marketplace + IT-Hilfe positioned as peer-to-peer ecosystem
  * Scalable platform architecture

Additional changes:
- Added config files for blog, marketplace status, refund, review status
- Added protocol import/process API routes
- Added date utilities
- Updated admin components for better status management
- Migration 027: protocol input method tracking

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-12 16:02:00 +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 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 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-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-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 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 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-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
g-butandClaude Opus 4.5 8364906681 feat(team): implement activity stream with current focus, updates, and help requests
Add comprehensive activity tracking for team profiles:
- Current focus status on profile detail page
- Manual activity updates (accomplishments, milestones, notes, announcements)
- Help request system (broadcast or targeted)
- Unified activity feed aggregating all sources
- Weekly digest for management with stats and top contributors

Also includes code quality fixes:
- Fix SQL injection vulnerabilities in activity and digest routes
- Extract shared formatRelativeTime utility to reduce duplication
- Fix TypeScript type errors in ActivityCard and focus route
- Fix lint errors in CurrentFocusInput (replace useEffect with useMemo)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 16:59:32 +01:00
g-butandClaude Opus 4.5 280a749db4 fix(tasks): add type assertions to all API route query results
Fix TypeScript errors by properly typing database query results
throughout the task management API routes.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 14:20:56 +01:00
g-butandClaude Opus 4.5 8eca53c33c feat(tasks): implement task management system for staff
Adds a complete task management system for team coordination including:
- Database migration with tasks, completions, attention flags, requests, and projects tables
- Full CRUD API endpoints for tasks, projects, and task requests
- Analytics endpoint for task metrics
- Admin UI pages: task list with filters, task detail, create/edit forms
- Task completion tracking with optional photo proof
- Attention flag system for urgent tasks
- Project-based task organization
- Zod schemas for validation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 13:58:26 +01:00
g-butandClaude Opus 4.5 aaff2ad83d fix(auth): resolve database schema conflict and add staff email templates
- Fix Listmonk/CMS users table conflict by using separate listmonk_db database
- Fix migration errors: index column names, conditional index creation,
  seller_profiles missing columns, immutable function in unique index
- Add staffVerificationCode and staffWelcome email templates for @revamp-it.ch
- Update registerUser() to select template based on staff status
- Add Listmonk service to docker-compose with Mailpit for local testing
- Add email provider abstraction supporting both Listmonk and direct SMTP

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 13:24:34 +01:00
g-butandClaude Opus 4.5 7f310a4140 fix(donations): add missing thank_you_sent_at column to migration
The original donations table migration didn't include thank_you_sent_at,
causing PATCH requests to fail when marking donations as thanked.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 07:42:44 +01:00
g-butandClaude Opus 4.5 b4d5b493ef feat(admin): add Team & HR management with profiles and enhanced users
Implement comprehensive team profile system for staff management:
- Database migration for team_profiles table with talent development fields
- Team profile CRUD API with permission-based HR notes visibility
- Team components: cards, filters, form with progressive disclosure, detail view
- Team pages: overview with PermissionRequestsManager, detail, edit, create
- Enhanced users API with search, filter, and pagination
- User detail page with link to team profile
- Config-driven labels and options (SSOT principle)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 07:37:25 +01:00
g-butandClaude Opus 4.5 c4c9ba33a4 feat(donations): add unified donations system for monetary and device donations
Implements Phase 1 of donations feature enabling staff to record donations
against user accounts and users to view their donation history.

- Add config SSOT for donation types, device categories, conditions, statuses
- Extend donations table with device fields via migration
- Add DbDonation interface and Zod validation schemas
- Create user API to fetch donation history
- Create admin API for CRUD operations with filtering/pagination
- Add user dashboard page showing donation history
- Add admin page with stats, filters, and donation recording form
- Register donations sections in admin sidebar and user dashboard

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 07:34:12 +01:00
g-butandClaude Opus 4.5 69b9880c0f feat(medusa): add production deployment configuration
- Add comprehensive deployment guide (docs/MEDUSA_PRODUCTION.md)
- Add Railway deployment config (railway.json)
- Add Vercel configuration script (scripts/configure-medusa-vercel.sh)
- Document deployment options: Railway, Render, self-hosted

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 19:14:39 +01:00
g-butandClaude Opus 4.5 70c41f4c4d feat(blog): Add complete blog submission workflow
- Create blog_submissions table for unified storage (migration 019)
- Add public submission endpoint at /api/public/blog/submit (CSRF-exempt)
- Add admin API at /api/admin/blog/submissions/[id] for approve/reject/publish
- Add admin UI at /admin/content/submissions for reviewing submissions
- Add public categories API at /api/blog/categories
- Update submission form to fetch categories from database
- Fix CSRF validation issue by using /api/public/ path

Flow: User submits → Admin reviews → Approve/Reject/Publish

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 14:18:05 +01:00
g-butandClaude Opus 4.5 ee3f92d602 feat(admin): enable admin editing of service presentation content
Add database fields and admin UI for editing all service content:
- Migration 018 adds presentation columns (icon, hero, features, process, pricing)
- Service icons config with curated Lucide icons for selection
- Category styling config for visual consistency
- IconPicker and ServiceForm admin components
- API routes for CRUD operations on services
- Edit page at /admin/services/[id]/edit
- Updated services list with edit links and category display

DB content now takes priority over presentation.ts with fallback support.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 14:11:00 +01:00
g-butandClaude Opus 4.5 da9351f6f4 feat(services): unify admin and public services with SSOT architecture
- Create unified service layer merging DB operational data with presentation config
- Add migration 017 to align service_types slugs with marketing data
- Refactor service detail pages to use getService() from unified layer
- Update API route to use getFeaturedServices/getBookableServices
- Add SERVICE_CATEGORIES and FEATURED_SERVICE_SLUGS constants
- Update service components to import types from @/lib/services
- Fix Next.js 16 params handling (await params)
- Mark src/data/services.ts as deprecated

Architecture:
- Database (service_types) = SSOT for operational data (prices, availability)
- Presentation config = rich display data (icons, features, process steps)
- Unified layer merges both for components to consume

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 12:29:35 +01:00
g-butandClaude Opus 4.5 8766e1d65b fix(admin): standardize API responses and fix admin-to-public data flow
- Fix services admin: use correct column name (price_cents not base_price_cents)
- Fix workshops public page: handle consistent API response format
- Fix workshop proposals API: use staff-based permissions, return items array
- Standardize API pattern: arrays returned directly, not wrapped in named objects
- Add PROPOSAL_STATUS constants to workshops config (SSOT)
- Add workshop error messages to error-messages config
- Document API response pattern in lib/api/helpers.ts
- Add migration 016 for workshop_proposals and locations tables

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 23:59:02 +01:00
g-butandClaude Opus 4.5 2f61495a3d feat(content): add blog admin CRUD and simplify Hirn providers
Blog Admin System:
- Add BlogPostForm component for create/edit
- Add /admin/content/blog/new and [id] pages
- Add /api/admin/blog CRUD endpoints
- Add /api/services public endpoint
- Add blog-db.ts and services-db.ts utilities
- Add 015_content_management.sql migration
- Update blog pages to use database with file fallback

Hirn Provider Simplification:
- Remove premium providers (Anthropic, OpenAI, Google, xAI)
- Keep only Ollama, Groq, OpenRouter
- Update HirnProviderSelector to show only free/local options
- Fix provider type definitions

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 20:24:44 +01:00
g-butandClaude Opus 4.5 f7cc0c43d5 feat: IT-Hilfe system, voice erfassung, product management, and various improvements
- Rename peer-repairs to it-hilfe with enhanced matching system
- Add voice input for product data entry (erfassung)
- Add product management components for admin
- Add user helper profile and skills management
- Simplify registration flow (remove role selection)
- Add new migrations for it-hilfe user skills
- Update navigation and config files
- Various bug fixes and improvements

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 18:30:38 +01:00
g-butandClaude Opus 4.5 f5c2e84d9b feat(infra): add unified startup scripts and graceful service degradation
- Add scripts/start-all.sh: orchestrated startup with health checks for all
  services (Docker, Medusa, Next.js) in correct dependency order
- Add scripts/stop-all.sh: graceful shutdown of application services
- Update package.json with cleaner commands (npm run d, start:all, stop:all)
- Enhance /api/health endpoint to check all services (database, Medusa,
  Meilisearch) with latency metrics and overall status
- Add graceful degradation to shop API: returns empty products instead of
  crashing when Medusa backend is unavailable
- Fix inventory API: remove references to non-existent item_uuid column

This makes the system more resilient - the frontend continues working even
when optional services (Medusa) are temporarily down.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 17:07:30 +01:00
g-butandClaude Opus 4.5 1754cd85c0 feat(admin): Improve admin password security and permission system
- Add lazy validation for admin password config (prevents build failures)
- Create modular sensitive areas config in src/config/sensitive-areas.ts
- Add visual indicator (shield icon) for sensitive sections in admin sidebar
- Add "Admin" link in UserMenu for staff members
- Add "Website" button in admin header for easy site switching
- Fix LogOut icon → User icon for "Mein Bereich" in admin sidebar
- Add npm script to generate bcrypt hashes: npm run generate:admin-hash

Admin password configuration:
- Production requires ADMIN_PASSWORD_HASH (bcrypt)
- Development allows ADMIN_PASSWORD (plain text, with warning)
- Validation now runs lazily at first use, not during build

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 10:41:39 +01:00
g-butandClaude Opus 4.5 ba9970d23c feat: Add HIRN AI RAG system with multi-provider support
Implements a complete RAG (Retrieval-Augmented Generation) system for
the admin dashboard with:

Core RAG Engine:
- Document ingestion with smart chunking (preserves complete functions/classes)
- pgvector-based semantic search with HNSW index
- Ollama embeddings (nomic-embed-text, 768 dimensions)
- Automatic content hashing for change detection

Multi-Provider AI Support:
- Ollama (local, default)
- Groq, OpenAI, Anthropic, Google, xAI, OpenRouter
- Per-user provider preferences stored in database
- Fallback chain for reliability

Auto-Documentation:
- Database schema extraction and indexing (62 tables)
- API route auto-documentation (116 endpoints)
- Generated docs stored in docs/ for reference

Admin Interface:
- Chat UI with context display
- Provider selector with API key management
- Document browser and stats
- Conversation history

Scripts:
- hirn-ingest.ts: Main document ingestion
- hirn-ingest-schema.ts: Database schema ingestion
- hirn-ingest-api-routes.ts: API documentation generator
- test-hirn-retrieval.ts: Retrieval testing
- test-hirn-chat.ts: Chat pipeline testing

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 01:50:20 +01:00