Skip to content

Commit

Permalink
Minor data model fix
Browse files Browse the repository at this point in the history
  • Loading branch information
DerAndereAndi committed May 29, 2024
1 parent c1d0dbd commit 097fd5e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
12 changes: 6 additions & 6 deletions model/powersequences.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,22 +127,22 @@ type PowerTimeSlotScheduleConstraintsListDataSelectorsType struct {
}

type PowerSequenceAlternativesRelationDataType struct {
AlternativeId *AlternativesIdType `json:"alternativeId,omitempty" eebus:"key"`
SequenceId []PowerSequenceIdType `json:"sequenceId,omitempty"`
AlternativesId *AlternativesIdType `json:"alternativesId,omitempty" eebus:"key"`
SequenceId []PowerSequenceIdType `json:"sequenceId,omitempty"`
}

type PowerSequenceAlternativesRelationDataElementsType struct {
AlternativeId *ElementTagType `json:"alternativeId,omitempty"`
SequenceId *ElementTagType `json:"sequenceId,omitempty"`
AlternativesId *ElementTagType `json:"alternativesId,omitempty"`
SequenceId *ElementTagType `json:"sequenceId,omitempty"`
}

type PowerSequenceAlternativesRelationListDataType struct {
PowerSequenceAlternativesRelationData []PowerSequenceAlternativesRelationDataType `json:"powerSequenceAlternativesRelationData,omitempty"`
}

type PowerSequenceAlternativesRelationListDataSelectorsType struct {
AlternativeId *AlternativesIdType `json:"alternativeId,omitempty"`
SequenceId []PowerSequenceIdType `json:"sequenceId,omitempty"`
AlternativesId *AlternativesIdType `json:"alternativesId,omitempty"`
SequenceId []PowerSequenceIdType `json:"sequenceId,omitempty"`
}

type PowerSequenceDescriptionDataType struct {
Expand Down
16 changes: 8 additions & 8 deletions model/powersequences_additions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,21 +131,21 @@ func TestPowerSequenceAlternativesRelationListDataType_Update(t *testing.T) {
sut := PowerSequenceAlternativesRelationListDataType{
PowerSequenceAlternativesRelationData: []PowerSequenceAlternativesRelationDataType{
{
AlternativeId: util.Ptr(AlternativesIdType(0)),
SequenceId: []PowerSequenceIdType{0},
AlternativesId: util.Ptr(AlternativesIdType(0)),
SequenceId: []PowerSequenceIdType{0},
},
{
AlternativeId: util.Ptr(AlternativesIdType(1)),
SequenceId: []PowerSequenceIdType{0},
AlternativesId: util.Ptr(AlternativesIdType(1)),
SequenceId: []PowerSequenceIdType{0},
},
},
}

newData := PowerSequenceAlternativesRelationListDataType{
PowerSequenceAlternativesRelationData: []PowerSequenceAlternativesRelationDataType{
{
AlternativeId: util.Ptr(AlternativesIdType(1)),
SequenceId: []PowerSequenceIdType{1},
AlternativesId: util.Ptr(AlternativesIdType(1)),
SequenceId: []PowerSequenceIdType{1},
},
},
}
Expand All @@ -158,11 +158,11 @@ func TestPowerSequenceAlternativesRelationListDataType_Update(t *testing.T) {
// check the non changing items
assert.Equal(t, 2, len(data))
item1 := data[0]
assert.Equal(t, 0, int(*item1.AlternativeId))
assert.Equal(t, 0, int(*item1.AlternativesId))
assert.Equal(t, 0, int(item1.SequenceId[0]))
// check properties of updated item
item2 := data[1]
assert.Equal(t, 1, int(*item2.AlternativeId))
assert.Equal(t, 1, int(*item2.AlternativesId))
assert.Equal(t, 1, int(item2.SequenceId[0]))
}

Expand Down

0 comments on commit 097fd5e

Please sign in to comment.