use crate::pagination::PaginatedResponse;
use nym_contracts_common::Percent;
use nym_performance_contract_common::{EpochId, KindMedians, LatestPerformance, NodeId};
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use tendermint::block::Height;
use time::OffsetDateTime;
use utoipa::ToSchema;
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
pub struct PerformanceEntriesRecordsResponse {
#[schema(value_type = String)]
pub height: Height,
pub entries: PaginatedResponse<LatestPerformance>,
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, JsonSchema, ToSchema)]
pub struct NodePerformanceResponseV3 {
pub node_id: NodeId,
pub performance: Option<DetailedNodePerformanceV3>,
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, JsonSchema, ToSchema)]
pub struct DetailedNodePerformanceV3 {
#[schema(value_type = Option<String>)]
pub performance_score: Option<Percent>,
pub source_epoch: EpochId,
#[serde(with = "time::serde::rfc3339")]
#[schemars(with = "String")]
#[schema(value_type = String)]
pub computed_at: OffsetDateTime,
pub medians: Option<KindMedians>,
}