Implemented a domain layer, because the API DTO's where getting bloated.
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
mod cents;
|
||||
mod direction;
|
||||
mod recurring_transaction;
|
||||
mod schedule;
|
||||
mod transaction;
|
||||
|
||||
pub use cents::{Cents, CentsConversionError};
|
||||
pub use direction::Direction;
|
||||
pub use recurring_transaction::RecurringTransaction;
|
||||
pub use schedule::{
|
||||
Recurrence, RecurrenceInterval, RecurrenceIntervalError, RecurrenceUnit, Schedule,
|
||||
WeekendAdjustment,
|
||||
};
|
||||
pub use transaction::Transaction;
|
||||
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
pub enum ValidationError {
|
||||
#[error(transparent)]
|
||||
Amount(#[from] CentsConversionError),
|
||||
|
||||
#[error(transparent)]
|
||||
RecurrenceInterval(#[from] RecurrenceIntervalError),
|
||||
|
||||
#[error("end must not be before start")]
|
||||
EndBeforeStart,
|
||||
}
|
||||
Reference in New Issue
Block a user