jobs now include direct link

master v0.1.4
Bel LaPointe 2022-01-14 00:22:34 -05:00
parent 48da446e83
commit e2cd24a39f
5 changed files with 15 additions and 9 deletions

View File

@ -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 := ""

View File

@ -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,

View File

@ -61,7 +61,7 @@
"Matrix": {
"ReceiveEnabled": true,
"Mock": false,
"Continuation": "602",
"Continuation": "1314",
"Homeserver": "https://m.bltrucks.top",
"Username": "@bot.m.bltrucks.top",
"Token": "mvDWB96KXMF8XhOam8EC5XVdQvSEw0CDeClcSWocBcYkwZX3FPNWZ5uOnQk2Em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@gmail.com",
"Password": "thumper123"

View File

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

View File

@ -1,6 +1,5 @@
todo:
- 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
- todo: details from ntg; stophours for pickup, appointmenttime/facitlyhours for dest
details: |
@ -22,6 +21,7 @@ todo:
- banlist criteria like vendors, brokers, metadata
- set up copy for caleb, broc
done:
- link to view more
- map with to-from line
- TO CONFLUENT.RS OR W/E
- rm get-set stuff for matrix now that it has continuation