fix: editorname (#281)

* feat: editorname on changes

* feat: editorname on changes

* feat: editorname on changes

* feat: editorname on changes

* fix: tests

* fix: tests
This commit is contained in:
Fabi
2020-06-29 09:37:10 +02:00
committed by GitHub
parent 5fc250f046
commit c8a0a050ba
23 changed files with 14103 additions and 13412 deletions

View File

@@ -22,11 +22,12 @@ type OrgChanges struct {
}
type OrgChange struct {
ChangeDate *timestamp.Timestamp `json:"changeDate,omitempty"`
EventType string `json:"eventType,omitempty"`
Sequence uint64 `json:"sequence,omitempty"`
Modifier string `json:"modifierUser,omitempty"`
Data interface{} `json:"data,omitempty"`
ChangeDate *timestamp.Timestamp `json:"changeDate,omitempty"`
EventType string `json:"eventType,omitempty"`
Sequence uint64 `json:"sequence,omitempty"`
ModifierId string `json:"modifierUser,omitempty"`
ModifierName string `json:"-"`
Data interface{} `json:"data,omitempty"`
}
type OrgState int32

View File

@@ -215,7 +215,7 @@ func (es *OrgEventstore) OrgChanges(ctx context.Context, id string, lastSequence
change := &org_model.OrgChange{
ChangeDate: creationDate,
EventType: u.Type.String(),
Modifier: u.EditorUser,
ModifierId: u.EditorUser,
Sequence: u.Sequence,
}

View File

@@ -1057,7 +1057,7 @@ func TestChangesOrg(t *testing.T) {
limit: 0,
},
res: res{
changes: &org_model.OrgChanges{Changes: []*org_model.OrgChange{&org_model.OrgChange{EventType: "", Sequence: 1, Modifier: ""}}, LastSequence: 1},
changes: &org_model.OrgChanges{Changes: []*org_model.OrgChange{&org_model.OrgChange{EventType: "", Sequence: 1, ModifierId: ""}}, LastSequence: 1},
org: &model.Org{Name: "MusterOrg"},
},
},