feat(health): 扩展 device_type 枚举支持 blood_pressure 和 blood_glucose
This commit is contained in:
@@ -233,6 +233,7 @@ pub fn validate_follow_up_status_transition(current: &str, new: &str) -> HealthR
|
|||||||
pub fn validate_device_type(value: &str) -> HealthResult<()> {
|
pub fn validate_device_type(value: &str) -> HealthResult<()> {
|
||||||
validate_enum!(value, "device_type", [
|
validate_enum!(value, "device_type", [
|
||||||
"heart_rate", "blood_oxygen", "steps", "sleep", "temperature", "stress",
|
"heart_rate", "blood_oxygen", "steps", "sleep", "temperature", "stress",
|
||||||
|
"blood_pressure", "blood_glucose",
|
||||||
]);
|
]);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
@@ -496,7 +497,11 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn device_type_steps() { assert!(validate_device_type("steps").is_ok()); }
|
fn device_type_steps() { assert!(validate_device_type("steps").is_ok()); }
|
||||||
#[test]
|
#[test]
|
||||||
fn device_type_invalid() { assert!(validate_device_type("blood_pressure").is_err()); }
|
fn device_type_blood_pressure() { assert!(validate_device_type("blood_pressure").is_ok()); }
|
||||||
|
#[test]
|
||||||
|
fn device_type_blood_glucose() { assert!(validate_device_type("blood_glucose").is_ok()); }
|
||||||
|
#[test]
|
||||||
|
fn device_type_invalid() { assert!(validate_device_type("invalid_device").is_err()); }
|
||||||
|
|
||||||
// --- condition_type ---
|
// --- condition_type ---
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
Reference in New Issue
Block a user