84 lines
3.1 KiB
Rust
84 lines
3.1 KiB
Rust
use once_cell::sync::Lazy;
|
|
|
|
use crate::models::{Dimension, Marker, MarkerPlacement, RepositoryConfiguration};
|
|
|
|
use super::TimesheetPointType;
|
|
|
|
pub const TIMESHEET_TAG: &str = "Timesheet";
|
|
pub const TIMESHEET_DIMENSION_NAME: &str = "timesheet";
|
|
|
|
/// Pre-configured repository configuration for timesheet tracking.
|
|
#[allow(non_upper_case_globals)]
|
|
pub static BasicTimesheetConfiguration: Lazy<RepositoryConfiguration> = Lazy::new(|| {
|
|
RepositoryConfiguration::new()
|
|
.with_dimension(
|
|
TIMESHEET_DIMENSION_NAME,
|
|
Dimension::new("Timesheet")
|
|
.with_comment("Used by Timesheet-Subcommand to create Timecards")
|
|
.with_propagate(false),
|
|
)
|
|
.with_marker(
|
|
TIMESHEET_TAG,
|
|
Marker::new("A default time card").with_placements(vec![MarkerPlacement::new(
|
|
TIMESHEET_DIMENSION_NAME,
|
|
)
|
|
.with_value(TimesheetPointType::Card.as_str())
|
|
.with_overwrites(false)]),
|
|
)
|
|
.with_marker(
|
|
"VacationDay",
|
|
Marker::new("Vacation Day").with_placements(vec![MarkerPlacement::new(
|
|
TIMESHEET_DIMENSION_NAME,
|
|
)
|
|
.with_if_with(vec![TIMESHEET_TAG])
|
|
.with_value(TimesheetPointType::Vacation.as_str())]),
|
|
)
|
|
.with_marker(
|
|
"Break",
|
|
Marker::new("Break").with_placements(vec![MarkerPlacement::new(
|
|
TIMESHEET_DIMENSION_NAME,
|
|
)
|
|
.with_if_with(vec![TIMESHEET_TAG])
|
|
.with_value(TimesheetPointType::Break.as_str())]),
|
|
)
|
|
.with_marker(
|
|
"LunchBreak",
|
|
Marker::new("Break").with_placements(vec![MarkerPlacement::new(
|
|
TIMESHEET_DIMENSION_NAME,
|
|
)
|
|
.with_if_with(vec![TIMESHEET_TAG])
|
|
.with_value(TimesheetPointType::Break.as_str())]),
|
|
)
|
|
.with_marker(
|
|
"Feierabend",
|
|
Marker::new("Break").with_placements(vec![MarkerPlacement::new(
|
|
TIMESHEET_DIMENSION_NAME,
|
|
)
|
|
.with_if_with(vec![TIMESHEET_TAG])
|
|
.with_value(TimesheetPointType::Break.as_str())]),
|
|
)
|
|
.with_marker(
|
|
"Holiday",
|
|
Marker::new("Official Holiday").with_placements(vec![MarkerPlacement::new(
|
|
TIMESHEET_DIMENSION_NAME,
|
|
)
|
|
.with_if_with(vec![TIMESHEET_TAG])
|
|
.with_value(TimesheetPointType::Holiday.as_str())]),
|
|
)
|
|
.with_marker(
|
|
"SickLeave",
|
|
Marker::new("Sick Leave").with_placements(vec![MarkerPlacement::new(
|
|
TIMESHEET_DIMENSION_NAME,
|
|
)
|
|
.with_if_with(vec![TIMESHEET_TAG])
|
|
.with_value(TimesheetPointType::SickLeave.as_str())]),
|
|
)
|
|
.with_marker(
|
|
"UndertimeDay",
|
|
Marker::new("Undertime Leave").with_placements(vec![MarkerPlacement::new(
|
|
TIMESHEET_DIMENSION_NAME,
|
|
)
|
|
.with_if_with(vec![TIMESHEET_TAG])
|
|
.with_value(TimesheetPointType::Undertime.as_str())]),
|
|
)
|
|
});
|