package models

import "time"

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

	UserID uint `gorm:"column:user_id " json:"user_id  "`

	AstrologerID uint `gorm:"column:astrologer_id " json:"astrologer_id "`

	ProductID uint `gorm:"column:product_id"`

	Quantity int `gorm:"column:report_type"`

	TotalAmount float64 `gorm:"column:report_type"`

	AstrologerEarning float64 `gorm:"column:report_type"`

	AdminCommission float64 `gorm:"column:report_type"`

	Status string `gorm:"column:report_type"`

	CreatedAt *time.Time `gorm:"column:created_at;autoCreateTime" json:"createdAt"`

	UpdatedAt *time.Time `gorm:"column:updated_at;autoUpdateTime" json:"updatedAt"`

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

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

	Product AstromallProducts `gorm:"foreignKey:ProductID;references:ID"`
}

func (AstromallOrder) TableName() string {
	return "astromall_orders"
}
