From c6bc8d0c6d1c1ab5d26b9e47e0248002d22ecf8f Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Sun, 3 Sep 2023 22:02:56 +0530 Subject: moved contact details to customer model for simplicity --- customer/customer.go | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'customer/customer.go') diff --git a/customer/customer.go b/customer/customer.go index 23c630d..e411ad5 100644 --- a/customer/customer.go +++ b/customer/customer.go @@ -27,18 +27,7 @@ var db *gorm.DB func init() { db = d.DB - db.AutoMigrate(&Customer{}, &CustomerContact{}, &CustomerBillingAddress{}, &CustomerShippingAddress{}) -} - -type CustomerContact struct { - gorm.Model - UserID uint `json:"-"` - User user.User `json:"-"` - CustomerID uint - Name string - Phone string - Email string - Website string + db.AutoMigrate(&Customer{}, &CustomerBillingAddress{}, &CustomerShippingAddress{}) } type Address struct { @@ -64,8 +53,11 @@ type Customer struct { UserID uint `json:"-"` User user.User `json:"-"` Name string - Gstin string - Contact CustomerContact - BillingAddress CustomerBillingAddress - ShippingAddresses []CustomerShippingAddress + Gstin string + ContactName string + Phone string + Email string + Website string + //BillingAddress CustomerBillingAddress + //ShippingAddresses []CustomerShippingAddress } -- cgit v1.2.3