Get back to compiling, but using new jet for publicreport
This was an epically long change, and a terrible idea, but it compiles. This was essentially a cascade that came about because I can't blend jet and bob in the same transaction. In for a penny, I guess...
This commit is contained in:
parent
a95e44cf42
commit
fcd95f1a25
65 changed files with 3129 additions and 3457 deletions
|
|
@ -9,7 +9,7 @@ import (
|
|||
"github.com/Gleipnir-Technology/bob/dialect/psql/sm"
|
||||
"github.com/Gleipnir-Technology/nidus-sync/db"
|
||||
|
||||
"github.com/Gleipnir-Technology/nidus-sync/db/models"
|
||||
"github.com/Gleipnir-Technology/nidus-sync/db/gen/nidus-sync/public/model"
|
||||
//"github.com/rs/zerolog/log"
|
||||
"github.com/stephenafamo/scan"
|
||||
)
|
||||
|
|
@ -31,7 +31,7 @@ type Address struct {
|
|||
func (a Address) String() string {
|
||||
return fmt.Sprintf("%s %s, %s, %s, %s, %s", a.Number, a.Street, a.Locality, a.Region, a.PostalCode, a.Country)
|
||||
}
|
||||
func AddressFromModel(m *models.Address) Address {
|
||||
func AddressFromModel(m model.Address) Address {
|
||||
//log.Debug().Int32("id", m.ID).Float64("lat", m.LocationLatitude.GetOr(0.0)).Float64("lng", m.LocationLongitude.GetOr(0.0)).Msg("converting address")
|
||||
return Address{
|
||||
Country: m.Country,
|
||||
|
|
@ -39,12 +39,12 @@ func AddressFromModel(m *models.Address) Address {
|
|||
ID: &m.ID,
|
||||
Locality: m.Locality,
|
||||
Location: &Location{
|
||||
Latitude: m.LocationLatitude.GetOr(0.0),
|
||||
Longitude: m.LocationLongitude.GetOr(0.0),
|
||||
Latitude: *m.LocationLatitude,
|
||||
Longitude: *m.LocationLongitude,
|
||||
},
|
||||
Number: m.Number,
|
||||
PostalCode: m.PostalCode,
|
||||
Raw: addressToRaw(*m),
|
||||
Raw: addressToRaw(m),
|
||||
Region: m.Region,
|
||||
Street: m.Street,
|
||||
Unit: m.Unit,
|
||||
|
|
@ -82,6 +82,6 @@ func AddressList(ctx context.Context, ids []int32) (map[int32]*Address, error) {
|
|||
func AddressToRaw(a Address) string {
|
||||
return fmt.Sprintf("%s %s, %s, %s", a.Number, a.Street, a.Locality, a.Region)
|
||||
}
|
||||
func addressToRaw(m models.Address) string {
|
||||
func addressToRaw(m model.Address) string {
|
||||
return fmt.Sprintf("%s %s, %s, %s", m.Number, m.Street, m.Locality, m.Region)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,8 +5,10 @@ import (
|
|||
"math"
|
||||
|
||||
"github.com/Gleipnir-Technology/nidus-sync/db/models"
|
||||
"github.com/Gleipnir-Technology/nidus-sync/geomutil"
|
||||
"github.com/Gleipnir-Technology/nidus-sync/h3utils"
|
||||
//"github.com/rs/zerolog/log"
|
||||
"github.com/twpayne/go-geom"
|
||||
"github.com/uber/h3-go/v4"
|
||||
)
|
||||
|
||||
|
|
@ -34,6 +36,9 @@ func (l Location) H3Cell() (*h3.Cell, error) {
|
|||
func (l Location) GeometryQuery() (string, error) {
|
||||
return fmt.Sprintf("ST_Point(%f, %f, 4326)", l.Longitude, l.Latitude), nil
|
||||
}
|
||||
func (l Location) ToGeom() geom.T {
|
||||
return geomutil.PointFromLngLat(l.Longitude, l.Latitude)
|
||||
}
|
||||
func LocationFromFS(pl *models.FieldseekerPointlocation) Location {
|
||||
return Location{}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue