From 10aed3cea7935f2f22ef713cff9839dd16afce48 Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Fri, 5 Apr 2024 11:36:43 +0530 Subject: moved some validator logic and common structs to util package --- customer/customer.go | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'customer/customer.go') diff --git a/customer/customer.go b/customer/customer.go index 1a5d6f1..21cae9e 100644 --- a/customer/customer.go +++ b/customer/customer.go @@ -1,5 +1,5 @@ /* openbills - Server for web based Libre Billing Software - * Copyright (C) 2023 Vidhu Kant Sharma + * Copyright (C) 2023-2024 Vidhu Kant Sharma * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,6 +20,7 @@ package customer import ( "gorm.io/gorm" d "vidhukant.com/openbills/db" + u "vidhukant.com/openbills/util" "vidhukant.com/openbills/user" ) @@ -30,23 +31,15 @@ func init() { db.AutoMigrate(&Customer{}, &CustomerBillingAddress{}, &CustomerShippingAddress{}) } -type Address struct { - AddressText string - City string - State string - PostalCode string - Country string -} - type CustomerBillingAddress struct { gorm.Model - Address + u.Address CustomerID uint } type CustomerShippingAddress struct { gorm.Model - Address + u.Address CustomerID uint } -- cgit v1.2.3