jobs now include direct link
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
|
||||
type Job struct {
|
||||
ID string
|
||||
URI string
|
||||
Pickup JobLocation
|
||||
Dropoff JobLocation
|
||||
Weight int
|
||||
@@ -25,12 +26,13 @@ type JobLocation struct {
|
||||
|
||||
func (j Job) String() string {
|
||||
return fmt.Sprintf(
|
||||
`%s => %s (%d miles), Weight:%d, Notes:%s`,
|
||||
`%s => %s (%d miles), Weight:%d, Notes:%s Link:%s`,
|
||||
j.Pickup.String(),
|
||||
j.Dropoff.String(),
|
||||
j.Miles,
|
||||
j.Weight,
|
||||
j.Meta,
|
||||
j.URI,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -41,7 +43,7 @@ func (j JobLocation) String() string {
|
||||
func (j Job) FormatMultilineText() string {
|
||||
foo := func(client string) string {
|
||||
return fmt.Sprintf(
|
||||
"--- %s: %s => %s ---\nPickup: %s\nDropoff: %s\nNotes: %d lbs, %d miles, %s",
|
||||
"--- %s: %s => %s ---\nPickup: %s\nDropoff: %s\nNotes: %d lbs, %d miles, %s\n%s",
|
||||
client,
|
||||
j.Pickup.State,
|
||||
j.Dropoff.State,
|
||||
@@ -50,6 +52,7 @@ func (j Job) FormatMultilineText() string {
|
||||
j.Weight,
|
||||
j.Miles,
|
||||
j.Meta,
|
||||
j.URI,
|
||||
)
|
||||
}
|
||||
out := ""
|
||||
|
||||
@@ -39,7 +39,8 @@ func (ntgJob ntgVisionJob) Job() Job {
|
||||
pickup, _ := time.ParseInLocation("01/02/06", ntgJob.PickupDate, time.Local)
|
||||
dropoff, _ := time.ParseInLocation("01/02/06", ntgJob.DropoffDate, time.Local)
|
||||
return Job{
|
||||
ID: fmt.Sprintf("ntg-%d", ntgJob.ID),
|
||||
ID: fmt.Sprintf("ntg-%d", ntgJob.ID),
|
||||
URI: fmt.Sprintf(config.Get().Brokers.NTG.LoadPageURIFormat, ntgJob.ID),
|
||||
Pickup: JobLocation{
|
||||
Date: pickup,
|
||||
City: ntgJob.PickupCity,
|
||||
|
||||
Reference in New Issue
Block a user