package dao

import (
	"time"
	"wails-app/internal/global"
)

type DigitalTicket struct {
	global.GVA_MODEL
	TicketNo        string     `gorm:"size:64;uniqueIndex" json:"ticket_no"`
	PlateNumber     string     `gorm:"size:20" json:"plate_number"`
	TriggerMode     string     `gorm:"size:20" json:"trigger_mode"`
	State           string     `gorm:"size:20;default:created" json:"state"`
	VehicleRecordID uint       `json:"vehicle_record_id"`
	EntryTime       time.Time  `json:"entry_time"`
	ExitTime        *time.Time `json:"exit_time"`
	Fee             float64    `json:"fee"`
	PaymentMethod   string     `gorm:"size:20" json:"payment_method"`
	PaymentOrderNo  string     `gorm:"size:64" json:"payment_order_no"`
	PaidAt          *time.Time `json:"paid_at"`
	ExpireAt        *time.Time `json:"expire_at"`
	EventLog        string     `gorm:"type:text" json:"event_log"`
}

func (DigitalTicket) TableName() string { return "digital_ticket" }
