omnix-sopiga/services/template-service/validator/orders.go

23 lines
445 B
Go
Raw Normal View History

2026-08-07 12:21:42 +07:00
package validator
import (
"errors"
"github.com/yourorg/go-dw-platform/services/template-service/dto"
)
var ErrMissingOrderID = errors.New("order_id is required")
func ValidateIngestRequest(req *dto.IngestRequest) error {
if req.OrderID == "" {
return ErrMissingOrderID
}
if req.CustomerID == "" {
return errors.New("customer_id is required")
}
if req.Amount <= 0 {
return errors.New("amount must be positive")
}
return nil
}