Add option to manually swap shifts after the schedule has been generated
This commit is contained in:
@@ -192,6 +192,27 @@ pub enum ShiftPosition {
|
||||
Second,
|
||||
}
|
||||
|
||||
impl ShiftPosition {
|
||||
pub fn as_str(self) -> &'static str {
|
||||
match self {
|
||||
ShiftPosition::First => "First",
|
||||
ShiftPosition::Second => "Second",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl TryFrom<&str> for ShiftPosition {
|
||||
type Error = ();
|
||||
|
||||
fn try_from(s: &str) -> Result<Self, Self::Error> {
|
||||
match s {
|
||||
"First" => Ok(ShiftPosition::First),
|
||||
"Second" => Ok(ShiftPosition::Second),
|
||||
_ => Err(()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use rstest::rstest;
|
||||
|
||||
Reference in New Issue
Block a user