2026-09-04 14:18:53 +08:00
|
|
|
// Code generated by ent, DO NOT EDIT.
|
|
|
|
|
|
|
|
|
|
package dock
|
|
|
|
|
|
|
|
|
|
import (
|
2026-09-21 10:48:53 +08:00
|
|
|
"time"
|
|
|
|
|
|
2026-09-04 14:18:53 +08:00
|
|
|
"entgo.io/ent/dialect/sql"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
|
// Label holds the string label denoting the dock type in the database.
|
|
|
|
|
Label = "dock"
|
|
|
|
|
// FieldID holds the string denoting the id field in the database.
|
|
|
|
|
FieldID = "id"
|
2026-09-21 10:48:53 +08:00
|
|
|
// FieldDockCode holds the string denoting the dockcode field in the database.
|
2026-09-04 14:18:53 +08:00
|
|
|
FieldDockCode = "dock_code"
|
|
|
|
|
// FieldName holds the string denoting the name field in the database.
|
|
|
|
|
FieldName = "name"
|
2026-09-21 10:48:53 +08:00
|
|
|
// FieldDockType holds the string denoting the docktype field in the database.
|
2026-09-04 14:18:53 +08:00
|
|
|
FieldDockType = "dock_type"
|
2026-09-21 10:48:53 +08:00
|
|
|
// FieldStationNo holds the string denoting the stationno field in the database.
|
2026-09-04 14:18:53 +08:00
|
|
|
FieldStationNo = "station_no"
|
2026-09-21 10:48:53 +08:00
|
|
|
// FieldHasPallet holds the string denoting the haspallet field in the database.
|
2026-09-04 14:18:53 +08:00
|
|
|
FieldHasPallet = "has_pallet"
|
2026-09-21 10:48:53 +08:00
|
|
|
// FieldPalletRef holds the string denoting the palletref field in the database.
|
2026-09-04 14:18:53 +08:00
|
|
|
FieldPalletRef = "pallet_ref"
|
|
|
|
|
// FieldStatus holds the string denoting the status field in the database.
|
|
|
|
|
FieldStatus = "status"
|
2026-09-21 10:48:53 +08:00
|
|
|
// FieldCreatedAt holds the string denoting the createdat field in the database.
|
2026-09-04 14:18:53 +08:00
|
|
|
FieldCreatedAt = "created_at"
|
|
|
|
|
// Table holds the table name of the dock in the database.
|
2026-09-21 10:48:53 +08:00
|
|
|
Table = "dock"
|
2026-09-04 14:18:53 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// Columns holds all SQL columns for dock fields.
|
|
|
|
|
var Columns = []string{
|
|
|
|
|
FieldID,
|
|
|
|
|
FieldDockCode,
|
|
|
|
|
FieldName,
|
|
|
|
|
FieldDockType,
|
|
|
|
|
FieldStationNo,
|
|
|
|
|
FieldHasPallet,
|
|
|
|
|
FieldPalletRef,
|
|
|
|
|
FieldStatus,
|
|
|
|
|
FieldCreatedAt,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ValidColumn reports if the column name is valid (part of the table columns).
|
|
|
|
|
func ValidColumn(column string) bool {
|
|
|
|
|
for i := range Columns {
|
|
|
|
|
if column == Columns[i] {
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var (
|
2026-09-21 10:48:53 +08:00
|
|
|
// DockCodeValidator is a validator for the "dockCode" field. It is called by the builders before save.
|
2026-09-04 14:18:53 +08:00
|
|
|
DockCodeValidator func(string) error
|
|
|
|
|
// DefaultName holds the default value on creation for the "name" field.
|
|
|
|
|
DefaultName string
|
|
|
|
|
// NameValidator is a validator for the "name" field. It is called by the builders before save.
|
|
|
|
|
NameValidator func(string) error
|
2026-09-21 10:48:53 +08:00
|
|
|
// DefaultDockType holds the default value on creation for the "dockType" field.
|
2026-09-04 14:18:53 +08:00
|
|
|
DefaultDockType string
|
2026-09-21 10:48:53 +08:00
|
|
|
// DockTypeValidator is a validator for the "dockType" field. It is called by the builders before save.
|
2026-09-04 14:18:53 +08:00
|
|
|
DockTypeValidator func(string) error
|
2026-09-21 10:48:53 +08:00
|
|
|
// DefaultStationNo holds the default value on creation for the "stationNo" field.
|
2026-09-04 14:18:53 +08:00
|
|
|
DefaultStationNo int
|
2026-09-21 10:48:53 +08:00
|
|
|
// DefaultHasPallet holds the default value on creation for the "hasPallet" field.
|
2026-09-04 14:18:53 +08:00
|
|
|
DefaultHasPallet bool
|
2026-09-21 10:48:53 +08:00
|
|
|
// DefaultPalletRef holds the default value on creation for the "palletRef" field.
|
2026-09-04 14:18:53 +08:00
|
|
|
DefaultPalletRef string
|
2026-09-21 10:48:53 +08:00
|
|
|
// PalletRefValidator is a validator for the "palletRef" field. It is called by the builders before save.
|
2026-09-04 14:18:53 +08:00
|
|
|
PalletRefValidator func(string) error
|
|
|
|
|
// DefaultStatus holds the default value on creation for the "status" field.
|
|
|
|
|
DefaultStatus string
|
|
|
|
|
// StatusValidator is a validator for the "status" field. It is called by the builders before save.
|
|
|
|
|
StatusValidator func(string) error
|
2026-09-21 10:48:53 +08:00
|
|
|
// DefaultCreatedAt holds the default value on creation for the "createdAt" field.
|
|
|
|
|
DefaultCreatedAt func() time.Time
|
2026-09-04 14:18:53 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// OrderOption defines the ordering options for the Dock queries.
|
|
|
|
|
type OrderOption func(*sql.Selector)
|
|
|
|
|
|
|
|
|
|
// ByID orders the results by the id field.
|
|
|
|
|
func ByID(opts ...sql.OrderTermOption) OrderOption {
|
|
|
|
|
return sql.OrderByField(FieldID, opts...).ToFunc()
|
|
|
|
|
}
|
|
|
|
|
|
2026-09-21 10:48:53 +08:00
|
|
|
// ByDockCode orders the results by the dockCode field.
|
2026-09-04 14:18:53 +08:00
|
|
|
func ByDockCode(opts ...sql.OrderTermOption) OrderOption {
|
|
|
|
|
return sql.OrderByField(FieldDockCode, opts...).ToFunc()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ByName orders the results by the name field.
|
|
|
|
|
func ByName(opts ...sql.OrderTermOption) OrderOption {
|
|
|
|
|
return sql.OrderByField(FieldName, opts...).ToFunc()
|
|
|
|
|
}
|
|
|
|
|
|
2026-09-21 10:48:53 +08:00
|
|
|
// ByDockType orders the results by the dockType field.
|
2026-09-04 14:18:53 +08:00
|
|
|
func ByDockType(opts ...sql.OrderTermOption) OrderOption {
|
|
|
|
|
return sql.OrderByField(FieldDockType, opts...).ToFunc()
|
|
|
|
|
}
|
|
|
|
|
|
2026-09-21 10:48:53 +08:00
|
|
|
// ByStationNo orders the results by the stationNo field.
|
2026-09-04 14:18:53 +08:00
|
|
|
func ByStationNo(opts ...sql.OrderTermOption) OrderOption {
|
|
|
|
|
return sql.OrderByField(FieldStationNo, opts...).ToFunc()
|
|
|
|
|
}
|
|
|
|
|
|
2026-09-21 10:48:53 +08:00
|
|
|
// ByHasPallet orders the results by the hasPallet field.
|
2026-09-04 14:18:53 +08:00
|
|
|
func ByHasPallet(opts ...sql.OrderTermOption) OrderOption {
|
|
|
|
|
return sql.OrderByField(FieldHasPallet, opts...).ToFunc()
|
|
|
|
|
}
|
|
|
|
|
|
2026-09-21 10:48:53 +08:00
|
|
|
// ByPalletRef orders the results by the palletRef field.
|
2026-09-04 14:18:53 +08:00
|
|
|
func ByPalletRef(opts ...sql.OrderTermOption) OrderOption {
|
|
|
|
|
return sql.OrderByField(FieldPalletRef, opts...).ToFunc()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ByStatus orders the results by the status field.
|
|
|
|
|
func ByStatus(opts ...sql.OrderTermOption) OrderOption {
|
|
|
|
|
return sql.OrderByField(FieldStatus, opts...).ToFunc()
|
|
|
|
|
}
|
|
|
|
|
|
2026-09-21 10:48:53 +08:00
|
|
|
// ByCreatedAt orders the results by the createdAt field.
|
2026-09-04 14:18:53 +08:00
|
|
|
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
|
|
|
|
|
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
|
|
|
|
|
}
|