Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
emacsway committed Feb 18, 2024
1 parent 4a5fa33 commit ee070eb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ func (r *ArtifactRepository) NextId(tenantId tenantVal.TenantId) (artifactVal.Ar
func eventQuery(iEvent aggregate.PersistentDomainEvent) (q session.EventSourcedQueryEvaluator) {
switch event := iEvent.(type) {
case *events.ArtifactProposed:
q = &queries.ArtifactProposedQuery{}
qt := q.(events.ArtifactProposedExporterSetter)
event.Export(qt)
q = queries.NewArtifactProposedQuery(event)
}
return q
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package queries
import (
"time"

"github.com/emacsway/grade/grade/internal/domain/artifact/events"
"github.com/emacsway/grade/grade/internal/domain/artifact/values"
competenceVal "github.com/emacsway/grade/grade/internal/domain/competence/values"
memberVal "github.com/emacsway/grade/grade/internal/domain/member/values"
Expand All @@ -11,6 +12,12 @@ import (
"github.com/emacsway/grade/grade/internal/infrastructure/seedwork/session"
)

func NewArtifactProposedQuery(event *events.ArtifactProposed) *ArtifactProposedQuery {
q := &ArtifactProposedQuery{}
event.Export(q)
return q
}

type ArtifactProposedQuery struct {
repository.EventInsertQuery
payload ArtifactProposedPayload
Expand Down

0 comments on commit ee070eb

Please sign in to comment.