package models

import "time"

type UserChatHistory struct {
	ID                uint       `gorm:"primaryKey;autoIncrement" json:"id"`
	UserID            uint       `gorm:"column:userId" json:"userId "`
	AstrologerID      uint       `gorm:"column:astrologerId" json:"astrologerId"`
	ChatHistoryNumber int        `gorm:"column:chat_history_number" json:"chat_history_number"`
	ChatStatus        string     `gorm:"column:chat_status" json:"chat_status"`
	ChatDuration      int        `gorm:"column:chat_duration" json:"chat_duration"`
	DeductionAmount   float64    `gorm:"column:deduction_amount" json:"deduction_amount"`
	CreatedAt         *time.Time `gorm:"column:created_at;autoCreateTime" json:"createdAt"`

	User User `gorm:"foreignKey:UserID;references:ID"`

	Astrologer Astrologer `gorm:"foreignKey:AstrologerID;references:ID"`
}

func (UserChatHistory) TableName() string {
	return "user_chat_histories"
}
