From 40a71e5a1c185528b0e869064df00920f8a7871d Mon Sep 17 00:00:00 2001 From: iven Date: Tue, 28 Apr 2026 19:21:21 +0800 Subject: [PATCH] =?UTF-8?q?feat(health):=20=E6=89=A9=E5=B1=95=20device=5Ft?= =?UTF-8?q?ype=20=E6=9E=9A=E4=B8=BE=E6=94=AF=E6=8C=81=20blood=5Fpressure?= =?UTF-8?q?=20=E5=92=8C=20blood=5Fglucose?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/erp-health/src/service/validation.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/erp-health/src/service/validation.rs b/crates/erp-health/src/service/validation.rs index b15fe82..a11ead6 100644 --- a/crates/erp-health/src/service/validation.rs +++ b/crates/erp-health/src/service/validation.rs @@ -233,6 +233,7 @@ pub fn validate_follow_up_status_transition(current: &str, new: &str) -> HealthR pub fn validate_device_type(value: &str) -> HealthResult<()> { validate_enum!(value, "device_type", [ "heart_rate", "blood_oxygen", "steps", "sleep", "temperature", "stress", + "blood_pressure", "blood_glucose", ]); Ok(()) } @@ -496,7 +497,11 @@ mod tests { #[test] fn device_type_steps() { assert!(validate_device_type("steps").is_ok()); } #[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 --- #[test]