feat(domain): add idempotency scope, result and conflict error

This commit is contained in:
Голиков Maximillian Антон
2026-10-06 21:38:09 +03:00
parent 26008a9ea3
commit 65ae23f46e
2 changed files with 34 additions and 0 deletions
+11
View File
@@ -49,6 +49,17 @@ func (e *AlreadyExistsError) Error() string {
func (e *AlreadyExistsError) Unwrap() error { return ErrAlreadyExists }
func (e *AlreadyExistsError) Code() ErrorCode { return CodeConflict }
type IdempotencyConflictError struct {
Key string
}
func (e *IdempotencyConflictError) Error() string {
return "Idempotency-Key " + e.Key + " уже использован с другим телом запроса"
}
func (e *IdempotencyConflictError) Unwrap() error { return ErrAlreadyExists }
func (e *IdempotencyConflictError) Code() ErrorCode { return CodeConflict }
type ValidationError struct {
Field string
Message string