Init with working version
Basic demo for Tally X AutoIxpert integration to showcase setup in Go due to impossibility of open-sourcing n8n setup.
This commit is contained in:
52
pkg/models/report.go
Normal file
52
pkg/models/report.go
Normal file
@@ -0,0 +1,52 @@
|
||||
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,
|
||||
},
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user