Basic demo for Tally X AutoIxpert integration to showcase setup in Go due to impossibility of open-sourcing n8n setup.
53 lines
1.1 KiB
Go
53 lines
1.1 KiB
Go
package models
|
|
|
|
import (
|
|
"strconv"
|
|
"time"
|
|
)
|
|
|
|
type CrashReport struct {
|
|
EventID string
|
|
SubmissionID string
|
|
|
|
FirstName string
|
|
LastName string
|
|
Street string
|
|
Postcode int
|
|
City string
|
|
Phone string
|
|
Email string
|
|
|
|
LicensePlate string
|
|
|
|
CrashDate time.Time
|
|
CrashLocation string
|
|
CrashDescription string
|
|
CrashOpponent string
|
|
|
|
Images []string
|
|
}
|
|
|
|
func (r CrashReport) ToClaimRequest() ClaimRequest {
|
|
return ClaimRequest{
|
|
Type: "liability",
|
|
Labels: []string{"vTyXeQFryVNA"}, // add to be reviewed label for specific customer
|
|
Accident: Accident{
|
|
Location: r.CrashLocation,
|
|
Circumstances: r.CrashDescription,
|
|
Time: r.CrashDate,
|
|
},
|
|
Car: Car{
|
|
LicensePlate: r.LicensePlate,
|
|
},
|
|
Claimant: Claimant{
|
|
FirstName: r.FirstName,
|
|
LastName: r.LastName,
|
|
City: r.City,
|
|
Zip: strconv.Itoa(r.Postcode),
|
|
StreetAndHousenumberOrLockbox: r.Street,
|
|
Phone: r.Phone,
|
|
Email: r.Email,
|
|
},
|
|
}
|
|
}
|