mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-28 05:37:44 +02:00
feat(feedback): add centralized feedback system with AI-generated titles
- Add shared-feedback-types package with TypeScript types - Add shared-feedback-service package with factory function - Add shared-feedback-ui package with Svelte 5 components - Add feedback module to mana-core-auth backend - Add AI service using Gemini 2.0 Flash for title/category generation - Add database schema and migration for feedback tables - Integrate feedback page into Chat web app - Add CORS support for X-App-Id header - Add COMMANDS.md documentation for all dev commands 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
05fe8ca5b6
commit
819e4c9a2f
41 changed files with 4290 additions and 338 deletions
41
packages/shared-feedback-types/src/api.ts
Normal file
41
packages/shared-feedback-types/src/api.ts
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
/**
|
||||
* API request/response types for feedback
|
||||
*/
|
||||
|
||||
import type { Feedback, FeedbackCategory, FeedbackStatus } from './feedback';
|
||||
|
||||
export interface CreateFeedbackInput {
|
||||
title?: string;
|
||||
feedbackText: string;
|
||||
category?: FeedbackCategory;
|
||||
deviceInfo?: Record<string, unknown>;
|
||||
}
|
||||
|
||||
export interface FeedbackQueryParams {
|
||||
appId?: string;
|
||||
status?: FeedbackStatus;
|
||||
category?: FeedbackCategory;
|
||||
sort?: 'votes' | 'recent';
|
||||
limit?: number;
|
||||
offset?: number;
|
||||
}
|
||||
|
||||
export interface FeedbackResponse {
|
||||
success: boolean;
|
||||
feedback?: Feedback;
|
||||
error?: string;
|
||||
}
|
||||
|
||||
export interface FeedbackListResponse {
|
||||
success: boolean;
|
||||
items: Feedback[];
|
||||
total: number;
|
||||
error?: string;
|
||||
}
|
||||
|
||||
export interface VoteResponse {
|
||||
success: boolean;
|
||||
newVoteCount: number;
|
||||
userHasVoted: boolean;
|
||||
error?: string;
|
||||
}
|
||||
59
packages/shared-feedback-types/src/feedback.ts
Normal file
59
packages/shared-feedback-types/src/feedback.ts
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
/**
|
||||
* Core feedback types
|
||||
*/
|
||||
|
||||
export type FeedbackCategory = 'bug' | 'feature' | 'improvement' | 'question' | 'other';
|
||||
|
||||
export type FeedbackStatus =
|
||||
| 'submitted'
|
||||
| 'under_review'
|
||||
| 'planned'
|
||||
| 'in_progress'
|
||||
| 'completed'
|
||||
| 'declined';
|
||||
|
||||
export interface Feedback {
|
||||
id: string;
|
||||
userId: string;
|
||||
appId: string;
|
||||
title?: string;
|
||||
feedbackText: string;
|
||||
category: FeedbackCategory;
|
||||
status: FeedbackStatus;
|
||||
isPublic: boolean;
|
||||
adminResponse?: string;
|
||||
voteCount: number;
|
||||
userHasVoted: boolean;
|
||||
deviceInfo?: Record<string, unknown>;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
publishedAt?: string;
|
||||
completedAt?: string;
|
||||
}
|
||||
|
||||
export interface FeedbackVote {
|
||||
id: string;
|
||||
feedbackId: string;
|
||||
userId: string;
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
export const FEEDBACK_CATEGORY_LABELS: Record<FeedbackCategory, string> = {
|
||||
bug: 'Bug',
|
||||
feature: 'Feature',
|
||||
improvement: 'Verbesserung',
|
||||
question: 'Frage',
|
||||
other: 'Sonstiges',
|
||||
};
|
||||
|
||||
export const FEEDBACK_STATUS_CONFIG: Record<
|
||||
FeedbackStatus,
|
||||
{ label: string; color: string; icon: string }
|
||||
> = {
|
||||
submitted: { label: 'Eingereicht', color: '#999', icon: 'clock' },
|
||||
under_review: { label: 'Wird geprüft', color: '#3498DB', icon: 'eye' },
|
||||
planned: { label: 'Geplant', color: '#9B59B6', icon: 'calendar' },
|
||||
in_progress: { label: 'In Arbeit', color: '#F39C12', icon: 'loader' },
|
||||
completed: { label: 'Umgesetzt', color: '#27AE60', icon: 'check-circle' },
|
||||
declined: { label: 'Abgelehnt', color: '#E74C3C', icon: 'x-circle' },
|
||||
};
|
||||
25
packages/shared-feedback-types/src/index.ts
Normal file
25
packages/shared-feedback-types/src/index.ts
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
/**
|
||||
* Shared feedback types for Manacore monorepo
|
||||
*
|
||||
* This package contains TypeScript types for feedback submissions,
|
||||
* voting, and API contracts.
|
||||
*/
|
||||
|
||||
// Feedback types
|
||||
export {
|
||||
type FeedbackCategory,
|
||||
type FeedbackStatus,
|
||||
type Feedback,
|
||||
type FeedbackVote,
|
||||
FEEDBACK_CATEGORY_LABELS,
|
||||
FEEDBACK_STATUS_CONFIG,
|
||||
} from './feedback';
|
||||
|
||||
// API types
|
||||
export {
|
||||
type CreateFeedbackInput,
|
||||
type FeedbackQueryParams,
|
||||
type FeedbackResponse,
|
||||
type FeedbackListResponse,
|
||||
type VoteResponse,
|
||||
} from './api';
|
||||
Loading…
Add table
Add a link
Reference in a new issue