package dao

import "wails-app/internal/global"

// Channel 通道模型
type Channel struct {
	global.GVA_MODEL
	ChannelCode    string `gorm:"size:50;not null;uniqueIndex" json:"channel_code"` // 通道编码
	ChannelName    string `gorm:"size:100;not null" json:"channel_name"`            // 通道名称
	Direction      string `gorm:"size:20;not null" json:"direction"`                // 进出方向 in/out/inout
	AllowTemporary bool   `gorm:"not null" json:"allow_temporary"`                  // 是否允许临时车进出
	Description    string `gorm:"size:200" json:"description"`                      // 备注
	ParkingLotID   uint   `json:"parking_lot_id"`                                   // 所属区域ID

	BoothID uint   `gorm:"index;comment:所属岗亭ID" json:"booth_id"`
	Booth   *Booth `gorm:"foreignKey:BoothID;references:ID" json:"booth"`

	UHFReaders []UHFReader `gorm:"foreignKey:ChannelID" json:"uhf_reader"`
}

func (Channel) TableName() string {
	return "channel"
}
