(m map[string]any)
| 313 | } |
| 314 | |
| 315 | func parsePhaseEntry(m map[string]any) (validator.PhaseConfig, bool) { |
| 316 | mc := validator.PhaseConfig{} |
| 317 | if id, ok := m["id"].(string); ok { |
| 318 | mc.ID = id |
| 319 | } |
| 320 | if name, ok := m["name"].(string); ok { |
| 321 | mc.Name = name |
| 322 | } |
| 323 | if desc, ok := m["description"].(string); ok { |
| 324 | mc.Description = desc |
| 325 | } |
| 326 | if due, ok := m["due"].(string); ok { |
| 327 | ft := model.FlexibleTime{} |
| 328 | node := yaml.Node{Kind: yaml.ScalarNode, Value: due, Tag: "!!str"} |
| 329 | if err := ft.UnmarshalYAML(&node); err == nil { |
| 330 | mc.Due = ft |
| 331 | } |
| 332 | } |
| 333 | return mc, true |
| 334 | } |
| 335 | |
| 336 | // toInt converts a viper numeric value (int, int64, float64) to int. |
| 337 | func toInt(v any) int { |
no test coverage detected