codetics-ocpp-service 0.1.0

Codetics OCPP: Charging Station Management System (CSMS) service for OCPP 1.6J, 2.0.1 and 2.1, with TLS security profiles, smart charging, reservations and tariffs
Documentation
// SPDX-License-Identifier: Apache-2.0
// Copyright 2026 Kevin Vavelin, Codetics (https://codetics.fr)

use std::sync::Arc;

use ocpp_core::MessageIdGenerator;
use tokio::sync::watch;

use crate::auth::Authenticator;
use crate::config::Config;
use crate::db::Db;
use crate::hub::Hub;

pub struct AppState {
    pub cfg: Config,
    pub db: Db,
    pub hub: Hub,
    pub auth: Authenticator,
    pub ids: MessageIdGenerator,
    /// Time zones of stations (tariff conditions use local time).
    pub zones: crate::tz::Zones,
    /// Flips to `true` on shutdown; sessions close their connections.
    pub shutdown: watch::Receiver<bool>,
}

pub type App = Arc<AppState>;