refactor: rewrite in rust
This commit is contained in:
parent
20a3e8b437
commit
4116a7042d
72 changed files with 5683 additions and 3686 deletions
84
src/timesheet/configuration.rs
Normal file
84
src/timesheet/configuration.rs
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
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())]),
|
||||
)
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue