Start to populate site information in review task
This commit is contained in:
parent
03dccb638a
commit
c4c22f6733
6 changed files with 71 additions and 2 deletions
19
platform/types/review_task.go
Normal file
19
platform/types/review_task.go
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
package types
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type ReviewTask struct {
|
||||
Created time.Time `db:"created" json:"created"`
|
||||
Creator User `db:"creator" json:"creator"`
|
||||
ID int32 `db:"id" json:"id"`
|
||||
Pool *ReviewTaskPool `db:"pool" json:"pool"`
|
||||
Reviewed *time.Time `db:"reviewed" json:"reviewed"`
|
||||
Reviewer *User `db:"reviewer" json:"reviewer"`
|
||||
}
|
||||
type ReviewTaskPool struct {
|
||||
Condition string `db:"condition" json:"condition"`
|
||||
Location Location `db:"location" json:"location"`
|
||||
Site Site `db:"site" json:"site"`
|
||||
}
|
||||
|
|
@ -2,6 +2,8 @@ package types
|
|||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/Gleipnir-Technology/nidus-sync/db/models"
|
||||
)
|
||||
|
||||
type Site struct {
|
||||
|
|
@ -19,3 +21,15 @@ type Site struct {
|
|||
Tags map[string]string `db:"tags" json:"tags"`
|
||||
Version int32 `db:"version" json:"version"`
|
||||
}
|
||||
|
||||
func SiteFromModel(s *models.Site) Site {
|
||||
return Site{
|
||||
Created: s.Created,
|
||||
CreatorID: s.CreatorID,
|
||||
//FileID: s.FileID,
|
||||
ID: s.ID,
|
||||
Notes: s.Notes,
|
||||
OrganizationID: s.OrganizationID,
|
||||
//ParcelID: s.ParcelID,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
6
platform/types/user.go
Normal file
6
platform/types/user.go
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
package types
|
||||
|
||||
type User struct {
|
||||
ID int32 `db:"id" json:"id"`
|
||||
Name string `db:"-" json:"name"`
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue