pub fn pay_on_date_for_level_and_step(&self, level: i32, step: i32, date: String) -> Option<&i32> {
        
        let payscale = self.pay_scales.iter().find(|p| p.level == level);

        let payscale = match payscale {
            Some(p) => p,
            None => return None
        };

        // Error here if level not applied for all groups
        
        // get target date and structure for PartialOrd
        let target_date: NaiveDate = NaiveDate::parse_from_str(
            date.as_str(),
            "%Y-%m-%d").unwrap();

        let target_rate = check_active_pay_rate(&payscale.rates_of_pay, target_date);

        let target_salary = target_rate.salary.get(step as usize -1);
        
        target_salary
    }
/// Directly returns the pay at a specified date for a level and step within the group
/// without needing to access pay scales and rates of pay.
/// Accepts level and step as integers and date in a YYYY-MM-DD string as arguments.
Directly returns the pay at a specified date for a level and step within the group
without needing to access pay scales and rates of pay.
Accepts level and step as integers and date in a YYYY-MM-DD string as arguments.
Directly returns the pay at a specified date for a level and step within the group without needing to access pay scales and rates of pay . Accepts level and step as integers and date in a YYYY - MM - DD string as arguments .
pub fn pay_on_date_for_level_and_step(&self, level: i32, step: i32, date: String) -> Option<&i32> {
        let payscale = self.pay_scales.iter().find(|p| p.level == level);
        let payscale = match payscale {
            Some(p) => p,
            None => return None
        };
        // Error here if level not applied for all groups
        // get target date and structure for PartialOrd
        let target_date: NaiveDate = NaiveDate::parse_from_str(
            date.as_str(),
            "%Y-%m-%d").unwrap();
        let target_rate = check_active_pay_rate(&payscale.rates_of_pay, target_date);
        let target_salary = target_rate.salary.get(step as usize -1);
        target_salary
    }
pub fn pay_on_date_for_level_and_step ( & self , level : i32 , step : i32 , date : String ) -> Option < & i32 > { let payscale = self . pay_scales . iter ( ) . find ( | p | p . level == level ) ; let payscale = match payscale { Some ( p ) => p , None => return None } ; // Error here if level not applied for all groups // get target date and structure for PartialOrd let target_date : NaiveDate = NaiveDate :: parse_from_str ( date . as_str ( ) , " " ) . unwrap ( ) ; let target_rate = check_active_pay_rate ( & payscale . rates_of_pay , target_date ) ; let target_salary = target_rate . salary . get ( step as usize - 1 ) ; target_salary }
Directly returns the pay at a specified date for a level and step within the group
without needing to access pay scales and rates of pay.
Directly returns the pay at a specified date for a level and step within the group without needing to access pay scales and rates of pay .
&self
level
i32
step
i32
date
String