mirror of
https://github.com/rjNemo/rentease.git
synced 2026-06-06 02:36:49 +00:00
23 lines
397 B
Go
23 lines
397 B
Go
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
|
|
}
|