Compare commits

...

2 Commits

Author SHA1 Message Date
Bel LaPointe
32d09dbac6 dont repeat entire job description for msg 2022-01-14 00:30:17 -05:00
Bel LaPointe
e2cd24a39f jobs now include direct link 2022-01-14 00:22:34 -05:00
5 changed files with 28 additions and 16 deletions

View File

@@ -10,6 +10,7 @@ import (
type Job struct { type Job struct {
ID string ID string
URI string
Pickup JobLocation Pickup JobLocation
Dropoff JobLocation Dropoff JobLocation
Weight int Weight int
@@ -25,12 +26,13 @@ type JobLocation struct {
func (j Job) String() string { func (j Job) String() string {
return fmt.Sprintf( 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.Pickup.String(),
j.Dropoff.String(), j.Dropoff.String(),
j.Miles, j.Miles,
j.Weight, j.Weight,
j.Meta, j.Meta,
j.URI,
) )
} }
@@ -41,15 +43,10 @@ func (j JobLocation) String() string {
func (j Job) FormatMultilineText() string { func (j Job) FormatMultilineText() string {
foo := func(client string) string { foo := func(client string) string {
return fmt.Sprintf( return fmt.Sprintf(
"--- %s: %s => %s ---\nPickup: %s\nDropoff: %s\nNotes: %d lbs, %d miles, %s", "--- %s: %s => %s ---",
client, client,
j.Pickup.State, j.Pickup.State,
j.Dropoff.State, j.Dropoff.State,
j.Pickup.String(),
j.Dropoff.String(),
j.Weight,
j.Miles,
j.Meta,
) )
} }
out := "" out := ""
@@ -58,10 +55,22 @@ func (j Job) FormatMultilineText() string {
log.Printf("job multiline: %+v contains %s then use %v", clients[k].States, j.Pickup.State, k) log.Printf("job multiline: %+v contains %s then use %v", clients[k].States, j.Pickup.State, k)
if strings.Contains(fmt.Sprint(clients[k].States), j.Pickup.State) { if strings.Contains(fmt.Sprint(clients[k].States), j.Pickup.State) {
if len(out) > 0 { if len(out) > 0 {
out += "\n\n" out += "\n"
} }
out += foo(k) out += foo(k)
} }
} }
if len(out) > 0 {
out = fmt.Sprintf(
"%s\nPickup: %s\nDropoff: %s\nNotes: %d lbs, %d miles, %s\n%s",
out,
j.Pickup.String(),
j.Dropoff.String(),
j.Weight,
j.Miles,
j.Meta,
j.URI,
)
}
return out return out
} }

View File

@@ -39,7 +39,8 @@ func (ntgJob ntgVisionJob) Job() Job {
pickup, _ := time.ParseInLocation("01/02/06", ntgJob.PickupDate, time.Local) pickup, _ := time.ParseInLocation("01/02/06", ntgJob.PickupDate, time.Local)
dropoff, _ := time.ParseInLocation("01/02/06", ntgJob.DropoffDate, time.Local) dropoff, _ := time.ParseInLocation("01/02/06", ntgJob.DropoffDate, time.Local)
return Job{ 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{ Pickup: JobLocation{
Date: pickup, Date: pickup,
City: ntgJob.PickupCity, City: ntgJob.PickupCity,

View File

@@ -19,7 +19,7 @@
"DirectionsURIFormat": "https://maps.googleapis.com/maps/api/directions/json?origin=%s\u0026destination=%s\u0026mode=driving\u0026key=AIzaSyBkACm-LQkoSfsTO5_XAzBVZE9-JQzcNkg", "DirectionsURIFormat": "https://maps.googleapis.com/maps/api/directions/json?origin=%s\u0026destination=%s\u0026mode=driving\u0026key=AIzaSyBkACm-LQkoSfsTO5_XAzBVZE9-JQzcNkg",
"PathedURIFormat": "https://maps.googleapis.com/maps/api/staticmap?size=250x250\u0026path=%s\u0026format=jpeg\u0026maptype=roadmap\u0026key=AIzaSyBkACm-LQkoSfsTO5_XAzBVZE9-JQzcNkg\u0026size=250x250\u0026markers=%s|%s\u0026zoom=5", "PathedURIFormat": "https://maps.googleapis.com/maps/api/staticmap?size=250x250\u0026path=%s\u0026format=jpeg\u0026maptype=roadmap\u0026key=AIzaSyBkACm-LQkoSfsTO5_XAzBVZE9-JQzcNkg\u0026size=250x250\u0026markers=%s|%s\u0026zoom=5",
"URIFormat": "https://maps.googleapis.com/maps/api/staticmap?center=%s\u0026markers=label=A|%s\u0026zoom=5\u0026size=250x250\u0026scale=1\u0026format=jpeg\u0026maptype=roadmap\u0026key=AIzaSyBkACm-LQkoSfsTO5_XAzBVZE9-JQzcNkg", "URIFormat": "https://maps.googleapis.com/maps/api/staticmap?center=%s\u0026markers=label=A|%s\u0026zoom=5\u0026size=250x250\u0026scale=1\u0026format=jpeg\u0026maptype=roadmap\u0026key=AIzaSyBkACm-LQkoSfsTO5_XAzBVZE9-JQzcNkg",
"Pathed": true, "Pathed": false,
"Pickup": false, "Pickup": false,
"Dropoff": false "Dropoff": false
}, },
@@ -61,7 +61,7 @@
"Matrix": { "Matrix": {
"ReceiveEnabled": true, "ReceiveEnabled": true,
"Mock": false, "Mock": false,
"Continuation": "602", "Continuation": "1318",
"Homeserver": "https://m.bltrucks.top", "Homeserver": "https://m.bltrucks.top",
"Username": "@bot.m.bltrucks.top", "Username": "@bot.m.bltrucks.top",
"Token": "mvDWB96KXMF8XhOam8EC5XVdQvSEw0CDeClcSWocBcYkwZX3FPNWZ5uOnQk2EmT1cjpzfeuD7gDYPPjOuyZlI3bE9TE35UjNOlZgi0Tugm25s91iVsbIF6kMZsCIhVMSmEf6w3jxX6wQYOWvmDZ4mu6f5c8wr221EMDcOpEzQV09d1zuBSWgKLBgjqAkYHJZ5dTRIWpEDpPgujhOFZa2ld1HiAOxrJKlIrlfDBN0CUsTlGOGplujDAr4VtpFzNRS", "Token": "mvDWB96KXMF8XhOam8EC5XVdQvSEw0CDeClcSWocBcYkwZX3FPNWZ5uOnQk2EmT1cjpzfeuD7gDYPPjOuyZlI3bE9TE35UjNOlZgi0Tugm25s91iVsbIF6kMZsCIhVMSmEf6w3jxX6wQYOWvmDZ4mu6f5c8wr221EMDcOpEzQV09d1zuBSWgKLBgjqAkYHJZ5dTRIWpEDpPgujhOFZa2ld1HiAOxrJKlIrlfDBN0CUsTlGOGplujDAr4VtpFzNRS",
@@ -73,6 +73,7 @@
"Brokers": { "Brokers": {
"NTG": {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ZSb2xlIjoiQ2FycmllckFwcHJvdmVkIiwidXNlckNhcnJpZXJzIjoiMTUzNDIzIiwib3RyVXNlciI6IkZhbHNlIiwibmJmIjoxNjQxODU5MTc2LCJleHAiOjE2NDE5NDE5NzYsImlzcyI6Ik5URyBTZWN1cml0eSBUb2tlbiBTZXJ2aWNlIiwiYXVkIjoiTlRHIn0.kpHOBTtcQhbdloAw7xEjnkzfxf4ToMgidrLCMomZmnmKQHlD_7OQuI8nQiCTHc_ntuGtt8Ui92kwWWUiLwN_2tT2vC7Jy6m9IjwqgbAzsgTLi4jAbIwITD-awiDh4FUKDwGq3XpEjs-i7XM3rI7tTk7jg9QSDId8EF3Pt5fJq6QhztC6y7-JaSFQZLMtkSCAWmOQx_TgKgVoVbgMeiqhHbZ2hhoA7TtpEIIL5Gnfq46t3E18ExdrsO96ZCGQGcBw5x8J1ustq2cwdlFKeg4ULNWAAd1ay1hojRa7jCHs98AcoJ3Nts9-o7yEMuN2rrfpK_nm68nciwFtF-ke1KoiBg",
"Username": "noeasyrunstrucking@gmail.com", "Username": "noeasyrunstrucking@gmail.com",
"Password": "thumper123" "Password": "thumper123"

View File

@@ -51,10 +51,11 @@ type Config struct {
Once bool Once bool
Brokers struct { Brokers struct {
NTG struct { NTG struct {
Mock bool Mock bool
Token string LoadPageURIFormat string
Username string Token string
Password string Username string
Password string
} }
} }

View File

@@ -1,6 +1,5 @@
todo: todo:
- write-as for clients so ma can write to pa by default - write-as for clients so ma can write to pa by default
- link to view more
- continuation is garbo, but I can still do better client side to avoid get-set high level - continuation is garbo, but I can still do better client side to avoid get-set high level
- todo: details from ntg; stophours for pickup, appointmenttime/facitlyhours for dest - todo: details from ntg; stophours for pickup, appointmenttime/facitlyhours for dest
details: | details: |
@@ -22,6 +21,7 @@ todo:
- banlist criteria like vendors, brokers, metadata - banlist criteria like vendors, brokers, metadata
- set up copy for caleb, broc - set up copy for caleb, broc
done: done:
- link to view more
- map with to-from line - map with to-from line
- TO CONFLUENT.RS OR W/E - TO CONFLUENT.RS OR W/E
- rm get-set stuff for matrix now that it has continuation - rm get-set stuff for matrix now that it has continuation