diff --git a/src/internal/model/model.go b/src/internal/model/model.go index 5542ff9d8..b0e906010 100644 --- a/src/internal/model/model.go +++ b/src/internal/model/model.go @@ -61,3 +61,8 @@ type BaseModel struct { func (bm *BaseModel) Base() *BaseModel { return bm } + +// GetID returns the baseModel.ID as a string rather than a model.StableID. +func (bm *BaseModel) GetID() string { + return string(bm.ID) +} diff --git a/src/internal/model/model_test.go b/src/internal/model/model_test.go index d55cffafb..d0fc0f81d 100644 --- a/src/internal/model/model_test.go +++ b/src/internal/model/model_test.go @@ -3,6 +3,7 @@ package model_test import ( "testing" + "github.com/google/uuid" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" @@ -36,3 +37,11 @@ func (suite *ModelUnitSuite) TestValid() { }) } } + +func (suite *ModelUnitSuite) TestGetID() { + bm := model.BaseModel{ + ID: model.StableID(uuid.NewString()), + } + + assert.Equal(suite.T(), string(bm.ID), bm.GetID()) +}