Start to populate site information in review task

This commit is contained in:
Eli Ribble 2026-04-16 06:58:05 +00:00
parent 03dccb638a
commit c4c22f6733
No known key found for this signature in database
6 changed files with 71 additions and 2 deletions

View 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"`
}

View file

@ -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
View file

@ -0,0 +1,6 @@
package types
type User struct {
ID int32 `db:"id" json:"id"`
Name string `db:"-" json:"name"`
}