syntax = "proto3";

package worldmonitor.giving.v1;

import "sebuf/http/annotations.proto";
import "worldmonitor/giving/v1/giving.proto";

// GetGivingSummaryRequest specifies parameters for retrieving the global giving summary.
message GetGivingSummaryRequest {
  // Number of platforms to include (0 = all).
  int32 platform_limit = 1 [(sebuf.http.query) = { name: "platform_limit" }];
  // Number of category breakdowns to include (0 = all).
  int32 category_limit = 2 [(sebuf.http.query) = { name: "category_limit" }];
}

// GetGivingSummaryResponse contains the global giving activity summary.
message GetGivingSummaryResponse {
  // The giving summary.
  GivingSummary summary = 1;

  // Time the summary was generated, as Unix epoch milliseconds. A value of 0
  // means the snapshot is unavailable/degraded, not that giving activity is
  // zero.
  int64 fetched_at = 2 [(sebuf.http.int64_encoding) = INT64_ENCODING_NUMBER];

  // True when summary is populated. False means an absent/empty summary is
  // graceful degradation because the snapshot is unavailable.
  bool data_available = 3;
}
