pub mod create; use async_trait::async_trait; use serde::{Deserialize, Serialize}; use time::OffsetDateTime; use crate::ConfigurationError; /// Transaction to monitor #[derive(Deserialize, Serialize)] #[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))] pub struct TransactionSchema { #[serde(rename = "type")] /// Transaction schema type pub kind: String, /// The schema's version pub version: String, /// JSON schema for transcation #[serde(rename = "json_schema")] pub schema: serde_json::Value, #[serde(with = "time::serde::rfc3339")] pub created_at: OffsetDateTime, #[serde(with = "time::serde::rfc3339")] pub updated_at: OffsetDateTime, } #[async_trait] pub trait SchemaDriver { async fn create_schema( &self, name: impl AsRef + Send + Sync, version: impl AsRef + Send + Sync, schema: &serde_json::Value, ) -> Result; }