2022-03-24 16:21:34 +00:00
|
|
|
package instance
|
2022-02-21 12:22:20 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
2022-04-26 23:01:45 +00:00
|
|
|
"github.com/zitadel/zitadel/internal/crypto"
|
|
|
|
"github.com/zitadel/zitadel/internal/eventstore"
|
2023-12-08 14:30:55 +00:00
|
|
|
"github.com/zitadel/zitadel/internal/zerrors"
|
2022-02-21 12:22:20 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
|
|
|
smsConfigPrefix = "sms.config"
|
|
|
|
smsConfigTwilioPrefix = "twilio."
|
2024-09-06 13:11:36 +00:00
|
|
|
smsConfigHTTPPrefix = "http."
|
2022-03-24 16:21:34 +00:00
|
|
|
SMSConfigTwilioAddedEventType = instanceEventTypePrefix + smsConfigPrefix + smsConfigTwilioPrefix + "added"
|
|
|
|
SMSConfigTwilioChangedEventType = instanceEventTypePrefix + smsConfigPrefix + smsConfigTwilioPrefix + "changed"
|
2024-09-06 13:11:36 +00:00
|
|
|
SMSConfigHTTPAddedEventType = instanceEventTypePrefix + smsConfigPrefix + smsConfigHTTPPrefix + "added"
|
|
|
|
SMSConfigHTTPChangedEventType = instanceEventTypePrefix + smsConfigPrefix + smsConfigHTTPPrefix + "changed"
|
2022-03-24 16:21:34 +00:00
|
|
|
SMSConfigTwilioTokenChangedEventType = instanceEventTypePrefix + smsConfigPrefix + smsConfigTwilioPrefix + "token.changed"
|
2024-09-06 13:11:36 +00:00
|
|
|
SMSConfigTwilioActivatedEventType = instanceEventTypePrefix + smsConfigPrefix + smsConfigTwilioPrefix + "activated"
|
|
|
|
SMSConfigTwilioDeactivatedEventType = instanceEventTypePrefix + smsConfigPrefix + smsConfigTwilioPrefix + "deactivated"
|
|
|
|
SMSConfigTwilioRemovedEventType = instanceEventTypePrefix + smsConfigPrefix + smsConfigTwilioPrefix + "removed"
|
|
|
|
SMSConfigActivatedEventType = instanceEventTypePrefix + smsConfigPrefix + "activated"
|
|
|
|
SMSConfigDeactivatedEventType = instanceEventTypePrefix + smsConfigPrefix + "deactivated"
|
|
|
|
SMSConfigRemovedEventType = instanceEventTypePrefix + smsConfigPrefix + "removed"
|
2022-02-21 12:22:20 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type SMSConfigTwilioAddedEvent struct {
|
2024-09-06 13:11:36 +00:00
|
|
|
*eventstore.BaseEvent `json:"-"`
|
2022-02-21 12:22:20 +00:00
|
|
|
|
2024-09-26 07:14:33 +00:00
|
|
|
ID string `json:"id,omitempty"`
|
|
|
|
Description string `json:"description,omitempty"`
|
|
|
|
SID string `json:"sid,omitempty"`
|
|
|
|
Token *crypto.CryptoValue `json:"token,omitempty"`
|
|
|
|
SenderNumber string `json:"senderNumber,omitempty"`
|
|
|
|
VerifyServiceSID string `json:"verifyServiceSid,omitempty"`
|
2022-02-21 12:22:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func NewSMSConfigTwilioAddedEvent(
|
|
|
|
ctx context.Context,
|
|
|
|
aggregate *eventstore.Aggregate,
|
|
|
|
id,
|
2024-09-06 13:11:36 +00:00
|
|
|
description string,
|
2022-02-21 12:22:20 +00:00
|
|
|
sid,
|
|
|
|
senderNumber string,
|
|
|
|
token *crypto.CryptoValue,
|
2024-09-26 07:14:33 +00:00
|
|
|
verifyServiceSid string,
|
2022-02-21 12:22:20 +00:00
|
|
|
) *SMSConfigTwilioAddedEvent {
|
|
|
|
return &SMSConfigTwilioAddedEvent{
|
2024-09-06 13:11:36 +00:00
|
|
|
BaseEvent: eventstore.NewBaseEventForPush(
|
2022-02-21 12:22:20 +00:00
|
|
|
ctx,
|
|
|
|
aggregate,
|
|
|
|
SMSConfigTwilioAddedEventType,
|
|
|
|
),
|
2024-09-26 07:14:33 +00:00
|
|
|
ID: id,
|
|
|
|
Description: description,
|
|
|
|
SID: sid,
|
|
|
|
Token: token,
|
|
|
|
SenderNumber: senderNumber,
|
|
|
|
VerifyServiceSID: verifyServiceSid,
|
2022-02-21 12:22:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-09-06 13:11:36 +00:00
|
|
|
func (e *SMSConfigTwilioAddedEvent) SetBaseEvent(event *eventstore.BaseEvent) {
|
|
|
|
e.BaseEvent = event
|
|
|
|
}
|
|
|
|
|
2023-10-19 10:19:10 +00:00
|
|
|
func (e *SMSConfigTwilioAddedEvent) Payload() interface{} {
|
2022-02-21 12:22:20 +00:00
|
|
|
return e
|
|
|
|
}
|
|
|
|
|
2023-10-19 10:19:10 +00:00
|
|
|
func (e *SMSConfigTwilioAddedEvent) UniqueConstraints() []*eventstore.UniqueConstraint {
|
2022-02-21 12:22:20 +00:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type SMSConfigTwilioChangedEvent struct {
|
2024-09-06 13:11:36 +00:00
|
|
|
*eventstore.BaseEvent `json:"-"`
|
2022-02-21 12:22:20 +00:00
|
|
|
|
2024-09-26 07:14:33 +00:00
|
|
|
ID string `json:"id,omitempty"`
|
|
|
|
Description *string `json:"description,omitempty"`
|
|
|
|
SID *string `json:"sid,omitempty"`
|
|
|
|
SenderNumber *string `json:"senderNumber,omitempty"`
|
|
|
|
VerifyServiceSID *string `json:"verifyServiceSid,omitempty"`
|
2022-02-21 12:22:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func NewSMSConfigTwilioChangedEvent(
|
|
|
|
ctx context.Context,
|
|
|
|
aggregate *eventstore.Aggregate,
|
|
|
|
id string,
|
|
|
|
changes []SMSConfigTwilioChanges,
|
|
|
|
) (*SMSConfigTwilioChangedEvent, error) {
|
|
|
|
if len(changes) == 0 {
|
2023-12-08 14:30:55 +00:00
|
|
|
return nil, zerrors.ThrowPreconditionFailed(nil, "IAM-smn8e", "Errors.NoChangesFound")
|
2022-02-21 12:22:20 +00:00
|
|
|
}
|
|
|
|
changeEvent := &SMSConfigTwilioChangedEvent{
|
2024-09-06 13:11:36 +00:00
|
|
|
BaseEvent: eventstore.NewBaseEventForPush(
|
2022-02-21 12:22:20 +00:00
|
|
|
ctx,
|
|
|
|
aggregate,
|
|
|
|
SMSConfigTwilioChangedEventType,
|
|
|
|
),
|
|
|
|
ID: id,
|
|
|
|
}
|
|
|
|
for _, change := range changes {
|
|
|
|
change(changeEvent)
|
|
|
|
}
|
|
|
|
return changeEvent, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type SMSConfigTwilioChanges func(event *SMSConfigTwilioChangedEvent)
|
|
|
|
|
|
|
|
func ChangeSMSConfigTwilioSID(sid string) func(event *SMSConfigTwilioChangedEvent) {
|
|
|
|
return func(e *SMSConfigTwilioChangedEvent) {
|
|
|
|
e.SID = &sid
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-09-06 13:11:36 +00:00
|
|
|
func ChangeSMSConfigTwilioDescription(description string) func(event *SMSConfigTwilioChangedEvent) {
|
|
|
|
return func(e *SMSConfigTwilioChangedEvent) {
|
|
|
|
e.Description = &description
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-02-21 12:22:20 +00:00
|
|
|
func ChangeSMSConfigTwilioSenderNumber(senderNumber string) func(event *SMSConfigTwilioChangedEvent) {
|
|
|
|
return func(e *SMSConfigTwilioChangedEvent) {
|
|
|
|
e.SenderNumber = &senderNumber
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-09-26 07:14:33 +00:00
|
|
|
func ChangeSMSConfigTwilioVerifyServiceSID(verifyServiceSID string) func(event *SMSConfigTwilioChangedEvent) {
|
|
|
|
return func(e *SMSConfigTwilioChangedEvent) {
|
|
|
|
e.VerifyServiceSID = &verifyServiceSID
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-09-06 13:11:36 +00:00
|
|
|
func (e *SMSConfigTwilioChangedEvent) SetBaseEvent(event *eventstore.BaseEvent) {
|
|
|
|
e.BaseEvent = event
|
|
|
|
}
|
|
|
|
|
2023-10-19 10:19:10 +00:00
|
|
|
func (e *SMSConfigTwilioChangedEvent) Payload() interface{} {
|
2022-02-21 12:22:20 +00:00
|
|
|
return e
|
|
|
|
}
|
|
|
|
|
2023-10-19 10:19:10 +00:00
|
|
|
func (e *SMSConfigTwilioChangedEvent) UniqueConstraints() []*eventstore.UniqueConstraint {
|
2022-02-21 12:22:20 +00:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type SMSConfigTwilioTokenChangedEvent struct {
|
2024-09-06 13:11:36 +00:00
|
|
|
*eventstore.BaseEvent `json:"-"`
|
2022-02-21 12:22:20 +00:00
|
|
|
|
|
|
|
ID string `json:"id,omitempty"`
|
2022-06-13 06:34:11 +00:00
|
|
|
Token *crypto.CryptoValue `json:"token,omitempty"`
|
2022-02-21 12:22:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func NewSMSConfigTokenChangedEvent(
|
|
|
|
ctx context.Context,
|
|
|
|
aggregate *eventstore.Aggregate,
|
|
|
|
id string,
|
|
|
|
token *crypto.CryptoValue,
|
|
|
|
) *SMSConfigTwilioTokenChangedEvent {
|
|
|
|
return &SMSConfigTwilioTokenChangedEvent{
|
2024-09-06 13:11:36 +00:00
|
|
|
BaseEvent: eventstore.NewBaseEventForPush(
|
2022-02-21 12:22:20 +00:00
|
|
|
ctx,
|
|
|
|
aggregate,
|
|
|
|
SMSConfigTwilioTokenChangedEventType,
|
|
|
|
),
|
|
|
|
ID: id,
|
|
|
|
Token: token,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-09-06 13:11:36 +00:00
|
|
|
func (e *SMSConfigTwilioTokenChangedEvent) SetBaseEvent(event *eventstore.BaseEvent) {
|
|
|
|
e.BaseEvent = event
|
|
|
|
}
|
|
|
|
|
2023-10-19 10:19:10 +00:00
|
|
|
func (e *SMSConfigTwilioTokenChangedEvent) Payload() interface{} {
|
2022-02-21 12:22:20 +00:00
|
|
|
return e
|
|
|
|
}
|
|
|
|
|
2023-10-19 10:19:10 +00:00
|
|
|
func (e *SMSConfigTwilioTokenChangedEvent) UniqueConstraints() []*eventstore.UniqueConstraint {
|
2022-02-21 12:22:20 +00:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2024-09-06 13:11:36 +00:00
|
|
|
type SMSConfigHTTPAddedEvent struct {
|
|
|
|
*eventstore.BaseEvent `json:"-"`
|
|
|
|
|
|
|
|
ID string `json:"id,omitempty"`
|
|
|
|
Description string `json:"description,omitempty"`
|
|
|
|
Endpoint string `json:"endpoint,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewSMSConfigHTTPAddedEvent(
|
|
|
|
ctx context.Context,
|
|
|
|
aggregate *eventstore.Aggregate,
|
|
|
|
id,
|
|
|
|
description,
|
|
|
|
endpoint string,
|
|
|
|
) *SMSConfigHTTPAddedEvent {
|
|
|
|
return &SMSConfigHTTPAddedEvent{
|
|
|
|
BaseEvent: eventstore.NewBaseEventForPush(
|
|
|
|
ctx,
|
|
|
|
aggregate,
|
|
|
|
SMSConfigHTTPAddedEventType,
|
|
|
|
),
|
|
|
|
ID: id,
|
|
|
|
Description: description,
|
|
|
|
Endpoint: endpoint,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e *SMSConfigHTTPAddedEvent) SetBaseEvent(event *eventstore.BaseEvent) {
|
|
|
|
e.BaseEvent = event
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e *SMSConfigHTTPAddedEvent) Payload() interface{} {
|
|
|
|
return e
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e *SMSConfigHTTPAddedEvent) UniqueConstraints() []*eventstore.UniqueConstraint {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type SMSConfigHTTPChangedEvent struct {
|
|
|
|
*eventstore.BaseEvent `json:"-"`
|
|
|
|
|
|
|
|
ID string `json:"id,omitempty"`
|
|
|
|
Description *string `json:"description,omitempty"`
|
|
|
|
Endpoint *string `json:"endpoint,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewSMSConfigHTTPChangedEvent(
|
|
|
|
ctx context.Context,
|
|
|
|
aggregate *eventstore.Aggregate,
|
|
|
|
id string,
|
|
|
|
changes []SMSConfigHTTPChanges,
|
|
|
|
) (*SMSConfigHTTPChangedEvent, error) {
|
|
|
|
if len(changes) == 0 {
|
|
|
|
return nil, zerrors.ThrowPreconditionFailed(nil, "IAM-smn8e", "Errors.NoChangesFound")
|
|
|
|
}
|
|
|
|
changeEvent := &SMSConfigHTTPChangedEvent{
|
|
|
|
BaseEvent: eventstore.NewBaseEventForPush(
|
|
|
|
ctx,
|
|
|
|
aggregate,
|
|
|
|
SMSConfigHTTPChangedEventType,
|
|
|
|
),
|
|
|
|
ID: id,
|
|
|
|
}
|
|
|
|
for _, change := range changes {
|
|
|
|
change(changeEvent)
|
|
|
|
}
|
|
|
|
return changeEvent, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type SMSConfigHTTPChanges func(event *SMSConfigHTTPChangedEvent)
|
|
|
|
|
|
|
|
func ChangeSMSConfigHTTPDescription(description string) func(event *SMSConfigHTTPChangedEvent) {
|
|
|
|
return func(e *SMSConfigHTTPChangedEvent) {
|
|
|
|
e.Description = &description
|
2022-02-21 12:22:20 +00:00
|
|
|
}
|
2024-09-06 13:11:36 +00:00
|
|
|
}
|
|
|
|
func ChangeSMSConfigHTTPEndpoint(endpoint string) func(event *SMSConfigHTTPChangedEvent) {
|
|
|
|
return func(e *SMSConfigHTTPChangedEvent) {
|
|
|
|
e.Endpoint = &endpoint
|
2022-02-21 12:22:20 +00:00
|
|
|
}
|
2024-09-06 13:11:36 +00:00
|
|
|
}
|
2022-02-21 12:22:20 +00:00
|
|
|
|
2024-09-06 13:11:36 +00:00
|
|
|
func (e *SMSConfigHTTPChangedEvent) SetBaseEvent(event *eventstore.BaseEvent) {
|
|
|
|
e.BaseEvent = event
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e *SMSConfigHTTPChangedEvent) Payload() interface{} {
|
|
|
|
return e
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e *SMSConfigHTTPChangedEvent) UniqueConstraints() []*eventstore.UniqueConstraint {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type SMSConfigTwilioActivatedEvent struct {
|
|
|
|
*eventstore.BaseEvent `json:"-"`
|
|
|
|
ID string `json:"id,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e *SMSConfigTwilioActivatedEvent) SetBaseEvent(event *eventstore.BaseEvent) {
|
|
|
|
e.BaseEvent = event
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e *SMSConfigTwilioActivatedEvent) Payload() interface{} {
|
|
|
|
return e
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e *SMSConfigTwilioActivatedEvent) UniqueConstraints() []*eventstore.UniqueConstraint {
|
|
|
|
return nil
|
2022-02-21 12:22:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type SMSConfigActivatedEvent struct {
|
2024-09-06 13:11:36 +00:00
|
|
|
*eventstore.BaseEvent `json:"-"`
|
|
|
|
ID string `json:"id,omitempty"`
|
2022-02-21 12:22:20 +00:00
|
|
|
}
|
|
|
|
|
2024-09-06 13:11:36 +00:00
|
|
|
func NewSMSConfigActivatedEvent(
|
2022-02-21 12:22:20 +00:00
|
|
|
ctx context.Context,
|
|
|
|
aggregate *eventstore.Aggregate,
|
|
|
|
id string,
|
|
|
|
) *SMSConfigActivatedEvent {
|
|
|
|
return &SMSConfigActivatedEvent{
|
2024-09-06 13:11:36 +00:00
|
|
|
BaseEvent: eventstore.NewBaseEventForPush(
|
2022-02-21 12:22:20 +00:00
|
|
|
ctx,
|
|
|
|
aggregate,
|
|
|
|
SMSConfigActivatedEventType,
|
|
|
|
),
|
|
|
|
ID: id,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-09-06 13:11:36 +00:00
|
|
|
func (e *SMSConfigActivatedEvent) SetBaseEvent(event *eventstore.BaseEvent) {
|
|
|
|
e.BaseEvent = event
|
|
|
|
}
|
|
|
|
|
2023-10-19 10:19:10 +00:00
|
|
|
func (e *SMSConfigActivatedEvent) Payload() interface{} {
|
2022-02-21 12:22:20 +00:00
|
|
|
return e
|
|
|
|
}
|
|
|
|
|
2023-10-19 10:19:10 +00:00
|
|
|
func (e *SMSConfigActivatedEvent) UniqueConstraints() []*eventstore.UniqueConstraint {
|
2022-02-21 12:22:20 +00:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2024-09-06 13:11:36 +00:00
|
|
|
type SMSConfigTwilioDeactivatedEvent struct {
|
|
|
|
*eventstore.BaseEvent `json:"-"`
|
|
|
|
ID string `json:"id,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e *SMSConfigTwilioDeactivatedEvent) SetBaseEvent(event *eventstore.BaseEvent) {
|
|
|
|
e.BaseEvent = event
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e *SMSConfigTwilioDeactivatedEvent) Payload() interface{} {
|
|
|
|
return e
|
|
|
|
}
|
2022-02-21 12:22:20 +00:00
|
|
|
|
2024-09-06 13:11:36 +00:00
|
|
|
func (e *SMSConfigTwilioDeactivatedEvent) UniqueConstraints() []*eventstore.UniqueConstraint {
|
|
|
|
return nil
|
2022-02-21 12:22:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type SMSConfigDeactivatedEvent struct {
|
2024-09-06 13:11:36 +00:00
|
|
|
*eventstore.BaseEvent `json:"-"`
|
|
|
|
ID string `json:"id,omitempty"`
|
2022-02-21 12:22:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func NewSMSConfigDeactivatedEvent(
|
|
|
|
ctx context.Context,
|
|
|
|
aggregate *eventstore.Aggregate,
|
|
|
|
id string,
|
|
|
|
) *SMSConfigDeactivatedEvent {
|
|
|
|
return &SMSConfigDeactivatedEvent{
|
2024-09-06 13:11:36 +00:00
|
|
|
BaseEvent: eventstore.NewBaseEventForPush(
|
2022-02-21 12:22:20 +00:00
|
|
|
ctx,
|
|
|
|
aggregate,
|
|
|
|
SMSConfigDeactivatedEventType,
|
|
|
|
),
|
|
|
|
ID: id,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-09-06 13:11:36 +00:00
|
|
|
func (e *SMSConfigDeactivatedEvent) SetBaseEvent(event *eventstore.BaseEvent) {
|
|
|
|
e.BaseEvent = event
|
|
|
|
}
|
|
|
|
|
2023-10-19 10:19:10 +00:00
|
|
|
func (e *SMSConfigDeactivatedEvent) Payload() interface{} {
|
2022-02-21 12:22:20 +00:00
|
|
|
return e
|
|
|
|
}
|
|
|
|
|
2023-10-19 10:19:10 +00:00
|
|
|
func (e *SMSConfigDeactivatedEvent) UniqueConstraints() []*eventstore.UniqueConstraint {
|
2022-02-21 12:22:20 +00:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2024-09-06 13:11:36 +00:00
|
|
|
type SMSConfigTwilioRemovedEvent struct {
|
|
|
|
*eventstore.BaseEvent `json:"-"`
|
|
|
|
ID string `json:"id,omitempty"`
|
|
|
|
}
|
2022-02-21 12:22:20 +00:00
|
|
|
|
2024-09-06 13:11:36 +00:00
|
|
|
func (e *SMSConfigTwilioRemovedEvent) SetBaseEvent(event *eventstore.BaseEvent) {
|
|
|
|
e.BaseEvent = event
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e *SMSConfigTwilioRemovedEvent) Payload() interface{} {
|
|
|
|
return e
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e *SMSConfigTwilioRemovedEvent) UniqueConstraints() []*eventstore.UniqueConstraint {
|
|
|
|
return nil
|
2022-02-21 12:22:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type SMSConfigRemovedEvent struct {
|
2024-09-06 13:11:36 +00:00
|
|
|
*eventstore.BaseEvent `json:"-"`
|
|
|
|
ID string `json:"id,omitempty"`
|
2022-02-21 12:22:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func NewSMSConfigRemovedEvent(
|
|
|
|
ctx context.Context,
|
|
|
|
aggregate *eventstore.Aggregate,
|
|
|
|
id string,
|
|
|
|
) *SMSConfigRemovedEvent {
|
|
|
|
return &SMSConfigRemovedEvent{
|
2024-09-06 13:11:36 +00:00
|
|
|
BaseEvent: eventstore.NewBaseEventForPush(
|
2022-02-21 12:22:20 +00:00
|
|
|
ctx,
|
|
|
|
aggregate,
|
|
|
|
SMSConfigRemovedEventType,
|
|
|
|
),
|
|
|
|
ID: id,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-09-06 13:11:36 +00:00
|
|
|
func (e *SMSConfigRemovedEvent) SetBaseEvent(event *eventstore.BaseEvent) {
|
|
|
|
e.BaseEvent = event
|
|
|
|
}
|
|
|
|
|
2023-10-19 10:19:10 +00:00
|
|
|
func (e *SMSConfigRemovedEvent) Payload() interface{} {
|
2022-02-21 12:22:20 +00:00
|
|
|
return e
|
|
|
|
}
|
|
|
|
|
2023-10-19 10:19:10 +00:00
|
|
|
func (e *SMSConfigRemovedEvent) UniqueConstraints() []*eventstore.UniqueConstraint {
|
2022-02-21 12:22:20 +00:00
|
|
|
return nil
|
|
|
|
}
|