use crate::model::Branch;
use crate::repository::RepositoryError;
use async_trait::async_trait;
#[async_trait]
pub trait BranchRepository: Send + Sync {
async fn get_all(&self) -> Result<Vec<Branch>, RepositoryError>;
async fn find_by_id(&self, id: i64) -> Result<Option<Branch>, RepositoryError>;
async fn delete_by_id(&self, id: i64) -> Result<(), RepositoryError>;
async fn update_last_commit_hash(
&self,
id: i64,
hash: &crate::domain::CommitHash,
) -> Result<(), RepositoryError>;
async fn update_last_commit_hash_in_tx(
&self,
id: i64,
hash: &crate::domain::CommitHash,
tx: &mut sqlx::SqliteConnection,
) -> Result<(), RepositoryError>;
}