Fix byte decoding

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
Bryan Frimin
2026-02-20 13:51:15 +01:00
parent 537797d35b
commit 9f54568625

View File

@@ -73,12 +73,17 @@ func (t ElectronicSignatureEventType) String() string {
} }
func (t *ElectronicSignatureEventType) Scan(value any) error { func (t *ElectronicSignatureEventType) Scan(value any) error {
val, ok := value.(string) var s string
if !ok { switch v := value.(type) {
return fmt.Errorf("invalid scan source for ElectronicSignatureEventType, expected string got %T", value) case string:
s = v
case []byte:
s = string(v)
default:
return fmt.Errorf("invalid scan source for ElectronicSignatureEventType, expected string or []byte got %T", value)
} }
return t.UnmarshalText([]byte(val)) return t.UnmarshalText([]byte(s))
} }
func (t ElectronicSignatureEventType) Value() (driver.Value, error) { func (t ElectronicSignatureEventType) Value() (driver.Value, error) {