refactor: rewrite in rust
All checks were successful
Continuous Integration / Lint, Check & Test (push) Successful in 2m32s
Continuous Integration / Build Package (push) Successful in 3m0s

This commit is contained in:
Konstantin Fickel 2026-03-29 18:19:15 +02:00
parent 20a3e8b437
commit 4116a7042d
Signed by: kfickel
GPG key ID: A793722F9933C1A5
72 changed files with 5683 additions and 3686 deletions

View 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())]),
)
});