package userdomain

import (
	subscribe "legalgo-BE-go/internal/domain/subscribe"
	"time"
)

type User struct {
	ID          string    `json:"id"`
	SubscribeID string    `json:"subscribe_id"`
	Password    string    `json:"password"`
	Email       string    `json:"email"`
	Phone       string    `json:"phone"`
	CreatedAt   time.Time `json:"created_at"`

	Subscribe subscribe.Subscribe `gorm:"foreignKey:SubscribeID" json:"subscribe"`
}

type UserRegister struct {
	Email           string `json:"email" validate:"required"`
	Password        string `json:"password" validate:"required"`
	Phone           string `json:"phone" validate:"required"`
	SubscribePlanID string `json:"subscribe_plan_id"`
}

type UserProfile struct {
	ID        string    `json:"id"`
	Email     string    `json:"email"`
	Phone     string    `json:"phone"`
	CreatedAt time.Time `json:"created_at"`

	Subscribe subscribe.Subscribe `gorm:"foreignKey:SubscribeID" json:"subscribe"`
}

type UserLogin struct {
	Email    string `json:"email" validate:"required"`
	Password string `json:"password" validate:"required"`
}

type UserSubsUpdate struct {
	ID              string     `json:"id"`
	Status          int8       `json:"status"`
	SubscribePlanID string     `json:"subscribe_plan_id"`
	AutoRenew       bool       `json:"auto_renew"`
	StartDate       time.Time  `json:"start_date"`
	EndDate         *time.Time `json:"end_date"`
}
