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

@@ -20,11 +20,12 @@ type ApplicationChanges struct {
}
type ApplicationChange 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 AppState int32

View File

@@ -21,11 +21,12 @@ type ProjectChanges struct {
}
type ProjectChange 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 ProjectState int32

View File

@@ -380,7 +380,7 @@ func (es *ProjectEventstore) ProjectChanges(ctx context.Context, id string, last
change := &proj_model.ProjectChange{
ChangeDate: creationDate,
EventType: u.Type.String(),
Modifier: u.EditorUser,
ModifierId: u.EditorUser,
Sequence: u.Sequence,
}
@@ -558,7 +558,7 @@ func (es *ProjectEventstore) ApplicationChanges(ctx context.Context, id string,
change := &proj_model.ApplicationChange{
ChangeDate: creationDate,
EventType: u.Type.String(),
Modifier: u.EditorUser,
ModifierId: u.EditorUser,
Sequence: u.Sequence,
}
appendChanges := true

View File

@@ -2604,7 +2604,7 @@ func TestChangesProject(t *testing.T) {
limit: 0,
},
res: res{
changes: &model.ProjectChanges{Changes: []*model.ProjectChange{&model.ProjectChange{EventType: "", Sequence: 1, Modifier: ""}}, LastSequence: 1},
changes: &model.ProjectChanges{Changes: []*model.ProjectChange{&model.ProjectChange{EventType: "", Sequence: 1, ModifierId: ""}}, LastSequence: 1},
project: &model.Project{Name: "MusterProject"},
},
},
@@ -2673,7 +2673,7 @@ func TestChangesApplication(t *testing.T) {
limit: 0,
},
res: res{
changes: &model.ApplicationChanges{Changes: []*model.ApplicationChange{&model.ApplicationChange{EventType: "", Sequence: 1, Modifier: ""}}, LastSequence: 1},
changes: &model.ApplicationChanges{Changes: []*model.ApplicationChange{&model.ApplicationChange{EventType: "", Sequence: 1, ModifierId: ""}}, LastSequence: 1},
app: &model.Application{Name: "MusterApp", AppID: "AppId", Type: 3},
},
},