feat: add assets to eventstore and event (#1674)

* fix: add assets to eventstore and event

* fix: project member, grant member, app changed tests

* fix: asset migrations

* feat: add asset tests

* feat: add asset tests

* Update internal/eventstore/repository/repository.go

Co-authored-by: Livio Amstutz <livio.a@gmail.com>

* feat: add asset tests

Co-authored-by: Livio Amstutz <livio.a@gmail.com>
This commit is contained in:
Fabi
2021-04-27 12:58:18 +02:00
committed by GitHub
parent eaf966e3d2
commit f51f0ede5c
102 changed files with 1079 additions and 34 deletions

View File

@@ -45,6 +45,10 @@ func (e *OrgAddedEvent) UniqueConstraints() []*eventstore.EventUniqueConstraint
return []*eventstore.EventUniqueConstraint{NewAddOrgNameUniqueConstraint(e.Name)}
}
func (e *OrgAddedEvent) Assets() []*eventstore.Asset {
return nil
}
func NewOrgAddedEvent(ctx context.Context, aggregate *eventstore.Aggregate, name string) *OrgAddedEvent {
return &OrgAddedEvent{
BaseEvent: *eventstore.NewBaseEventForPush(
@@ -86,6 +90,10 @@ func (e *OrgChangedEvent) UniqueConstraints() []*eventstore.EventUniqueConstrain
}
}
func (e *OrgChangedEvent) Assets() []*eventstore.Asset {
return nil
}
func NewOrgChangedEvent(ctx context.Context, aggregate *eventstore.Aggregate, oldName, newName string) *OrgChangedEvent {
return &OrgChangedEvent{
BaseEvent: *eventstore.NewBaseEventForPush(
@@ -122,6 +130,10 @@ func (e *OrgDeactivatedEvent) UniqueConstraints() []*eventstore.EventUniqueConst
return nil
}
func (e *OrgDeactivatedEvent) Assets() []*eventstore.Asset {
return nil
}
func NewOrgDeactivatedEvent(ctx context.Context, aggregate *eventstore.Aggregate) *OrgDeactivatedEvent {
return &OrgDeactivatedEvent{
BaseEvent: *eventstore.NewBaseEventForPush(
@@ -156,6 +168,10 @@ func (e *OrgReactivatedEvent) UniqueConstraints() []*eventstore.EventUniqueConst
return nil
}
func (e *OrgReactivatedEvent) Assets() []*eventstore.Asset {
return nil
}
func NewOrgReactivatedEvent(ctx context.Context, aggregate *eventstore.Aggregate) *OrgReactivatedEvent {
return &OrgReactivatedEvent{
BaseEvent: *eventstore.NewBaseEventForPush(
@@ -191,6 +207,10 @@ func (e *OrgRemovedEvent) UniqueConstraints() []*eventstore.EventUniqueConstrain
return []*eventstore.EventUniqueConstraint{NewRemoveOrgNameUniqueConstraint(e.name)}
}
func (e *OrgRemovedEvent) Assets() []*eventstore.Asset {
return nil
}
func NewOrgRemovedEvent(ctx context.Context, aggregate *eventstore.Aggregate, name string) *OrgRemovedEvent {
return &OrgRemovedEvent{
BaseEvent: *eventstore.NewBaseEventForPush(