add support for mysql and postgres unique index error codes

This commit is contained in:
bergquist
2018-09-27 11:33:13 +02:00
parent 3fab616239
commit c5278af6c4
4 changed files with 57 additions and 15 deletions

View File

@@ -11,7 +11,7 @@ var (
ErrNotificationFrequencyNotFound = errors.New("Notification frequency not specified")
ErrAlertNotificationStateNotFound = errors.New("alert notification state not found")
ErrAlertNotificationStateVersionConflict = errors.New("alert notification state update version conflict")
ErrAlertNotificationStateAllreadyExist = errors.New("alert notification state allready exists.")
ErrAlertNotificationStateAlreadyExist = errors.New("alert notification state already exists.")
)
type AlertNotificationStateType string
@@ -95,13 +95,17 @@ type AlertNotificationState struct {
Version int64
}
type UpdateAlertNotificationStateCommand struct {
type SetAlertNotificationStateToPendingCommand struct {
Id int64
SentAt int64
State AlertNotificationStateType
Version int64
}
type SetAlertNotificationStateToCompleteCommand struct {
Id int64
SentAt int64
}
type GetNotificationStateQuery struct {
OrgId int64
AlertId int64