use async_trait::async_trait;
use serde::{Deserialize, Serialize};
pub mod manager;
#[async_trait]
pub trait TxManager {
async fn find_all_auth_commits_for_stele(
&mut self,
stele_id: &str,
) -> anyhow::Result<Vec<DataRepoCommits>>;
async fn insert_bulk(&mut self, data_repo_commits: Vec<DataRepoCommits>) -> anyhow::Result<()>;
}
#[derive(sqlx::FromRow, Debug, Deserialize, Serialize)]
pub struct DataRepoCommits {
pub commit_hash: String,
pub date: String,
pub repo_type: String,
pub auth_commit_hash: String,
pub auth_commit_timestamp: String,
pub publication_id: String,
}
impl DataRepoCommits {
#[must_use]
pub const fn new(
commit_hash: String,
date: String,
repo_type: String,
auth_commit_hash: String,
auth_commit_timestamp: String,
publication_id: String,
) -> Self {
Self {
commit_hash,
date,
repo_type,
auth_commit_hash,
auth_commit_timestamp,
publication_id,
}
}
}