syntax = "proto3";

package devvit.dev_portal.curated_game;

import "google/protobuf/timestamp.proto";

option go_package = "github.snooguts.net/reddit/reddit-devplatform-monorepo/go-common/generated/protos/types/devvit/devportal/curatedgame";

// The curated list type for a game entry, for example NEW or POPULAR.
enum CuratedGameCurationType {
  // Unspecified curation type. Example: omitted in a malformed request.
  UNSPECIFIED = 0;
  // Entry appears in the "New" curated games list.
  NEW = 1;
  // Entry appears in the "Popular" curated games list.
  POPULAR = 2;
}

// Represents one curated game in an admin-managed ranked list.
message CuratedGameEntry {
  // The app UUID, for example "6d0a383a-eb60-44ed-92c5-62b6261177f8".
  string app_id = 1;
  // The display name of the app, for example "Pixelary".
  string app_name = 2;
  // The app slug, for example "pixelary-game".
  string app_slug = 3;
  // The curated list that this entry belongs to, for example NEW.
  CuratedGameCurationType curation_type = 4;
  // The timestamp when this entry was last modified, for example "2026-02-07T18:43:12Z".
  google.protobuf.Timestamp last_modified = 5;
  // The 1-indexed rank inside the curated list, for example 3.
  int32 rank = 6;
  // The subreddit thing ID where this entry is displayed, for example "t5_2qh1i".
  string subreddit_id = 7;
}

// Request to list curated games, optionally filtered by curation type.
message ListCuratedGamesRequest {
  // Optional curation type filter, for example POPULAR.
  optional CuratedGameCurationType curation_type = 1;
}

// Response containing curated game entries ordered by curation type and rank.
message ListCuratedGamesResponse {
  // Curated game entries, for example the NEW and POPULAR lists.
  repeated CuratedGameEntry entries = 1;
}

// Request to add an app to a curated game list.
message AddCuratedGameRequest {
  // The app slug to add, for example "pixelary-game".
  string app_slug = 1;
  // The target curated list, for example NEW.
  CuratedGameCurationType curation_type = 2;
  // The subreddit thing ID where this curated app is shown, for example "t5_2qh1i".
  string subreddit_id = 3;
}

// Response after adding a curated game entry.
message AddCuratedGameResponse {
  // The created curated game entry.
  CuratedGameEntry entry = 1;
}

// Request to update rank for an existing curated game entry.
message UpdateCuratedGameRankRequest {
  // The app slug of the entry to update, for example "pixelary-game".
  string app_slug = 1;
  // The curated list containing the entry, for example POPULAR.
  CuratedGameCurationType curation_type = 2;
  // The new 1-indexed rank, for example 1.
  int32 rank = 3;
}

// Response after updating rank for a curated game entry.
message UpdateCuratedGameRankResponse {
  // The updated curated game entry.
  CuratedGameEntry entry = 1;
}

// Request to remove an app from a curated game list.
message RemoveCuratedGameRequest {
  // The app slug to remove, for example "pixelary-game".
  string app_slug = 1;
  // The curated list containing the entry, for example NEW.
  CuratedGameCurationType curation_type = 2;
}
