rename RecyclePolicy→RotationPolicy, collapse AccessMode, clean OIDC refs

This commit is contained in:
2026-07-12 06:50:25 +02:00
parent efd15c4f53
commit 773e228e21
19 changed files with 81 additions and 145 deletions

View File

@@ -1,5 +1,5 @@
use chrono::{DateTime, Utc};
use domain::{DomainError, RecyclePolicy, ScheduleConfig, ScheduleConfigCompat};
use domain::{DomainError, RotationPolicy, ScheduleConfig, ScheduleConfigCompat};
use serde::de::DeserializeOwned;
use uuid::Uuid;
@@ -32,8 +32,8 @@ pub fn parse_schedule_config(json: &str) -> Result<ScheduleConfig, DomainError>
Ok(ScheduleConfig::from(compat))
}
pub fn parse_recycle_policy(json: &str) -> Result<RecyclePolicy, DomainError> {
parse_json(json, "recycle_policy")
pub fn parse_rotation_policy(json: &str) -> Result<RotationPolicy, DomainError> {
parse_json(json, "rotation_policy")
}
pub fn parse_enum_or_default<T: DeserializeOwned + Default>(value: String) -> T {
@@ -151,9 +151,9 @@ mod tests {
}
#[test]
fn parse_recycle_policy_valid() {
fn parse_rotation_policy_valid() {
let json = r#"{"cooldown_days":7,"cooldown_generations":3,"min_available_ratio":0.3}"#;
let policy = parse_recycle_policy(json).unwrap();
let policy = parse_rotation_policy(json).unwrap();
assert_eq!(policy.cooldown_days, Some(7));
}