package dispute

import (
	"time"

	"hfb_sys/backend/internal/auditlog"

	"gorm.io/datatypes"
)

type DisputeDTO struct {
	ID                uint64         `json:"id"`
	OrderID           uint64         `json:"order_id"`
	OrderNo           string         `json:"order_no"`
	Title             string         `json:"title"`
	InitiatorID       uint64         `json:"initiator_id"`
	TargetUserID      uint64         `json:"target_user_id"`
	Type              string         `json:"type"`
	Status            string         `json:"status"`
	Description       string         `json:"description"`
	EvidenceURLS      datatypes.JSON `json:"evidence_urls"`
	ArbitrationResult string         `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"`
}

type CreateRequest struct {
	Type         string   `json:"type" binding:"required"`
	Description  string   `json:"description" binding:"required"`
	EvidenceURLS []string `json:"evidence_urls"`
}

type ArbitrateRequest struct {
	Result string  `json:"result" binding:"required"`
	Remark string  `json:"remark" binding:"required"`
	Amount float64 `json:"amount"`
}
type AuditMeta = auditlog.Meta

type PaginatedResult struct {
	Items    []DisputeDTO `json:"items"`
	Total    int64        `json:"total"`
	Page     int          `json:"page"`
	PageSize int          `json:"page_size"`
}
