2fas-server/internal/api/browser_extension/domain/browser_extension_paired_device.go
2022-12-31 10:22:38 +01:00

33 lines
601 B
Go

package domain
import (
"github.com/google/uuid"
)
const (
IOS = "ios"
Android = "android"
)
type ExtensionDevice struct {
Id uuid.UUID
ExtensionId uuid.UUID
Name string
Platform string
FcmToken string
}
func (e *ExtensionDevice) IsAndroid() bool {
return e.Platform == Android
}
func (e *ExtensionDevice) IsiOS() bool {
return e.Platform == IOS
}
type BrowserExtensionDevicesRepository interface {
FindAll(extensionId uuid.UUID) []*ExtensionDevice
GetById(extensionId, deviceId uuid.UUID) (*ExtensionDevice, error)
Delete(device *ExtensionDevice) error
}