package booking import ( "log" "gorm.io/gorm" ) type Payment struct { gorm.Model BookingID uint `gorm:"not null;index"` Booking Booking `gorm:"foreignKey:BookingID;constraint:OnDelete:CASCADE"` Amount float64 PaymentMethod string } func (bs Service) OnePayment(id int) *Payment { p, err := bs.store.GetPayment(id) if err != nil { log.Println(err) } return p }