| 108 | } |
| 109 | |
| 110 | fn validate_summary(summary: &Option<String>) -> ModelValidatorResult<RequestError> { |
| 111 | if let Some(summary) = summary { |
| 112 | if summary.len() > Request::MAX_SUMMARY_LEN as usize { |
| 113 | return Err(RequestError::ValidationError { |
| 114 | info: format!( |
| 115 | "Request summary length exceeds the maximum allowed: {}", |
| 116 | Request::MAX_SUMMARY_LEN |
| 117 | ), |
| 118 | }); |
| 119 | } |
| 120 | } |
| 121 | |
| 122 | Ok(()) |
| 123 | } |
| 124 | |
| 125 | fn validate_expiration_dt(expiration_dt: &Timestamp) -> ModelValidatorResult<RequestError> { |
| 126 | if *expiration_dt <= next_time() { |