package models

import "time"

type UserCallHistory struct {
	ID uint `gorm:"primaryKey;autoIncrement" json:"id"`

	UserID uint `gorm:"column:userId;not null;index" json:"userId"`

	AstrologerID uint `gorm:"column:astrologerId ;not null;index" json:"astrologerId "`

	CallHistoryNumber int `gorm:"column:callHistoryNumber"`

	CallStatus string `gorm:"column:callStatus"`

	CallDuration int `gorm:"column:callDuration"`

	DeductionAmount float64 `gorm:"column:deductionAmount"`

	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 (UserCallHistory) TableName() string {
	return "user_call_histories"
}
