Add basic employee hour balance report
This commit is contained in:
parent
0eb885216a
commit
d4adcb182f
31 changed files with 2155 additions and 5 deletions
41
dao/src/shiftplan_report.rs
Normal file
41
dao/src/shiftplan_report.rs
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
use async_trait::async_trait;
|
||||
use mockall::automock;
|
||||
use std::sync::Arc;
|
||||
use uuid::Uuid;
|
||||
|
||||
use crate::slot::DayOfWeek;
|
||||
use crate::DaoError;
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub struct ShiftplanReportEntity {
|
||||
pub sales_person_id: Uuid,
|
||||
pub hours: f32,
|
||||
pub year: u32,
|
||||
pub calendar_week: u8,
|
||||
pub day_of_week: DayOfWeek,
|
||||
}
|
||||
|
||||
pub struct ShiftplanQuickOverviewEntity {
|
||||
pub sales_person_id: Uuid,
|
||||
pub hours: f32,
|
||||
pub year: u32,
|
||||
}
|
||||
|
||||
#[automock]
|
||||
#[async_trait]
|
||||
pub trait ShiftplanReportDao {
|
||||
/// A report which contains the worked hours of a sales person for each day.
|
||||
async fn extract_shiftplan_report(
|
||||
&self,
|
||||
sales_person_id: Uuid,
|
||||
year: u32,
|
||||
until_week: u8,
|
||||
) -> Result<Arc<[ShiftplanReportEntity]>, DaoError>;
|
||||
|
||||
/// A report which shows the summed up yearly work hours of all sales persons.
|
||||
async fn extract_quick_shiftplan_report(
|
||||
&self,
|
||||
year: u32,
|
||||
until_week: u8,
|
||||
) -> Result<Arc<[ShiftplanQuickOverviewEntity]>, DaoError>;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue