pub struct StatutoryConfig {
pub pph21: Pph21Config,
pub bpjs: BpjsConfig,
pub overtime: OvertimeConfig,
}Expand description
Top-level statutory configuration — the statutory: block of config/application.yml.
Construct with StatutoryConfig::default (current-law values baked in) or load from YAML via
StatutoryConfig::from_yaml_str / StatutoryConfig::load_from_config_dir.
Fields§
§pph21: Pph21Config§bpjs: BpjsConfig§overtime: OvertimeConfigOvertime multiplier bands. Distinct from the other two blocks in that it is pay math, not a withholding — but it shares the same as-of/effective-dated lifecycle, so it lives here.
Implementations§
Source§impl StatutoryConfig
impl StatutoryConfig
Sourcepub fn from_yaml_str(application_yml: &str) -> Result<Self, StatutoryError>
pub fn from_yaml_str(application_yml: &str) -> Result<Self, StatutoryError>
Parse the statutory: block out of a full application.yml document string. If the block is
absent, the current-law StatutoryConfig::default is returned so a payroll node that has not
yet added the block still boots with correct statutory values.
Sourcepub fn load_from_config_dir(
dir: &Path,
environment: &str,
) -> Result<Self, StatutoryError>
pub fn load_from_config_dir( dir: &Path, environment: &str, ) -> Result<Self, StatutoryError>
Load from a config directory containing application.yml (+ optional
application-{env}.yml override). The env file’s whole statutory: block replaces the
base block when present (shallow override — you tune rates by overriding the entire section).
Trait Implementations§
Source§impl Clone for StatutoryConfig
impl Clone for StatutoryConfig
Source§impl Debug for StatutoryConfig
impl Debug for StatutoryConfig
Source§impl Default for StatutoryConfig
impl Default for StatutoryConfig
Source§impl<'de> Deserialize<'de> for StatutoryConfig
impl<'de> Deserialize<'de> for StatutoryConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for StatutoryConfig
impl RefUnwindSafe for StatutoryConfig
impl Send for StatutoryConfig
impl Sync for StatutoryConfig
impl Unpin for StatutoryConfig
impl UnsafeUnpin for StatutoryConfig
impl UnwindSafe for StatutoryConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more