syntax = "proto3";

package freeexile.feedback;

enum FeedbackCategory {
    CATEGORY_UNSPECIFIED = 0;
    CATEGORY_BUG_REPORT = 1;          // Báo lỗi kỹ thuật / Lỗi đồ họa / Mất kết nối
    CATEGORY_GAMEPLAY_SUGGESTION = 2; // Đề xuất tính năng võ học / Phụ bản / Tiên phủ
    CATEGORY_BALANCE_ADJUSTMENT = 3;  // Cân bằng Ngũ Hành / Sát thương chiêu thức
    CATEGORY_LOCALIZATION = 4;        // Góp ý dịch thuật / Thuật ngữ cổ võ
    CATEGORY_OTHER = 5;               // Ý kiến đóng góp khác
}

enum FeedbackStatus {
    STATUS_UNSPECIFIED = 0;
    STATUS_NEW = 1;                   // Mới tiếp nhận, chờ xem xét
    STATUS_UNDER_REVIEW = 2;         // Đang được đội ngũ phát triển đánh giá
    STATUS_PLANNED = 3;              // Đã đưa vào kế hoạch phát triển (Roadmap)
    STATUS_RESOLVED = 4;             // Đã khắc phục / Đã cập nhật vào game
    STATUS_REJECTED = 5;             // Không khả thi hoặc không phù hợp định hướng
}

message SystemDiagnostics {
    string client_platform = 1;      // iOS, Android, WebApp, PC
    string os_version = 2;            // iOS 18.2, Windows 11, etc.
    string device_model = 3;          // iPhone 16 Pro Max, iPad Pro M4
    float current_fps = 4;
    int32 current_ping_ms = 5;
    string current_zone_name = 6;
    float player_x = 7;
    float player_y = 8;
    float player_z = 9;
    string game_build_version = 10;
}

message FeedbackEntry {
    string feedback_id = 1;
    int64 player_id = 2;
    string player_name = 3;
    FeedbackCategory category = 4;
    string title = 5;
    string content = 6;
    SystemDiagnostics diagnostics = 7;
    FeedbackStatus status = 8;
    string admin_response = 9;
    int64 created_at_ms = 10;
    int64 updated_at_ms = 11;
}

message SubmitFeedbackRequest {
    int64 player_id = 1;
    string player_name = 2;
    FeedbackCategory category = 3;
    string title = 4;
    string content = 5;
    SystemDiagnostics diagnostics = 6;
}

message SubmitFeedbackResponse {
    bool success = 1;
    string error_message = 2;
    string feedback_id = 3;
    string acknowledgement_message = 4;
}

message QueryFeedbackListRequest {
    FeedbackStatus filter_status = 1;
    FeedbackCategory filter_category = 2;
    int32 page = 3;
    int32 page_size = 4;
}

message QueryFeedbackListResponse {
    repeated FeedbackEntry entries = 1;
    int32 total_count = 2;
}

message UpdateFeedbackStatusRequest {
    string feedback_id = 1;
    FeedbackStatus new_status = 2;
    string admin_response = 3;
    string reviewed_by = 4;
}

message UpdateFeedbackStatusResponse {
    bool success = 1;
    string error_message = 2;
}
