brewlog/src/domain/mod.rs
copilot-swe-agent[bot] ca5d25ea10
feat(domain): add auth database schema and domain models
Co-authored-by: jnsgruk <668505+jnsgruk@users.noreply.github.com>
2025-11-25 16:27:51 +00:00

34 lines
771 B
Rust

pub mod ids;
pub mod listing;
pub mod origins;
pub mod repositories;
pub mod roasters;
pub mod roasts;
pub mod timeline;
pub mod tokens;
pub mod users;
use std::fmt::Display;
use thiserror::Error;
// TODO: This should probably be in a file named errors.rs
// so that it's domain::errors::RepositoryError.
#[derive(Debug, Error)]
pub enum RepositoryError {
#[error("entity not found")]
NotFound,
#[error("conflict: {0}")]
Conflict(String),
#[error("unexpected data store error: {0}")]
Unexpected(String),
}
impl RepositoryError {
pub fn conflict<T: Display>(message: T) -> Self {
Self::Conflict(message.to_string())
}
pub fn unexpected<T: Display>(message: T) -> Self {
Self::Unexpected(message.to_string())
}
}