2026-07-03 10:01:28 -05:00
|
|
|
package validate
|
2026-07-03 12:50:09 +00:00
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"strings"
|
|
|
|
|
|
|
|
|
|
"gitea.maximumdirect.net/eric/notarius/internal/framework/contracts"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
|
ReasonApproved = "approved"
|
|
|
|
|
)
|
|
|
|
|
|
2026-07-07 20:55:49 +00:00
|
|
|
func Approved() contracts.ValidationResult {
|
|
|
|
|
return contracts.ValidationResult{
|
|
|
|
|
Approved: true,
|
|
|
|
|
ReasonCode: ReasonApproved,
|
|
|
|
|
Message: ReasonApproved,
|
2026-07-03 12:50:09 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-07-07 20:55:49 +00:00
|
|
|
func Rejected(reasonCode string, message string) contracts.ValidationResult {
|
|
|
|
|
return contracts.ValidationResult{
|
|
|
|
|
Approved: false,
|
|
|
|
|
ReasonCode: strings.TrimSpace(reasonCode),
|
|
|
|
|
Message: strings.TrimSpace(message),
|
2026-07-03 12:50:09 +00:00
|
|
|
}
|
|
|
|
|
}
|