use serde::{Deserialize, Serialize};

use super::companies::RuntimeTrackPieceCounts;

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct RuntimeTerritory {
    pub territory_id: u32,
    #[serde(default)]
    pub name: Option<String>,
    #[serde(default)]
    pub track_piece_counts: RuntimeTrackPieceCounts,
}

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct RuntimeCompanyTerritoryTrackPieceCount {
    pub company_id: u32,
    pub territory_id: u32,
    #[serde(default)]
    pub track_piece_counts: RuntimeTrackPieceCounts,
}

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct RuntimeCompanyTerritoryAccess {
    pub company_id: u32,
    pub territory_id: u32,
}
