package Models

import (
	"database/sql"
	"time"

	"github.com/gofrs/uuid"
)

// FriendRequest Set with Friend being the requestee, and RequestFromID being the requester
type FriendRequest struct {
	Base
	UserID                    uuid.UUID    `gorm:"type:uuid;column:user_id;not null;" json:"user_id"`
	User                      User         `                                          json:"user"`
	FriendID                  string       `gorm:"not null"                           json:"friend_id"`       // Stored encrypted
	FriendUsername            string       `                                          json:"friend_username"` // Stored encrypted
	FriendImagePath           string       `                                          json:"friend_image_path"`
	FriendPublicAsymmetricKey string       `                                          json:"asymmetric_public_key"` // Stored encrypted
	SymmetricKey              string       `gorm:"not null"                           json:"symmetric_key"`         // Stored encrypted
	AcceptedAt                sql.NullTime `                                          json:"accepted_at"`
	CreatedAt                 time.Time    `gorm:"not null"                           json:"created_at"`
}
