Initial cloud-services repo - gateway service + pkg modules

This commit is contained in:
Chris Rai
2026-01-30 23:14:52 -05:00
commit fbb820d7b3
1037 changed files with 171318 additions and 0 deletions

88
pkg/common/hmi_tx_test.go Normal file
View File

@@ -0,0 +1,88 @@
package common_test
import (
"testing"
"time"
"fiskerinc.com/modules/common"
"fiskerinc.com/modules/common/dbbasemodel"
"fiskerinc.com/modules/testhelper"
)
func TestHMITXMessages(t *testing.T) {
schema := "file://" + testhelper.GetSchemaDirPath() + "/hmi/TXMessage.json"
now := time.Now()
tests := []testhelper.SchemaTest{
{
Name: "TestHMIVerifySalt",
Object: common.Message{
Handler: "verify",
Data: common.HMISessionData{
Salt: "testsalt",
},
},
},
{
Name: "TestHMIVerifySession",
Object: common.Message{
Handler: "verify",
Data: common.HMISessionData{
SessionID: "test_session_id",
},
},
},
{
Name: "TestHMIProfiles",
Object: common.Message{
Handler: "profiles",
Data: nil,
},
},
{
Name: "TestHMISettingsUpdate",
Object: common.Message{
Handler: "settings_update",
Data: common.HMISettingsUpdate{
DriverID: "valid-cognito-id-1",
Settings: []common.CarSetting{{
Name: "TESTSETTING",
Value: "TESTVALUE",
Type: "string",
DBModelBase: dbbasemodel.DBModelBase{
UpdatedAt: &now,
},
}},
},
},
},
{
Name: "TestHMIPOIs",
Object: common.Message{
Handler: "user_pois",
Data: common.HMIPOIsMessage{
DriverID: "valid-cognito-id-1",
UserPOIs: []common.PointOfInterest{
{
Name: "TestWorkPOI",
Location: common.POILocation{
Latitude: 1.11,
Longitude: 2.22,
},
},
{
Name: "TestHomePOI",
Location: common.POILocation{
Latitude: 8.88,
Longitude: 9.99,
},
},
},
},
},
},
}
testhelper.NewSchemaTestHelper(t, schema).
RunSchemaTests(tests)
}