package models import "time" type InProgressOrderDB struct { ID string `gorm:"primaryKey;column:id"` PartnerID int64 `gorm:"column:partner_id"` CustomerID *int64 `gorm:"column:customer_id"` CustomerName string `gorm:"column:customer_name"` PaymentType string `gorm:"column:payment_type"` CreatedBy int64 `gorm:"column:created_by"` CreatedAt time.Time `gorm:"column:created_at"` UpdatedAt time.Time `gorm:"column:updated_at"` TableNumber string `gorm:"column:table_number"` OrderItems []InProgressOrderItemDB `gorm:"foreignKey:InProgressOrderIO"` OrderType string `gorm:"column:order_type"` } type InProgressOrderItemDB struct { ID int64 `gorm:"primaryKey;column:id"` InProgressOrderIO string `gorm:"column:in_progress_order_id"` ItemID int64 `gorm:"column:item_id"` Quantity int `gorm:"column:quantity"` CreatedBy int64 `gorm:"column:created_by"` CreatedAt time.Time `gorm:"column:created_at"` Product ProductDB `gorm:"foreignKey:ItemID;references:ID"` } func (InProgressOrderItemDB) TableName() string { return "in_progress_order_items" } func (InProgressOrderDB) TableName() string { return "in_progress_order" }