Skip to content

Commit

Permalink
Rename ArtifactProposed.id to ArtifactProposed.aggregateId
Browse files Browse the repository at this point in the history
  • Loading branch information
emacsway committed Dec 16, 2023
1 parent c9cf4bf commit 2e01d78
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion grade/internal/domain/artifact/artifact.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func (a Artifact) Export(ex ArtifactExporterSetter) {

func (a *Artifact) onArtifactProposed(e aggregate.PersistentDomainEvent) {
et := e.(*events.ArtifactProposed)
a.id = et.Id()
a.id = et.AggregateId()
a.status = et.Status()
a.name = et.Name()
a.description = et.Description()
Expand Down
14 changes: 7 additions & 7 deletions grade/internal/domain/artifact/events/artifact_proposed.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
)

func NewArtifactProposed(
id values.ArtifactId,
aggregateId values.ArtifactId,
status values.Status,
name values.Name,
description values.Description,
Expand All @@ -21,7 +21,7 @@ func NewArtifactProposed(
createdAt time.Time,
) *ArtifactProposed {
return &ArtifactProposed{
id: id,
aggregateId: aggregateId,
status: status,
name: name,
description: description,
Expand All @@ -34,7 +34,7 @@ func NewArtifactProposed(
}

type ArtifactProposed struct {
id values.ArtifactId
aggregateId values.ArtifactId
status values.Status
name values.Name
description values.Description
Expand All @@ -47,8 +47,8 @@ type ArtifactProposed struct {
eventMeta aggregate.EventMeta
}

func (e ArtifactProposed) Id() values.ArtifactId {
return e.id
func (e ArtifactProposed) AggregateId() values.ArtifactId {
return e.aggregateId
}

func (e ArtifactProposed) Status() values.Status {
Expand Down Expand Up @@ -109,7 +109,7 @@ func (e *ArtifactProposed) SetEventMeta(val aggregate.EventMeta) {
}

func (e ArtifactProposed) Export(ex ArtifactProposedExporterSetter) {
ex.SetId(e.id)
ex.SetAggregateId(e.aggregateId)
ex.SetStatus(e.status)
ex.SetName(e.name)
ex.SetDescription(e.description)
Expand All @@ -131,7 +131,7 @@ func (e ArtifactProposed) Export(ex ArtifactProposedExporterSetter) {

type ArtifactProposedExporterSetter interface {
aggregate.PersistentDomainEventExporterSetter
SetId(id values.ArtifactId)
SetAggregateId(id values.ArtifactId)
SetStatus(values.Status)
SetName(values.Name)
SetDescription(values.Description)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
)

type ArtifactProposedReconstitutor struct {
Id values.ArtifactIdReconstitutor
AggregateId values.ArtifactIdReconstitutor
Status uint8
Name string
Description string
Expand All @@ -24,7 +24,7 @@ type ArtifactProposedReconstitutor struct {
}

func (r ArtifactProposedReconstitutor) Reconstitute() (*ArtifactProposed, error) {
id, err := r.Id.Reconstitute()
id, err := r.AggregateId.Reconstitute()
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -69,7 +69,7 @@ func (r ArtifactProposedReconstitutor) Reconstitute() (*ArtifactProposed, error)
return nil, err
}
return &ArtifactProposed{
id: id,
aggregateId: id,
status: status,
name: name,
description: description,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ type ArtifactProposedQuery struct {
payload ArtifactProposedPayload
}

func (q *ArtifactProposedQuery) SetId(val values.ArtifactId) {
val.Export(&q.payload.Id)
func (q *ArtifactProposedQuery) SetAggregateId(val values.ArtifactId) {
val.Export(&q.payload.AggregateId)
val.Export(q)
}

Expand Down Expand Up @@ -62,7 +62,7 @@ func (q *ArtifactProposedQuery) Evaluate(s infrastructure.DbSession) (infrastruc
}

type ArtifactProposedPayload struct {
Id values.ArtifactIdExporter // Remove?
AggregateId values.ArtifactIdExporter // Remove?
Status exporters.Uint8Exporter
Name exporters.StringExporter
Description exporters.StringExporter
Expand Down

0 comments on commit 2e01d78

Please sign in to comment.