From 81b379afbd971bb9d6d8bc5c72cf2cbb695f62e1 Mon Sep 17 00:00:00 2001 From: qowevisa Date: Wed, 20 Nov 2024 18:19:12 +0200 Subject: [PATCH] Add Paymenr Item and ItemBought as entities in PaymentGroup for db interface resolution --- db/item.go | 2 ++ db/item_bought.go | 2 ++ db/payment.go | 2 ++ 3 files changed, 6 insertions(+) diff --git a/db/item.go b/db/item.go index e2fff33..3dff6e4 100644 --- a/db/item.go +++ b/db/item.go @@ -27,6 +27,8 @@ type Item struct { User *User } +func (i Item) __internalBelogingToPayment() {} + // Implements db.UserIdentifiable:1 func (i Item) GetID() uint { return i.ID diff --git a/db/item_bought.go b/db/item_bought.go index d63d152..082a94c 100644 --- a/db/item_bought.go +++ b/db/item_bought.go @@ -15,3 +15,5 @@ type ItemBought struct { MetricType uint8 MetricValue uint64 } + +func (i ItemBought) __internalBelogingToPayment() {} diff --git a/db/payment.go b/db/payment.go index 3256e4a..c05b47f 100644 --- a/db/payment.go +++ b/db/payment.go @@ -21,3 +21,5 @@ type Payment struct { Items []ItemBought `gorm:"constraint:OnDelete:CASCADE;"` Date time.Time } + +func (p Payment) __internalBelogingToPayment() {}