package structs

import "time"

type User struct {
	Id                string `gorm:"primaryKey;type:varchar(36)"`
	OrganizationId    string `gorm:"type:varchar(36)"`
	State             uint8  `gorm:"type:tinyint(1)"`
	Active            bool   `gorm:"type:tinyint(1)"`
	RoleId            string `gorm:"type:varchar(36)"`
	FirstName         string `gorm:"type:varchar(255)"`
	LastName          string `gorm:"type:varchar(255)"`
	Email             string `gorm:"type:varchar(255)"`
	Password          string `gorm:"type:varchar(255)"`
	ProfilePictureUrl string `gorm:"type:varchar(255)"`
	LastOnlineAt      time.Time
	CreatedAt         time.Time
	UpdatedAt         time.Time
}

type UserSession struct {
	Id             string `gorm:"primaryKey;type:varchar(36)"`
	UserId         string `gorm:"type:varchar(36)"`
	OrganizationId string `gorm:"type:varchar(36)"`
	Session        string `gorm:"type:varchar(36)"`
	UserAgent      string `gorm:"type:varchar(255)"`
	ExpiresAt      time.Time
	LastUsedAt     time.Time
	CreatedAt      time.Time
	UpdatedAt      time.Time
}

type GetUserResponse struct {
	AvatarUrl string
}

// swagger:model UserLoginRequest
type UserLoginRequest struct {
	Email    string
	Password string
}

// swagger:model UserLoginResponse
type UserLoginResponse struct {
	Session string
}

// swagger:model TeamMember
type TeamMember struct {
	Id                string
	FirstName         string
	LastName          string
	Email             string
	RoleId            string
	ProfilePictureUrl string
}
