37 lines
1.4 KiB
Go
37 lines
1.4 KiB
Go
// Package domain contains pure domain models with no external dependencies.
|
|
// These types represent the core business concepts of the service.
|
|
package domain
|
|
|
|
import "errors"
|
|
|
|
// Domain errors - these are business-level errors that should be translated
|
|
// to appropriate HTTP status codes by the handler layer.
|
|
var (
|
|
// ErrNotFound indicates a requested resource does not exist.
|
|
ErrNotFound = errors.New("not found")
|
|
|
|
// ErrExampleNotFound indicates the requested example does not exist.
|
|
ErrExampleNotFound = errors.New("example not found")
|
|
|
|
// ErrDuplicateExample indicates an example with the same name already exists.
|
|
ErrDuplicateExample = errors.New("example with this name already exists")
|
|
|
|
// ErrInvalidExampleName indicates the example name is invalid.
|
|
ErrInvalidExampleName = errors.New("invalid example name")
|
|
|
|
// ErrUserNotFound indicates the requested user does not exist.
|
|
ErrUserNotFound = errors.New("user not found")
|
|
|
|
// ErrDuplicateUser indicates a user with the same email already exists.
|
|
ErrDuplicateUser = errors.New("user with this email already exists")
|
|
|
|
// ErrInvalidEmail indicates the email is invalid.
|
|
ErrInvalidEmail = errors.New("invalid email")
|
|
|
|
// ErrInvalidPassword indicates the password is invalid.
|
|
ErrInvalidPassword = errors.New("invalid password")
|
|
|
|
// ErrInvalidCredentials indicates invalid login credentials.
|
|
ErrInvalidCredentials = errors.New("invalid credentials")
|
|
)
|