package models

import "time"

type AppReview struct {
	ID uint `gorm:"primaryKey;autoIncrement" json:"id"`
	UserID uint `gorm:"column:userId;not null;index" json:"userId"`
	Review string `gorm:"column:review;type:longtext;not null" json:"review"`
	IsActive bool `gorm:"column:isActive;default:true" json:"isActive"`
	IsDelete bool `gorm:"column:isDelete;default:false" json:"isDelete"`
	AppID int `gorm:"column:appId;not null" json:"appId"`
	CreatedAt *time.Time `gorm:"column:created_at" json:"created_at,omitempty"`
	UpdatedAt *time.Time `gorm:"column:updated_at" json:"updated_at,omitempty"`
	CreatedBy int `gorm:"column:createdBy;not null" json:"createdBy"`
	ModifiedBy int `gorm:"column:modifiedBy;not null" json:"modifiedBy"`
	// Relation
	User User `gorm:"foreignKey:UserID;references:ID" json:"user,omitempty"`
}

func (AppReview) TableName() string {
	return "app_reviews"
}