package model

import (
	"time"

	"gorm.io/datatypes"
)

type Dispute struct {
	ID                uint64         `gorm:"primaryKey" json:"id"`
	OrderID           uint64         `gorm:"not null;index" json:"order_id"`
	InitiatorID       uint64         `gorm:"not null" json:"initiator_id"`
	TargetUserID      uint64         `gorm:"not null" json:"target_user_id"`
	Type              string         `gorm:"size:32;not null" json:"type"`
	Status            string         `gorm:"size:32;not null;default:'open'" json:"status"`
	Description       string         `json:"description"`
	EvidenceURLS      datatypes.JSON `gorm:"column:evidence_urls" json:"evidence_urls"`
	ArbitrationResult string         `gorm:"size:32;not null;default:''" json:"arbitration_result"`
	ArbitrationRemark string         `json:"arbitration_remark"`
	HandledBy         *uint64        `json:"handled_by"`
	HandledAt         *time.Time     `json:"handled_at"`
	CreatedAt         time.Time      `json:"created_at"`
	UpdatedAt         time.Time      `json:"updated_at"`
}

func (Dispute) TableName() string {
	return "disputes"
}
