Refactoring data access to command query model, and adding tests for sql code

This commit is contained in:
Torkel Ödegaard
2014-12-19 09:43:16 +01:00
parent e5811e29b1
commit 36c46112df
4 changed files with 107 additions and 34 deletions
+20
View File
@@ -42,3 +42,23 @@ type Account struct {
Created time.Time
Updated time.Time
}
// api projection model
type CollaboratorDTO struct {
AccountId int64 `json:"accountId"`
Email string `json:"email"`
Role string `json:"role"`
}
// api view projection
type AccountDTO struct {
Email string `json:"email"`
Name string `json:"name"`
Collaborators []*CollaboratorDTO `json:"collaborators"`
}
// returns a view projection
type GetAccountInfoQuery struct {
Id int64
Result AccountDTO
}