oncall-engine/engine/apps/api/errors.py
Innokentii Konstantinov a865ae1378
Fix backend for resolution notes via mobile app (#2117)
# What this PR does
Add first internal api error code and add "resolution_note" param to
resolve endpoint

## Which issue(s) this PR fixes
It fixes resolving alert groups via mobile app when resolution note is
required

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [ ] Documentation added (or `pr:no public docs` PR label added if not
required)
- [ ] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
2023-06-07 12:19:16 +00:00

18 lines
518 B
Python

"""errors contains business-logic error codes for internal api.
It's expected that error codes will use 1000-9999 codes range, where first two digits are for entity:
11xx - AlertGroup, 12xx - AlertReceiveChannel, etc.
10xx are saved for non-entity related errors.
"""
# TODO: this package is WIP. It requires validation of code ranges.
from enum import Enum, unique
@unique
class AlertGroupAPIError(Enum):
"""
Error codes for alert group.
Range is 1100-1199
"""
RESOLUTION_NOTE_REQUIRED = 1101