parse ntg jobs and strigify them

This commit is contained in:
Bel LaPointe
2022-01-09 21:56:01 -05:00
parent bf3c382877
commit ad9af0a5db
7 changed files with 236 additions and 2 deletions

34
broker/job.go Normal file
View File

@@ -0,0 +1,34 @@
package broker
import (
"fmt"
"time"
)
type Job struct {
ID string
Pickup JobLocation
Dropoff JobLocation
Weight int
Meta string
}
type JobLocation struct {
Date time.Time
City string
State string
}
func (j Job) String() string {
return fmt.Sprintf(
`%s => %s, Weight:%d, Notes:%s`,
j.Pickup.String(),
j.Dropoff.String(),
j.Weight,
j.Meta,
)
}
func (j JobLocation) String() string {
return fmt.Sprintf("%s, %s @ %s", j.City, j.State, j.Date.Format("Monday Jan 02"))
}